diff --git a/.github/labeler.yml b/.github/labeler.yml index 6d53d581063..e22f074604f 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -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/**" diff --git a/.github/workflows/Dockerfile.toolchain b/.github/workflows/Dockerfile.toolchain deleted file mode 100644 index 949bc2bb5c2..00000000000 --- a/.github/workflows/Dockerfile.toolchain +++ /dev/null @@ -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/ diff --git a/.github/workflows/Dockerfile.tools b/.github/workflows/Dockerfile.tools deleted file mode 100644 index 5d365fc56d9..00000000000 --- a/.github/workflows/Dockerfile.tools +++ /dev/null @@ -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 diff --git a/.github/workflows/build-tools.yml b/.github/workflows/build-tools.yml deleted file mode 100644 index 0629b1b62ad..00000000000 --- a/.github/workflows/build-tools.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 367a43383bb..00000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/check-kernel-patches.yml b/.github/workflows/check-kernel-patches.yml deleted file mode 100644 index 1ab4a361f53..00000000000 --- a/.github/workflows/check-kernel-patches.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 72f39a729bb..f54695986da 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -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 diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 3aa46f5cd7c..87b8a14293b 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -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 diff --git a/.github/workflows/label-kernel.yml b/.github/workflows/label-kernel.yml index eab79cf0c0c..655d7d6ff37 100644 --- a/.github/workflows/label-kernel.yml +++ b/.github/workflows/label-kernel.yml @@ -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 diff --git a/.github/workflows/label-target.yml b/.github/workflows/label-target.yml index 610aab026aa..989ee9fcb43 100644 --- a/.github/workflows/label-target.yml +++ b/.github/workflows/label-target.yml @@ -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 diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index fe2898cacdb..07621dcb4ac 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -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 diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index 1678c5ad4fe..5b5140961cd 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -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 diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index 4f4d78f4f8a..0bc9fec1795 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -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 diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 83bf5e98f5a..35904a5e564 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -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 diff --git a/.github/workflows/upload-file-s3.yml b/.github/workflows/upload-file-s3.yml deleted file mode 100644 index 6bcb172468d..00000000000 --- a/.github/workflows/upload-file-s3.yml +++ /dev/null @@ -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 }}/ diff --git a/config/Config-images.in b/config/Config-images.in index ea7b3d37c3d..c37537b1a71 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -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 diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 7de0d17b5ea..a770a9d7973 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -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. diff --git a/include/image-commands.mk b/include/image-commands.mk index 1d694850195..77a35f3eec0 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -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" \ diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 6db270a3741..ac48a2e8b11 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -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 diff --git a/include/kernel-6.1 b/include/kernel-6.1 index 51dd7ec52ac..bc84e23dad7 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .33 -LINUX_KERNEL_HASH-6.1.33 = b87d6ba8ea7328e8007a7ea9171d1aa0d540d95eacfcab09578e0a3b623dd2cd \ No newline at end of file +LINUX_VERSION-6.1 = .35 +LINUX_KERNEL_HASH-6.1.35 = be368143bc5d0dc73dd3e8c6191630c1620520379baf6f47c16116b2c0bc26ac \ No newline at end of file diff --git a/include/kernel.mk b/include/kernel.mk index b1ae42534dc..3012eb89935 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -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 \ diff --git a/package/boot/arm-trusted-firmware-rockchip/Makefile b/package/boot/arm-trusted-firmware-rockchip/Makefile index b712a3530a0..aaae4ce3929 100644 --- a/package/boot/arm-trusted-firmware-rockchip/Makefile +++ b/package/boot/arm-trusted-firmware-rockchip/Makefile @@ -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 -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)) diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 7c30aa052a6..e83703b0355 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -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|\ diff --git a/package/boot/uboot-envtools/files/layerscape b/package/boot/uboot-envtools/files/layerscape index b11587d8765..acc5a073ad9 100644 --- a/package/boot/uboot-envtools/files/layerscape +++ b/package/boot/uboot-envtools/files/layerscape @@ -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 diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 9df64791b2b..77c9d964db3 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -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|\ diff --git a/package/boot/uboot-envtools/files/mediatek_mt7629 b/package/boot/uboot-envtools/files/mediatek_mt7629 index a5aa2b58a61..313fb6a4480 100644 --- a/package/boot/uboot-envtools/files/mediatek_mt7629 +++ b/package/boot/uboot-envtools/files/mediatek_mt7629 @@ -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 diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/qualcommax_ipq807x similarity index 100% rename from package/boot/uboot-envtools/files/ipq807x rename to package/boot/uboot-envtools/files/qualcommax_ipq807x diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index b3f37c7c3eb..c94f8d69c74 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -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) diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 8ea05b9159e..33fd7e086e8 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -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 \ diff --git a/package/boot/uboot-mediatek/patches/435-add-h3c_magic-nx30-pro.patch b/package/boot/uboot-mediatek/patches/435-add-h3c_magic-nx30-pro.patch new file mode 100644 index 00000000000..e7d1ce764cb --- /dev/null +++ b/package/boot/uboot-mediatek/patches/435-add-h3c_magic-nx30-pro.patch @@ -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 ++ */ ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #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 = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wps { ++ label = "wps"; ++ linux,code = ; ++ 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 = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++ ++ 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= ( ( ( OpenWrt ) ) ) ++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=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=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 $ver" diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile index 6ae767f6773..afd73e191b1 100644 --- a/package/boot/uboot-mxs/Makefile +++ b/package/boot/uboot-mxs/Makefile @@ -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)) diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index 59b8be84cfb..983edcb2409 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -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 diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 0c6941050b0..9b0d4c5c9fd 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -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)))) diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile index bed11fdbe1f..63259cae36a 100644 --- a/package/firmware/linux-firmware/Makefile +++ b/package/firmware/linux-firmware/Makefile @@ -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 diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk index 97694572b0b..23b58358b4e 100644 --- a/package/firmware/linux-firmware/intel.mk +++ b/package/firmware/linux-firmware/intel.mk @@ -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)) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 86a5ffb5c52..da3e69e49ac 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -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 diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 0c5d2da9504..cb85c46b785 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -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) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 644365ed19e..45efd7449f8 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -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) diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk index dc08df4f6fe..c75630a8bb0 100644 --- a/package/kernel/mac80211/ath.mk +++ b/package/kernel/mac80211/ath.mk @@ -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 diff --git a/package/kernel/mac80211/patches/subsys/337-mac80211-fix-sband-iftype-data-lookup-for-AP_VLAN.patch b/package/kernel/mac80211/patches/subsys/337-mac80211-fix-sband-iftype-data-lookup-for-AP_VLAN.patch new file mode 100644 index 00000000000..67b42849496 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/337-mac80211-fix-sband-iftype-data-lookup-for-AP_VLAN.patch @@ -0,0 +1,23 @@ +From: Felix Fietkau +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 +--- + +--- 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]; diff --git a/package/kernel/mac80211/patches/subsys/338-mac80211-split-mesh-fast-tx-cache-into-local-proxied.patch b/package/kernel/mac80211/patches/subsys/338-mac80211-split-mesh-fast-tx-cache-into-local-proxied.patch new file mode 100644 index 00000000000..f7391a58090 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/338-mac80211-split-mesh-fast-tx-cache-into-local-proxied.patch @@ -0,0 +1,219 @@ +From: Felix Fietkau +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 +--- + +--- 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; + diff --git a/package/kernel/mac80211/patches/subsys/340-mac80211-always-use-mac80211-loss-detection.patch b/package/kernel/mac80211/patches/subsys/340-mac80211-always-use-mac80211-loss-detection.patch new file mode 100644 index 00000000000..e084773fd9c --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/340-mac80211-always-use-mac80211-loss-detection.patch @@ -0,0 +1,36 @@ +From cdf461888f900c3a149b10a04d72b4a590ecdec3 Mon Sep 17 00:00:00 2001 +From: David Bauer +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 +--- + 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)) diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index 4a3984fb424..58a590682a3 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -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); diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 04db7fe32c2..0dfe7600df0 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -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 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 diff --git a/package/kernel/qca-nss-dp/Makefile b/package/kernel/qca-nss-dp/Makefile index e9d9706141f..f9e992f246a 100644 --- a/package/kernel/qca-nss-dp/Makefile +++ b/package/kernel/qca-nss-dp/Makefile @@ -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 diff --git a/package/kernel/qca-nss-dp/patches/0001-nss-dp-Drop-_nocache-variants-of-ioremap.patch b/package/kernel/qca-nss-dp/patches/0001-nss-dp-Drop-_nocache-variants-of-ioremap.patch new file mode 100644 index 00000000000..c998874d4e6 --- /dev/null +++ b/package/kernel/qca-nss-dp/patches/0001-nss-dp-Drop-_nocache-variants-of-ioremap.patch @@ -0,0 +1,48 @@ +From 946381fd6fdabedf2b5a1d8647a49e3da8f1894e Mon Sep 17 00:00:00 2001 +From: Baruch Siach +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 +Signed-off-by: Robert Marko +--- + 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__); diff --git a/package/kernel/qca-nss-dp/patches/0001-edma_tx_rx-support-newer-kernels-time-stamping-API.patch b/package/kernel/qca-nss-dp/patches/0002-edma_tx_rx-support-newer-kernels-time-stamping-API.patch similarity index 82% rename from package/kernel/qca-nss-dp/patches/0001-edma_tx_rx-support-newer-kernels-time-stamping-API.patch rename to package/kernel/qca-nss-dp/patches/0002-edma_tx_rx-support-newer-kernels-time-stamping-API.patch index 1fed4ba8ab9..d84e9a98d56 100644 --- a/package/kernel/qca-nss-dp/patches/0001-edma_tx_rx-support-newer-kernels-time-stamping-API.patch +++ b/package/kernel/qca-nss-dp/patches/0002-edma_tx_rx-support-newer-kernels-time-stamping-API.patch @@ -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 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 --- hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/kernel/qca-nss-dp/patches/0002-nss_dp_main-make-phy-mode-code-compatible-with-newer.patch b/package/kernel/qca-nss-dp/patches/0002-nss_dp_main-make-phy-mode-code-compatible-with-newer.patch deleted file mode 100644 index 04adad86f6b..00000000000 --- a/package/kernel/qca-nss-dp/patches/0002-nss_dp_main-make-phy-mode-code-compatible-with-newer.patch +++ /dev/null @@ -1,48 +0,0 @@ -From cef7873a2d77df13ee702d902ed4e06b2248904b Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il> -References: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il> -From: Baruch Siach -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 - #include - #include --#include -+#include - #include - - #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) { diff --git a/package/kernel/qca-nss-dp/patches/0003-Drop-_nocache-variants-of-ioremap.patch b/package/kernel/qca-nss-dp/patches/0003-Drop-_nocache-variants-of-ioremap.patch deleted file mode 100644 index 18bd85c8c36..00000000000 --- a/package/kernel/qca-nss-dp/patches/0003-Drop-_nocache-variants-of-ioremap.patch +++ /dev/null @@ -1,48 +0,0 @@ -From c8c52512ff48bee578901c381a42f027e79eadf9 Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il> -References: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il> -From: Baruch Siach -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"); diff --git a/package/kernel/qca-nss-dp/patches/0004-EDMA-Fix-NAPI-packet-counting.patch b/package/kernel/qca-nss-dp/patches/0003-EDMA-Fix-NAPI-packet-counting.patch similarity index 88% rename from package/kernel/qca-nss-dp/patches/0004-EDMA-Fix-NAPI-packet-counting.patch rename to package/kernel/qca-nss-dp/patches/0003-EDMA-Fix-NAPI-packet-counting.patch index f7653729a00..a2268010d4c 100644 --- a/package/kernel/qca-nss-dp/patches/0004-EDMA-Fix-NAPI-packet-counting.patch +++ b/package/kernel/qca-nss-dp/patches/0003-EDMA-Fix-NAPI-packet-counting.patch @@ -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 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. diff --git a/package/kernel/qca-nss-dp/patches/0005-EDMA-Use-NAPI_POLL_WEIGHT-as-NAPI-weight.patch b/package/kernel/qca-nss-dp/patches/0004-EDMA-Use-NAPI_POLL_WEIGHT-as-NAPI-weight.patch similarity index 87% rename from package/kernel/qca-nss-dp/patches/0005-EDMA-Use-NAPI_POLL_WEIGHT-as-NAPI-weight.patch rename to package/kernel/qca-nss-dp/patches/0004-EDMA-Use-NAPI_POLL_WEIGHT-as-NAPI-weight.patch index 9c22fa79044..84fb02a92a5 100644 --- a/package/kernel/qca-nss-dp/patches/0005-EDMA-Use-NAPI_POLL_WEIGHT-as-NAPI-weight.patch +++ b/package/kernel/qca-nss-dp/patches/0004-EDMA-Use-NAPI_POLL_WEIGHT-as-NAPI-weight.patch @@ -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 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 --- 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, diff --git a/package/kernel/qca-nss-dp/patches/0005-nss-dp-adapt-to-netif_napi_add-changes.patch b/package/kernel/qca-nss-dp/patches/0005-nss-dp-adapt-to-netif_napi_add-changes.patch new file mode 100644 index 00000000000..d5b0f624783 --- /dev/null +++ b/package/kernel/qca-nss-dp/patches/0005-nss-dp-adapt-to-netif_napi_add-changes.patch @@ -0,0 +1,46 @@ +From e46c4d526d77916c00fff4fff3237b9c9d0d774d Mon Sep 17 00:00:00 2001 +From: Robert Marko +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 +--- + 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 diff --git a/package/kernel/qca-nss-dp/patches/0006-NSS-DP-fix-of_get_mac_address.patch b/package/kernel/qca-nss-dp/patches/0006-NSS-DP-fix-of_get_mac_address.patch deleted file mode 100644 index 1d7b49129fb..00000000000 --- a/package/kernel/qca-nss-dp/patches/0006-NSS-DP-fix-of_get_mac_address.patch +++ /dev/null @@ -1,46 +0,0 @@ -From cadeb62a42296563141d6954eec58e34ef86778d Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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); diff --git a/package/kernel/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch b/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch similarity index 71% rename from package/kernel/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch rename to package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch index 276c87adfc5..0432b82dda3 100644 --- a/package/kernel/qca-nss-dp/patches/0013-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch +++ b/package/kernel/qca-nss-dp/patches/0006-nss_dp_main-Use-a-phy-handle-property-to-connect-to-.patch @@ -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 -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 +Signed-off-by: Robert Marko --- 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 --- 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 /* 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 - - 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 -{ - 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 - 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 - } - - 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 #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 - + 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) diff --git a/package/kernel/qca-nss-dp/patches/0007-NSS-DP-implement-ethernet-IOCTL-s.patch b/package/kernel/qca-nss-dp/patches/0007-NSS-DP-implement-ethernet-IOCTL-s.patch deleted file mode 100644 index 824f18634be..00000000000 --- a/package/kernel/qca-nss-dp/patches/0007-NSS-DP-implement-ethernet-IOCTL-s.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 5da62ba19f554bf437752a44360fb5ae9f1a7f5e Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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, diff --git a/package/kernel/qca-nss-dp/patches/0014-nss-dp-edma-v1-use-NAPI-GRO-by-default.patch b/package/kernel/qca-nss-dp/patches/0007-nss-dp-edma-v1-use-NAPI-GRO-by-default.patch similarity index 91% rename from package/kernel/qca-nss-dp/patches/0014-nss-dp-edma-v1-use-NAPI-GRO-by-default.patch rename to package/kernel/qca-nss-dp/patches/0007-nss-dp-edma-v1-use-NAPI-GRO-by-default.patch index f3a0948dfa8..6fbe75dc1c4 100644 --- a/package/kernel/qca-nss-dp/patches/0014-nss-dp-edma-v1-use-NAPI-GRO-by-default.patch +++ b/package/kernel/qca-nss-dp/patches/0007-nss-dp-edma-v1-use-NAPI-GRO-by-default.patch @@ -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 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 --- 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) { diff --git a/package/kernel/qca-nss-dp/patches/0015-nss-dp-allow-setting-netdev-name-from-DTS.patch b/package/kernel/qca-nss-dp/patches/0008-nss-dp-allow-setting-netdev-name-from-DTS.patch similarity index 87% rename from package/kernel/qca-nss-dp/patches/0015-nss-dp-allow-setting-netdev-name-from-DTS.patch rename to package/kernel/qca-nss-dp/patches/0008-nss-dp-allow-setting-netdev-name-from-DTS.patch index 906e5ee7624..e90bf32ced7 100644 --- a/package/kernel/qca-nss-dp/patches/0015-nss-dp-allow-setting-netdev-name-from-DTS.patch +++ b/package/kernel/qca-nss-dp/patches/0008-nss-dp-allow-setting-netdev-name-from-DTS.patch @@ -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 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 --- 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; diff --git a/package/kernel/qca-nss-dp/patches/0008-switchdev-remove-the-transaction-structure.patch b/package/kernel/qca-nss-dp/patches/0008-switchdev-remove-the-transaction-structure.patch deleted file mode 100644 index 220be961ab4..00000000000 --- a/package/kernel/qca-nss-dp/patches/0008-switchdev-remove-the-transaction-structure.patch +++ /dev/null @@ -1,48 +0,0 @@ -From c9afdcdd2642485a6476906be9da2e811090fc7a Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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); diff --git a/package/kernel/qca-nss-dp/patches/0010-switchdev-fix-FDB-roaming.patch b/package/kernel/qca-nss-dp/patches/0009-nss-dp-switchdev-fix-FDB-roaming.patch similarity index 65% rename from package/kernel/qca-nss-dp/patches/0010-switchdev-fix-FDB-roaming.patch rename to package/kernel/qca-nss-dp/patches/0009-nss-dp-switchdev-fix-FDB-roaming.patch index 19395ac42c4..ec10bdc2d98 100644 --- a/package/kernel/qca-nss-dp/patches/0010-switchdev-fix-FDB-roaming.patch +++ b/package/kernel/qca-nss-dp/patches/0009-nss-dp-switchdev-fix-FDB-roaming.patch @@ -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 -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 --- - 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 #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 + 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 + 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() diff --git a/package/kernel/qca-nss-dp/patches/0009-switchdev-use-new-switchdev-flags.patch b/package/kernel/qca-nss-dp/patches/0009-switchdev-use-new-switchdev-flags.patch deleted file mode 100644 index ecc84c1741c..00000000000 --- a/package/kernel/qca-nss-dp/patches/0009-switchdev-use-new-switchdev-flags.patch +++ /dev/null @@ -1,51 +0,0 @@ -From f95868d54301c0f54e968ec9d978c9caa02ee425 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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 - #include - #include -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)) -+#include -+#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); diff --git a/package/kernel/qca-nss-dp/patches/0011-treewide-fix-confusing-printing-of-registered-netdev.patch b/package/kernel/qca-nss-dp/patches/0011-treewide-fix-confusing-printing-of-registered-netdev.patch deleted file mode 100644 index 726ca304df7..00000000000 --- a/package/kernel/qca-nss-dp/patches/0011-treewide-fix-confusing-printing-of-registered-netdev.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 7e4ae2d6285095794d73d2f2ce61404f61d4e633 Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -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 ---- - 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; - diff --git a/package/kernel/qca-nss-dp/patches/0012-gmac-syn-xgmac-silence-debug-log-on-probe.patch b/package/kernel/qca-nss-dp/patches/0012-gmac-syn-xgmac-silence-debug-log-on-probe.patch deleted file mode 100644 index 3c1c8ab83b5..00000000000 --- a/package/kernel/qca-nss-dp/patches/0012-gmac-syn-xgmac-silence-debug-log-on-probe.patch +++ /dev/null @@ -1,23 +0,0 @@ -From fee52ef165e9fab2fca15492677082fd8e9e891f Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -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 ---- - 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); diff --git a/package/kernel/qca-nss-dp/patches/0016-nss-dp-netdev-mac_addr-is-const.patch b/package/kernel/qca-nss-dp/patches/0016-nss-dp-netdev-mac_addr-is-const.patch deleted file mode 100644 index 6957f146092..00000000000 --- a/package/kernel/qca-nss-dp/patches/0016-nss-dp-netdev-mac_addr-is-const.patch +++ /dev/null @@ -1,57 +0,0 @@ -From ff9284e3a59982c78a0132e6f2c5e3f04ba11472 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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; - } diff --git a/package/kernel/qca-nss-dp/patches/0017-nss-dp-use-proper-netdev-MAC-helpers.patch b/package/kernel/qca-nss-dp/patches/0017-nss-dp-use-proper-netdev-MAC-helpers.patch deleted file mode 100644 index beb6db4996d..00000000000 --- a/package/kernel/qca-nss-dp/patches/0017-nss-dp-use-proper-netdev-MAC-helpers.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 704706969301076961c15423dedce9e2e6f1026e Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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); - } diff --git a/package/kernel/qca-nss-dp/patches/0018-nss-dp-adapt-to-netif_napi_add-changes.patch b/package/kernel/qca-nss-dp/patches/0018-nss-dp-adapt-to-netif_napi_add-changes.patch deleted file mode 100644 index 084f30da136..00000000000 --- a/package/kernel/qca-nss-dp/patches/0018-nss-dp-adapt-to-netif_napi_add-changes.patch +++ /dev/null @@ -1,84 +0,0 @@ -From ba748ab91a62db57f9bdf69dd306e6557315db85 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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 diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile index 92f7b66490b..7420b038037 100644 --- a/package/kernel/qca-ssdk/Makefile +++ b/package/kernel/qca-ssdk/Makefile @@ -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 diff --git a/package/kernel/qca-ssdk/patches/0001-SSDK-replace-ioremap_nocache-with-ioremap.patch b/package/kernel/qca-ssdk/patches/0001-SSDK-replace-ioremap_nocache-with-ioremap.patch deleted file mode 100644 index 2b659e1322e..00000000000 --- a/package/kernel/qca-ssdk/patches/0001-SSDK-replace-ioremap_nocache-with-ioremap.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 1e46d596701fedb751a669666a74677344fb8724 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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__); diff --git a/package/kernel/qca-ssdk/patches/0005-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch b/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch similarity index 92% rename from package/kernel/qca-ssdk/patches/0005-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch rename to package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch index 6ff92ab95a9..da5387dafc3 100644 --- a/package/kernel/qca-ssdk/patches/0005-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch +++ b/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch @@ -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 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 #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); diff --git a/package/kernel/qca-ssdk/patches/0002-SSDK-platform-use-of_mdio_find_bus-to-get-MDIO-bus.patch b/package/kernel/qca-ssdk/patches/0002-SSDK-platform-use-of_mdio_find_bus-to-get-MDIO-bus.patch deleted file mode 100644 index 21b3491c6f7..00000000000 --- a/package/kernel/qca-ssdk/patches/0002-SSDK-platform-use-of_mdio_find_bus-to-get-MDIO-bus.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 60d2b72cacd43796def9b4bd69a9e0e84be9d2e1 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 -Signed-off-by: Robert Marko ---- - 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); diff --git a/package/kernel/qca-ssdk/patches/0006-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch b/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch similarity index 84% rename from package/kernel/qca-ssdk/patches/0006-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch rename to package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch index 6e044c7466d..9d456b23990 100644 --- a/package/kernel/qca-ssdk/patches/0006-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch +++ b/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch @@ -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 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 --- 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); diff --git a/package/kernel/qca-ssdk/patches/0003-SSDK-dts-fix-of_get_mac_address.patch b/package/kernel/qca-ssdk/patches/0003-SSDK-dts-fix-of_get_mac_address.patch deleted file mode 100644 index c004f4acd88..00000000000 --- a/package/kernel/qca-ssdk/patches/0003-SSDK-dts-fix-of_get_mac_address.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c1b6fa42a160763b574dd52aa4845718e4cd0ea6 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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); diff --git a/package/kernel/qca-ssdk/patches/0004-qca8081-convert-to-5.11-IRQ-model.patch b/package/kernel/qca-ssdk/patches/0004-qca8081-convert-to-5.11-IRQ-model.patch deleted file mode 100644 index 1e496ad9810..00000000000 --- a/package/kernel/qca-ssdk/patches/0004-qca8081-convert-to-5.11-IRQ-model.patch +++ /dev/null @@ -1,83 +0,0 @@ -From aaac91b5e8756dce1c0242d58074a0b5d4607b57 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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, diff --git a/package/kernel/qca-ssdk/patches/0007-include-fix-compilation-error-for-parse_uci_option.patch b/package/kernel/qca-ssdk/patches/0007-include-fix-compilation-error-for-parse_uci_option.patch deleted file mode 100644 index 6b084a844d2..00000000000 --- a/package/kernel/qca-ssdk/patches/0007-include-fix-compilation-error-for-parse_uci_option.patch +++ /dev/null @@ -1,22 +0,0 @@ -From adc75660a50c5b7a16032921a30a0eaedc8b826f Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -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 ---- - 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 - - #if defined(IN_SWCONFIG) - int diff --git a/package/kernel/qca-ssdk/patches/0008-QSDK-config-Avoid-Werror-heroics.patch b/package/kernel/qca-ssdk/patches/0008-QSDK-config-Avoid-Werror-heroics.patch deleted file mode 100644 index 30b4e4be4f9..00000000000 --- a/package/kernel/qca-ssdk/patches/0008-QSDK-config-Avoid-Werror-heroics.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d70d013ac1090565ebb71875f5bdc70840807428 Mon Sep 17 00:00:00 2001 -From: Alexandru Gagniuc -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 ---- - 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 - diff --git a/package/kernel/qca-ssdk/patches/0009-Revert-qca-ssdk-remove-bridge-fdb-entry-for-the-auth.patch b/package/kernel/qca-ssdk/patches/0009-Revert-qca-ssdk-remove-bridge-fdb-entry-for-the-auth.patch deleted file mode 100644 index 92c46a815ed..00000000000 --- a/package/kernel/qca-ssdk/patches/0009-Revert-qca-ssdk-remove-bridge-fdb-entry-for-the-auth.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0582c76ce9c35ce8d49cba598e0e17073dd875b5 Mon Sep 17 00:00:00 2001 -From: Alexandru Gagniuc -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 ---- - 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 --#include - - /* 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; - } - diff --git a/package/kernel/qca-ssdk/patches/0010-Support-Linux-Style-Makefile-for-SSDK.patch b/package/kernel/qca-ssdk/patches/0010-Support-Linux-Style-Makefile-for-SSDK.patch deleted file mode 100644 index 180701bb143..00000000000 --- a/package/kernel/qca-ssdk/patches/0010-Support-Linux-Style-Makefile-for-SSDK.patch +++ /dev/null @@ -1,281 +0,0 @@ -From 2276a0b93751f015ef719dedf9a0d4b55ae684d5 Mon Sep 17 00:00:00 2001 -From: crao -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 ---- - 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 diff --git a/package/kernel/qca-ssdk/patches/0011-fix-compilation-issue-in-Linux-Style-Makefile.patch b/package/kernel/qca-ssdk/patches/0011-fix-compilation-issue-in-Linux-Style-Makefile.patch deleted file mode 100644 index f7d07a7baf9..00000000000 --- a/package/kernel/qca-ssdk/patches/0011-fix-compilation-issue-in-Linux-Style-Makefile.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 46a5dd73195081b5d78582f2a13f83e49f36e917 Mon Sep 17 00:00:00 2001 -From: crao -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 ---- - 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: diff --git a/package/kernel/qca-ssdk/patches/0012-fix-compilation-issue-in-Miami-yocto.patch b/package/kernel/qca-ssdk/patches/0012-fix-compilation-issue-in-Miami-yocto.patch deleted file mode 100644 index 7670d7f354a..00000000000 --- a/package/kernel/qca-ssdk/patches/0012-fix-compilation-issue-in-Miami-yocto.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0060aa1b0d2530672e64708d8062b3f33d007ed3 Mon Sep 17 00:00:00 2001 -From: crao -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 ---- - 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: diff --git a/package/kernel/qca-ssdk/patches/0013-SSDK-config-add-kernel-6.1.patch b/package/kernel/qca-ssdk/patches/0013-SSDK-config-add-kernel-6.1.patch deleted file mode 100644 index 44b5e625eed..00000000000 --- a/package/kernel/qca-ssdk/patches/0013-SSDK-config-add-kernel-6.1.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 05aba6d6dfd49fe10b33cf221b7e81250a67033c Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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 diff --git a/package/kernel/qca-ssdk/patches/0014-SSDK-qca808x-use-get_random_u32.patch b/package/kernel/qca-ssdk/patches/0014-SSDK-qca808x-use-get_random_u32.patch deleted file mode 100644 index f5aa0e907c7..00000000000 --- a/package/kernel/qca-ssdk/patches/0014-SSDK-qca808x-use-get_random_u32.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6a49dd6bb2e40ce49351adb6100599f176d80494 Mon Sep 17 00:00:00 2001 -From: Robert Marko -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 ---- - 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); diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile index 7239c286fdd..048c3e79397 100644 --- a/package/libs/libnl-tiny/Makefile +++ b/package/libs/libnl-tiny/Makefile @@ -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 diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 31fd0838a49..a660f27bdf5 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -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 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 28bd210623b..bf3625c92d8 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -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 diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index c471c7c75d2..0eadcc9a5d5 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -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 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 3923e55b072..02a02405fd6 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -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 PKG_LICENSE:=ISC diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index fcb89ff42b3..e5add395ff9 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -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 PKG_LICENSE:=GPL-2.0 -IWINFO_ABI_VERSION:=20230121 +IWINFO_ABI_VERSION:=20230701 include $(INCLUDE_DIR)/package.mk diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 2d51b51ad72..9e829a21591 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -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 diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index 6221da8c8ef..977932f9d1c 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -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 PKG_LICENSE:=ISC diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile index e768acbae91..e2fe4c8bad4 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile @@ -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 PKG_LICENSE:=ISC diff --git a/scripts/moxa-encode-fw.py b/scripts/moxa-encode-fw.py new file mode 100755 index 00000000000..48d139b839c --- /dev/null +++ b/scripts/moxa-encode-fw.py @@ -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() diff --git a/scripts/netgear-encrypted-factory.py b/scripts/netgear-encrypted-factory.py index b6bb72f3b87..40cfd9df0d2 100755 --- a/scripts/netgear-encrypted-factory.py +++ b/scripts/netgear-encrypted-factory.py @@ -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, diff --git a/target/linux/apm821xx/config-6.1 b/target/linux/apm821xx/config-6.1 index 9e51e94a2f5..2979312101b 100644 --- a/target/linux/apm821xx/config-6.1 +++ b/target/linux/apm821xx/config-6.1 @@ -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 diff --git a/target/linux/armsr/armv8/config-6.1 b/target/linux/armsr/armv8/config-6.1 index f1b4838d153..f6bcce191f1 100644 --- a/target/linux/armsr/armv8/config-6.1 +++ b/target/linux/armsr/armv8/config-6.1 @@ -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 diff --git a/target/linux/armsr/config-6.1 b/target/linux/armsr/config-6.1 index a48af89b875..46483152d03 100644 --- a/target/linux/armsr/config-6.1 +++ b/target/linux/armsr/config-6.1 @@ -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 diff --git a/target/linux/ath25/patches-5.15/107-ar5312_gpio.patch b/target/linux/ath25/patches-5.15/107-ar5312_gpio.patch index 4ad1d40facd..e6e1290d35a 100644 --- a/target/linux/ath25/patches-5.15/107-ar5312_gpio.patch +++ b/target/linux/ath25/patches-5.15/107-ar5312_gpio.patch @@ -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 diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951g-2hnd.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951g-2hnd.dts new file mode 100644 index 00000000000..6229eefb1f0 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951g-2hnd.dts @@ -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"; +}; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951ui-2hnd.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951ui-2hnd.dts index 3d59a30f112..65003cb9a1f 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951ui-2hnd.dts +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951ui-2hnd.dts @@ -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"; -}; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951x-2hnd.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951x-2hnd.dtsi new file mode 100644 index 00000000000..5d135f1ca6d --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-951x-2hnd.dtsi @@ -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"; +}; diff --git a/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts b/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts new file mode 100644 index 00000000000..d2c51714020 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts @@ -0,0 +1,184 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include +#include + +/ { + 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 = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + + led_status_green: led-0 { + label = "green:status"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + led_status_red: led-1 { + label = "red:status"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-2 { + label = "green:wifi"; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <0>; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-3 { + label = "green:lan1"; + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-4 { + label = "green:lan2"; + color = ; + function = LED_FUNCTION_LAN; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-5 { + label = "yellow:wifi"; + color = ; + 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; +}; diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts index 8fc21be1dcb..8dc1ceb6666 100644 --- a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -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 { diff --git a/target/linux/ath79/dts/qca9558_aruba_ap-115.dts b/target/linux/ath79/dts/qca9558_aruba_ap-115.dts new file mode 100644 index 00000000000..b8aed4c283a --- /dev/null +++ b/target/linux/ath79/dts/qca9558_aruba_ap-115.dts @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "aruba,ap-115", "qca,qca9558"; + model = "Aruba AP-115"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + label-mac-device = ð0; + }; + + chosen { + bootargs = "console=ttyS0,9600n8"; + }; + + /** + * Currently unused GPIOs in OpenWrt: + * + * TPM-CLK: 19 + * TPM-IO: 20 + * ETH-PHY-Interrupt: 11 + * Power-DC: 22 + * Power-PoE: 23 + * Power-PoE-8023af: 17 + */ + + leds { + compatible = "gpio-leds"; + + led_power_green: power-green { + label = "green:power"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_power_red: power-red { + label = "red:power"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + radio-24-green { + label = "green:radio-24"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + radio-24-amber { + label = "amber:radio-24"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + radio-5-green { + label = "green:radio-5"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + radio-5-amber { + label = "amber:radio-5"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; + + reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 3 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + + nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cell-names = "mac-address"; + + mac-address-increment = <1>; + }; +}; + +&pinmux { + /** + * Ugly hack ahead! + * + * GPIO05: Bank1-CS / Bank2-CLK + * GPIO14: Bank1-CLK / Bank2-CS + * + * We can not support this with OpenWrt, as this + * would require us to influence the pinmux based on the CS. + * + * We force-select Bank 1. Remember to blame Aruba for that. + */ + cs0_pin5: spi-cs0-pin5 { + pinctrl-single,bits = <0x4 0x900 0xff00>; + }; + + clk_pin14: spi-cs1-pin14 { + pinctrl-single,bits = <0xc 0x0a0000 0xff0000>; + }; +}; + +&spi { + pinctrl-names = "default"; + pinctrl-0 = <&cs0_pin5 &clk_pin14>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@1 { + label = "flash-full"; + reg = <0x0 0x1000000>; + read-only; + }; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + /* Here be dragons */ + + partition@100000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x100000 0xe00000>; + }; + + oemdata: partition@fe0000 { + label = "oemdata"; + reg = <0xfe0000 0x010000>; + read-only; + }; + + partition@ff0000 { + label = "u-boot-env"; + reg = <0xff0000 0x10000>; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; + nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cell-names = "mac-address"; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + reset-gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + reset-assert-us = <10000>; + reset-deassert-us = <10000>; + + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy0>; + phy-mode = "rgmii-id"; + + pll-data = <0xa6000000 0xa0000101 0xa0001313>; + + gmac-config { + device = <&gmac>; + ge0-sgmii = <0>; + txen-delay = <3>; + txd-delay = <3>; + rxdv-delay = <3>; + rxd-delay = <3>; + rgmii-enabled = <1>; + }; +}; + +&oemdata { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_oemdata_1d: macaddr@1d { + reg = <0x1d 0x6>; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + dr_mode = "host"; + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts new file mode 100644 index 00000000000..b38e2e848f6 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "comfast,cf-e380ac-v2", "qca,qca9558"; + model = "COMFAST CF-E380AC"; + + aliases { + serial0 = &uart; + label-mac-device = ð1; + led-boot = &led_lan; + led-failsafe = &led_lan; + led-upgrade = &led_lan; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + led_lan: lan { + label = "green:lan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "blue:wlan2g"; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "red:wlan5g"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + hw_margin_ms = <1200>; + always-running; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&art 0x0>; +}; + + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + art: partition@40000 { + label = "art"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0x0fa0000>; + }; + + partition@ff0000 { + label = "art-backup"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + pll-data = <0xbe000000 0xb0000101 0xb0001313>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&wdt { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <10>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 10c67991fd2..00bcad2bc50 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -302,6 +302,10 @@ tplink,cpe210-v3) meraki,mr16) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" ;; +moxa,awk-1137c) + ucidef_set_led_switch "wan" "LAN1" "green:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan" "LAN2" "green:lan2" "switch0" "0x04" + ;; netgear,wnr2200-8m|\ netgear,wnr2200-16m) ucidef_set_led_netdev "wan-amber" "WAN (amber)" "amber:wan" "eth0" @@ -441,6 +445,7 @@ tplink,cpe510-v3) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:link3" "wlan0" "51" "100" "-50" "13" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:link4" "wlan0" "76" "100" "-75" "13" ;; +comfast,cf-e380ac-v2|\ tplink,tl-wr902ac-v1) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" ucidef_set_led_netdev "internet" "Internet" "green:internet" "eth0" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index d18eddf5b74..1b12a21d0d9 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -27,6 +27,7 @@ ath79_setup_interfaces() avm,fritzdvbc|\ comfast,cf-wr752ac-v1|\ comfast,cf-e130n-v2|\ + comfast,cf-e380ac-v2|\ devolo,dvl1200i|\ devolo,dvl1750c|\ devolo,dvl1750i|\ @@ -240,7 +241,8 @@ ath79_setup_interfaces() ubnt,routerstation) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; - comfast,cf-e375ac) + comfast,cf-e375ac|\ + moxa,awk-1137c) ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan" ;; @@ -731,6 +733,11 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config)) label_mac=$lan_mac ;; + moxa,awk-1137c) + lan_mac=$(mtd_get_mac_ascii u-boot-env mac_addr) + wan_mac=$(mtd_get_mac_ascii u-boot-env mac_addr) + label_mac=$lan_mac + ;; nec,wf1200cr|\ nec,wg1200cr) lan_mac=$(mtd_get_mac_ascii devdata "lanmac") @@ -742,6 +749,7 @@ ath79_setup_macs() wan_mac=$(mtd_get_mac_text board_data 0x480) label_mac=$wan_mac ;; + comfast,cf-e380ac-v2|\ netgear,wndr3700|\ netgear,wndr3700-v2|\ netgear,wndr3800|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index a57479b87cf..3b089885b31 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -12,6 +12,9 @@ case "$FIRMWARE" in 8dev,lima) caldata_extract "art" 0x1000 0x800 ;; + aruba,ap-115) + caldata_extract "oemdata" 0x1000 0x440 + ;; asus,pl-ac56|\ asus,rp-ac51|\ asus,rp-ac66) @@ -59,6 +62,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr) ;; + moxa,awk-1137c) + caldata_extract "art" 0x1000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr) + ;; nec,wg800hp) caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_text board_data 0x680) @@ -79,6 +86,9 @@ case "$FIRMWARE" in ;; "ath9k-eeprom-pci-0000:00:00.0.bin") case $board in + aruba,ap-115) + caldata_extract "oemdata" 0x5000 0x440 + ;; avm,fritz300e) caldata_extract_reverse "urloader" 0x1541 0x440 ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index f0a3755de91..dd627ad2d65 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -13,6 +13,7 @@ case "$FIRMWARE" in allnet,all-wap02860ac|\ araknis,an-500-ap-i-ac|\ araknis,an-700-ap-i-ac|\ + comfast,cf-e380ac-v2|\ engenius,enstationac-v1|\ glinet,gl-x750|\ watchguard,ap300) diff --git a/target/linux/ath79/generic/base-files/etc/init.d/bootcount b/target/linux/ath79/generic/base-files/etc/init.d/bootcount index 7807559d810..01c446b1bb4 100755 --- a/target/linux/ath79/generic/base-files/etc/init.d/bootcount +++ b/target/linux/ath79/generic/base-files/etc/init.d/bootcount @@ -8,6 +8,9 @@ boot() { adtran,bsap1840) fconfig -s -w -d $(find_mtd_part "RedBoot config") -n boot_cntb -x 0 ;; + moxa,awk-1137c) + fw_setenv fwr_verify 0 + ;; qihoo,c301) local n=$(fw_printenv activeregion | cut -d = -f 2) fw_setenv "image${n}trynum" 0 diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh index 5fa23e8eb68..8b39a17eb0c 100644 --- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -28,6 +28,9 @@ preinit_set_mac_address() { fortinet,fap-221-b) ip link set dev eth0 address $(mtd_get_mac_text u-boot 0x3ff80 12) ;; + moxa,awk-1137c) + ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env mac_addr) + ;; tplink,deco-s4-v2) base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config)) ip link set dev eth0 address $base_mac diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 788520120de..b32a09f34b5 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -9,6 +9,7 @@ DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += KERNEL_INITRAMFS_PREFIX DAP_SIGNATURE DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL +DEVICE_VARS += MOXA_MAGIC MOXA_HWID DEVICE_VARS += OPENMESH_CE_TYPE ZYXEL_MODEL_STRING DEVICE_VARS += SUPPORTED_TELTONIKA_DEVICES @@ -413,6 +414,21 @@ define Device/aruba_ap-105 endef TARGET_DEVICES += aruba_ap-105 +define Device/aruba_ap-115 + SOC := qca9558 + DEVICE_VENDOR := Aruba + DEVICE_MODEL := AP-115 + IMAGE_SIZE := 16000k + DEVICE_PACKAGES := kmod-usb2 + LOADER_TYPE := bin + LOADER_FLASH_OFFS := 0x102000 + COMPILE := loader-$(1).bin + COMPILE/loader-$(1).bin := loader-okli-compile + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 8128 | uImage none + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel +endef +TARGET_DEVICES += aruba_ap-115 + define Device/aruba_ap-175 SOC := ar7161 DEVICE_VENDOR := Aruba @@ -724,6 +740,17 @@ define Device/comfast_cf-e375ac endef TARGET_DEVICES += comfast_cf-e375ac +define Device/comfast_cf-e380ac-v2 + SOC := qca9558 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-E380AC + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 \ + kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += comfast_cf-e380ac-v2 + define Device/comfast_cf-e5 SOC := qca9531 DEVICE_VENDOR := COMFAST @@ -1804,6 +1831,19 @@ define Device/mercury_mw4530r-v1 endef TARGET_DEVICES += mercury_mw4530r-v1 +define Device/moxa_awk-1137c + SOC := ar9344 + DEVICE_MODEL := AWK-1137C + DEVICE_VENDOR := MOXA + MOXA_MAGIC := 0x8919123028877702 + MOXA_HWID := 0x01080000 + IMAGE_SIZE := 14336k + DEVICE_PACKAGES := uboot-envtools + IMAGES += factory.rom + IMAGE/factory.rom := $$(IMAGE/sysupgrade.bin) | moxa-encode-fw +endef +TARGET_DEVICES += moxa_awk-1137c + define Device/nec_wx1200cr DEVICE_VENDOR := NEC IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 3f65b35c8c5..683e9a33304 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -48,6 +48,15 @@ define Device/mikrotik_routerboard-922uags-5hpacd endef TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd +define Device/mikrotik_routerboard-951g-2hnd + $(Device/mikrotik_nand) + SOC := ar9344 + DEVICE_MODEL := RouterBOARD 951G-2HnD + DEVICE_PACKAGES += kmod-usb-ohci kmod-usb2 + SUPPORTED_DEVICES += rb-951g-2hnd +endef +TARGET_DEVICES += mikrotik_routerboard-951g-2hnd + define Device/mikrotik_routerboard-951ui-2hnd $(Device/mikrotik_nand) SOC := ar9344 diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index aba811fb2d1..68c8cfb96e7 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -35,6 +35,7 @@ ath79_setup_interfaces() mikrotik,routerboard-map-2nd) ucidef_set_interface_lan "eth0 eth1" ;; + mikrotik,routerboard-951g-2hnd|\ mikrotik,routerboard-962uigs-5hact2hnt) ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index b23bd05bcd5..cc05ba080bf 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -46,6 +46,7 @@ case "$FIRMWARE" in mikrotik,routerboard-962uigs-5hact2hnt) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 7) ;; + mikrotik,routerboard-951g-2hnd|\ mikrotik,routerboard-951ui-2hnd) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +11) ;; diff --git a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh index cefbc5d3341..e3887bfc50d 100644 --- a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh @@ -33,6 +33,7 @@ platform_do_upgrade() { mikrotik,routerboard-912uag-2hpnd|\ mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-922uags-5hpacd|\ + mikrotik,routerboard-951g-2hnd|\ mikrotik,routerboard-951ui-2hnd|\ mikrotik,routerboard-sxt-5nd-r2) platform_do_upgrade_mikrotik_nand "$1" diff --git a/target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch b/target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch index 9bce3a26333..9d014434ecb 100644 --- a/target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch +++ b/target/linux/ath79/patches-5.15/0032-MIPS-ath79-sanitize-symbols.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -256,6 +256,8 @@ config ATH79 +@@ -257,6 +257,8 @@ config ATH79 select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_MIPS16 select SYS_SUPPORTS_ZBOOT_UART_PROM diff --git a/target/linux/ath79/patches-5.15/0041-MIPS-ath79-common-exports.patch b/target/linux/ath79/patches-5.15/0041-MIPS-ath79-common-exports.patch new file mode 100644 index 00000000000..befcf2d50f1 --- /dev/null +++ b/target/linux/ath79/patches-5.15/0041-MIPS-ath79-common-exports.patch @@ -0,0 +1,26 @@ +From: Luiz Angelo Daros de Luca +Subject: [PATCH] ath79: export ath79_pll_base + +This symbol is declared as extern but nobody exported it. +Any module including arch/mips/include/asm/mach-ath79/ath79.h +will not build. Without this export, ag71xx.ko will not build +as a module and the build will fail like this: + +ERROR: modpost: "ath79_pll_base" [drivers/net/ethernet/atheros/ag71xx/ag71xx.ko] undefined! + +The ath79_pll_base symbol is accessed in the ath79_pll_wr() inline function. + +--- + arch/mips/ath79/common.c | 1 + + 1 file changed, 1 insertions(+) + +--- a/arch/mips/ath79/common.c ++++ b/arch/mips/ath79/common.c +@@ -34,6 +34,7 @@ unsigned int ath79_soc_rev; + EXPORT_SYMBOL_GPL(ath79_soc_rev); + + void __iomem *ath79_pll_base; ++EXPORT_SYMBOL_GPL(ath79_pll_base); + void __iomem *ath79_reset_base; + EXPORT_SYMBOL_GPL(ath79_reset_base); + void __iomem *ath79_ddr_base; diff --git a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch index 5c659b3d2ca..55539d7d539 100644 --- a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch @@ -311,7 +311,7 @@ SVN-Revision: 35130 case IPV6_2292HOPOPTS: --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c -@@ -1009,7 +1009,7 @@ static bool ipv6_hop_jumbo(struct sk_buf +@@ -1002,7 +1002,7 @@ static bool ipv6_hop_jumbo(struct sk_buf goto drop; } @@ -737,7 +737,7 @@ SVN-Revision: 35130 | TCPOLEN_TIMESTAMP)) --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c -@@ -166,8 +166,8 @@ int xfrm_parse_spi(struct sk_buff *skb, +@@ -167,8 +167,8 @@ int xfrm_parse_spi(struct sk_buff *skb, if (!pskb_may_pull(skb, hlen)) return -EINVAL; @@ -784,7 +784,7 @@ SVN-Revision: 35130 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h -@@ -275,8 +275,10 @@ static inline bool neigh_key_eq128(const +@@ -270,8 +270,10 @@ static inline bool neigh_key_eq128(const const u32 *n32 = (const u32 *)n->primary_key; const u32 *p32 = pkey; diff --git a/target/linux/bcm27xx/bcm2708/config-6.1 b/target/linux/bcm27xx/bcm2708/config-6.1 index edf74c4fad8..c5d604e6bc2 100644 --- a/target/linux/bcm27xx/bcm2708/config-6.1 +++ b/target/linux/bcm27xx/bcm2708/config-6.1 @@ -4,7 +4,6 @@ CONFIG_APERTURE_HELPERS=y CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM2835=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y @@ -163,7 +162,6 @@ CONFIG_FONT_SUPPORT=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -CONFIG_FRAME_WARN=1024 CONFIG_FREEZER=y CONFIG_FS_IOMAP=y CONFIG_FS_MBCACHE=y diff --git a/target/linux/bcm27xx/bcm2709/config-6.1 b/target/linux/bcm27xx/bcm2709/config-6.1 index 4f9be6d3716..ec2e7f3fa61 100644 --- a/target/linux/bcm27xx/bcm2709/config-6.1 +++ b/target/linux/bcm27xx/bcm2709/config-6.1 @@ -5,7 +5,6 @@ CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM2835=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_MIGHT_HAVE_PC_PARPORT=y @@ -198,7 +197,6 @@ CONFIG_FONT_SUPPORT=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -CONFIG_FRAME_WARN=1024 CONFIG_FREEZER=y CONFIG_FS_ENCRYPTION=y CONFIG_FS_ENCRYPTION_ALGS=y diff --git a/target/linux/bcm27xx/bcm2710/config-6.1 b/target/linux/bcm27xx/bcm2710/config-6.1 index 295b6655895..b0abd49c7f1 100644 --- a/target/linux/bcm27xx/bcm2710/config-6.1 +++ b/target/linux/bcm27xx/bcm2710/config-6.1 @@ -6,7 +6,6 @@ CONFIG_ARCH_BCM2835=y CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=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_MHP_MEMMAP_ON_MEMORY_ENABLE=y @@ -207,7 +206,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y CONFIG_FRAME_POINTER=y -CONFIG_FRAME_WARN=2048 CONFIG_FREEZER=y CONFIG_FSL_ERRATUM_A008585=y CONFIG_FS_ENCRYPTION=y diff --git a/target/linux/bcm27xx/bcm2711/config-6.1 b/target/linux/bcm27xx/bcm2711/config-6.1 index 6642a88142d..ff88926e3df 100644 --- a/target/linux/bcm27xx/bcm2711/config-6.1 +++ b/target/linux/bcm27xx/bcm2711/config-6.1 @@ -6,7 +6,6 @@ CONFIG_ARCH_BCM2835=y CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=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_MHP_MEMMAP_ON_MEMORY_ENABLE=y @@ -212,7 +211,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y CONFIG_FRAME_POINTER=y -CONFIG_FRAME_WARN=2048 CONFIG_FREEZER=y CONFIG_FSL_ERRATUM_A008585=y CONFIG_FS_ENCRYPTION=y diff --git a/target/linux/bcm27xx/patches-6.1/950-0080-Revert-net-bcmgenet-Request-APD-DLL-disable-and-IDDQ.patch b/target/linux/bcm27xx/patches-6.1/950-0080-Revert-net-bcmgenet-Request-APD-DLL-disable-and-IDDQ.patch index 59e06e10f76..9a29d617929 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0080-Revert-net-bcmgenet-Request-APD-DLL-disable-and-IDDQ.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0080-Revert-net-bcmgenet-Request-APD-DLL-disable-and-IDDQ.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c -@@ -285,9 +285,7 @@ int bcmgenet_mii_probe(struct net_device +@@ -290,9 +290,7 @@ int bcmgenet_mii_probe(struct net_device struct device_node *dn = kdev->of_node; phy_interface_t phy_iface = priv->phy_interface; struct phy_device *phydev; diff --git a/target/linux/bcm27xx/patches-6.1/950-0084-cgroup-Disable-cgroup-memory-by-default.patch b/target/linux/bcm27xx/patches-6.1/950-0084-cgroup-Disable-cgroup-memory-by-default.patch index 77419cbc4b5..d437cccb3c7 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0084-cgroup-Disable-cgroup-memory-by-default.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0084-cgroup-Disable-cgroup-memory-by-default.patch @@ -29,7 +29,7 @@ Signed-off-by: Phil Elwell * @@ -6079,6 +6082,12 @@ int __init cgroup_init(void) - mutex_unlock(&cgroup_mutex); + cgroup_unlock(); + /* + * Apply an implicit disable, knowing that an explicit enable will @@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6717,6 +6726,10 @@ static int __init cgroup_disable(char *s +@@ -6716,6 +6725,10 @@ static int __init cgroup_disable(char *s strcmp(token, ss->legacy_name)) continue; @@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6735,6 +6748,31 @@ static int __init cgroup_disable(char *s +@@ -6734,6 +6747,31 @@ static int __init cgroup_disable(char *s } __setup("cgroup_disable=", cgroup_disable); diff --git a/target/linux/bcm27xx/patches-6.1/950-0179-bcmgenet-Better-coalescing-parameter-defaults.patch b/target/linux/bcm27xx/patches-6.1/950-0179-bcmgenet-Better-coalescing-parameter-defaults.patch index c2f480d7cb0..4fc97de5446 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0179-bcmgenet-Better-coalescing-parameter-defaults.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0179-bcmgenet-Better-coalescing-parameter-defaults.patch @@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -2660,7 +2660,7 @@ static void bcmgenet_init_tx_ring(struct +@@ -2657,7 +2657,7 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX); bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX); @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); -@@ -4141,9 +4141,12 @@ static int bcmgenet_probe(struct platfor +@@ -4138,9 +4138,12 @@ static int bcmgenet_probe(struct platfor netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); /* Set default coalescing parameters */ diff --git a/target/linux/bcm27xx/patches-6.1/950-0180-net-genet-enable-link-energy-detect-powerdown-for-ex.patch b/target/linux/bcm27xx/patches-6.1/950-0180-net-genet-enable-link-energy-detect-powerdown-for-ex.patch index a03ca7fcb27..cc76ba5db92 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0180-net-genet-enable-link-energy-detect-powerdown-for-ex.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0180-net-genet-enable-link-energy-detect-powerdown-for-ex.patch @@ -20,7 +20,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c -@@ -291,6 +291,8 @@ int bcmgenet_mii_probe(struct net_device +@@ -296,6 +296,8 @@ int bcmgenet_mii_probe(struct net_device /* Communicate the integrated PHY revision */ if (priv->internal_phy) phy_flags = priv->gphy_rev; diff --git a/target/linux/bcm27xx/patches-6.1/950-0189-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch b/target/linux/bcm27xx/patches-6.1/950-0189-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch index e5f7bce3b55..ba1baac7d0c 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0189-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0189-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch @@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell static inline void bcmgenet_writel(u32 value, void __iomem *offset) { -@@ -2491,6 +2494,11 @@ static void reset_umac(struct bcmgenet_p +@@ -2488,6 +2491,11 @@ static void reset_umac(struct bcmgenet_p bcmgenet_rbuf_ctrl_set(priv, 0); udelay(10); diff --git a/target/linux/bcm27xx/patches-6.1/950-0238-zswap-Defer-zswap-initialisation.patch b/target/linux/bcm27xx/patches-6.1/950-0238-zswap-Defer-zswap-initialisation.patch index eccee8dd360..845b3466de6 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0238-zswap-Defer-zswap-initialisation.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0238-zswap-Defer-zswap-initialisation.patch @@ -80,7 +80,7 @@ Signed-off-by: Phil Elwell } /********************************* -@@ -1489,7 +1505,6 @@ static int __init zswap_debugfs_init(voi +@@ -1496,7 +1512,6 @@ static int __init zswap_debugfs_init(voi **********************************/ static int __init init_zswap(void) { @@ -88,7 +88,7 @@ Signed-off-by: Phil Elwell int ret; zswap_init_started = true; -@@ -1513,33 +1528,23 @@ static int __init init_zswap(void) +@@ -1520,33 +1535,23 @@ static int __init init_zswap(void) if (ret) goto hp_fail; diff --git a/target/linux/bcm27xx/patches-6.1/950-0270-net-bcmgenet-Reset-RBUF-on-first-open.patch b/target/linux/bcm27xx/patches-6.1/950-0270-net-bcmgenet-Reset-RBUF-on-first-open.patch index 04392b51d3d..0c71db2d00f 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0270-net-bcmgenet-Reset-RBUF-on-first-open.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0270-net-bcmgenet-Reset-RBUF-on-first-open.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -3307,7 +3307,7 @@ static void bcmgenet_get_hw_addr(struct +@@ -3304,7 +3304,7 @@ static void bcmgenet_get_hw_addr(struct } /* Returns a reusable dma control register value */ @@ -33,7 +33,7 @@ Signed-off-by: Phil Elwell { unsigned int i; u32 reg; -@@ -3332,6 +3332,14 @@ static u32 bcmgenet_dma_disable(struct b +@@ -3329,6 +3329,14 @@ static u32 bcmgenet_dma_disable(struct b udelay(10); bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH); @@ -48,7 +48,7 @@ Signed-off-by: Phil Elwell return dma_ctrl; } -@@ -3395,8 +3403,8 @@ static int bcmgenet_open(struct net_devi +@@ -3392,8 +3400,8 @@ static int bcmgenet_open(struct net_devi bcmgenet_set_hw_addr(priv, dev->dev_addr); @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell /* Reinitialize TDMA and RDMA and SW housekeeping */ ret = bcmgenet_init_dma(priv); -@@ -4270,7 +4278,7 @@ static int bcmgenet_resume(struct device +@@ -4267,7 +4275,7 @@ static int bcmgenet_resume(struct device bcmgenet_hfb_create_rxnfc_filter(priv, rule); /* Disable RX/TX DMA and flush TX queues */ diff --git a/target/linux/bcm27xx/patches-6.1/950-0513-net-bcmgenet-Add-eee-module-parameter.patch b/target/linux/bcm27xx/patches-6.1/950-0513-net-bcmgenet-Add-eee-module-parameter.patch index 4b87824dc37..a145f6c48f0 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0513-net-bcmgenet-Add-eee-module-parameter.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0513-net-bcmgenet-Add-eee-module-parameter.patch @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell static inline void bcmgenet_writel(u32 value, void __iomem *offset) { -@@ -3441,6 +3444,17 @@ static int bcmgenet_open(struct net_devi +@@ -3438,6 +3441,17 @@ static int bcmgenet_open(struct net_devi bcmgenet_phy_pause_set(dev, priv->rx_pause, priv->tx_pause); diff --git a/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch b/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch index c47978f22b6..6fd82ce0112 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch @@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c -@@ -4529,6 +4529,7 @@ static const struct { +@@ -4540,6 +4540,7 @@ static const struct { */ static int hci_dev_setup_sync(struct hci_dev *hdev) { @@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell int ret = 0; bool invalid_bdaddr; size_t i; -@@ -4557,7 +4558,9 @@ static int hci_dev_setup_sync(struct hci +@@ -4568,7 +4569,9 @@ static int hci_dev_setup_sync(struct hci if (!ret) { if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks)) { diff --git a/target/linux/bcm53xx/Makefile b/target/linux/bcm53xx/Makefile index 49d179c34c0..84f08f1f802 100644 --- a/target/linux/bcm53xx/Makefile +++ b/target/linux/bcm53xx/Makefile @@ -12,6 +12,7 @@ CPU_TYPE:=cortex-a9 SUBTARGETS:=generic KERNEL_PATCHVER:=5.15 +KERNEL_TESTING_PATCHVER:=6.1 define Target/Description Build firmware images for Broadcom based BCM47xx/53xx routers with ARM CPU, *not* MIPS. diff --git a/target/linux/bcm53xx/config-6.1 b/target/linux/bcm53xx/config-6.1 new file mode 100644 index 00000000000..d96beb687df --- /dev/null +++ b/target/linux/bcm53xx/config-6.1 @@ -0,0 +1,318 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_BCM=y +CONFIG_ARCH_BCM_5301X=y +CONFIG_ARCH_BCM_53573=y +# CONFIG_ARCH_BCM_HR2 is not set +CONFIG_ARCH_BCM_IPROC=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +# CONFIG_ARM_ATAG_DTB_COMPAT is not set +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_764369=y +CONFIG_ARM_ERRATA_775420=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GLOBAL_TIMER=y +CONFIG_ARM_GT_INITIAL_PRESCALER_VAL=1 +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_ATAGS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_B53=y +CONFIG_B53_MDIO_DRIVER=y +CONFIG_B53_SRAB_DRIVER=y +CONFIG_BCM47XX_NVRAM=y +CONFIG_BCM47XX_SPROM=y +CONFIG_BCM47XX_WDT=y +CONFIG_BCMA=y +CONFIG_BCMA_BLOCKIO=y +CONFIG_BCMA_DEBUG=y +CONFIG_BCMA_DRIVER_GMAC_CMN=y +CONFIG_BCMA_DRIVER_GPIO=y +CONFIG_BCMA_DRIVER_PCI=y +CONFIG_BCMA_FALLBACK_SPROM=y +CONFIG_BCMA_HOST_PCI=y +CONFIG_BCMA_HOST_PCI_POSSIBLE=y +CONFIG_BCMA_HOST_SOC=y +CONFIG_BCMA_SFLASH=y +# CONFIG_BCM_CYGNUS_PHY is not set +CONFIG_BCM_NET_PHYLIB=y +CONFIG_BCM_NS_THERMAL=y +CONFIG_BCM_SR_THERMAL=y +CONFIG_BGMAC=y +CONFIG_BGMAC_BCMA=y +# CONFIG_BGMAC_PLATFORM is not set +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOUNCE=y +CONFIG_BROADCOM_PHY=y +CONFIG_CACHE_L2X0=y +CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y +CONFIG_CLKSRC_MMIO=y +# CONFIG_CLK_BCM_NS2 is not set +CONFIG_CLK_BCM_NSP=y +# CONFIG_CLK_BCM_SR is not set +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMMON_CLK_IPROC=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SPECTRE=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRC16=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_BCM_5301X=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_MISC=y +CONFIG_DEBUG_UART_8250=y +CONFIG_DEBUG_UART_8250_SHIFT=0 +CONFIG_DEBUG_UART_PHYS=0x18000300 +CONFIG_DEBUG_UART_VIRT=0xf1000300 +CONFIG_DEBUG_UNCOMPRESS=y +CONFIG_DEBUG_USER=y +CONFIG_DMA_OPS=y +CONFIG_DMA_REMAP=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXTCON=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FWNODE_MDIO=y +CONFIG_FW_LOADER_PAGED_BUF=y +# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ARCH_TOPOLOGY=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_VDSO_32=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_74X164=y +CONFIG_GPIO_BCM_XGS_IPROC=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GRO_CELLS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_SMP=y +CONFIG_HIGHMEM=y +CONFIG_HIGHPTE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_BCM2835=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_KMAP_LOCAL=y +CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y +# CONFIG_LEDS_BCM63138 is not set +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MDIO_BCM_IPROC=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_BUS_MUX=y +# CONFIG_MDIO_BUS_MUX_BCM_IPROC is not set +CONFIG_MDIO_BUS_MUX_MMIOREG=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MEMFD_CREATE=y +CONFIG_MFD_SYSCON=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGRATION=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_BCM47XXSFLASH=y +CONFIG_MTD_BCM47XX_PARTS=y +CONFIG_MTD_NAND_BRCMNAND=y +CONFIG_MTD_NAND_BRCMNAND_IPROC=y +CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_ECC_SW_HAMMING=y +CONFIG_MTD_OF_PARTS_LINKSYS_NS=y +CONFIG_MTD_PARSER_TPLINK_SAFELOADER=y +CONFIG_MTD_PARSER_TRX=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_SEAMA_FW=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_TAG_BRCM=y +CONFIG_NET_DSA_TAG_BRCM_COMMON=y +CONFIG_NET_DSA_TAG_BRCM_LEGACY=y +CONFIG_NET_DSA_TAG_BRCM_PREPEND=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_SWITCHDEV=y +CONFIG_NR_CPUS=2 +CONFIG_NVMEM=y +CONFIG_NVMEM_BRCM_NVRAM=y +CONFIG_NVMEM_SYSFS=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +CONFIG_PCIE_IPROC=y +CONFIG_PCIE_IPROC_BCMA=y +# CONFIG_PCIE_IPROC_PLATFORM is not set +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLINK=y +# CONFIG_PHY_BCM_NS_USB2 is not set +# CONFIG_PHY_BCM_NS_USB3 is not set +# CONFIG_PHY_BCM_SR_PCIE is not set +CONFIG_PHY_BCM_SR_USB=y +# CONFIG_PHY_BRCM_SATA is not set +# CONFIG_PHY_NS2_USB_DRD is not set +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_IPROC_GPIO is not set +CONFIG_PINCTRL_NS=y +# CONFIG_PINCTRL_NS2_MUX is not set +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_PWM=y +CONFIG_PWM_BCM_IPROC=y +CONFIG_PWM_SYSFS=y +CONFIG_RATIONAL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SGL_ALLOC=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_BCM_QSPI=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_GPIO=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SRCU=y +CONFIG_SWPHY=y +CONFIG_SWP_EMULATE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UBIFS_FS=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +# CONFIG_VFP is not set +CONFIG_WATCHDOG_CORE=y +CONFIG_XPS=y +CONFIG_XXHASH=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index defa68e59f9..b1eb4277b79 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -461,6 +461,10 @@ TARGET_DEVICES += smartrg_sr400ac define Device/phicomm_k3 DEVICE_VENDOR := PHICOMM DEVICE_MODEL := K3 + DEVICE_ALT0_VENDOR := Wavlink + DEVICE_ALT0_MODEL := QUANTUM DAX + DEVICE_ALT1_VENDOR := Wavlink + DEVICE_ALT1_MODEL := WL-WN538A8 DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES) IMAGES := trx endef diff --git a/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch b/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch new file mode 100644 index 00000000000..4c4ed036b90 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-BCM5301X-Correct-description-of-TP-Link-part.patch @@ -0,0 +1,99 @@ +From c8ee9f119bfb4244f76c9971c341ec06b49332cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 8 Nov 2022 12:07:08 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Correct description of TP-Link partitions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +TP-Link routers have flash space partitioned according to the partitions +table. It may look like fixed partitioning but those partitions can be +actually reorganized. New can be added (or some removed), offsets and +sizes may change. + +Fix DT to use binding for the TP-Link SafeLoader partitioning method. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20221108110708.13693-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../boot/dts/bcm47081-tplink-archer-c5-v2.dts | 25 ++++--------------- + .../boot/dts/bcm4709-tplink-archer-c9-v1.dts | 25 ++++--------------- + 2 files changed, 10 insertions(+), 40 deletions(-) + +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -95,30 +95,15 @@ + status = "okay"; + + partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; ++ compatible = "tplink,safeloader-partitions"; ++ partitions-table-offset = <0xe50000>; + +- boot@0 { +- label = "boot"; +- reg = <0x000000 0x040000>; +- read-only; +- }; +- +- os-image@100000 { +- label = "os-image"; +- reg = <0x040000 0x200000>; ++ partition-os-image { + compatible = "brcm,trx"; + }; + +- rootfs@240000 { +- label = "rootfs"; +- reg = <0x240000 0xc00000>; +- }; +- +- nvram@ff0000 { +- label = "nvram"; +- reg = <0xff0000 0x010000>; ++ partition-file-system { ++ linux,rootfs; + }; + }; + }; +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -104,30 +104,15 @@ + status = "okay"; + + partitions { +- compatible = "fixed-partitions"; +- #address-cells = <1>; +- #size-cells = <1>; ++ compatible = "tplink,safeloader-partitions"; ++ partitions-table-offset = <0xe50000>; + +- boot@0 { +- label = "boot"; +- reg = <0x000000 0x040000>; +- read-only; +- }; +- +- os-image@100000 { +- label = "os-image"; +- reg = <0x040000 0x200000>; ++ partition-os-image { + compatible = "brcm,trx"; + }; + +- rootfs@240000 { +- label = "rootfs"; +- reg = <0x240000 0xc00000>; +- }; +- +- nvram@ff0000 { +- label = "nvram"; +- reg = <0xff0000 0x010000>; ++ partition-file-system { ++ linux,rootfs; + }; + }; + }; diff --git a/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch b/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch new file mode 100644 index 00000000000..21bb94fcc34 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-bcm47094-Add-devicetree-for-D-Link-DIR-890L.patch @@ -0,0 +1,242 @@ +From b1ba87897ceda8e49a47aa92832dd7bff8583e21 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Mon, 7 Nov 2022 14:41:04 +0100 +Subject: [PATCH] ARM: dts: bcm47094: Add devicetree for D-Link DIR-890L + +This adds a device tree for the D-Link DIR-890L. This device +is very similar to D-Link DIR-885L, the differences are detailed +as a comment in the DTS file. + +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20221107134104.1422169-2-linus.walleij@linaro.org +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts | 211 ++++++++++++++++++ + 2 files changed, 212 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -129,6 +129,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-tplink-archer-c9-v1.dtb \ + bcm47094-asus-rt-ac88u.dtb \ + bcm47094-dlink-dir-885l.dtb \ ++ bcm47094-dlink-dir-890l.dtb \ + bcm47094-linksys-panamera.dtb \ + bcm47094-luxul-abr-4500.dtb \ + bcm47094-luxul-xap-1610.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts +@@ -0,0 +1,211 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Device tree for D-Link DIR-890L ++ * D-Link calls this board "WRGAC36" ++ * this router has the same looks and form factor as D-Link DIR-885L. ++ * ++ * Some differences from DIR-885L include a separate USB2 port, separate LEDs ++ * for USB2 and USB3, a separate VCC supply for the USB2 slot and no ++ * router/extender switch is mounted (there is an empty mount point on the ++ * PCB) so this device is a pure router. Also the LAN ports are in the right ++ * order. ++ * ++ * Based on the device tree for DIR-885L ++ * Copyright (C) 2016 Rafał Miłecki ++ * Copyright (C) 2022 Linus Walleij ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch1.dtsi" ++ ++/ { ++ compatible = "dlink,dir-890l", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "D-Link DIR-890L"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200 earlycon"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++ leds { ++ /* ++ * LED information is derived from the boot log which ++ * conveniently lists all the LEDs. ++ */ ++ compatible = "gpio-leds"; ++ ++ power-white { ++ label = "bcm53xx:white:power"; ++ gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ wan-white { ++ label = "bcm53xx:white:wan"; ++ gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ power-amber { ++ label = "bcm53xx:amber:power"; ++ gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wan-amber { ++ label = "bcm53xx:amber:wan"; ++ gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb3-white { ++ label = "bcm53xx:white:usb3"; ++ gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&xhci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ usb2-white { ++ label = "bcm53xx:white:usb2"; ++ gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>; ++ trigger-sources = <&ohci_port1>, <&ehci_port1>; ++ linux,default-trigger = "usbport"; ++ }; ++ ++ 2ghz { ++ label = "bcm53xx:white:2ghz"; ++ gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ 5ghz { ++ label = "bcm53xx:white:5ghz"; ++ gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; ++ }; ++ ++ /* Called "factory reset" in the vendor dmesg */ ++ button-restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ /* ++ * The flash memory is memory mapped at 0x1e000000-0x1fffffff ++ * 64KB blocks; total size 2MB, same that can be ++ * found attached to the spi_nor SPI controller. ++ */ ++ nvram@1e1f0000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e1f0000 0x00010000>; ++ ++ et0macaddr: et0macaddr { ++ }; ++ }; ++}; ++ ++&gmac2 { ++ /* ++ * The NVRAM curiously does not contain a MAC address ++ * for et2 so since that is the only ethernet interface ++ * actually in use on the platform, we use this et0 MAC ++ * address for et2. ++ */ ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&spi_nor { ++ status = "okay"; ++}; ++ ++&nandcs { ++ /* Spansion S34ML01G2, 128MB with 128KB erase blocks */ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* ++ * This is called "nflash" in the vendor kernel with ++ * "upgrade" and "rootfs" (probably using OpenWrt ++ * splitpart). We call it "firmware" like standard tools ++ * assume. The CFE loader contains incorrect information ++ * about TRX partitions, ignore this, there are no TRX ++ * partitions: this device uses SEAMA. ++ */ ++ firmware@0 { ++ label = "firmware"; ++ reg = <0x00000000 0x08000000>; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpios = <&chipcommon 21 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3 { ++ vcc-gpios = <&chipcommon 18 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ phy-mode = "rgmii"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch b/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch new file mode 100644 index 00000000000..cd242318390 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/035-v6.2-0001-ARM-dts-bcm53016-Add-devicetree-for-D-Link-DWL-8610A.patch @@ -0,0 +1,165 @@ +From 9f66e1dd82e3186aee95282657512ca2aef1afe0 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Wed, 19 Oct 2022 21:34:49 +0200 +Subject: [PATCH] ARM: dts: bcm53016: Add devicetree for D-Link DWL-8610AP + +This adds a device tree for the BCM53016-based D-Link DWL-8610AP +access point wireless router. + +The TRX-format partitions had to be named "firmware" due to +an OpenWrt patch that only accepts parting such nodes if they +are named "firmware". + +Signed-off-by: Linus Walleij +Link: https://lore.kernel.org/r/20221019193449.3036010-2-linus.walleij@linaro.org +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + .../boot/dts/bcm53016-dlink-dwl-8610ap.dts | 131 ++++++++++++++++++ + 2 files changed, 132 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm53016-dlink-dwl-8610ap.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -140,6 +140,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm47094-netgear-r8500.dtb \ + bcm47094-phicomm-k3.dtb \ + bcm53015-meraki-mr26.dtb \ ++ bcm53016-dlink-dwl-8610ap.dtb \ + bcm53016-meraki-mr32.dtb \ + bcm94708.dtb \ + bcm94709.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm53016-dlink-dwl-8610ap.dts +@@ -0,0 +1,131 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/dts-v1/; ++ ++#include "bcm4709.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++#include ++#include ++ ++/ { ++ model = "D-Link DWL-8610AP"; ++ compatible = "dlink,dwl-8610ap", "brcm,bcm53016", "brcm,bcm4708"; ++ ++ memory@0 { ++ device_type = "memory"; ++ /* 512 MB RAM in 2 x Macronix D9PSH chips */ ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ power { ++ function = LED_FUNCTION_POWER; ++ color = ; ++ gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ ++ diag { ++ /* Actually "diag" unclear what this means */ ++ function = LED_FUNCTION_INDICATOR; ++ color = ; ++ gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ wlan-2g { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wlan-5g { ++ function = LED_FUNCTION_WLAN; ++ color = ; ++ gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ debounce-interval = <100>; ++ wakeup-source; ++ linux,code = ; ++ label = "reset"; ++ /* This GPIO is actually stored in NVRAM, but it's not gonna change */ ++ gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ /* ++ * Flash memory at 0x1e000000-0x1fffffff ++ * Macronix 32 64KB blocks; total size 2MB, same that can be ++ * found attached to the spi_nor SPI controller. ++ */ ++ nvram@1e080000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e080000 0x00020000>; ++ ++ et0macaddr: et0macaddr { ++ }; ++ ++ et1macaddr: et1macaddr { ++ }; ++ }; ++}; ++ ++&gmac0 { ++ nvmem-cells = <&et0macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&gmac1 { ++ nvmem-cells = <&et1macaddr>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&spi_nor { ++ /* Serial SPI NOR Flash MX 25L1606E */ ++ status = "okay"; ++}; ++ ++&nandcs { ++ /* ++ * Spansion S34ML01G100TFI00 128 MB NAND Flash memory ++ * ++ * This ECC is a bit unorthodox but it is what the stock firmware ++ * is using, so to be able to mount the original partitions ++ * this is necessary. ++ */ ++ nand-ecc-strength = <5>; ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ /* This is named nflash1.trx in CFE */ ++ trx@0 { ++ label = "firmware"; ++ reg = <0x00000000 0x02800000>; ++ compatible = "brcm,trx"; ++ }; ++ ++ /* This is named nflash1.trx2 in CFE */ ++ trx2@2800000 { ++ label = "firmware2"; ++ reg = <0x02800000 0x02800000>; ++ compatible = "brcm,trx"; ++ }; ++ ++ /* This is named nflash1.rwfs in CFE */ ++ free@5000000 { ++ label = "free"; ++ reg = <0x05000000 0x03000000>; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-6.1/036-v6.2-bcma-support-SPROM-rev-11.patch b/target/linux/bcm53xx/patches-6.1/036-v6.2-bcma-support-SPROM-rev-11.patch new file mode 100644 index 00000000000..5ebc78ca202 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/036-v6.2-bcma-support-SPROM-rev-11.patch @@ -0,0 +1,28 @@ +From b9457a04eb89645049fdf427c13e6a18d5501895 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 11 Oct 2022 14:24:40 +0200 +Subject: [PATCH] bcma: support SPROM rev 11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Rev 11 works fine for me to set the MAC address of gmac0 and +gmac1 in the D-Link DWL-8610AP. + +Cc: Rafał Miłecki +Signed-off-by: Linus Walleij +--- + drivers/bcma/sprom.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/bcma/sprom.c ++++ b/drivers/bcma/sprom.c +@@ -170,7 +170,7 @@ static int bcma_sprom_valid(struct bcma_ + return err; + + revision = sprom[words - 1] & SSB_SPROM_REVISION_REV; +- if (revision != 8 && revision != 9 && revision != 10) { ++ if (revision < 8 || revision > 11) { + pr_err("Unsupported SPROM revision: %d\n", revision); + return -ENOENT; + } diff --git a/target/linux/bcm53xx/patches-6.1/140-mtd-parsers-trx-parse-firmware-MTD-partitions-only.patch b/target/linux/bcm53xx/patches-6.1/140-mtd-parsers-trx-parse-firmware-MTD-partitions-only.patch new file mode 100644 index 00000000000..e1933e75c78 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/140-mtd-parsers-trx-parse-firmware-MTD-partitions-only.patch @@ -0,0 +1,43 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 13 Apr 2021 18:25:20 +0200 +Subject: [PATCH] mtd: parsers: trx: parse "firmware" MTD partitions only +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Parsing every partition with "compatible" set to "brcm,trx" results in +parsing both: firmware partition and failsafe partition on devices that +implement failsafe booting. This affects e.g. Linksys EA9500 which has: + +partition@200000 { + reg = <0x0200000 0x01d00000>; + compatible = "linksys,ns-firmware", "brcm,trx"; +}; + +partition@1f00000 { + reg = <0x01f00000 0x01d00000>; + compatible = "linksys,ns-firmware", "brcm,trx"; +}; + +Check for MTD partition name "firmware" before parsing. Recently added +ofpart_linksys_ns.c creates "firmware" and "failsafe" depending on +bootloader setup. + +Signed-off-by: Rafał Miłecki +--- + drivers/mtd/parsers/parser_trx.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/mtd/parsers/parser_trx.c ++++ b/drivers/mtd/parsers/parser_trx.c +@@ -92,6 +92,10 @@ static int parser_trx_parse(struct mtd_i + if (err != 0 && err != -EINVAL) + pr_err("failed to parse \"brcm,trx-magic\" DT attribute, using default: %d\n", err); + ++ /* Don't parse any failsafe / backup partitions */ ++ if (strcmp(mtd->name, "firmware")) ++ return -EINVAL; ++ + parts = kcalloc(TRX_PARSER_MAX_PARTS, sizeof(struct mtd_partition), + GFP_KERNEL); + if (!parts) diff --git a/target/linux/bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch new file mode 100644 index 00000000000..33066a84d8e --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -0,0 +1,117 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 1 Oct 2016 22:54:48 +0200 +Subject: [PATCH] usb: xhci: add support for performing fake doorbell + +Broadcom's Northstar XHCI controllers seem to need a special start +procedure to work correctly. There isn't any official documentation of +this, the problem is that controller doesn't detect any connected +devices with default setup. Moreover connecting USB device to controller +that doesn't run properly can cause SoC's watchdog issues. + +A workaround that was successfully tested on multiple devices is to +perform a fake doorbell. This patch adds code for doing this and enables +it on BCM4708 family. +--- + drivers/usb/host/xhci-plat.c | 6 +++++ + drivers/usb/host/xhci.c | 63 +++++++++++++++++++++++++++++++++++++++++--- + drivers/usb/host/xhci.h | 1 + + 3 files changed, 67 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/xhci-plat.c ++++ b/drivers/usb/host/xhci-plat.c +@@ -77,6 +77,8 @@ static int xhci_priv_resume_quirk(struct + static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) + { + struct xhci_plat_priv *priv = xhci_to_priv(xhci); ++ struct platform_device*pdev = to_platform_device(dev); ++ struct device_node *node = pdev->dev.of_node; + + /* + * As of now platform drivers don't provide MSI support so we ensure +@@ -84,6 +86,9 @@ static void xhci_plat_quirks(struct devi + * dev struct in order to setup MSI + */ + xhci->quirks |= XHCI_PLAT | priv->quirks; ++ ++ if (node && of_machine_is_compatible("brcm,bcm4708")) ++ xhci->quirks |= XHCI_FAKE_DOORBELL; + } + + /* called during probe() after chip reset completes */ +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -161,6 +161,49 @@ int xhci_start(struct xhci_hcd *xhci) + return ret; + } + ++/** ++ * xhci_fake_doorbell - Perform a fake doorbell on a specified slot ++ * ++ * Some controllers require a fake doorbell to start correctly. Without that ++ * they simply don't detect any devices. ++ */ ++static int xhci_fake_doorbell(struct xhci_hcd *xhci, int slot_id) ++{ ++ u32 temp; ++ ++ /* Alloc a virt device for that slot */ ++ if (!xhci_alloc_virt_device(xhci, slot_id, NULL, GFP_NOIO)) { ++ xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); ++ return -ENOMEM; ++ } ++ ++ /* Ring fake doorbell for slot_id ep 0 */ ++ xhci_ring_ep_doorbell(xhci, slot_id, 0, 0); ++ usleep_range(1000, 1500); ++ ++ /* Read the status to check if HSE is set or not */ ++ temp = readl(&xhci->op_regs->status); ++ ++ /* Clear HSE if set */ ++ if (temp & STS_FATAL) { ++ xhci_dbg(xhci, "HSE problem detected, status: 0x%08x\n", temp); ++ temp &= ~0x1fff; ++ temp |= STS_FATAL; ++ writel(temp, &xhci->op_regs->status); ++ usleep_range(1000, 1500); ++ readl(&xhci->op_regs->status); ++ } ++ ++ /* Free virt device */ ++ xhci_free_virt_device(xhci, slot_id); ++ ++ /* We're done if controller is already running */ ++ if (readl(&xhci->op_regs->command) & CMD_RUN) ++ return 0; ++ ++ return xhci_start(xhci); ++} ++ + /* + * Reset a halted HC. + * +@@ -641,6 +684,14 @@ static int xhci_run_finished(struct xhci + return -ENODEV; + } + ++ if (xhci->quirks & XHCI_FAKE_DOORBELL) { ++ int err = xhci_fake_doorbell(xhci, 1); ++ if (err) { ++ xhci_halt(xhci); ++ return err; ++ } ++ } ++ + xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; + + if (xhci->quirks & XHCI_NEC_HOST) +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1899,6 +1899,7 @@ struct xhci_hcd { + #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) + #define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43) + #define XHCI_RESET_TO_DEFAULT BIT_ULL(44) ++#define XHCI_FAKE_DOORBELL BIT_ULL(45) + + unsigned int num_active_eps; + unsigned int limit_active_eps; diff --git a/target/linux/bcm53xx/patches-6.1/300-ARM-BCM5301X-Disable-MMU-and-Dcache-during-decompres.patch b/target/linux/bcm53xx/patches-6.1/300-ARM-BCM5301X-Disable-MMU-and-Dcache-during-decompres.patch new file mode 100644 index 00000000000..034d5b52fc7 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/300-ARM-BCM5301X-Disable-MMU-and-Dcache-during-decompres.patch @@ -0,0 +1,101 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 24 Sep 2014 22:14:07 +0200 +Subject: [PATCH] ARM: BCM5301X: Disable MMU and Dcache during decompression +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Broadcom devices have broken CFE (bootloader) that leaves hardware in an +invalid state. It causes problems with booting Linux. On Northstar +devices kernel was randomly hanging in ~25% of tries during early init. +Hangs used to happen at random places in the start_kernel. On BCM53573 +kernel doesn't even seem to start booting. + +To workaround this problem we need to do following very early: +1) Clear 2 following bits in the SCTLR register: +#define CR_M (1 << 0) /* MMU enable */ +#define CR_C (1 << 2) /* Dcache enable */ +2) Flush the whole D-cache +3) Disable L2 cache + +Unfortunately this patch is not upstreamable as it does above things +unconditionally. We can't check if we are running on Broadcom platform +in any safe way and doing such hacks with ARCH_MULTI_V7 is unacceptable +as it could break other devices support. + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/compressed/Makefile ++++ b/arch/arm/boot/compressed/Makefile +@@ -35,6 +35,11 @@ ifeq ($(CONFIG_ARCH_ACORN),y) + OBJS += ll_char_wr.o font.o + endif + ++ifeq ($(CONFIG_ARCH_BCM_5301X),y) ++OBJS += head-bcm_5301x-mpcore.o ++OBJS += cache-v7-min.o ++endif ++ + ifeq ($(CONFIG_ARCH_SA1100),y) + OBJS += head-sa1100.o + endif +--- /dev/null ++++ b/arch/arm/boot/compressed/head-bcm_5301x-mpcore.S +@@ -0,0 +1,37 @@ ++/* ++ * ++ * Platform specific tweaks. This is merged into head.S by the linker. ++ * ++ */ ++ ++#include ++#include ++#include ++ ++ .section ".start", "ax" ++ ++/* ++ * This code section is spliced into the head code by the linker ++ */ ++ ++__plat_uncompress_start: ++ ++ @ Preserve r8/r7 i.e. kernel entry values ++ mov r12, r8 ++ ++ @ Clear MMU enable and Dcache enable bits ++ mrc p15, 0, r0, c1, c0, 0 @ Read SCTLR ++ bic r0, #CR_C|CR_M ++ mcr p15, 0, r0, c1, c0, 0 @ Write SCTLR ++ nop ++ ++ @ Call the cache invalidation routine ++ bl v7_flush_dcache_all ++ nop ++ mov r0,#0 ++ ldr r3, =0x19022000 @ L2 cache controller, control reg ++ str r0, [r3, #0x100] @ Disable L2 cache ++ nop ++ ++ @ Restore ++ mov r8, r12 +--- a/arch/arm/boot/compressed/cache-v7-min.S ++++ b/arch/arm/boot/compressed/cache-v7-min.S +@@ -12,6 +12,7 @@ + + #include + #include ++#include + + __INIT + +@@ -63,7 +64,7 @@ loop2: + ARM( orr r11, r11, r9, lsl r2 ) @ factor index number into r11 + THUMB( lsl r6, r9, r2 ) + THUMB( orr r11, r11, r6 ) @ factor index number into r11 +- mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way ++ mcr p15, 0, r11, c7, c6, 2 @ clean & invalidate by set/way + subs r9, r9, #1 @ decrement the index + bge loop2 + subs r4, r4, #1 @ decrement the way diff --git a/target/linux/bcm53xx/patches-6.1/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-6.1/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch new file mode 100644 index 00000000000..0fb29e99d34 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -0,0 +1,711 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] ARM: dts: BCM5301X: Specify switch ports for remaining + devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +@@ -93,3 +93,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts ++++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +@@ -83,3 +83,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +@@ -149,3 +149,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +@@ -46,3 +46,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +@@ -42,3 +42,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +@@ -86,3 +86,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts ++++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +@@ -77,3 +77,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -66,6 +66,38 @@ + status = "okay"; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@7 { ++ reg = <7>; ++ label = "cpu"; ++ ethernet = <&gmac1>; ++ }; ++ }; ++}; ++ + &nandcs { + partitions { + compatible = "fixed-partitions"; +--- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts ++++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +@@ -130,3 +130,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -47,3 +47,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +@@ -104,3 +104,40 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts ++++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +@@ -94,3 +94,45 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@8 { ++ reg = <8>; ++ label = "cpu"; ++ ethernet = <&gmac2>; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; +--- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -38,6 +38,38 @@ + status = "okay"; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &nandcs { + partitions { + compatible = "fixed-partitions"; +--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts ++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +@@ -91,6 +91,43 @@ + }; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &spi_nor { + status = "okay"; + +--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts ++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +@@ -100,6 +100,43 @@ + vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>; + }; + ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan2"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan3"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ + &spi_nor { + status = "okay"; + +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +@@ -107,3 +107,41 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "wan"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ }; ++ }; ++}; ++ diff --git a/target/linux/bcm53xx/patches-6.1/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-6.1/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch new file mode 100644 index 00000000000..02340f4e9f0 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch @@ -0,0 +1,64 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] ARM: BCM5301X: Add DT for Netgear R7900 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -125,6 +125,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-buffalo-wxr-1900dhp.dtb \ + bcm4709-linksys-ea9200.dtb \ + bcm4709-netgear-r7000.dtb \ ++ bcm4709-netgear-r7900.dtb \ + bcm4709-netgear-r8000.dtb \ + bcm4709-tplink-archer-c9-v1.dtb \ + bcm47094-asus-rt-ac88u.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4709-netgear-r7900.dts +@@ -0,0 +1,42 @@ ++/* ++ * Broadcom BCM470X / BCM5301X ARM platform code. ++ * DTS for Netgear R7900 ++ * ++ * Copyright (C) 2016 Rafał Miłecki ++ * ++ * Licensed under the GNU/GPL. See COPYING for details. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4709.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++ ++/ { ++ compatible = "netgear,r7900", "brcm,bcm4709", "brcm,bcm4708"; ++ model = "Netgear R7900"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ memory { ++ reg = <0x00000000 0x08000000 ++ 0x88000000 0x08000000>; ++ }; ++ ++ axi@18000000 { ++ usb3@23000 { ++ reg = <0x00023000 0x1000>; ++ ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-6.1/315-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch b/target/linux/bcm53xx/patches-6.1/315-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch new file mode 100644 index 00000000000..068d6769628 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/315-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch @@ -0,0 +1,27 @@ +From e492f69e4da879db7b3e9a2290e5b6620f1335b5 Mon Sep 17 00:00:00 2001 +From: Aleksey Nasibulin +Date: Thu, 13 Oct 2022 08:16:51 +0000 +Subject: [PATCH] ARM: dts: BCM5301X: Extend RAM to full 256MB for Linksys + EA6500 V2 + +Linksys ea6500-v2 have 256MB of ram. Currently we only use 128MB. +Expand the definition to use all the available RAM. + +Fixes: 03e96644d7a8 ("ARM: dts: BCM5301X: Add basic DT for Linksys EA6500 V2") +Signed-off-by: Aleksey Nasibulin +--- + arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +@@ -19,7 +19,8 @@ + + memory@0 { + device_type = "memory"; +- reg = <0x00000000 0x08000000>; ++ reg = <0x00000000 0x08000000>, ++ <0x88000000 0x08000000>; + }; + + gpio-keys { diff --git a/target/linux/bcm53xx/patches-6.1/321-ARM-dts-BCM5301X-Describe-partition-formats.patch b/target/linux/bcm53xx/patches-6.1/321-ARM-dts-BCM5301X-Describe-partition-formats.patch new file mode 100644 index 00000000000..f2861177dd1 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/321-ARM-dts-BCM5301X-Describe-partition-formats.patch @@ -0,0 +1,25 @@ +From 7166207bd1d8c46d09d640d46afc685df9bb9083 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 22 Nov 2018 09:21:49 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Describe partition formats +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It's needed by OpenWrt for custom partitioning. + +Signed-off-by: Rafał Miłecki +--- + arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -35,6 +35,7 @@ + partition@0 { + label = "firmware"; + reg = <0x00000000 0x08000000>; ++ compatible = "seama"; + }; + }; + }; diff --git a/target/linux/bcm53xx/patches-6.1/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch b/target/linux/bcm53xx/patches-6.1/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch new file mode 100644 index 00000000000..209c57ca0bd --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch @@ -0,0 +1,59 @@ +From 2a2af518266a29323cf30c3f9ba9ef2ceb1dd84b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 16 Oct 2014 20:52:16 +0200 +Subject: [PATCH] UBI: Detect EOF mark and erase all remaining blocks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + drivers/mtd/ubi/attach.c | 5 +++++ + drivers/mtd/ubi/io.c | 4 ++++ + drivers/mtd/ubi/ubi.h | 1 + + 3 files changed, 10 insertions(+) + +--- a/drivers/mtd/ubi/attach.c ++++ b/drivers/mtd/ubi/attach.c +@@ -82,6 +82,9 @@ static int self_check_ai(struct ubi_devi + #define AV_ADD BIT(1) + #define AV_FIND_OR_ADD (AV_FIND | AV_ADD) + ++/* Set on finding block with 0xdeadc0de, indicates erasing all blocks behind */ ++bool erase_all_next; ++ + /** + * find_or_add_av - internal function to find a volume, add a volume or do + * both (find and add if missing). +@@ -1580,6 +1583,8 @@ int ubi_attach(struct ubi_device *ubi, i + if (!ai) + return -ENOMEM; + ++ erase_all_next = false; ++ + #ifdef CONFIG_MTD_UBI_FASTMAP + /* On small flash devices we disable fastmap in any case. */ + if ((int)mtd_div_by_eb(ubi->mtd->size, ubi->mtd) <= UBI_FM_MAX_START) { +--- a/drivers/mtd/ubi/io.c ++++ b/drivers/mtd/ubi/io.c +@@ -717,6 +717,10 @@ int ubi_io_read_ec_hdr(struct ubi_device + } + + magic = be32_to_cpu(ec_hdr->magic); ++ if (magic == 0xdeadc0de) ++ erase_all_next = true; ++ if (erase_all_next) ++ return read_err ? UBI_IO_FF_BITFLIPS : UBI_IO_FF; + if (magic != UBI_EC_HDR_MAGIC) { + if (mtd_is_eccerr(read_err)) + return UBI_IO_BAD_HDR_EBADMSG; +--- a/drivers/mtd/ubi/ubi.h ++++ b/drivers/mtd/ubi/ubi.h +@@ -820,6 +820,7 @@ extern struct mutex ubi_devices_mutex; + extern struct blocking_notifier_head ubi_notifiers; + + /* attach.c */ ++extern bool erase_all_next; + struct ubi_ainf_peb *ubi_alloc_aeb(struct ubi_attach_info *ai, int pnum, + int ec); + void ubi_free_aeb(struct ubi_attach_info *ai, struct ubi_ainf_peb *aeb); diff --git a/target/linux/bcm53xx/patches-6.1/600-net-disable-GRO-by-default.patch b/target/linux/bcm53xx/patches-6.1/600-net-disable-GRO-by-default.patch new file mode 100644 index 00000000000..9f6343c7917 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/600-net-disable-GRO-by-default.patch @@ -0,0 +1,36 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 20 Jun 2022 10:01:18 +0200 +Subject: [PATCH] net: disable GRO by default +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In many cases GRO improves network performance however it comes at a +cost of chacksums calculations. In case of slow CPU and missing hardware +csum calculation support GRO can actually decrease network speed. + +On BCM4708 *disabling* GRO results in following NAT masquarade speed +changes: +1. 364 Mb/s → 396 Mb/s (packet steering disabled) +2. 341 Mb/s → 566 Mb/s (packet steering enabled) + +Signed-off-by: Rafał Miłecki +--- + include/linux/netdev_features.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/netdev_features.h ++++ b/include/linux/netdev_features.h +@@ -242,10 +242,10 @@ static inline int find_next_netdev_featu + #define NETIF_F_UPPER_DISABLES NETIF_F_LRO + + /* changeable features with no special hardware requirements */ +-#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) ++#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO) + + /* Changeable features with no special hardware requirements that defaults to off. */ +-#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD) ++#define NETIF_F_SOFT_FEATURES_OFF (NETIF_F_GRO_FRAGLIST | NETIF_F_GRO_UDP_FWD | NETIF_F_GRO) + + #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ + NETIF_F_HW_VLAN_CTAG_RX | \ diff --git a/target/linux/bcm53xx/patches-6.1/700-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch b/target/linux/bcm53xx/patches-6.1/700-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch new file mode 100644 index 00000000000..3a2f4b06ed6 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/700-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch @@ -0,0 +1,33 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 10 Jun 2022 13:10:47 +0200 +Subject: [PATCH] bgmac: reduce max frame size to support just MTU 1500 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +bgmac allocates new replacement buffer before handling each received +frame. Allocating & DMA-preparing 9724 B each time consumes a lot of CPU +time. Ideally bgmac should just respect currently set MTU but it isn't +the case right now. For now just revert back to the old limited frame +size. + +This change bumps NAT masquarade speed by ~95%. + +Ref: 8c7da63978f1 ("bgmac: configure MTU and add support for frames beyond 8192 byte size") +Signed-off-by: Rafał Miłecki +--- + drivers/net/ethernet/broadcom/bgmac.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bgmac.h ++++ b/drivers/net/ethernet/broadcom/bgmac.h +@@ -328,8 +328,7 @@ + #define BGMAC_RX_FRAME_OFFSET 30 /* There are 2 unused bytes between header and real data */ + #define BGMAC_RX_BUF_OFFSET (NET_SKB_PAD + NET_IP_ALIGN - \ + BGMAC_RX_FRAME_OFFSET) +-/* Jumbo frame size with FCS */ +-#define BGMAC_RX_MAX_FRAME_SIZE 9724 ++#define BGMAC_RX_MAX_FRAME_SIZE 1536 + #define BGMAC_RX_BUF_SIZE (BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE) + #define BGMAC_RX_ALLOC_SIZE (SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \ + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) diff --git a/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch new file mode 100644 index 00000000000..721cc3c1548 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch @@ -0,0 +1,80 @@ +From 6f1c62440eb6846cb8045d7a5480ec7bbe47c96f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 15 Aug 2016 10:30:41 +0200 +Subject: [PATCH] BCM53573 minor hacks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/dts/bcm53573.dtsi ++++ b/arch/arm/boot/dts/bcm53573.dtsi +@@ -54,6 +54,7 @@ + , + , + ; ++ clocks = <&ilp>; + }; + + clocks { +--- a/drivers/bcma/main.c ++++ b/drivers/bcma/main.c +@@ -330,14 +330,6 @@ static int bcma_register_devices(struct + } + #endif + +-#ifdef CONFIG_BCMA_SFLASH +- if (bus->drv_cc.sflash.present) { +- err = platform_device_register(&bcma_sflash_dev); +- if (err) +- bcma_err(bus, "Error registering serial flash\n"); +- } +-#endif +- + #ifdef CONFIG_BCMA_NFLASH + if (bus->drv_cc.nflash.present) { + err = platform_device_register(&bcma_nflash_dev); +@@ -415,6 +407,14 @@ int bcma_bus_register(struct bcma_bus *b + bcma_register_core(bus, core); + } + ++#ifdef CONFIG_BCMA_SFLASH ++ if (bus->drv_cc.sflash.present) { ++ err = platform_device_register(&bcma_sflash_dev); ++ if (err) ++ bcma_err(bus, "Error registering serial flash\n"); ++ } ++#endif ++ + /* Try to get SPROM */ + err = bcma_sprom_get(bus); + if (err == -ENOENT) { +--- a/drivers/clocksource/arm_arch_timer.c ++++ b/drivers/clocksource/arm_arch_timer.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1021,6 +1022,16 @@ static void __init arch_timer_of_configu + if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) + arch_timer_rate = rate; + ++ /* Get clk rate through clk driver if present */ ++ if (!arch_timer_rate) { ++ struct clk *clk = of_clk_get(np, 0); ++ ++ if (!IS_ERR(clk)) { ++ if (!clk_prepare_enable(clk)) ++ arch_timer_rate = clk_get_rate(clk); ++ } ++ } ++ + /* Check the timer frequency. */ + if (validate_timer_rate()) + pr_warn("frequency not available\n"); diff --git a/target/linux/bcm63xx/Makefile b/target/linux/bcm63xx/Makefile index 4bcf9613d97..f206aed3d35 100644 --- a/target/linux/bcm63xx/Makefile +++ b/target/linux/bcm63xx/Makefile @@ -9,7 +9,7 @@ ARCH:=mips BOARD:=bcm63xx BOARDNAME:=Broadcom BCM63xx SUBTARGETS:=generic smp -FEATURES:=squashfs usb atm pci pcmcia usbgadget +FEATURES:=squashfs usb atm pci pcmcia usbgadget source-only KERNEL_PATCHVER:=5.15 diff --git a/target/linux/bcm63xx/dts/bcm6358-bt-home-hub-2-a.dts b/target/linux/bcm63xx/dts/bcm6358-bt-home-hub-2-a.dts index b5eea3dcb12..10aea48783b 100644 --- a/target/linux/bcm63xx/dts/bcm6358-bt-home-hub-2-a.dts +++ b/target/linux/bcm63xx/dts/bcm6358-bt-home-hub-2-a.dts @@ -60,7 +60,7 @@ }; led_power_green: led@1 { - reg = <0>; + reg = <1>; active-low; label = "green:power"; default-state = "on"; diff --git a/target/linux/bcm63xx/patches-5.15/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch b/target/linux/bcm63xx/patches-5.15/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch index 4874fd12379..4b3e87cbbfd 100644 --- a/target/linux/bcm63xx/patches-5.15/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch +++ b/target/linux/bcm63xx/patches-5.15/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch @@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski } --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c -@@ -1802,7 +1802,8 @@ int gpiochip_add_pingroup_range(struct g +@@ -1815,7 +1815,8 @@ int gpiochip_add_pingroup_range(struct g list_add_tail(&pin_range->node, &gdev->pin_ranges); @@ -126,7 +126,7 @@ Signed-off-by: Jonas Gorski } EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range); -@@ -1859,7 +1860,7 @@ int gpiochip_add_pin_range(struct gpio_c +@@ -1872,7 +1873,7 @@ int gpiochip_add_pin_range(struct gpio_c list_add_tail(&pin_range->node, &gdev->pin_ranges); diff --git a/target/linux/bcm63xx/patches-5.15/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch b/target/linux/bcm63xx/patches-5.15/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch index a848165ac5f..aff3f4a1a0e 100644 --- a/target/linux/bcm63xx/patches-5.15/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch +++ b/target/linux/bcm63xx/patches-5.15/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch @@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -331,6 +331,9 @@ config BCM63XX +@@ -332,6 +332,9 @@ config BCM63XX select SYNC_R4K select DMA_NONCOHERENT select IRQ_MIPS_CPU diff --git a/target/linux/bmips/bcm6318/config-6.1 b/target/linux/bmips/bcm6318/config-6.1 index 4f54ce55339..526319da33d 100644 --- a/target/linux/bmips/bcm6318/config-6.1 +++ b/target/linux/bmips/bcm6318/config-6.1 @@ -1,5 +1,4 @@ CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 diff --git a/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network b/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network index ad7f2432e20..7fb9333cc18 100644 --- a/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network +++ b/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network @@ -16,6 +16,7 @@ sercomm,h500-s-vfes) ucidef_set_interface "qtn" device "wifi" protocol "static" ipaddr "1.1.1.1" netmask "255.255.255.252" uci add_list firewall.@zone[0].network='qtn' ;; +comtrend,vg-8050 |\ sercomm,shg2500) ucidef_set_bridge_device switch ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" diff --git a/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh index befffd346e1..fd309d38099 100644 --- a/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh +++ b/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh @@ -9,6 +9,7 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in + comtrend,vg-8050 |\ comtrend,vr-3032u) CI_JFFS2_CLEAN_MARKERS=1 nand_do_upgrade "$1" diff --git a/target/linux/bmips/bcm63268/config-6.1 b/target/linux/bmips/bcm63268/config-6.1 index 2ed4eba2f6e..624c00556db 100644 --- a/target/linux/bmips/bcm63268/config-6.1 +++ b/target/linux/bmips/bcm63268/config-6.1 @@ -1,5 +1,4 @@ CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 diff --git a/target/linux/bmips/bcm6328/base-files/etc/board.d/01_leds b/target/linux/bmips/bcm6328/base-files/etc/board.d/01_leds new file mode 100644 index 00000000000..b2ccc9a60e9 --- /dev/null +++ b/target/linux/bmips/bcm6328/base-files/etc/board.d/01_leds @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +. /lib/functions/leds.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in +arcadyan,ar7516) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" + ucidef_set_led_netdev "wlan0" "WiFi" "green:wifi" "phy0-ap0" + ;; +nucom,r5010unv2 |\ +sercomm,ad1018) + ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/bmips/bcm6328/base-files/etc/board.d/02_network b/target/linux/bmips/bcm6328/base-files/etc/board.d/02_network index c9c704067e9..391e38c4dcb 100644 --- a/target/linux/bmips/bcm6328/base-files/etc/board.d/02_network +++ b/target/linux/bmips/bcm6328/base-files/etc/board.d/02_network @@ -5,11 +5,20 @@ board_config_update case "$(board_name)" in +arcadyan,ar7516) + ucidef_set_bridge_device switch + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" + ;; comtrend,ar-5381u |\ -comtrend,ar-5387un) +comtrend,ar-5387un |\ +nucom,r5010unv2) ucidef_set_bridge_device switch ucidef_set_interface_lan "lan1 lan2 lan3 lan4" ;; +sercomm,ad1018) + ucidef_set_bridge_device switch + ucidef_set_interface_lan "lan1 lan2 lan3 fibre" + ;; esac board_config_flush diff --git a/target/linux/bmips/bcm6328/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bmips/bcm6328/base-files/etc/uci-defaults/09_fix_crc index 21f18b4b819..e521af36ba6 100644 --- a/target/linux/bmips/bcm6328/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bmips/bcm6328/base-files/etc/uci-defaults/09_fix_crc @@ -3,8 +3,10 @@ . /lib/functions.sh case "$(board_name)" in +arcadyan,ar7516 |\ comtrend,ar-5381u |\ -comtrend,ar-5387un) +comtrend,ar-5387un |\ +nucom,r5010unv2) mtd fixtrx firmware ;; esac diff --git a/target/linux/bmips/bcm6328/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm6328/base-files/lib/upgrade/platform.sh index 1cf95be26a5..d820b207188 100644 --- a/target/linux/bmips/bcm6328/base-files/lib/upgrade/platform.sh +++ b/target/linux/bmips/bcm6328/base-files/lib/upgrade/platform.sh @@ -9,6 +9,9 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in + sercomm,ad1018) + nand_do_upgrade "$1" + ;; *) default_do_upgrade "$1" ;; diff --git a/target/linux/bmips/bcm6328/config-6.1 b/target/linux/bmips/bcm6328/config-6.1 index 85d5578b8eb..5b33e932360 100644 --- a/target/linux/bmips/bcm6328/config-6.1 +++ b/target/linux/bmips/bcm6328/config-6.1 @@ -1,5 +1,4 @@ CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 diff --git a/target/linux/bmips/bcm6358/config-6.1 b/target/linux/bmips/bcm6358/config-6.1 index 1d95a92cbc3..8ca1ca3af54 100644 --- a/target/linux/bmips/bcm6358/config-6.1 +++ b/target/linux/bmips/bcm6358/config-6.1 @@ -1,5 +1,4 @@ CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 diff --git a/target/linux/bmips/bcm6362/config-6.1 b/target/linux/bmips/bcm6362/config-6.1 index b51f7e4166a..dba808dfb23 100644 --- a/target/linux/bmips/bcm6362/config-6.1 +++ b/target/linux/bmips/bcm6362/config-6.1 @@ -1,5 +1,4 @@ CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 diff --git a/target/linux/bmips/bcm6368/base-files/etc/board.d/01_leds b/target/linux/bmips/bcm6368/base-files/etc/board.d/01_leds index c7e61fe72f3..9af5257c116 100644 --- a/target/linux/bmips/bcm6368/base-files/etc/board.d/01_leds +++ b/target/linux/bmips/bcm6368/base-files/etc/board.d/01_leds @@ -6,6 +6,10 @@ board_config_update case "$(board_name)" in +actiontec,r1000h) + ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1" + ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" + ;; comtrend,wap-5813n) ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1" ;; diff --git a/target/linux/bmips/bcm6368/base-files/etc/board.d/02_network b/target/linux/bmips/bcm6368/base-files/etc/board.d/02_network index 58fba05fec3..fabc4216cd5 100644 --- a/target/linux/bmips/bcm6368/base-files/etc/board.d/02_network +++ b/target/linux/bmips/bcm6368/base-files/etc/board.d/02_network @@ -14,6 +14,7 @@ comtrend,vr-3025un) ucidef_set_bridge_device switch ucidef_set_interface_lan "lan1 lan2 lan3 iptv" ;; +actiontec,r1000h |\ comtrend,wap-5813n |\ netgear,dgnd3700-v1 |\ netgear,dgnd3800b |\ diff --git a/target/linux/bmips/bcm6368/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bmips/bcm6368/base-files/etc/uci-defaults/09_fix_crc index 63d10c9a8e8..f3b1eafdfc6 100644 --- a/target/linux/bmips/bcm6368/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bmips/bcm6368/base-files/etc/uci-defaults/09_fix_crc @@ -3,6 +3,7 @@ . /lib/functions.sh case "$(board_name)" in +actiontec,r1000h |\ comtrend,vr-3025u |\ comtrend,vr-3025un |\ comtrend,wap-5813n |\ diff --git a/target/linux/bmips/bcm6368/config-6.1 b/target/linux/bmips/bcm6368/config-6.1 index 6fd4fe03bbe..13915425d85 100644 --- a/target/linux/bmips/bcm6368/config-6.1 +++ b/target/linux/bmips/bcm6368/config-6.1 @@ -1,5 +1,4 @@ CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 diff --git a/target/linux/bmips/dts/bcm63169-comtrend-vg-8050.dts b/target/linux/bmips/dts/bcm63169-comtrend-vg-8050.dts new file mode 100644 index 00000000000..bf96673af8a --- /dev/null +++ b/target/linux/bmips/dts/bcm63169-comtrend-vg-8050.dts @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bcm63268.dtsi" + +/ { + model = "Comtrend VG-8050"; + compatible = "comtrend,vg-8050", "brcm,bcm63169", "brcm,bcm63268"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + reset { + label = "reset"; + gpios = <&gpio 33 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&gpio 34 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + status = "okay"; + + nvmem-cells = <&macaddr_cferom_6a0>; + nvmem-cell-names = "mac-address"; +}; + +&hsspi { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hsspi_cs5>; + + switch@5 { + compatible = "brcm,bcm53125"; + reg = <5>; + spi-max-frequency = <781000>; + spi-cpha; + spi-cpol; + dsa,member = <1 0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan4"; + }; + + port@1 { + reg = <1>; + label = "lan3"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan1"; + }; + + port@4 { + reg = <4>; + label = "wan"; + }; + + port@8 { + reg = <8>; + + phy-mode = "rgmii"; + ethernet = <&switch0port6>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; +}; + +&leds { + status = "okay"; + + brcm,serial-leds; + brcm,serial-dat-low; + brcm,serial-shift-inv; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_serial_led>; + + led@2 { + reg = <2>; + active-low; + label = "red:internet"; + }; + + led_power_red: led@3 { + reg = <3>; + active-low; + label = "red:power"; + panic-indicator; + }; + + led_power_green: led@6 { + reg = <6>; + active-low; + label = "green:power"; + }; + + led@7 { + reg = <7>; + active-low; + label = "green:wps"; + }; + + led@8 { + reg = <8>; + active-low; + label = "green:internet"; + }; + + led@10 { + reg = <10>; + active-low; + label = "green:voip"; + }; + + led@12 { + reg = <12>; + active-low; + label = "red:voip"; + }; + + led@14 { + reg = <14>; + active-low; + label = "red:wps"; + }; +}; + +&nflash { + status = "okay"; + + nandcs@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-ecc-step-size = <512>; + nand-ecc-strength = <15>; + nand-on-flash-bbt; + brcm,nand-oob-sector-size = <64>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cferom: partition@0 { + label = "cferom"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + partition@20000 { + compatible = "brcm,wfi-split"; + label = "wfi"; + reg = <0x0020000 0x7ac0000>; + }; + }; + }; +}; + +&ohci { + status = "okay"; +}; + +&switch0 { + dsa,member = <0 0>; + + ports { + switch0port6: port@6 { + reg = <6>; + label = "extsw"; + + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&usbh { + status = "okay"; +}; + +&cferom { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; +}; diff --git a/target/linux/bmips/dts/bcm6328-arcadyan-ar7516.dts b/target/linux/bmips/dts/bcm6328-arcadyan-ar7516.dts new file mode 100644 index 00000000000..cc50f575499 --- /dev/null +++ b/target/linux/bmips/dts/bcm6328-arcadyan-ar7516.dts @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bcm6328.dtsi" + +/ { + model = "Arcadyan AR7516"; + compatible = "arcadyan,ar7516", "brcm,bcm6328"; + + aliases { + led-failsafe = &led_upgrade_green; + led-upgrade = &led_upgrade_green; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + reset { + label = "reset"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + bcm43227-sprom { + compatible = "brcm,bcma-sprom"; + + pci-bus = <1>; + pci-dev = <0>; + + nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + + brcm,sprom = "brcm/bcm43227-sprom.bin"; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + status = "okay"; + + nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cell-names = "mac-address"; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cfe: partition@0 { + label = "cfe"; + reg = <0x000000 0x010000>; + read-only; + }; + + partition@10000 { + compatible = "brcm,bcm963xx-imagetag"; + label = "firmware"; + reg = <0x010000 0x7e0000>; + }; + + partition@7f0000 { + label = "nvram"; + reg = <0x7f0000 0x010000>; + }; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led + &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led + &pinctrl_leds>; + + led_upgrade_green: led@1 { + reg = <1>; + label = "green:upgrade"; + }; + + led@6 { + reg = <6>; + active-low; + label = "green:wan"; + }; + + led@7 { + reg = <7>; + active-low; + label = "green:wifi"; + }; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio6", "gpio7"; + }; +}; + +&switch0 { + ports { + port@0 { + reg = <0>; + label = "lan1"; + + phy-handle = <&phy1>; + phy-mode = "mii"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + + phy-handle = <&phy2>; + phy-mode = "mii"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + + phy-handle = <&phy3>; + phy-mode = "mii"; + }; + + port@3 { + reg = <3>; + label = "wan"; + + phy-handle = <&phy4>; + phy-mode = "mii"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&usbh { + status = "okay"; +}; + +&cfe { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; +}; diff --git a/target/linux/bmips/dts/bcm6328-nucom-r5010unv2.dts b/target/linux/bmips/dts/bcm6328-nucom-r5010unv2.dts new file mode 100644 index 00000000000..826b2a61e25 --- /dev/null +++ b/target/linux/bmips/dts/bcm6328-nucom-r5010unv2.dts @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bcm6328.dtsi" + +/ { + model = "NuCom R5010UNv2"; + compatible = "nucom,r5010unv2", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + reset { + label = "reset"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + bcm43217-sprom { + compatible = "brcm,bcma-sprom"; + + pci-bus = <1>; + pci-dev = <0>; + + nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + + brcm,sprom = "brcm/bcm43217-sprom.bin"; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + status = "okay"; + + nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cell-names = "mac-address"; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cfe: partition@0 { + label = "cfe"; + reg = <0x000000 0x010000>; + read-only; + }; + + partition@10000 { + compatible = "brcm,bcm963xx-imagetag"; + label = "firmware"; + reg = <0x010000 0xfe0000>; + }; + + partition@ff0000 { + label = "nvram"; + reg = <0xff0000 0x010000>; + }; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led + &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led + &pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:internet"; + }; + + led@2 { + reg = <2>; + active-low; + label = "red:internet"; + }; + + led@3 { + reg = <3>; + active-low; + label = "green:dsl"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + }; + + led_power_red: led@5 { + reg = <5>; + active-low; + label = "red:power"; + panic-indicator; + }; + + led@10 { + reg = <10>; + active-low; + label = "green:wps"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:usb"; + }; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio2", "gpio3", + "gpio4", "gpio5", "gpio10", + "gpio11"; + }; +}; + +&switch0 { + ports { + port@0 { + reg = <0>; + label = "lan1"; + + phy-handle = <&phy1>; + phy-mode = "mii"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + + phy-handle = <&phy2>; + phy-mode = "mii"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + + phy-handle = <&phy3>; + phy-mode = "mii"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + + phy-handle = <&phy4>; + phy-mode = "mii"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&usbh { + status = "okay"; +}; + +&cfe { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; +}; diff --git a/target/linux/bmips/dts/bcm6328-sercomm-ad1018.dts b/target/linux/bmips/dts/bcm6328-sercomm-ad1018.dts new file mode 100644 index 00000000000..5d182668188 --- /dev/null +++ b/target/linux/bmips/dts/bcm6328-sercomm-ad1018.dts @@ -0,0 +1,312 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bcm6328.dtsi" + +/ { + model = "Sercomm AD1018"; + compatible = "sercomm,ad1018", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + wps { + label = "wps"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + wlan { + label = "wlan"; + gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&gpio 31 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + bcm432217-sprom { + compatible = "brcm,bcma-sprom"; + + pci-bus = <1>; + pci-dev = <0>; + + nvmem-cells = <&macaddr_cferom_6a0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + + brcm,sprom = "brcm/bcm43217-sprom.bin"; + brcm,sprom-fixups = <6 0x1c00>, + <65 0x1256>, + <96 0x2046>, + <97 0xfe69>, + <98 0x1726>, + <99 0xfa5c>, + <112 0x2046>, + <113 0xfea8>, + <114 0x1978>, + <115 0xfa26>, + <161 0x2222>, + <169 0x2222>, + <171 0x2222>, + <173 0x2222>, + <174 0x4444>, + <175 0x2222>, + <176 0x4444>; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + status = "okay"; + + nvmem-cells = <&macaddr_cferom_6a0>; + nvmem-cell-names = "mac-address"; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led + &pinctrl_ephy0_spd_led &pinctrl_ephy1_act_led + &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; + + brcm,serial-leds; + brcm,serial-shift-inv; + brcm,serial-dat-low; + + led@0 { + reg = <0>; + active-low; + label = "red:internet"; + }; + + led@1 { + reg = <1>; + active-low; + label = "green:internet"; + }; + + led_power_green: led@8 { + reg = <8>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led@10 { + reg = <10>; + active-low; + label = "green:adsl"; + }; + + led@11 { + reg = <11>; + active-low; + label = "red:adsl"; + }; + + led@12 { + reg = <12>; + active-low; + label = "green:phone"; + }; + + led@13 { + reg = <13>; + active-low; + label = "green:wps"; + }; + + led@14 { + reg = <14>; + active-low; + label = "green:wifi"; + }; + + led@15 { + reg = <15>; + active-low; + label = "green:usb"; + }; + + led@17 { + /* EPHY0 Spd */ + reg = <17>; + brcm,hardware-controlled; + }; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio0", "gpio1"; + }; +}; + +&nflash { + status = "okay"; + + nandcs@0 { + compatible = "brcm,nandcs"; + reg = <0>; + nand-ecc-step-size = <512>; + nand-ecc-strength = <15>; + nand-on-flash-bbt; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cferom: partition@0 { + label = "cferom"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + partition@20000 { + label = "mmap"; + reg = <0x0020000 0x00a0000>; + read-only; + }; + + partition@c0000 { + label = "cferam1"; + reg = <0x00c0000 0x0140000>; + read-only; + }; + + partition@200000 { + label = "cferam2"; + reg = <0x0200000 0x0140000>; + read-only; + }; + + partition@340000 { + label = "serial"; + reg = <0x0340000 0x00a0000>; + read-only; + }; + + partition@3e0000 { + label = "protect"; + reg = <0x03e0000 0x0140000>; + read-only; + }; + + partition@6920000 { + label = "bootflag1"; + reg = <0x6920000 0x0140000>; + read-only; + }; + + partition@6a60000 { + label = "bootflag2"; + reg = <0x6a60000 0x0140000>; + read-only; + }; + + partition@520000 { + compatible = "sercomm,wfi"; + label = "wfi"; + reg = <0x0520000 0x6400000>; + }; + + partition@6ba0000 { + label = "xml_cfg"; + reg = <0x6ba0000 0x0280000>; + read-only; + }; + + partition@6e20000 { + label = "app_dat"; + reg = <0x6e20000 0x0280000>; + read-only; + }; + }; + }; +}; + +&switch0 { + ports { + port@0 { + reg = <0>; + label = "fibre"; + + phy-handle = <&phy1>; + phy-mode = "mii"; + }; + + port@1 { + reg = <1>; + label = "lan3"; + + phy-handle = <&phy2>; + phy-mode = "mii"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + + phy-handle = <&phy3>; + phy-mode = "mii"; + }; + + port@3 { + reg = <3>; + label = "lan1"; + + phy-handle = <&phy4>; + phy-mode = "mii"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&usbh { + status = "okay"; +}; + +&cferom { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; +}; diff --git a/target/linux/bmips/dts/bcm6368-actiontec-r1000h.dts b/target/linux/bmips/dts/bcm6368-actiontec-r1000h.dts new file mode 100644 index 00000000000..ff115afb8fb --- /dev/null +++ b/target/linux/bmips/dts/bcm6368-actiontec-r1000h.dts @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bcm6368.dtsi" + +/ { + model = "Actiontec R1000H"; + compatible = "actiontec,r1000h", "brcm,bcm6368"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + reset { + label = "reset"; + gpios = <&gpio 34 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&gpio 35 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led@5 { + label = "green:wan"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + + led@21 { + label = "green:usb"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + led_power_green: led@22 { + label = "green:power"; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + }; + + led@23 { + label = "green:wps"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + led_power_red: led@24 { + label = "red:power"; + gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + led@30 { + label = "red:wps"; + gpios = <&gpio 30 GPIO_ACTIVE_LOW>; + }; + + led@31 { + label = "red:wan"; + gpios = <&gpio 31 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + status = "okay"; + + nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cell-names = "mac-address"; +}; + +&mdio_ext { + switch@1e { + compatible = "brcm,bcm53115"; + reg = <30>; + + dsa,member = <1 0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@4 { + reg = <4>; + label = "wan"; + }; + + port@5 { + /* HPNA coaxial port */ + reg = <5>; + label = "coax"; + + phy-mode = "mii"; + + fixed-link { + speed = <100>; + full-duplex; + }; + }; + + port@8 { + reg = <8>; + + phy-mode = "rgmii"; + ethernet = <&switch0port5>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; +}; + +&switch0 { + dsa,member = <0 0>; + + ports { + switch0port5: port@5 { + reg = <5>; + label = "extsw"; + + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; + +&pflash { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cfe: partition@0 { + label = "CFE"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "firmware"; + reg = <0x020000 0x1fc0000>; + compatible = "brcm,bcm963xx-imagetag"; + }; + + partition@fe0000 { + label = "nvram"; + reg = <0x1fe0000 0x020000>; + }; + }; +}; + +&ohci { + status = "okay"; +}; + +&pci { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&usbh { + status = "okay"; +}; + +&cfe { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; +}; diff --git a/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi b/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi index 74494556310..c878dd2cffa 100644 --- a/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi +++ b/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi @@ -123,7 +123,7 @@ #address-cells = <1>; #size-cells = <0>; - wan@0 { + port@0 { reg = <0>; label = "wan"; }; diff --git a/target/linux/bmips/image/Makefile b/target/linux/bmips/image/Makefile index 5ce026c5842..9311e2df096 100644 --- a/target/linux/bmips/image/Makefile +++ b/target/linux/bmips/image/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR := 0x80010000 # RAM start + 64K -LOADER_ENTRY := 0x80a00000 # RAM start + 10M, for relocate +LOADER_ENTRY := 0x81000000 # RAM start + 16M, for relocate LZMA_TEXT_START := 0x82000000 # RAM start + 32M DEVICE_VARS += CFE_BOARD_ID CFE_EXTRAS diff --git a/target/linux/bmips/image/bcm63268.mk b/target/linux/bmips/image/bcm63268.mk index 6e27b16624f..941e83f71bf 100644 --- a/target/linux/bmips/image/bcm63268.mk +++ b/target/linux/bmips/image/bcm63268.mk @@ -1,5 +1,24 @@ # SPDX-License-Identifier: GPL-2.0-or-later +define Device/comtrend_vg-8050 + $(Device/bcm63xx-nand) + DEVICE_VENDOR := Comtrend + DEVICE_MODEL := VG-8050 + CHIP_ID := 63268 + SOC := bcm63169 + CFE_RAM_FILE := comtrend,vg-8050/cferam.000 + CFE_RAM_JFFS2_NAME := cferam.000 + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 512 + VID_HDR_OFFSET := 2048 + DEVICE_PACKAGES += $(USB2_PACKAGES) \ + kmod-leds-bcm6328 + CFE_WFI_FLASH_TYPE := 3 + CFE_WFI_VERSION := 0x5732 +endef +TARGET_DEVICES += comtrend_vg-8050 + define Device/comtrend_vr-3032u $(Device/bcm63xx-nand) DEVICE_VENDOR := Comtrend diff --git a/target/linux/bmips/image/bcm6328.mk b/target/linux/bmips/image/bcm6328.mk index dfa134df946..fd0cf16dbb0 100644 --- a/target/linux/bmips/image/bcm6328.mk +++ b/target/linux/bmips/image/bcm6328.mk @@ -1,5 +1,18 @@ # SPDX-License-Identifier: GPL-2.0-or-later +define Device/arcadyan_ar7516 + $(Device/bcm63xx-cfe) + DEVICE_VENDOR := Arcadyan + DEVICE_MODEL := AR7516 + CHIP_ID := 6328 + CFE_BOARD_ID := AR7516AAW + FLASH_MB := 8 + DEVICE_PACKAGES += $(USB2_PACKAGES) \ + $(B43_PACKAGES) broadcom-43227-sprom \ + kmod-leds-bcm6328 +endef +TARGET_DEVICES += arcadyan_ar7516 + define Device/comtrend_ar-5381u $(Device/bcm63xx-cfe) DEVICE_VENDOR := Comtrend @@ -25,3 +38,34 @@ define Device/comtrend_ar-5387un kmod-leds-bcm6328 endef TARGET_DEVICES += comtrend_ar-5387un + +define Device/nucom_r5010unv2 + $(Device/bcm63xx-cfe) + DEVICE_VENDOR := NuCom + DEVICE_MODEL := R5010UNv2 + CHIP_ID := 6328 + CFE_BOARD_ID := 96328ang + FLASH_MB := 16 + DEVICE_PACKAGES += $(USB2_PACKAGES) \ + $(B43_PACKAGES) broadcom-43217-sprom \ + kmod-leds-bcm6328 +endef +TARGET_DEVICES += nucom_r5010unv2 + +define Device/sercomm_ad1018 + $(Device/sercomm-nand) + DEVICE_VENDOR := Sercomm + DEVICE_MODEL := AD1018 + CHIP_ID := 6328 + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 512 + VID_HDR_OFFSET := 2048 + DEVICE_PACKAGES += $(USB2_PACKAGES) \ + $(B43_PACKAGES) broadcom-43217-sprom \ + kmod-leds-bcm6328 + SERCOMM_FSVER := 1001 + SERCOMM_HWVER := 1415153 + SERCOMM_SWVER := 3013 +endef +TARGET_DEVICES += sercomm_ad1018 diff --git a/target/linux/bmips/image/bcm6368.mk b/target/linux/bmips/image/bcm6368.mk index 83cd096959b..39fcb023182 100644 --- a/target/linux/bmips/image/bcm6368.mk +++ b/target/linux/bmips/image/bcm6368.mk @@ -1,5 +1,20 @@ # SPDX-License-Identifier: GPL-2.0-or-later +define Device/actiontec_r1000h + $(Device/bcm63xx-cfe) + DEVICE_VENDOR := Actiontec + DEVICE_MODEL := R1000H + CHIP_ID := 6368 + CFE_BOARD_ID := 96368VVW + BLOCKSIZE := 0x20000 + FLASH_MB := 32 + CFE_EXTRAS += --signature "$$(DEVICE_VENDOR)" + DEVICE_PACKAGES += $(USB2_PACKAGES) \ + $(B43_PACKAGES) \ + kmod-leds-gpio +endef +TARGET_DEVICES += actiontec_r1000h + define Device/comtrend_vr-3025u $(Device/bcm63xx-cfe) DEVICE_VENDOR := Comtrend diff --git a/target/linux/bmips/patches-5.15/202-mips-bmips-tweak-Kconfig-options.patch b/target/linux/bmips/patches-5.15/202-mips-bmips-tweak-Kconfig-options.patch index c39df850a03..eb3f1c1d5ce 100644 --- a/target/linux/bmips/patches-5.15/202-mips-bmips-tweak-Kconfig-options.patch +++ b/target/linux/bmips/patches-5.15/202-mips-bmips-tweak-Kconfig-options.patch @@ -13,7 +13,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -274,25 +274,20 @@ config BMIPS_GENERIC +@@ -275,25 +275,20 @@ config BMIPS_GENERIC select SYNC_R4K select COMMON_CLK select BCM6345_L1_IRQ diff --git a/target/linux/bmips/patches-5.15/203-mips-bmips-dma-fix-CBR-address.patch b/target/linux/bmips/patches-5.15/203-mips-bmips-dma-fix-CBR-address.patch new file mode 100644 index 00000000000..57bf395e2e0 --- /dev/null +++ b/target/linux/bmips/patches-5.15/203-mips-bmips-dma-fix-CBR-address.patch @@ -0,0 +1,84 @@ +From 3e4c3863e0cfb8c2abdff6bb494ca69d3d2aed9c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Sat, 10 Jun 2023 17:01:40 +0200 +Subject: [PATCH] mips: bmips: dma: fix CBR address +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some BCM63xx SoCs may return CBR address as 0. + +Signed-off-by: Álvaro Fernández Rojas +--- + arch/mips/bmips/dma.c | 12 ++++-------- + arch/mips/bmips/setup.c | 11 ++++------- + 2 files changed, 8 insertions(+), 15 deletions(-) + +--- a/arch/mips/bmips/dma.c ++++ b/arch/mips/bmips/dma.c +@@ -64,11 +64,10 @@ phys_addr_t dma_to_phys(struct device *d + return dma_addr; + } + +-bool bmips_rac_flush_disable; ++void __iomem *bmips_cbr_addr; + + void arch_sync_dma_for_cpu_all(void) + { +- void __iomem *cbr = BMIPS_GET_CBR(); + u32 cfg; + + if (boot_cpu_type() != CPU_BMIPS3300 && +@@ -76,13 +75,10 @@ void arch_sync_dma_for_cpu_all(void) + boot_cpu_type() != CPU_BMIPS4380) + return; + +- if (unlikely(bmips_rac_flush_disable)) +- return; +- + /* Flush stale data out of the readahead cache */ +- cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); +- __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG); +- __raw_readl(cbr + BMIPS_RAC_CONFIG); ++ cfg = __raw_readl(bmips_cbr_addr + BMIPS_RAC_CONFIG); ++ __raw_writel(cfg | 0x100, bmips_cbr_addr + BMIPS_RAC_CONFIG); ++ __raw_readl(bmips_cbr_addr + BMIPS_RAC_CONFIG); + } + + static int __init bmips_init_dma_ranges(void) +--- a/arch/mips/bmips/setup.c ++++ b/arch/mips/bmips/setup.c +@@ -89,7 +89,7 @@ + + #define DDR_CSEND_REG 0x8 + +-extern bool bmips_rac_flush_disable; ++extern void __iomem *bmips_cbr_addr; + + static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000; + +@@ -170,12 +170,6 @@ static void bcm6358_quirks(void) + * disable SMP for now + */ + bmips_smp_enabled = 0; +- +- /* +- * RAC flush causes kernel panics on BCM6358 when booting from TP1 +- * because the bootloader is not initializing it properly. +- */ +- bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)); + } + + static void bcm6368_quirks(void) +@@ -198,6 +192,11 @@ static const struct bmips_quirk bmips_qu + + void __init prom_init(void) + { ++ if (!(read_c0_brcm_cbr() >> 18)) ++ bmips_cbr_addr = (void __iomem *)0xff400000; ++ else ++ bmips_cbr_addr = BMIPS_GET_CBR(); ++ + bmips_cpu_setup(); + register_bmips_smp_ops(); + } diff --git a/target/linux/bmips/patches-5.15/204-mips-bmips-enable-RAC-on-BMIPS4350.patch b/target/linux/bmips/patches-5.15/204-mips-bmips-enable-RAC-on-BMIPS4350.patch new file mode 100644 index 00000000000..26bd03e3298 --- /dev/null +++ b/target/linux/bmips/patches-5.15/204-mips-bmips-enable-RAC-on-BMIPS4350.patch @@ -0,0 +1,42 @@ +From 7f862eaedac56b67972393f0a9affcd2fe53479b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= +Date: Sun, 18 Jun 2023 19:59:25 +0200 +Subject: [PATCH] mips: bmips: enable RAC on BMIPS4350 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The data RAC is left disabled by the bootloader in some SoCs, at least in +the core it boots from. +Enabling this feature increases the performance up to +30% depending on the +task. + +Signed-off-by: Daniel González Cabanelas +Signed-off-by: Álvaro Fernández Rojas +--- + arch/mips/kernel/smp-bmips.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/arch/mips/kernel/smp-bmips.c ++++ b/arch/mips/kernel/smp-bmips.c +@@ -614,6 +614,20 @@ void bmips_cpu_setup(void) + __raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE); + break; + ++ case CPU_BMIPS4350: ++ /* Enable data RAC */ ++ if (!(read_c0_brcm_cmt_local() & (1 << 31))) { ++ cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); ++ __raw_writel(cfg | 0xa, cbr + BMIPS_RAC_CONFIG); ++ __raw_readl(cbr + BMIPS_RAC_CONFIG); ++ } else { ++ cbr = (void __iomem *)0xff400000; ++ cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG_1); ++ __raw_writel(cfg | 0xa, cbr + BMIPS_RAC_CONFIG_1); ++ __raw_readl(cbr + BMIPS_RAC_CONFIG_1); ++ } ++ break; ++ + case CPU_BMIPS4380: + /* CBG workaround for early BMIPS4380 CPUs */ + switch (read_c0_prid()) { diff --git a/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch b/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch index 36b09105b72..e2ca75a3930 100644 --- a/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch +++ b/target/linux/bmips/patches-5.15/600-mips-bmips-add-pci-support.patch @@ -14,7 +14,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -274,6 +274,7 @@ config BMIPS_GENERIC +@@ -275,6 +275,7 @@ config BMIPS_GENERIC select SYNC_R4K select COMMON_CLK select BCM6345_L1_IRQ diff --git a/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch b/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch index e85056aee79..1c4a478148f 100644 --- a/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch +++ b/target/linux/bmips/patches-6.1/202-mips-bmips-tweak-Kconfig-options.patch @@ -13,7 +13,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -272,19 +272,13 @@ config BMIPS_GENERIC +@@ -273,19 +273,13 @@ config BMIPS_GENERIC select SYNC_R4K select COMMON_CLK select BCM6345_L1_IRQ @@ -33,7 +33,7 @@ Signed-off-by: Álvaro Fernández Rojas select SWAP_IO_SPACE select USB_EHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN -@@ -294,6 +288,7 @@ config BMIPS_GENERIC +@@ -295,6 +289,7 @@ config BMIPS_GENERIC select HAVE_PCI select PCI_DRIVERS_GENERIC select FW_CFE diff --git a/target/linux/bmips/patches-6.1/203-mips-bmips-dma-fix-CBR-address.patch b/target/linux/bmips/patches-6.1/203-mips-bmips-dma-fix-CBR-address.patch new file mode 100644 index 00000000000..d440b979d5f --- /dev/null +++ b/target/linux/bmips/patches-6.1/203-mips-bmips-dma-fix-CBR-address.patch @@ -0,0 +1,82 @@ +From 3e4c3863e0cfb8c2abdff6bb494ca69d3d2aed9c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Sat, 10 Jun 2023 17:01:40 +0200 +Subject: [PATCH] mips: bmips: dma: fix CBR address +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some BCM63xx SoCs may return CBR address as 0. + +Signed-off-by: Álvaro Fernández Rojas +--- + arch/mips/bmips/dma.c | 12 ++++-------- + arch/mips/bmips/setup.c | 11 ++++------- + 2 files changed, 8 insertions(+), 15 deletions(-) + +--- a/arch/mips/bmips/dma.c ++++ b/arch/mips/bmips/dma.c +@@ -5,11 +5,10 @@ + #include + #include + +-bool bmips_rac_flush_disable; ++void __iomem *bmips_cbr_addr; + + void arch_sync_dma_for_cpu_all(void) + { +- void __iomem *cbr = BMIPS_GET_CBR(); + u32 cfg; + + if (boot_cpu_type() != CPU_BMIPS3300 && +@@ -17,11 +16,8 @@ void arch_sync_dma_for_cpu_all(void) + boot_cpu_type() != CPU_BMIPS4380) + return; + +- if (unlikely(bmips_rac_flush_disable)) +- return; +- + /* Flush stale data out of the readahead cache */ +- cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); +- __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG); +- __raw_readl(cbr + BMIPS_RAC_CONFIG); ++ cfg = __raw_readl(bmips_cbr_addr + BMIPS_RAC_CONFIG); ++ __raw_writel(cfg | 0x100, bmips_cbr_addr + BMIPS_RAC_CONFIG); ++ __raw_readl(bmips_cbr_addr + BMIPS_RAC_CONFIG); + } +--- a/arch/mips/bmips/setup.c ++++ b/arch/mips/bmips/setup.c +@@ -90,7 +90,7 @@ + + #define DDR_CSEND_REG 0x8 + +-extern bool bmips_rac_flush_disable; ++extern void __iomem *bmips_cbr_addr; + + static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000; + +@@ -171,12 +171,6 @@ static void bcm6358_quirks(void) + * disable SMP for now + */ + bmips_smp_enabled = 0; +- +- /* +- * RAC flush causes kernel panics on BCM6358 when booting from TP1 +- * because the bootloader is not initializing it properly. +- */ +- bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)); + } + + static void bcm6368_quirks(void) +@@ -209,6 +203,11 @@ static void __init bmips_init_cfe(void) + + void __init prom_init(void) + { ++ if (!(read_c0_brcm_cbr() >> 18)) ++ bmips_cbr_addr = (void __iomem *) 0xff400000; ++ else ++ bmips_cbr_addr = BMIPS_GET_CBR(); ++ + bmips_init_cfe(); + bmips_cpu_setup(); + register_bmips_smp_ops(); diff --git a/target/linux/bmips/patches-6.1/204-mips-bmips-enable-RAC-on-BMIPS4350.patch b/target/linux/bmips/patches-6.1/204-mips-bmips-enable-RAC-on-BMIPS4350.patch new file mode 100644 index 00000000000..8a98e6bedb1 --- /dev/null +++ b/target/linux/bmips/patches-6.1/204-mips-bmips-enable-RAC-on-BMIPS4350.patch @@ -0,0 +1,42 @@ +From 7f862eaedac56b67972393f0a9affcd2fe53479b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= +Date: Sun, 18 Jun 2023 19:59:25 +0200 +Subject: [PATCH] mips: bmips: enable RAC on BMIPS4350 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The data RAC is left disabled by the bootloader in some SoCs, at least in +the core it boots from. +Enabling this feature increases the performance up to +30% depending on the +task. + +Signed-off-by: Daniel González Cabanelas +Signed-off-by: Álvaro Fernández Rojas +--- + arch/mips/kernel/smp-bmips.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/arch/mips/kernel/smp-bmips.c ++++ b/arch/mips/kernel/smp-bmips.c +@@ -615,6 +615,20 @@ void bmips_cpu_setup(void) + __raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE); + break; + ++ case CPU_BMIPS4350: ++ /* Enable data RAC */ ++ if (!(read_c0_brcm_cmt_local() & (1 << 31))) { ++ cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); ++ __raw_writel(cfg | 0xa, cbr + BMIPS_RAC_CONFIG); ++ __raw_readl(cbr + BMIPS_RAC_CONFIG); ++ } else { ++ cbr = (void __iomem *)0xff400000; ++ cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG_1); ++ __raw_writel(cfg | 0xa, cbr + BMIPS_RAC_CONFIG_1); ++ __raw_readl(cbr + BMIPS_RAC_CONFIG_1); ++ } ++ break; ++ + case CPU_BMIPS4380: + /* CBG workaround for early BMIPS4380 CPUs */ + switch (read_c0_prid()) { diff --git a/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch b/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch index f28dda908d7..66e8db4d010 100644 --- a/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch +++ b/target/linux/bmips/patches-6.1/600-mips-bmips-add-pci-support.patch @@ -14,7 +14,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -286,7 +286,6 @@ config BMIPS_GENERIC +@@ -287,7 +287,6 @@ config BMIPS_GENERIC select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN select HARDIRQS_SW_RESEND select HAVE_PCI diff --git a/target/linux/gemini/config-6.1 b/target/linux/gemini/config-6.1 index 41f7093c1ce..a4f2cba8512 100644 --- a/target/linux/gemini/config-6.1 +++ b/target/linux/gemini/config-6.1 @@ -1,7 +1,6 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_AMBA_PL08X=y CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_GEMINI=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y diff --git a/target/linux/generic/backport-5.15/346-v5.18-01-Revert-ata-ahci-mvebu-Make-SATA-PHY-optional-for-Arm.patch b/target/linux/generic/backport-5.15/346-v5.18-01-Revert-ata-ahci-mvebu-Make-SATA-PHY-optional-for-Arm.patch index b254e7c0b3f..f225a210570 100644 --- a/target/linux/generic/backport-5.15/346-v5.18-01-Revert-ata-ahci-mvebu-Make-SATA-PHY-optional-for-Arm.patch +++ b/target/linux/generic/backport-5.15/346-v5.18-01-Revert-ata-ahci-mvebu-Make-SATA-PHY-optional-for-Arm.patch @@ -31,13 +31,13 @@ Signed-off-by: Vinod Koul --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h -@@ -240,8 +240,6 @@ enum { - as default lpm_policy */ - AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during - suspend/resume */ -- AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP -- from phy_power_on() */ - AHCI_HFLAG_NO_SXS = (1 << 28), /* SXS not supported */ +@@ -241,8 +241,6 @@ enum { + as default lpm_policy */ + AHCI_HFLAG_SUSPEND_PHYS = BIT(26), /* handle PHYs during + suspend/resume */ +- AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = BIT(27), /* ignore -EOPNOTSUPP +- from phy_power_on() */ + AHCI_HFLAG_NO_SXS = BIT(28), /* SXS not supported */ /* ap->flags bits */ --- a/drivers/ata/ahci_mvebu.c diff --git a/target/linux/generic/backport-5.15/600-v5.18-page_pool-Add-allocation-stats.patch b/target/linux/generic/backport-5.15/600-v5.18-page_pool-Add-allocation-stats.patch index f4c5b9afee4..dca1062be9c 100644 --- a/target/linux/generic/backport-5.15/600-v5.18-page_pool-Add-allocation-stats.patch +++ b/target/linux/generic/backport-5.15/600-v5.18-page_pool-Add-allocation-stats.patch @@ -65,7 +65,7 @@ Signed-off-by: David S. Miller struct page *page_pool_alloc_pages(struct page_pool *pool, gfp_t gfp); --- a/net/Kconfig +++ b/net/Kconfig -@@ -434,6 +434,19 @@ config NET_DEVLINK +@@ -432,6 +432,19 @@ config NET_DEVLINK config PAGE_POOL bool diff --git a/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch b/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch index 50d65b1eb6f..ef2f53aa384 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch @@ -233,7 +233,7 @@ Signed-off-by: Felix Fietkau static inline void --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -872,6 +872,7 @@ enum net_device_path_type { +@@ -875,6 +875,7 @@ enum net_device_path_type { DEV_PATH_BRIDGE, DEV_PATH_PPPOE, DEV_PATH_DSA, @@ -241,7 +241,7 @@ Signed-off-by: Felix Fietkau }; struct net_device_path { -@@ -897,6 +898,12 @@ struct net_device_path { +@@ -900,6 +901,12 @@ struct net_device_path { int port; u16 proto; } dsa; diff --git a/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch b/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch index 4142fd1d508..d54819120ea 100644 --- a/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch +++ b/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1190,27 +1190,31 @@ static int +@@ -1198,27 +1198,31 @@ static int mt7530_port_bridge_join(struct dsa_switch *ds, int port, struct net_device *bridge) { @@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski } /* Add the all other ports to this port matrix. */ -@@ -1315,24 +1319,28 @@ static void +@@ -1323,24 +1327,28 @@ static void mt7530_port_bridge_leave(struct dsa_switch *ds, int port, struct net_device *bridge) { diff --git a/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch b/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch index f2ead18c36e..391934a30af 100644 --- a/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch +++ b/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch @@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2444,6 +2444,32 @@ mt7531_setup(struct dsa_switch *ds) +@@ -2454,6 +2454,32 @@ mt7531_setup(struct dsa_switch *ds) return 0; } @@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni static bool mt7530_phy_mode_supported(struct dsa_switch *ds, int port, const struct phylink_link_state *state) -@@ -2480,6 +2506,37 @@ static bool mt7531_is_rgmii_port(struct +@@ -2490,6 +2516,37 @@ static bool mt7531_is_rgmii_port(struct return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); } @@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni static bool mt7531_phy_mode_supported(struct dsa_switch *ds, int port, const struct phylink_link_state *state) -@@ -2956,6 +3013,18 @@ mt7531_cpu_port_config(struct dsa_switch +@@ -2966,6 +3023,18 @@ mt7531_cpu_port_config(struct dsa_switch return 0; } @@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni static void mt7530_mac_port_validate(struct dsa_switch *ds, int port, unsigned long *supported) -@@ -3191,6 +3260,7 @@ static const struct dsa_switch_ops mt753 +@@ -3201,6 +3270,7 @@ static const struct dsa_switch_ops mt753 .port_vlan_del = mt7530_port_vlan_del, .port_mirror_add = mt753x_port_mirror_add, .port_mirror_del = mt753x_port_mirror_del, @@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni .phylink_validate = mt753x_phylink_validate, .phylink_mac_link_state = mt753x_phylink_mac_link_state, .phylink_mac_config = mt753x_phylink_mac_config, -@@ -3208,6 +3278,7 @@ static const struct mt753x_info mt753x_t +@@ -3218,6 +3288,7 @@ static const struct mt753x_info mt753x_t .phy_read = mt7530_phy_read, .phy_write = mt7530_phy_write, .pad_setup = mt7530_pad_clk_setup, @@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni .phy_mode_supported = mt7530_phy_mode_supported, .mac_port_validate = mt7530_mac_port_validate, .mac_port_get_state = mt7530_phylink_mac_link_state, -@@ -3219,6 +3290,7 @@ static const struct mt753x_info mt753x_t +@@ -3229,6 +3300,7 @@ static const struct mt753x_info mt753x_t .phy_read = mt7530_phy_read, .phy_write = mt7530_phy_write, .pad_setup = mt7530_pad_clk_setup, @@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni .phy_mode_supported = mt7530_phy_mode_supported, .mac_port_validate = mt7530_mac_port_validate, .mac_port_get_state = mt7530_phylink_mac_link_state, -@@ -3231,6 +3303,7 @@ static const struct mt753x_info mt753x_t +@@ -3241,6 +3313,7 @@ static const struct mt753x_info mt753x_t .phy_write = mt7531_ind_phy_write, .pad_setup = mt7531_pad_setup, .cpu_port_config = mt7531_cpu_port_config, @@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni .phy_mode_supported = mt7531_phy_mode_supported, .mac_port_validate = mt7531_mac_port_validate, .mac_port_get_state = mt7531_phylink_mac_link_state, -@@ -3293,6 +3366,7 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3303,6 +3376,7 @@ mt7530_probe(struct mdio_device *mdiodev */ if (!priv->info->sw_setup || !priv->info->pad_setup || !priv->info->phy_read || !priv->info->phy_write || diff --git a/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch b/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch index 228016383d9..ac191633105 100644 --- a/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch +++ b/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch @@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2470,37 +2470,6 @@ static void mt7530_mac_port_get_caps(str +@@ -2480,37 +2480,6 @@ static void mt7530_mac_port_get_caps(str } } @@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port) { return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); -@@ -2537,44 +2506,6 @@ static void mt7531_mac_port_get_caps(str +@@ -2547,44 +2516,6 @@ static void mt7531_mac_port_get_caps(str } } @@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni static int mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) { -@@ -2829,9 +2760,6 @@ mt753x_phylink_mac_config(struct dsa_swi +@@ -2839,9 +2770,6 @@ mt753x_phylink_mac_config(struct dsa_swi struct mt7530_priv *priv = ds->priv; u32 mcr_cur, mcr_new; @@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni switch (port) { case 0 ... 4: /* Internal phy */ if (state->interface != PHY_INTERFACE_MODE_GMII) -@@ -3047,12 +2975,6 @@ mt753x_phylink_validate(struct dsa_switc +@@ -3057,12 +2985,6 @@ mt753x_phylink_validate(struct dsa_switc __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; struct mt7530_priv *priv = ds->priv; @@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni phylink_set_port_modes(mask); if (state->interface != PHY_INTERFACE_MODE_TRGMII && -@@ -3279,7 +3201,6 @@ static const struct mt753x_info mt753x_t +@@ -3289,7 +3211,6 @@ static const struct mt753x_info mt753x_t .phy_write = mt7530_phy_write, .pad_setup = mt7530_pad_clk_setup, .mac_port_get_caps = mt7530_mac_port_get_caps, @@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni .mac_port_validate = mt7530_mac_port_validate, .mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_config = mt7530_mac_config, -@@ -3291,7 +3212,6 @@ static const struct mt753x_info mt753x_t +@@ -3301,7 +3222,6 @@ static const struct mt753x_info mt753x_t .phy_write = mt7530_phy_write, .pad_setup = mt7530_pad_clk_setup, .mac_port_get_caps = mt7530_mac_port_get_caps, @@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni .mac_port_validate = mt7530_mac_port_validate, .mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_config = mt7530_mac_config, -@@ -3304,7 +3224,6 @@ static const struct mt753x_info mt753x_t +@@ -3314,7 +3234,6 @@ static const struct mt753x_info mt753x_t .pad_setup = mt7531_pad_setup, .cpu_port_config = mt7531_cpu_port_config, .mac_port_get_caps = mt7531_mac_port_get_caps, @@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni .mac_port_validate = mt7531_mac_port_validate, .mac_port_get_state = mt7531_phylink_mac_link_state, .mac_port_config = mt7531_mac_config, -@@ -3367,7 +3286,6 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3377,7 +3296,6 @@ mt7530_probe(struct mdio_device *mdiodev if (!priv->info->sw_setup || !priv->info->pad_setup || !priv->info->phy_read || !priv->info->phy_write || !priv->info->mac_port_get_caps || diff --git a/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch b/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch index 1a1802a1670..63f6e9b9547 100644 --- a/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch +++ b/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2999,11 +2999,6 @@ mt753x_phylink_validate(struct dsa_switc +@@ -3009,11 +3009,6 @@ mt753x_phylink_validate(struct dsa_switc linkmode_and(supported, supported, mask); linkmode_and(state->advertising, state->advertising, mask); diff --git a/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch b/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch index 636353c2d64..5a3098ade3e 100644 --- a/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch +++ b/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch @@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2577,12 +2577,13 @@ static int mt7531_rgmii_setup(struct mt7 +@@ -2587,12 +2587,13 @@ static int mt7531_rgmii_setup(struct mt7 } static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port, @@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni phylink_set(supported, 2500baseX_Full); phylink_set(supported, 2500baseT_Full); } -@@ -2955,16 +2956,18 @@ static void mt753x_phylink_get_caps(stru +@@ -2965,16 +2966,18 @@ static void mt753x_phylink_get_caps(stru static void mt7530_mac_port_validate(struct dsa_switch *ds, int port, @@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni } static void -@@ -2987,12 +2990,13 @@ mt753x_phylink_validate(struct dsa_switc +@@ -2997,12 +3000,13 @@ mt753x_phylink_validate(struct dsa_switc } /* This switch only supports 1G full-duplex. */ diff --git a/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch b/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch index 4d7569b4ce3..c779cb141ef 100644 --- a/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch +++ b/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2576,19 +2576,6 @@ static int mt7531_rgmii_setup(struct mt7 +@@ -2586,19 +2586,6 @@ static int mt7531_rgmii_setup(struct mt7 return 0; } @@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni static void mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, -@@ -2955,51 +2942,21 @@ static void mt753x_phylink_get_caps(stru +@@ -2965,51 +2952,21 @@ static void mt753x_phylink_get_caps(stru } static void @@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni linkmode_and(supported, supported, mask); linkmode_and(state->advertising, state->advertising, mask); -@@ -3200,7 +3157,6 @@ static const struct mt753x_info mt753x_t +@@ -3210,7 +3167,6 @@ static const struct mt753x_info mt753x_t .phy_write = mt7530_phy_write, .pad_setup = mt7530_pad_clk_setup, .mac_port_get_caps = mt7530_mac_port_get_caps, @@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni .mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_config = mt7530_mac_config, }, -@@ -3211,7 +3167,6 @@ static const struct mt753x_info mt753x_t +@@ -3221,7 +3177,6 @@ static const struct mt753x_info mt753x_t .phy_write = mt7530_phy_write, .pad_setup = mt7530_pad_clk_setup, .mac_port_get_caps = mt7530_mac_port_get_caps, @@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni .mac_port_get_state = mt7530_phylink_mac_link_state, .mac_port_config = mt7530_mac_config, }, -@@ -3223,7 +3178,6 @@ static const struct mt753x_info mt753x_t +@@ -3233,7 +3188,6 @@ static const struct mt753x_info mt753x_t .pad_setup = mt7531_pad_setup, .cpu_port_config = mt7531_cpu_port_config, .mac_port_get_caps = mt7531_mac_port_get_caps, @@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni .mac_port_get_state = mt7531_phylink_mac_link_state, .mac_port_config = mt7531_mac_config, .mac_pcs_an_restart = mt7531_sgmii_restart_an, -@@ -3285,7 +3239,6 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3295,7 +3249,6 @@ mt7530_probe(struct mdio_device *mdiodev if (!priv->info->sw_setup || !priv->info->pad_setup || !priv->info->phy_read || !priv->info->phy_write || !priv->info->mac_port_get_caps || diff --git a/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch b/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch index fdf2a964ccf..3854d0e6d52 100644 --- a/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch +++ b/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch @@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni /* String, offset, and register size in bytes if different from 4 bytes */ static const struct mt7530_mib_desc mt7530_mib[] = { MIB_DESC(1, 0x00, "TxDrop"), -@@ -2576,12 +2581,11 @@ static int mt7531_rgmii_setup(struct mt7 +@@ -2586,12 +2591,11 @@ static int mt7531_rgmii_setup(struct mt7 return 0; } @@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni unsigned int val; /* For adjusting speed and duplex of SGMII force mode. */ -@@ -2607,6 +2611,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw +@@ -2617,6 +2621,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw /* MT7531 SGMII 1G force mode can only work in full duplex mode, * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not. @@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni */ if ((speed == SPEED_10 || speed == SPEED_100) && duplex != DUPLEX_FULL) -@@ -2682,9 +2689,10 @@ static int mt7531_sgmii_setup_mode_an(st +@@ -2692,9 +2699,10 @@ static int mt7531_sgmii_setup_mode_an(st return 0; } @@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni u32 val; /* Only restart AN when AN is enabled */ -@@ -2741,6 +2749,24 @@ mt753x_mac_config(struct dsa_switch *ds, +@@ -2751,6 +2759,24 @@ mt753x_mac_config(struct dsa_switch *ds, return priv->info->mac_port_config(ds, port, mode, state->interface); } @@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni static void mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, const struct phylink_link_state *state) -@@ -2802,17 +2828,6 @@ unsupported: +@@ -2812,17 +2838,6 @@ unsupported: mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); } @@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface) -@@ -2822,16 +2837,13 @@ static void mt753x_phylink_mac_link_down +@@ -2832,16 +2847,13 @@ static void mt753x_phylink_mac_link_down mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); } @@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni } static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port, -@@ -2844,8 +2856,6 @@ static void mt753x_phylink_mac_link_up(s +@@ -2854,8 +2866,6 @@ static void mt753x_phylink_mac_link_up(s struct mt7530_priv *priv = ds->priv; u32 mcr; @@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK; /* MT753x MAC works in 1G full duplex mode for all up-clocked -@@ -2923,6 +2933,8 @@ mt7531_cpu_port_config(struct dsa_switch +@@ -2933,6 +2943,8 @@ mt7531_cpu_port_config(struct dsa_switch return ret; mt7530_write(priv, MT7530_PMCR_P(port), PMCR_CPU_PORT_SETTING(priv->id)); @@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL, speed, DUPLEX_FULL, true, true); -@@ -2962,16 +2974,13 @@ mt753x_phylink_validate(struct dsa_switc +@@ -2972,16 +2984,13 @@ mt753x_phylink_validate(struct dsa_switc linkmode_and(state->advertising, state->advertising, mask); } @@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni pmsr = mt7530_read(priv, MT7530_PMSR_P(port)); state->link = (pmsr & PMSR_LINK); -@@ -2998,8 +3007,6 @@ mt7530_phylink_mac_link_state(struct dsa +@@ -3008,8 +3017,6 @@ mt7530_phylink_mac_link_state(struct dsa state->pause |= MLO_PAUSE_RX; if (pmsr & PMSR_TX_FC) state->pause |= MLO_PAUSE_TX; @@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni } static int -@@ -3041,32 +3048,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 +@@ -3051,32 +3058,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 return 0; } @@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni if (ret) return ret; -@@ -3079,6 +3103,13 @@ mt753x_setup(struct dsa_switch *ds) +@@ -3089,6 +3113,13 @@ mt753x_setup(struct dsa_switch *ds) if (ret && priv->irq) mt7530_free_irq_common(priv); @@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni return ret; } -@@ -3140,9 +3171,8 @@ static const struct dsa_switch_ops mt753 +@@ -3150,9 +3181,8 @@ static const struct dsa_switch_ops mt753 .port_mirror_del = mt753x_port_mirror_del, .phylink_get_caps = mt753x_phylink_get_caps, .phylink_validate = mt753x_phylink_validate, @@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni .phylink_mac_link_down = mt753x_phylink_mac_link_down, .phylink_mac_link_up = mt753x_phylink_mac_link_up, .get_mac_eee = mt753x_get_mac_eee, -@@ -3152,36 +3182,34 @@ static const struct dsa_switch_ops mt753 +@@ -3162,36 +3192,34 @@ static const struct dsa_switch_ops mt753 static const struct mt753x_info mt753x_table[] = { [ID_MT7621] = { .id = ID_MT7621, @@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni }, }; -@@ -3239,7 +3267,7 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3249,7 +3277,7 @@ mt7530_probe(struct mdio_device *mdiodev if (!priv->info->sw_setup || !priv->info->pad_setup || !priv->info->phy_read || !priv->info->phy_write || !priv->info->mac_port_get_caps || diff --git a/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch b/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch index 7b2fa36699b..220e34d1dfb 100644 --- a/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch +++ b/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch @@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2953,25 +2953,16 @@ static void mt753x_phylink_get_caps(stru +@@ -2963,25 +2963,16 @@ static void mt753x_phylink_get_caps(stru priv->info->mac_port_get_caps(ds, port, config); } @@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni } static void mt7530_pcs_get_state(struct phylink_pcs *pcs, -@@ -3073,12 +3064,14 @@ static void mt7530_pcs_an_restart(struct +@@ -3083,12 +3074,14 @@ static void mt7530_pcs_an_restart(struct } static const struct phylink_pcs_ops mt7530_pcs_ops = { @@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni .pcs_get_state = mt7531_pcs_get_state, .pcs_config = mt753x_pcs_config, .pcs_an_restart = mt7531_pcs_an_restart, -@@ -3170,7 +3163,6 @@ static const struct dsa_switch_ops mt753 +@@ -3180,7 +3173,6 @@ static const struct dsa_switch_ops mt753 .port_mirror_add = mt753x_port_mirror_add, .port_mirror_del = mt753x_port_mirror_del, .phylink_get_caps = mt753x_phylink_get_caps, diff --git a/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch b/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch index 8bb587f5f57..71ececd074b 100644 --- a/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch +++ b/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch @@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2950,6 +2950,12 @@ static void mt753x_phylink_get_caps(stru +@@ -2960,6 +2960,12 @@ static void mt753x_phylink_get_caps(stru config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000FD; diff --git a/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch b/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch index 438c02ade6f..26c465d67e5 100644 --- a/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch +++ b/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch @@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -3088,9 +3088,16 @@ static int +@@ -3098,9 +3098,16 @@ static int mt753x_setup(struct dsa_switch *ds) { struct mt7530_priv *priv = ds->priv; @@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski if (ret) return ret; -@@ -3102,13 +3109,6 @@ mt753x_setup(struct dsa_switch *ds) +@@ -3112,13 +3119,6 @@ mt753x_setup(struct dsa_switch *ds) if (ret && priv->irq) mt7530_free_irq_common(priv); diff --git a/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch b/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch index 26d207ca6ab..4adb1671999 100644 --- a/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch +++ b/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch @@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1536,11 +1536,11 @@ static void +@@ -1544,11 +1544,11 @@ static void mt7530_hw_vlan_add(struct mt7530_priv *priv, struct mt7530_hw_vlan_entry *entry) { @@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski /* Validate the entry with independent learning, create egress tag per * VLAN and joining the port as one of the port members. -@@ -1551,22 +1551,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p +@@ -1559,22 +1559,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p /* Decide whether adding tag or not for those outgoing packets from the * port inside the VLAN. @@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski } static void -@@ -1585,11 +1583,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p +@@ -1593,11 +1591,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p return; } diff --git a/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch b/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch index 2bfa1ef438e..276251f509e 100644 --- a/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch +++ b/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch @@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1040,6 +1040,7 @@ static int +@@ -1048,6 +1048,7 @@ static int mt7530_port_enable(struct dsa_switch *ds, int port, struct phy_device *phy) { @@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski struct mt7530_priv *priv = ds->priv; mutex_lock(&priv->reg_mutex); -@@ -1048,7 +1049,11 @@ mt7530_port_enable(struct dsa_switch *ds +@@ -1056,7 +1057,11 @@ mt7530_port_enable(struct dsa_switch *ds * restore the port matrix if the port is the member of a certain * bridge. */ @@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski priv->ports[port].enable = true; mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, priv->ports[port].pm); -@@ -1196,7 +1201,8 @@ mt7530_port_bridge_join(struct dsa_switc +@@ -1204,7 +1209,8 @@ mt7530_port_bridge_join(struct dsa_switc struct net_device *bridge) { struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; @@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski struct mt7530_priv *priv = ds->priv; mutex_lock(&priv->reg_mutex); -@@ -1273,9 +1279,12 @@ mt7530_port_set_vlan_unaware(struct dsa_ +@@ -1281,9 +1287,12 @@ mt7530_port_set_vlan_unaware(struct dsa_ * the CPU port get out of VLAN filtering mode. */ if (all_user_ports_removed) { @@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); } } -@@ -1325,6 +1334,7 @@ mt7530_port_bridge_leave(struct dsa_swit +@@ -1333,6 +1342,7 @@ mt7530_port_bridge_leave(struct dsa_swit struct net_device *bridge) { struct dsa_port *dp = dsa_to_port(ds, port), *other_dp; @@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski struct mt7530_priv *priv = ds->priv; mutex_lock(&priv->reg_mutex); -@@ -1353,8 +1363,8 @@ mt7530_port_bridge_leave(struct dsa_swit +@@ -1361,8 +1371,8 @@ mt7530_port_bridge_leave(struct dsa_swit */ if (priv->ports[port].enable) mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, @@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski /* When a port is removed from the bridge, the port would be set up * back to the default as is at initial boot which is a VLAN-unaware -@@ -1517,6 +1527,9 @@ static int +@@ -1525,6 +1535,9 @@ static int mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, struct netlink_ext_ack *extack) { @@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski if (vlan_filtering) { /* The port is being kept as VLAN-unaware port when bridge is * set up with vlan_filtering not being set, Otherwise, the -@@ -1524,7 +1537,7 @@ mt7530_port_vlan_filtering(struct dsa_sw +@@ -1532,7 +1545,7 @@ mt7530_port_vlan_filtering(struct dsa_sw * for becoming a VLAN-aware port. */ mt7530_port_set_vlan_aware(ds, port); diff --git a/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch b/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch index 9743a3f2062..3668a821ef7 100644 --- a/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch +++ b/target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch @@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11789,6 +11789,14 @@ L: netdev@vger.kernel.org +@@ -11782,6 +11782,14 @@ L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/mediatek/ diff --git a/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch b/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch index 377ee76171c..8d55ffb8b68 100644 --- a/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch +++ b/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2736,9 +2736,6 @@ mt7531_mac_config(struct dsa_switch *ds, +@@ -2746,9 +2746,6 @@ mt7531_mac_config(struct dsa_switch *ds, case PHY_INTERFACE_MODE_NA: case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_2500BASEX: @@ -29,7 +29,7 @@ Signed-off-by: David S. Miller return mt7531_sgmii_setup_mode_force(priv, port, interface); default: return -EINVAL; -@@ -2814,13 +2811,6 @@ unsupported: +@@ -2824,13 +2821,6 @@ unsupported: return; } @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port)); mcr_new = mcr_cur; mcr_new &= ~PMCR_LINK_SETTINGS_MASK; -@@ -2957,6 +2947,9 @@ static void mt753x_phylink_get_caps(stru +@@ -2967,6 +2957,9 @@ static void mt753x_phylink_get_caps(stru config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000FD; @@ -53,7 +53,7 @@ Signed-off-by: David S. Miller /* This driver does not make use of the speed, duplex, pause or the * advertisement in its mac_config, so it is safe to mark this driver * as non-legacy. -@@ -3022,6 +3015,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 +@@ -3032,6 +3025,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); state->link = !!(status & MT7531_SGMII_LINK_STATUS); @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller if (state->interface == PHY_INTERFACE_MODE_SGMII && (status & MT7531_SGMII_AN_ENABLE)) { val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port)); -@@ -3052,16 +3046,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 +@@ -3062,16 +3056,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 return 0; } @@ -109,7 +109,7 @@ Signed-off-by: David S. Miller } static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode, -@@ -3102,6 +3124,8 @@ mt753x_setup(struct dsa_switch *ds) +@@ -3112,6 +3134,8 @@ mt753x_setup(struct dsa_switch *ds) priv->pcs[i].pcs.ops = priv->info->pcs_ops; priv->pcs[i].priv = priv; priv->pcs[i].port = i; diff --git a/target/linux/generic/backport-5.15/788-v6.3-net-dsa-mt7530-use-external-PCS-driver.patch b/target/linux/generic/backport-5.15/788-v6.3-net-dsa-mt7530-use-external-PCS-driver.patch index 9e445f1300c..2642cd4fafc 100644 --- a/target/linux/generic/backport-5.15/788-v6.3-net-dsa-mt7530-use-external-PCS-driver.patch +++ b/target/linux/generic/backport-5.15/788-v6.3-net-dsa-mt7530-use-external-PCS-driver.patch @@ -81,7 +81,7 @@ Tested-by: Frank Wunderlich #include #include #include -@@ -2588,128 +2589,11 @@ static int mt7531_rgmii_setup(struct mt7 +@@ -2598,128 +2599,11 @@ static int mt7531_rgmii_setup(struct mt7 return 0; } @@ -210,7 +210,7 @@ Tested-by: Frank Wunderlich static int mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface) -@@ -2732,11 +2616,11 @@ mt7531_mac_config(struct dsa_switch *ds, +@@ -2742,11 +2626,11 @@ mt7531_mac_config(struct dsa_switch *ds, phydev = dp->slave->phydev; return mt7531_rgmii_setup(priv, port, interface, phydev); case PHY_INTERFACE_MODE_SGMII: @@ -224,7 +224,7 @@ Tested-by: Frank Wunderlich default: return -EINVAL; } -@@ -2761,11 +2645,11 @@ mt753x_phylink_mac_select_pcs(struct dsa +@@ -2771,11 +2655,11 @@ mt753x_phylink_mac_select_pcs(struct dsa switch (interface) { case PHY_INTERFACE_MODE_TRGMII: @@ -238,7 +238,7 @@ Tested-by: Frank Wunderlich default: return NULL; } -@@ -3006,86 +2890,6 @@ static void mt7530_pcs_get_state(struct +@@ -3016,86 +2900,6 @@ static void mt7530_pcs_get_state(struct state->pause |= MLO_PAUSE_TX; } @@ -325,7 +325,7 @@ Tested-by: Frank Wunderlich static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode, phy_interface_t interface, const unsigned long *advertising, -@@ -3105,18 +2909,57 @@ static const struct phylink_pcs_ops mt75 +@@ -3115,18 +2919,57 @@ static const struct phylink_pcs_ops mt75 .pcs_an_restart = mt7530_pcs_an_restart, }; @@ -389,7 +389,7 @@ Tested-by: Frank Wunderlich int i, ret; /* Initialise the PCS devices */ -@@ -3124,8 +2967,6 @@ mt753x_setup(struct dsa_switch *ds) +@@ -3134,8 +2977,6 @@ mt753x_setup(struct dsa_switch *ds) priv->pcs[i].pcs.ops = priv->info->pcs_ops; priv->pcs[i].priv = priv; priv->pcs[i].port = i; @@ -398,7 +398,7 @@ Tested-by: Frank Wunderlich } ret = priv->info->sw_setup(ds); -@@ -3140,6 +2981,16 @@ mt753x_setup(struct dsa_switch *ds) +@@ -3150,6 +2991,16 @@ mt753x_setup(struct dsa_switch *ds) if (ret && priv->irq) mt7530_free_irq_common(priv); @@ -415,7 +415,7 @@ Tested-by: Frank Wunderlich return ret; } -@@ -3231,7 +3082,7 @@ static const struct mt753x_info mt753x_t +@@ -3241,7 +3092,7 @@ static const struct mt753x_info mt753x_t }, [ID_MT7531] = { .id = ID_MT7531, @@ -424,7 +424,7 @@ Tested-by: Frank Wunderlich .sw_setup = mt7531_setup, .phy_read = mt7531_ind_phy_read, .phy_write = mt7531_ind_phy_write, -@@ -3339,7 +3190,7 @@ static void +@@ -3349,7 +3200,7 @@ static void mt7530_remove(struct mdio_device *mdiodev) { struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev); @@ -433,7 +433,7 @@ Tested-by: Frank Wunderlich if (!priv) return; -@@ -3358,6 +3209,10 @@ mt7530_remove(struct mdio_device *mdiode +@@ -3368,6 +3219,10 @@ mt7530_remove(struct mdio_device *mdiode mt7530_free_irq(priv); dsa_unregister_switch(priv->ds); diff --git a/target/linux/generic/backport-5.15/790-v6.4-0002-net-dsa-mt7530-refactor-SGMII-PCS-creation.patch b/target/linux/generic/backport-5.15/790-v6.4-0002-net-dsa-mt7530-refactor-SGMII-PCS-creation.patch index a933d376c88..983423aaff6 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0002-net-dsa-mt7530-refactor-SGMII-PCS-creation.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0002-net-dsa-mt7530-refactor-SGMII-PCS-creation.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2941,26 +2941,56 @@ static const struct regmap_bus mt7531_re +@@ -2951,26 +2951,56 @@ static const struct regmap_bus mt7531_re .reg_update_bits = mt7530_regmap_update_bits, }; @@ -88,7 +88,7 @@ Signed-off-by: David S. Miller int i, ret; /* Initialise the PCS devices */ -@@ -2982,15 +3012,11 @@ mt753x_setup(struct dsa_switch *ds) +@@ -2992,15 +3022,11 @@ mt753x_setup(struct dsa_switch *ds) if (ret && priv->irq) mt7530_free_irq_common(priv); diff --git a/target/linux/generic/backport-5.15/790-v6.4-0003-net-dsa-mt7530-use-unlocked-regmap-accessors.patch b/target/linux/generic/backport-5.15/790-v6.4-0003-net-dsa-mt7530-use-unlocked-regmap-accessors.patch index 5f6990f1178..9d8f67ba957 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0003-net-dsa-mt7530-use-unlocked-regmap-accessors.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0003-net-dsa-mt7530-use-unlocked-regmap-accessors.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2914,7 +2914,7 @@ static int mt7530_regmap_read(void *cont +@@ -2924,7 +2924,7 @@ static int mt7530_regmap_read(void *cont { struct mt7530_priv *priv = context; @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller return 0; }; -@@ -2922,23 +2922,25 @@ static int mt7530_regmap_write(void *con +@@ -2932,23 +2932,25 @@ static int mt7530_regmap_write(void *con { struct mt7530_priv *priv = context; @@ -62,7 +62,7 @@ Signed-off-by: David S. Miller }; static int -@@ -2964,6 +2966,9 @@ mt7531_create_sgmii(struct mt7530_priv * +@@ -2974,6 +2976,9 @@ mt7531_create_sgmii(struct mt7530_priv * mt7531_pcs_config[i]->reg_stride = 4; mt7531_pcs_config[i]->reg_base = MT7531_SGMII_REG_BASE(5 + i); mt7531_pcs_config[i]->max_register = 0x17c; diff --git a/target/linux/generic/backport-5.15/790-v6.4-0004-net-dsa-mt7530-use-regmap-to-access-switch-register-.patch b/target/linux/generic/backport-5.15/790-v6.4-0004-net-dsa-mt7530-use-regmap-to-access-switch-register-.patch index 9499ca598fb..bd1d5c98a7c 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0004-net-dsa-mt7530-use-regmap-to-access-switch-register-.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0004-net-dsa-mt7530-use-regmap-to-access-switch-register-.patch @@ -133,7 +133,7 @@ Signed-off-by: David S. Miller } static void -@@ -2910,22 +2931,6 @@ static const struct phylink_pcs_ops mt75 +@@ -2920,22 +2941,6 @@ static const struct phylink_pcs_ops mt75 .pcs_an_restart = mt7530_pcs_an_restart, }; @@ -156,7 +156,7 @@ Signed-off-by: David S. Miller static void mt7530_mdio_regmap_lock(void *mdio_lock) { -@@ -2938,7 +2943,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc +@@ -2948,7 +2953,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc mutex_unlock(mdio_lock); } @@ -165,7 +165,7 @@ Signed-off-by: David S. Miller .reg_write = mt7530_regmap_write, .reg_read = mt7530_regmap_read, }; -@@ -2971,7 +2976,7 @@ mt7531_create_sgmii(struct mt7530_priv * +@@ -2981,7 +2986,7 @@ mt7531_create_sgmii(struct mt7530_priv * mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock; regmap = devm_regmap_init(priv->dev, @@ -174,7 +174,7 @@ Signed-off-by: David S. Miller mt7531_pcs_config[i]); if (IS_ERR(regmap)) { ret = PTR_ERR(regmap); -@@ -3136,6 +3141,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match) +@@ -3146,6 +3151,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match) static int mt7530_probe(struct mdio_device *mdiodev) { @@ -182,7 +182,7 @@ Signed-off-by: David S. Miller struct mt7530_priv *priv; struct device_node *dn; -@@ -3215,6 +3221,21 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3225,6 +3231,21 @@ mt7530_probe(struct mdio_device *mdiodev mutex_init(&priv->reg_mutex); dev_set_drvdata(&mdiodev->dev, priv); diff --git a/target/linux/generic/backport-5.15/790-v6.4-0005-net-dsa-mt7530-move-SGMII-PCS-creation-to-mt7530_pro.patch b/target/linux/generic/backport-5.15/790-v6.4-0005-net-dsa-mt7530-move-SGMII-PCS-creation-to-mt7530_pro.patch index 44c31a4f6f2..8c11bc3733e 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0005-net-dsa-mt7530-move-SGMII-PCS-creation-to-mt7530_pro.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0005-net-dsa-mt7530-move-SGMII-PCS-creation-to-mt7530_pro.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -3022,12 +3022,6 @@ mt753x_setup(struct dsa_switch *ds) +@@ -3032,12 +3032,6 @@ mt753x_setup(struct dsa_switch *ds) if (ret && priv->irq) mt7530_free_irq_common(priv); @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller return ret; } -@@ -3144,6 +3138,7 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3154,6 +3148,7 @@ mt7530_probe(struct mdio_device *mdiodev static struct regmap_config *regmap_config; struct mt7530_priv *priv; struct device_node *dn; @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller dn = mdiodev->dev.of_node; -@@ -3236,6 +3231,12 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3246,6 +3241,12 @@ mt7530_probe(struct mdio_device *mdiodev if (IS_ERR(priv->regmap)) return PTR_ERR(priv->regmap); diff --git a/target/linux/generic/backport-5.15/790-v6.4-0006-net-dsa-mt7530-introduce-mutex-helpers.patch b/target/linux/generic/backport-5.15/790-v6.4-0006-net-dsa-mt7530-introduce-mutex-helpers.patch index c23f96e7a66..4d75c55647c 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0006-net-dsa-mt7530-introduce-mutex-helpers.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0006-net-dsa-mt7530-introduce-mutex-helpers.patch @@ -214,7 +214,7 @@ Signed-off-by: David S. Miller return ret; } -@@ -1109,7 +1109,6 @@ static int +@@ -1117,7 +1117,6 @@ static int mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu) { struct mt7530_priv *priv = ds->priv; @@ -222,7 +222,7 @@ Signed-off-by: David S. Miller int length; u32 val; -@@ -1120,7 +1119,7 @@ mt7530_port_change_mtu(struct dsa_switch +@@ -1128,7 +1127,7 @@ mt7530_port_change_mtu(struct dsa_switch if (!dsa_is_cpu_port(ds, port)) return 0; @@ -231,7 +231,7 @@ Signed-off-by: David S. Miller val = mt7530_mii_read(priv, MT7530_GMACCR); val &= ~MAX_RX_PKT_LEN_MASK; -@@ -1141,7 +1140,7 @@ mt7530_port_change_mtu(struct dsa_switch +@@ -1149,7 +1148,7 @@ mt7530_port_change_mtu(struct dsa_switch mt7530_mii_write(priv, MT7530_GMACCR, val); @@ -240,7 +240,7 @@ Signed-off-by: David S. Miller return 0; } -@@ -1937,10 +1936,10 @@ mt7530_irq_thread_fn(int irq, void *dev_ +@@ -1945,10 +1944,10 @@ mt7530_irq_thread_fn(int irq, void *dev_ u32 val; int p; @@ -253,7 +253,7 @@ Signed-off-by: David S. Miller for (p = 0; p < MT7530_NUM_PHYS; p++) { if (BIT(p) & val) { -@@ -1976,7 +1975,7 @@ mt7530_irq_bus_lock(struct irq_data *d) +@@ -1984,7 +1983,7 @@ mt7530_irq_bus_lock(struct irq_data *d) { struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); @@ -262,7 +262,7 @@ Signed-off-by: David S. Miller } static void -@@ -1985,7 +1984,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da +@@ -1993,7 +1992,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); mt7530_mii_write(priv, MT7530_SYS_INT_EN, priv->irq_enable); diff --git a/target/linux/generic/backport-5.15/790-v6.4-0008-net-dsa-mt7530-introduce-mt7530_probe_common-helper-.patch b/target/linux/generic/backport-5.15/790-v6.4-0008-net-dsa-mt7530-introduce-mt7530_probe_common-helper-.patch index aeb1e37a1a1..00dd91bbc95 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0008-net-dsa-mt7530-introduce-mt7530_probe_common-helper-.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0008-net-dsa-mt7530-introduce-mt7530_probe_common-helper-.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -3150,44 +3150,21 @@ static const struct of_device_id mt7530_ +@@ -3160,44 +3160,21 @@ static const struct of_device_id mt7530_ MODULE_DEVICE_TABLE(of, mt7530_of_match); static int @@ -67,7 +67,7 @@ Signed-off-by: David S. Miller if (!priv->info) return -EINVAL; -@@ -3201,23 +3178,53 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3211,23 +3188,53 @@ mt7530_probe(struct mdio_device *mdiodev return -EINVAL; priv->id = priv->info->id; @@ -131,7 +131,7 @@ Signed-off-by: David S. Miller priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(priv->reset)) { -@@ -3226,12 +3233,15 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3236,12 +3243,15 @@ mt7530_probe(struct mdio_device *mdiodev } } diff --git a/target/linux/generic/backport-5.15/790-v6.4-0009-net-dsa-mt7530-introduce-mt7530_remove_common-helper.patch b/target/linux/generic/backport-5.15/790-v6.4-0009-net-dsa-mt7530-introduce-mt7530_remove_common-helper.patch index 2651f459183..be73b67c948 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0009-net-dsa-mt7530-introduce-mt7530_remove_common-helper.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0009-net-dsa-mt7530-introduce-mt7530_remove_common-helper.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -3268,6 +3268,17 @@ mt7530_probe(struct mdio_device *mdiodev +@@ -3278,6 +3278,17 @@ mt7530_probe(struct mdio_device *mdiodev } static void @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller mt7530_remove(struct mdio_device *mdiodev) { struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev); -@@ -3286,16 +3297,11 @@ mt7530_remove(struct mdio_device *mdiode +@@ -3296,16 +3307,11 @@ mt7530_remove(struct mdio_device *mdiode dev_err(priv->dev, "Failed to disable io pwr: %d\n", ret); diff --git a/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch b/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch index 51346d0620d..c0e29fa00fb 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11901,6 +11901,7 @@ M: Landen Chao L: netdev@vger.kernel.org S: Maintained @@ -416,7 +416,7 @@ Signed-off-by: David S. Miller static u32 mt7530_mii_read(struct mt7530_priv *priv, u32 reg) { -@@ -2948,72 +2899,6 @@ static const struct phylink_pcs_ops mt75 +@@ -2958,72 +2909,6 @@ static const struct phylink_pcs_ops mt75 .pcs_an_restart = mt7530_pcs_an_restart, }; @@ -489,7 +489,7 @@ Signed-off-by: David S. Miller static int mt753x_setup(struct dsa_switch *ds) { -@@ -3072,7 +2957,7 @@ static int mt753x_set_mac_eee(struct dsa +@@ -3082,7 +2967,7 @@ static int mt753x_set_mac_eee(struct dsa return 0; } @@ -498,7 +498,7 @@ Signed-off-by: David S. Miller .get_tag_protocol = mtk_get_tag_protocol, .setup = mt753x_setup, .get_strings = mt7530_get_strings, -@@ -3106,8 +2991,9 @@ static const struct dsa_switch_ops mt753 +@@ -3116,8 +3001,9 @@ static const struct dsa_switch_ops mt753 .get_mac_eee = mt753x_get_mac_eee, .set_mac_eee = mt753x_set_mac_eee, }; @@ -509,7 +509,7 @@ Signed-off-by: David S. Miller [ID_MT7621] = { .id = ID_MT7621, .pcs_ops = &mt7530_pcs_ops, -@@ -3140,16 +3026,9 @@ static const struct mt753x_info mt753x_t +@@ -3150,16 +3036,9 @@ static const struct mt753x_info mt753x_t .mac_port_config = mt7531_mac_config, }, }; @@ -528,7 +528,7 @@ Signed-off-by: David S. Miller mt7530_probe_common(struct mt7530_priv *priv) { struct device *dev = priv->dev; -@@ -3186,88 +3065,9 @@ mt7530_probe_common(struct mt7530_priv * +@@ -3196,88 +3075,9 @@ mt7530_probe_common(struct mt7530_priv * return 0; } @@ -619,7 +619,7 @@ Signed-off-by: David S. Miller mt7530_remove_common(struct mt7530_priv *priv) { if (priv->irq) -@@ -3278,57 +3078,6 @@ mt7530_remove_common(struct mt7530_priv +@@ -3288,57 +3088,6 @@ mt7530_remove_common(struct mt7530_priv mutex_destroy(&priv->reg_mutex); } diff --git a/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch b/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch index 00f4b25c44e..89dc30c7dff 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11899,9 +11899,11 @@ MEDIATEK SWITCH DRIVER +@@ -11892,9 +11892,11 @@ MEDIATEK SWITCH DRIVER M: Sean Wang M: Landen Chao M: DENG Qingfang @@ -184,7 +184,7 @@ Signed-off-by: David S. Miller +MODULE_LICENSE("GPL"); --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -1984,6 +1984,47 @@ static const struct irq_domain_ops mt753 +@@ -1992,6 +1992,47 @@ static const struct irq_domain_ops mt753 }; static void @@ -232,7 +232,7 @@ Signed-off-by: David S. Miller mt7530_setup_mdio_irq(struct mt7530_priv *priv) { struct dsa_switch *ds = priv->ds; -@@ -2017,8 +2058,15 @@ mt7530_setup_irq(struct mt7530_priv *pri +@@ -2025,8 +2066,15 @@ mt7530_setup_irq(struct mt7530_priv *pri return priv->irq ? : -EINVAL; } @@ -250,7 +250,7 @@ Signed-off-by: David S. Miller if (!priv->irq_domain) { dev_err(dev, "failed to create IRQ domain\n"); return -ENOMEM; -@@ -2511,6 +2559,25 @@ static void mt7531_mac_port_get_caps(str +@@ -2521,6 +2569,25 @@ static void mt7531_mac_port_get_caps(str } } @@ -276,7 +276,7 @@ Signed-off-by: David S. Miller static int mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) { -@@ -2587,6 +2654,17 @@ static bool mt753x_is_mac_port(u32 port) +@@ -2597,6 +2664,17 @@ static bool mt753x_is_mac_port(u32 port) } static int @@ -294,7 +294,7 @@ Signed-off-by: David S. Miller mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface) { -@@ -2656,7 +2734,8 @@ mt753x_phylink_mac_config(struct dsa_swi +@@ -2666,7 +2744,8 @@ mt753x_phylink_mac_config(struct dsa_swi switch (port) { case 0 ... 4: /* Internal phy */ @@ -304,7 +304,7 @@ Signed-off-by: David S. Miller goto unsupported; break; case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ -@@ -2734,7 +2813,8 @@ static void mt753x_phylink_mac_link_up(s +@@ -2744,7 +2823,8 @@ static void mt753x_phylink_mac_link_up(s /* MT753x MAC works in 1G full duplex mode for all up-clocked * variants. */ @@ -314,7 +314,7 @@ Signed-off-by: David S. Miller (phy_interface_mode_is_8023z(interface))) { speed = SPEED_1000; duplex = DUPLEX_FULL; -@@ -2814,6 +2894,21 @@ mt7531_cpu_port_config(struct dsa_switch +@@ -2824,6 +2904,21 @@ mt7531_cpu_port_config(struct dsa_switch return 0; } @@ -336,7 +336,7 @@ Signed-off-by: David S. Miller static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port, struct phylink_config *config) { -@@ -2959,6 +3054,27 @@ static int mt753x_set_mac_eee(struct dsa +@@ -2969,6 +3064,27 @@ static int mt753x_set_mac_eee(struct dsa return 0; } @@ -364,7 +364,7 @@ Signed-off-by: David S. Miller const struct dsa_switch_ops mt7530_switch_ops = { .get_tag_protocol = mtk_get_tag_protocol, .setup = mt753x_setup, -@@ -3027,6 +3143,17 @@ const struct mt753x_info mt753x_table[] +@@ -3037,6 +3153,17 @@ const struct mt753x_info mt753x_table[] .mac_port_get_caps = mt7531_mac_port_get_caps, .mac_port_config = mt7531_mac_config, }, diff --git a/target/linux/generic/backport-5.15/790-v6.4-0014-net-dsa-mt7530-fix-support-for-MT7531BE.patch b/target/linux/generic/backport-5.15/790-v6.4-0014-net-dsa-mt7530-fix-support-for-MT7531BE.patch index ed8bca7d1c1..40e18167267 100644 --- a/target/linux/generic/backport-5.15/790-v6.4-0014-net-dsa-mt7530-fix-support-for-MT7531BE.patch +++ b/target/linux/generic/backport-5.15/790-v6.4-0014-net-dsa-mt7530-fix-support-for-MT7531BE.patch @@ -73,7 +73,7 @@ Signed-off-by: Jakub Kicinski } --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -3021,6 +3021,12 @@ mt753x_setup(struct dsa_switch *ds) +@@ -3031,6 +3031,12 @@ mt753x_setup(struct dsa_switch *ds) if (ret && priv->irq) mt7530_free_irq_common(priv); diff --git a/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch b/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch index e2a0e25a794..eb51b410b54 100644 --- a/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch +++ b/target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch @@ -21,7 +21,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -12700,6 +12700,7 @@ F: include/uapi/linux/meye.h +@@ -12693,6 +12693,7 @@ F: include/uapi/linux/meye.h MOTORCOMM PHY DRIVER M: Peter Geis diff --git a/target/linux/generic/backport-5.15/804-v5.18-0009-nvmem-Add-driver-for-OCOTP-in-Sunplus-SP7021.patch b/target/linux/generic/backport-5.15/804-v5.18-0009-nvmem-Add-driver-for-OCOTP-in-Sunplus-SP7021.patch index ae177e0cb03..6ad9257d60e 100644 --- a/target/linux/generic/backport-5.15/804-v5.18-0009-nvmem-Add-driver-for-OCOTP-in-Sunplus-SP7021.patch +++ b/target/linux/generic/backport-5.15/804-v5.18-0009-nvmem-Add-driver-for-OCOTP-in-Sunplus-SP7021.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -17965,6 +17965,11 @@ L: netdev@vger.kernel.org +@@ -17958,6 +17958,11 @@ L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/dlink/sundance.c diff --git a/target/linux/generic/backport-5.15/806-v6.0-0001-nvmem-microchip-otpc-add-support.patch b/target/linux/generic/backport-5.15/806-v6.0-0001-nvmem-microchip-otpc-add-support.patch index ad0460d4f36..f7ea61626c5 100644 --- a/target/linux/generic/backport-5.15/806-v6.0-0001-nvmem-microchip-otpc-add-support.patch +++ b/target/linux/generic/backport-5.15/806-v6.0-0001-nvmem-microchip-otpc-add-support.patch @@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -12364,6 +12364,14 @@ S: Supported +@@ -12357,6 +12357,14 @@ S: Supported F: Documentation/devicetree/bindings/mtd/atmel-nand.txt F: drivers/mtd/nand/raw/atmel/* diff --git a/target/linux/generic/backport-5.15/810-v5.17-net-qmi_wwan-add-ZTE-MF286D-modem-19d2-1485.patch b/target/linux/generic/backport-5.15/810-v5.17-net-qmi_wwan-add-ZTE-MF286D-modem-19d2-1485.patch index 25802be7e3d..41d3e121de1 100644 --- a/target/linux/generic/backport-5.15/810-v5.17-net-qmi_wwan-add-ZTE-MF286D-modem-19d2-1485.patch +++ b/target/linux/generic/backport-5.15/810-v5.17-net-qmi_wwan-add-ZTE-MF286D-modem-19d2-1485.patch @@ -49,7 +49,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1314,6 +1314,7 @@ static const struct usb_device_id produc +@@ -1316,6 +1316,7 @@ static const struct usb_device_id produc {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */ {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ {QMI_FIXED_INTF(0x19d2, 0x1432, 3)}, /* ZTE ME3620 */ diff --git a/target/linux/generic/backport-5.15/813-v6.5-0001-nvmem-imx-ocotp-set-varaiable-imx_ocotp_layout-stora.patch b/target/linux/generic/backport-5.15/813-v6.5-0001-nvmem-imx-ocotp-set-varaiable-imx_ocotp_layout-stora.patch new file mode 100644 index 00000000000..38cfccd5ef9 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0001-nvmem-imx-ocotp-set-varaiable-imx_ocotp_layout-stora.patch @@ -0,0 +1,31 @@ +From eebc6573ad940b62a87776db3917e912b4f52d78 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Sun, 11 Jun 2023 15:03:05 +0100 +Subject: [PATCH] nvmem: imx-ocotp: set varaiable imx_ocotp_layout + storage-class-specifier to static + +smatch reports +drivers/nvmem/imx-ocotp.c:599:21: warning: symbol + 'imx_ocotp_layout' was not declared. Should it be static? + +This variable is only used in one file so should be static. + +Signed-off-by: Tom Rix +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-2-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/imx-ocotp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/imx-ocotp.c ++++ b/drivers/nvmem/imx-ocotp.c +@@ -596,7 +596,7 @@ static void imx_ocotp_fixup_cell_info(st + cell->read_post_process = imx_ocotp_cell_pp; + } + +-struct nvmem_layout imx_ocotp_layout = { ++static struct nvmem_layout imx_ocotp_layout = { + .fixup_cell_info = imx_ocotp_fixup_cell_info, + }; + diff --git a/target/linux/generic/backport-5.15/813-v6.5-0002-nvmem-imx-ocotp-Reverse-MAC-addresses-on-all-i.MX-de.patch b/target/linux/generic/backport-5.15/813-v6.5-0002-nvmem-imx-ocotp-Reverse-MAC-addresses-on-all-i.MX-de.patch new file mode 100644 index 00000000000..7523e5ebf64 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0002-nvmem-imx-ocotp-Reverse-MAC-addresses-on-all-i.MX-de.patch @@ -0,0 +1,71 @@ +From 8a00fc606312c68b98add8fe8e6f7a013ce29e78 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Sun, 11 Jun 2023 15:03:06 +0100 +Subject: [PATCH] nvmem: imx-ocotp: Reverse MAC addresses on all i.MX derivates + +Not just i.MX8M, but all i.MX6/7 (and subtypes) need to reverse the +MAC address read from fuses. Exceptions are i.MX6SLL and i.MX7ULP which +do not support ethernet at all. + +Fixes: d0221a780cbc ("nvmem: imx-ocotp: add support for post processing") +Signed-off-by: Alexander Stein +Tested-by: Richard Leitner # imx6q +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-3-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/imx-ocotp.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/drivers/nvmem/imx-ocotp.c ++++ b/drivers/nvmem/imx-ocotp.c +@@ -97,7 +97,6 @@ struct ocotp_params { + unsigned int bank_address_words; + void (*set_timing)(struct ocotp_priv *priv); + struct ocotp_ctrl_reg ctrl; +- bool reverse_mac_address; + }; + + static int imx_ocotp_wait_for_busy(struct ocotp_priv *priv, u32 flags) +@@ -545,7 +544,6 @@ static const struct ocotp_params imx8mq_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, +- .reverse_mac_address = true, + }; + + static const struct ocotp_params imx8mm_params = { +@@ -553,7 +551,6 @@ static const struct ocotp_params imx8mm_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, +- .reverse_mac_address = true, + }; + + static const struct ocotp_params imx8mn_params = { +@@ -561,7 +558,6 @@ static const struct ocotp_params imx8mn_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, +- .reverse_mac_address = true, + }; + + static const struct ocotp_params imx8mp_params = { +@@ -569,7 +565,6 @@ static const struct ocotp_params imx8mp_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_8MP, +- .reverse_mac_address = true, + }; + + static const struct of_device_id imx_ocotp_dt_ids[] = { +@@ -624,8 +619,7 @@ static int imx_ocotp_probe(struct platfo + imx_ocotp_nvmem_config.size = 4 * priv->params->nregs; + imx_ocotp_nvmem_config.dev = dev; + imx_ocotp_nvmem_config.priv = priv; +- if (priv->params->reverse_mac_address) +- imx_ocotp_nvmem_config.layout = &imx_ocotp_layout; ++ imx_ocotp_nvmem_config.layout = &imx_ocotp_layout; + + priv->config = &imx_ocotp_nvmem_config; + diff --git a/target/linux/generic/backport-5.15/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch b/target/linux/generic/backport-5.15/813-v6.5-0003-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch similarity index 87% rename from target/linux/generic/backport-5.15/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch rename to target/linux/generic/backport-5.15/813-v6.5-0003-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch index 8749cad7f77..fb4d346a95a 100644 --- a/target/linux/generic/backport-5.15/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch +++ b/target/linux/generic/backport-5.15/813-v6.5-0003-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch @@ -1,5 +1,6 @@ +From 73bcd133c910bff3b6d3b3834d0d14be9444e90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 6 Apr 2023 12:46:16 +0200 +Date: Sun, 11 Jun 2023 15:03:08 +0100 Subject: [PATCH] nvmem: brcm_nvram: add .read_post_process() for MACs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -9,6 +10,9 @@ Content-Transfer-Encoding: 8bit 2. Calculate relative addresses based on index argument Signed-off-by: Rafał Miłecki +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-5-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman --- drivers/nvmem/Kconfig | 1 + drivers/nvmem/brcm_nvram.c | 28 ++++++++++++++++++++++++++++ diff --git a/target/linux/generic/backport-5.15/813-v6.5-0004-nvmem-rockchip-otp-Add-clks-and-reg_read-to-rockchip.patch b/target/linux/generic/backport-5.15/813-v6.5-0004-nvmem-rockchip-otp-Add-clks-and-reg_read-to-rockchip.patch new file mode 100644 index 00000000000..3b6e6e57f52 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0004-nvmem-rockchip-otp-Add-clks-and-reg_read-to-rockchip.patch @@ -0,0 +1,166 @@ +From 8dc61364164e79e44c07fa2ac0a7b6939f00d5db Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:13 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Add clks and reg_read to rockchip_data + +In preparation to support new Rockchip OTP memory devices with different +clock configurations and register layout, extend rockchip_data struct +with the related members: clks, num_clks, reg_read. + +Additionally, to avoid managing redundant driver data, drop num_clks +member from rockchip_otp struct and update all references to point to +the equivalent member in rockchip_data. + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-10-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 79 ++++++++++++++++++++++-------------- + 1 file changed, 49 insertions(+), 30 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -54,21 +54,19 @@ + + #define OTPC_TIMEOUT 10000 + ++struct rockchip_data { ++ int size; ++ const char * const *clks; ++ int num_clks; ++ nvmem_reg_read_t reg_read; ++}; ++ + struct rockchip_otp { + struct device *dev; + void __iomem *base; +- struct clk_bulk_data *clks; +- int num_clks; ++ struct clk_bulk_data *clks; + struct reset_control *rst; +-}; +- +-/* list of required clocks */ +-static const char * const rockchip_otp_clocks[] = { +- "otp", "apb_pclk", "phy", +-}; +- +-struct rockchip_data { +- int size; ++ const struct rockchip_data *data; + }; + + static int rockchip_otp_reset(struct rockchip_otp *otp) +@@ -132,29 +130,23 @@ static int rockchip_otp_ecc_enable(struc + return ret; + } + +-static int rockchip_otp_read(void *context, unsigned int offset, +- void *val, size_t bytes) ++static int px30_otp_read(void *context, unsigned int offset, ++ void *val, size_t bytes) + { + struct rockchip_otp *otp = context; + u8 *buf = val; +- int ret = 0; +- +- ret = clk_bulk_prepare_enable(otp->num_clks, otp->clks); +- if (ret < 0) { +- dev_err(otp->dev, "failed to prepare/enable clks\n"); +- return ret; +- } ++ int ret; + + ret = rockchip_otp_reset(otp); + if (ret) { + dev_err(otp->dev, "failed to reset otp phy\n"); +- goto disable_clks; ++ return ret; + } + + ret = rockchip_otp_ecc_enable(otp, false); + if (ret < 0) { + dev_err(otp->dev, "rockchip_otp_ecc_enable err\n"); +- goto disable_clks; ++ return ret; + } + + writel(OTPC_USE_USER | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL); +@@ -174,8 +166,28 @@ static int rockchip_otp_read(void *conte + + read_end: + writel(0x0 | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL); +-disable_clks: +- clk_bulk_disable_unprepare(otp->num_clks, otp->clks); ++ ++ return ret; ++} ++ ++static int rockchip_otp_read(void *context, unsigned int offset, ++ void *val, size_t bytes) ++{ ++ struct rockchip_otp *otp = context; ++ int ret; ++ ++ if (!otp->data || !otp->data->reg_read) ++ return -EINVAL; ++ ++ ret = clk_bulk_prepare_enable(otp->data->num_clks, otp->clks); ++ if (ret < 0) { ++ dev_err(otp->dev, "failed to prepare/enable clks\n"); ++ return ret; ++ } ++ ++ ret = otp->data->reg_read(context, offset, val, bytes); ++ ++ clk_bulk_disable_unprepare(otp->data->num_clks, otp->clks); + + return ret; + } +@@ -189,8 +201,15 @@ static struct nvmem_config otp_config = + .reg_read = rockchip_otp_read, + }; + ++static const char * const px30_otp_clocks[] = { ++ "otp", "apb_pclk", "phy", ++}; ++ + static const struct rockchip_data px30_data = { + .size = 0x40, ++ .clks = px30_otp_clocks, ++ .num_clks = ARRAY_SIZE(px30_otp_clocks), ++ .reg_read = px30_otp_read, + }; + + static const struct of_device_id rockchip_otp_match[] = { +@@ -225,21 +244,21 @@ static int rockchip_otp_probe(struct pla + if (!otp) + return -ENOMEM; + ++ otp->data = data; + otp->dev = dev; + otp->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(otp->base)) + return PTR_ERR(otp->base); + +- otp->num_clks = ARRAY_SIZE(rockchip_otp_clocks); +- otp->clks = devm_kcalloc(dev, otp->num_clks, +- sizeof(*otp->clks), GFP_KERNEL); ++ otp->clks = devm_kcalloc(dev, data->num_clks, sizeof(*otp->clks), ++ GFP_KERNEL); + if (!otp->clks) + return -ENOMEM; + +- for (i = 0; i < otp->num_clks; ++i) +- otp->clks[i].id = rockchip_otp_clocks[i]; ++ for (i = 0; i < data->num_clks; ++i) ++ otp->clks[i].id = data->clks[i]; + +- ret = devm_clk_bulk_get(dev, otp->num_clks, otp->clks); ++ ret = devm_clk_bulk_get(dev, data->num_clks, otp->clks); + if (ret) + return ret; + diff --git a/target/linux/generic/backport-5.15/813-v6.5-0005-nvmem-rockchip-otp-Generalize-rockchip_otp_wait_stat.patch b/target/linux/generic/backport-5.15/813-v6.5-0005-nvmem-rockchip-otp-Generalize-rockchip_otp_wait_stat.patch new file mode 100644 index 00000000000..b5b66cfc5ac --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0005-nvmem-rockchip-otp-Generalize-rockchip_otp_wait_stat.patch @@ -0,0 +1,62 @@ +From 30fd21cfb1e64ef20035559a8246f5fbf682c40e Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:14 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Generalize rockchip_otp_wait_status() + +In preparation to support additional Rockchip OTP memory devices with +different register layout, generalize rockchip_otp_wait_status() to +accept a new parameter for specifying the offset of the status register. + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-11-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -90,18 +90,19 @@ static int rockchip_otp_reset(struct roc + return 0; + } + +-static int rockchip_otp_wait_status(struct rockchip_otp *otp, u32 flag) ++static int rockchip_otp_wait_status(struct rockchip_otp *otp, ++ unsigned int reg, u32 flag) + { + u32 status = 0; + int ret; + +- ret = readl_poll_timeout_atomic(otp->base + OTPC_INT_STATUS, status, ++ ret = readl_poll_timeout_atomic(otp->base + reg, status, + (status & flag), 1, OTPC_TIMEOUT); + if (ret) + return ret; + + /* clean int status */ +- writel(flag, otp->base + OTPC_INT_STATUS); ++ writel(flag, otp->base + reg); + + return 0; + } +@@ -123,7 +124,7 @@ static int rockchip_otp_ecc_enable(struc + + writel(SBPI_ENABLE_MASK | SBPI_ENABLE, otp->base + OTPC_SBPI_CTRL); + +- ret = rockchip_otp_wait_status(otp, OTPC_SBPI_DONE); ++ ret = rockchip_otp_wait_status(otp, OTPC_INT_STATUS, OTPC_SBPI_DONE); + if (ret < 0) + dev_err(otp->dev, "timeout during ecc_enable\n"); + +@@ -156,7 +157,7 @@ static int px30_otp_read(void *context, + otp->base + OTPC_USER_ADDR); + writel(OTPC_USER_FSM_ENABLE | OTPC_USER_FSM_ENABLE_MASK, + otp->base + OTPC_USER_ENABLE); +- ret = rockchip_otp_wait_status(otp, OTPC_USER_DONE); ++ ret = rockchip_otp_wait_status(otp, OTPC_INT_STATUS, OTPC_USER_DONE); + if (ret < 0) { + dev_err(otp->dev, "timeout during read setup\n"); + goto read_end; diff --git a/target/linux/generic/backport-5.15/813-v6.5-0006-nvmem-rockchip-otp-Use-devm_reset_control_array_get_.patch b/target/linux/generic/backport-5.15/813-v6.5-0006-nvmem-rockchip-otp-Use-devm_reset_control_array_get_.patch new file mode 100644 index 00000000000..3a17479d959 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0006-nvmem-rockchip-otp-Use-devm_reset_control_array_get_.patch @@ -0,0 +1,31 @@ +From d325c9dd2b6e94040ca722ddcadcd6af358dd2be Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:15 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Use + devm_reset_control_array_get_exclusive() + +In preparation to support new Rockchip OTP memory devices having +specific reset configurations, switch devm_reset_control_get() to +devm_reset_control_array_get_exclusive(). + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-12-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -263,7 +263,7 @@ static int rockchip_otp_probe(struct pla + if (ret) + return ret; + +- otp->rst = devm_reset_control_get(dev, "phy"); ++ otp->rst = devm_reset_control_array_get_exclusive(dev); + if (IS_ERR(otp->rst)) + return PTR_ERR(otp->rst); + diff --git a/target/linux/generic/backport-5.15/813-v6.5-0007-nvmem-rockchip-otp-Improve-probe-error-handling.patch b/target/linux/generic/backport-5.15/813-v6.5-0007-nvmem-rockchip-otp-Improve-probe-error-handling.patch new file mode 100644 index 00000000000..37cb927b100 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0007-nvmem-rockchip-otp-Improve-probe-error-handling.patch @@ -0,0 +1,71 @@ +From 912517345b867a69542dc9f5c2cc3e9d8beaccf5 Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:16 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Improve probe error handling + +Enhance error handling in the probe function by making use of +dev_err_probe(), which ensures the error code is always printed, in +addition to the specified error message. + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-13-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -235,10 +235,8 @@ static int rockchip_otp_probe(struct pla + int ret, i; + + data = of_device_get_match_data(dev); +- if (!data) { +- dev_err(dev, "failed to get match data\n"); +- return -EINVAL; +- } ++ if (!data) ++ return dev_err_probe(dev, -EINVAL, "failed to get match data\n"); + + otp = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_otp), + GFP_KERNEL); +@@ -249,7 +247,8 @@ static int rockchip_otp_probe(struct pla + otp->dev = dev; + otp->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(otp->base)) +- return PTR_ERR(otp->base); ++ return dev_err_probe(dev, PTR_ERR(otp->base), ++ "failed to ioremap resource\n"); + + otp->clks = devm_kcalloc(dev, data->num_clks, sizeof(*otp->clks), + GFP_KERNEL); +@@ -261,18 +260,22 @@ static int rockchip_otp_probe(struct pla + + ret = devm_clk_bulk_get(dev, data->num_clks, otp->clks); + if (ret) +- return ret; ++ return dev_err_probe(dev, ret, "failed to get clocks\n"); + + otp->rst = devm_reset_control_array_get_exclusive(dev); + if (IS_ERR(otp->rst)) +- return PTR_ERR(otp->rst); ++ return dev_err_probe(dev, PTR_ERR(otp->rst), ++ "failed to get resets\n"); + + otp_config.size = data->size; + otp_config.priv = otp; + otp_config.dev = dev; +- nvmem = devm_nvmem_register(dev, &otp_config); + +- return PTR_ERR_OR_ZERO(nvmem); ++ nvmem = devm_nvmem_register(dev, &otp_config); ++ if (IS_ERR(nvmem)) ++ return dev_err_probe(dev, PTR_ERR(nvmem), ++ "failed to register nvmem device\n"); ++ return 0; + } + + static struct platform_driver rockchip_otp_driver = { diff --git a/target/linux/generic/backport-5.15/813-v6.5-0008-nvmem-rockchip-otp-Add-support-for-RK3588.patch b/target/linux/generic/backport-5.15/813-v6.5-0008-nvmem-rockchip-otp-Add-support-for-RK3588.patch new file mode 100644 index 00000000000..c1e2231c9ec --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0008-nvmem-rockchip-otp-Add-support-for-RK3588.patch @@ -0,0 +1,129 @@ +From 8ab099fafbbc8c9607c399d21a774784a6cb8b45 Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:17 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Add support for RK3588 + +Add support for the OTP memory device found on the Rockchip RK3588 SoC. + +While here, remove the unnecessary 'void *' casts in the OF device ID +table. + +Co-developed-by: Finley Xiao +Signed-off-by: Finley Xiao +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-14-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 78 +++++++++++++++++++++++++++++++++++- + 1 file changed, 76 insertions(+), 2 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -54,6 +54,19 @@ + + #define OTPC_TIMEOUT 10000 + ++/* RK3588 Register */ ++#define RK3588_OTPC_AUTO_CTRL 0x04 ++#define RK3588_OTPC_AUTO_EN 0x08 ++#define RK3588_OTPC_INT_ST 0x84 ++#define RK3588_OTPC_DOUT0 0x20 ++#define RK3588_NO_SECURE_OFFSET 0x300 ++#define RK3588_NBYTES 4 ++#define RK3588_BURST_NUM 1 ++#define RK3588_BURST_SHIFT 8 ++#define RK3588_ADDR_SHIFT 16 ++#define RK3588_AUTO_EN BIT(0) ++#define RK3588_RD_DONE BIT(1) ++ + struct rockchip_data { + int size; + const char * const *clks; +@@ -171,6 +184,52 @@ read_end: + return ret; + } + ++static int rk3588_otp_read(void *context, unsigned int offset, ++ void *val, size_t bytes) ++{ ++ struct rockchip_otp *otp = context; ++ unsigned int addr_start, addr_end, addr_len; ++ int ret, i = 0; ++ u32 data; ++ u8 *buf; ++ ++ addr_start = round_down(offset, RK3588_NBYTES) / RK3588_NBYTES; ++ addr_end = round_up(offset + bytes, RK3588_NBYTES) / RK3588_NBYTES; ++ addr_len = addr_end - addr_start; ++ addr_start += RK3588_NO_SECURE_OFFSET; ++ ++ buf = kzalloc(array_size(addr_len, RK3588_NBYTES), GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ while (addr_len--) { ++ writel((addr_start << RK3588_ADDR_SHIFT) | ++ (RK3588_BURST_NUM << RK3588_BURST_SHIFT), ++ otp->base + RK3588_OTPC_AUTO_CTRL); ++ writel(RK3588_AUTO_EN, otp->base + RK3588_OTPC_AUTO_EN); ++ ++ ret = rockchip_otp_wait_status(otp, RK3588_OTPC_INT_ST, ++ RK3588_RD_DONE); ++ if (ret < 0) { ++ dev_err(otp->dev, "timeout during read setup\n"); ++ goto read_end; ++ } ++ ++ data = readl(otp->base + RK3588_OTPC_DOUT0); ++ memcpy(&buf[i], &data, RK3588_NBYTES); ++ ++ i += RK3588_NBYTES; ++ addr_start++; ++ } ++ ++ memcpy(val, buf + offset % RK3588_NBYTES, bytes); ++ ++read_end: ++ kfree(buf); ++ ++ return ret; ++} ++ + static int rockchip_otp_read(void *context, unsigned int offset, + void *val, size_t bytes) + { +@@ -213,14 +272,29 @@ static const struct rockchip_data px30_d + .reg_read = px30_otp_read, + }; + ++static const char * const rk3588_otp_clocks[] = { ++ "otp", "apb_pclk", "phy", "arb", ++}; ++ ++static const struct rockchip_data rk3588_data = { ++ .size = 0x400, ++ .clks = rk3588_otp_clocks, ++ .num_clks = ARRAY_SIZE(rk3588_otp_clocks), ++ .reg_read = rk3588_otp_read, ++}; ++ + static const struct of_device_id rockchip_otp_match[] = { + { + .compatible = "rockchip,px30-otp", +- .data = (void *)&px30_data, ++ .data = &px30_data, + }, + { + .compatible = "rockchip,rk3308-otp", +- .data = (void *)&px30_data, ++ .data = &px30_data, ++ }, ++ { ++ .compatible = "rockchip,rk3588-otp", ++ .data = &rk3588_data, + }, + { /* sentinel */ }, + }; diff --git a/target/linux/generic/backport-5.15/813-v6.5-0009-nvmem-zynqmp-Switch-xilinx.com-emails-to-amd.com.patch b/target/linux/generic/backport-5.15/813-v6.5-0009-nvmem-zynqmp-Switch-xilinx.com-emails-to-amd.com.patch new file mode 100644 index 00000000000..220e3e9a05f --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0009-nvmem-zynqmp-Switch-xilinx.com-emails-to-amd.com.patch @@ -0,0 +1,26 @@ +From 9734408969e978a1c0d5d752be63dd638288e374 Mon Sep 17 00:00:00 2001 +From: Michal Simek +Date: Sun, 11 Jun 2023 15:03:23 +0100 +Subject: [PATCH] nvmem: zynqmp: Switch @xilinx.com emails to @amd.com + +@xilinx.com is still working but better to switch to new amd.com after +AMD/Xilinx acquisition. + +Signed-off-by: Michal Simek +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-20-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/zynqmp_nvmem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/zynqmp_nvmem.c ++++ b/drivers/nvmem/zynqmp_nvmem.c +@@ -76,6 +76,6 @@ static struct platform_driver zynqmp_nvm + + module_platform_driver(zynqmp_nvmem_driver); + +-MODULE_AUTHOR("Michal Simek , Nava kishore Manne "); ++MODULE_AUTHOR("Michal Simek , Nava kishore Manne "); + MODULE_DESCRIPTION("ZynqMP NVMEM driver"); + MODULE_LICENSE("GPL"); diff --git a/target/linux/generic/backport-5.15/813-v6.5-0010-nvmem-imx-support-i.MX93-OCOTP.patch b/target/linux/generic/backport-5.15/813-v6.5-0010-nvmem-imx-support-i.MX93-OCOTP.patch new file mode 100644 index 00000000000..f8e6be42416 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0010-nvmem-imx-support-i.MX93-OCOTP.patch @@ -0,0 +1,230 @@ +From 22e9e6fcfb5042cb6d6c7874c459b034800092f1 Mon Sep 17 00:00:00 2001 +From: Peng Fan +Date: Sun, 11 Jun 2023 15:03:25 +0100 +Subject: [PATCH] nvmem: imx: support i.MX93 OCOTP + +Add i.MX93 OCOTP support. i.MX93 OCOTP has two parts: Fuse shadow +block(fsb) and fuse managed by ELE. The FSB part could be directly +accessed with MMIO, the ELE could only be accessed with ELE API. + +Currently the ELE API is not ready, so NULL function callback is used, +but it was tested with downstream ELE API. + +Signed-off-by: Peng Fan +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-22-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/Kconfig | 9 ++ + drivers/nvmem/Makefile | 2 + + drivers/nvmem/imx-ocotp-ele.c | 175 ++++++++++++++++++++++++++++++++++ + 3 files changed, 186 insertions(+) + create mode 100644 drivers/nvmem/imx-ocotp-ele.c + +--- a/drivers/nvmem/Kconfig ++++ b/drivers/nvmem/Kconfig +@@ -83,6 +83,15 @@ config NVMEM_IMX_OCOTP + This driver can also be built as a module. If so, the module + will be called nvmem-imx-ocotp. + ++config NVMEM_IMX_OCOTP_ELE ++ tristate "i.MX On-Chip OTP Controller support" ++ depends on ARCH_MXC || COMPILE_TEST ++ depends on HAS_IOMEM ++ depends on OF ++ help ++ This is a driver for the On-Chip OTP Controller (OCOTP) ++ available on i.MX SoCs which has ELE. ++ + config NVMEM_IMX_OCOTP_SCU + tristate "i.MX8 SCU On-Chip OTP Controller support" + depends on IMX_SCU +--- a/drivers/nvmem/Makefile ++++ b/drivers/nvmem/Makefile +@@ -18,6 +18,8 @@ obj-$(CONFIG_NVMEM_IMX_IIM) += nvmem-im + nvmem-imx-iim-y := imx-iim.o + obj-$(CONFIG_NVMEM_IMX_OCOTP) += nvmem-imx-ocotp.o + nvmem-imx-ocotp-y := imx-ocotp.o ++obj-$(CONFIG_NVMEM_IMX_OCOTP_ELE) += nvmem-imx-ocotp-ele.o ++nvmem-imx-ocotp-ele-y := imx-ocotp-ele.o + obj-$(CONFIG_NVMEM_IMX_OCOTP_SCU) += nvmem-imx-ocotp-scu.o + nvmem-imx-ocotp-scu-y := imx-ocotp-scu.o + obj-$(CONFIG_NVMEM_JZ4780_EFUSE) += nvmem_jz4780_efuse.o +--- /dev/null ++++ b/drivers/nvmem/imx-ocotp-ele.c +@@ -0,0 +1,175 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++/* ++ * i.MX9 OCOTP fusebox driver ++ * ++ * Copyright 2023 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++enum fuse_type { ++ FUSE_FSB = 1, ++ FUSE_ELE = 2, ++ FUSE_INVALID = -1 ++}; ++ ++struct ocotp_map_entry { ++ u32 start; /* start word */ ++ u32 num; /* num words */ ++ enum fuse_type type; ++}; ++ ++struct ocotp_devtype_data { ++ u32 reg_off; ++ char *name; ++ u32 size; ++ u32 num_entry; ++ u32 flag; ++ nvmem_reg_read_t reg_read; ++ struct ocotp_map_entry entry[]; ++}; ++ ++struct imx_ocotp_priv { ++ struct device *dev; ++ void __iomem *base; ++ struct nvmem_config config; ++ struct mutex lock; ++ const struct ocotp_devtype_data *data; ++}; ++ ++static enum fuse_type imx_ocotp_fuse_type(void *context, u32 index) ++{ ++ struct imx_ocotp_priv *priv = context; ++ const struct ocotp_devtype_data *data = priv->data; ++ u32 start, end; ++ int i; ++ ++ for (i = 0; i < data->num_entry; i++) { ++ start = data->entry[i].start; ++ end = data->entry[i].start + data->entry[i].num; ++ ++ if (index >= start && index < end) ++ return data->entry[i].type; ++ } ++ ++ return FUSE_INVALID; ++} ++ ++static int imx_ocotp_reg_read(void *context, unsigned int offset, void *val, size_t bytes) ++{ ++ struct imx_ocotp_priv *priv = context; ++ void __iomem *reg = priv->base + priv->data->reg_off; ++ u32 count, index, num_bytes; ++ enum fuse_type type; ++ u32 *buf; ++ void *p; ++ int i; ++ ++ index = offset; ++ num_bytes = round_up(bytes, 4); ++ count = num_bytes >> 2; ++ ++ if (count > ((priv->data->size >> 2) - index)) ++ count = (priv->data->size >> 2) - index; ++ ++ p = kzalloc(num_bytes, GFP_KERNEL); ++ if (!p) ++ return -ENOMEM; ++ ++ mutex_lock(&priv->lock); ++ ++ buf = p; ++ ++ for (i = index; i < (index + count); i++) { ++ type = imx_ocotp_fuse_type(context, i); ++ if (type == FUSE_INVALID || type == FUSE_ELE) { ++ *buf++ = 0; ++ continue; ++ } ++ ++ *buf++ = readl_relaxed(reg + (i << 2)); ++ } ++ ++ memcpy(val, (u8 *)p, bytes); ++ ++ mutex_unlock(&priv->lock); ++ ++ kfree(p); ++ ++ return 0; ++}; ++ ++static int imx_ele_ocotp_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct imx_ocotp_priv *priv; ++ struct nvmem_device *nvmem; ++ ++ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ priv->data = of_device_get_match_data(dev); ++ ++ priv->base = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(priv->base)) ++ return PTR_ERR(priv->base); ++ ++ priv->config.dev = dev; ++ priv->config.name = "ELE-OCOTP"; ++ priv->config.id = NVMEM_DEVID_AUTO; ++ priv->config.owner = THIS_MODULE; ++ priv->config.size = priv->data->size; ++ priv->config.reg_read = priv->data->reg_read; ++ priv->config.word_size = 4; ++ priv->config.stride = 1; ++ priv->config.priv = priv; ++ priv->config.read_only = true; ++ mutex_init(&priv->lock); ++ ++ nvmem = devm_nvmem_register(dev, &priv->config); ++ if (IS_ERR(nvmem)) ++ return PTR_ERR(nvmem); ++ ++ return 0; ++} ++ ++static const struct ocotp_devtype_data imx93_ocotp_data = { ++ .reg_off = 0x8000, ++ .reg_read = imx_ocotp_reg_read, ++ .size = 2048, ++ .num_entry = 6, ++ .entry = { ++ { 0, 52, FUSE_FSB }, ++ { 63, 1, FUSE_ELE}, ++ { 128, 16, FUSE_ELE }, ++ { 182, 1, FUSE_ELE }, ++ { 188, 1, FUSE_ELE }, ++ { 312, 200, FUSE_FSB } ++ }, ++}; ++ ++static const struct of_device_id imx_ele_ocotp_dt_ids[] = { ++ { .compatible = "fsl,imx93-ocotp", .data = &imx93_ocotp_data, }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, imx_ele_ocotp_dt_ids); ++ ++static struct platform_driver imx_ele_ocotp_driver = { ++ .driver = { ++ .name = "imx_ele_ocotp", ++ .of_match_table = imx_ele_ocotp_dt_ids, ++ }, ++ .probe = imx_ele_ocotp_probe, ++}; ++module_platform_driver(imx_ele_ocotp_driver); ++ ++MODULE_DESCRIPTION("i.MX OCOTP/ELE driver"); ++MODULE_AUTHOR("Peng Fan "); ++MODULE_LICENSE("GPL"); diff --git a/target/linux/generic/backport-5.15/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch b/target/linux/generic/backport-5.15/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch new file mode 100644 index 00000000000..59b2f9fa2c6 --- /dev/null +++ b/target/linux/generic/backport-5.15/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch @@ -0,0 +1,96 @@ +From 27f699e578b1a72df89dfa3bc42e093a01dc8d10 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sun, 11 Jun 2023 15:03:29 +0100 +Subject: [PATCH] nvmem: core: add support for fixed cells *layout* +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This adds support for the "fixed-layout" NVMEM layout binding. It allows +defining NVMEM cells in a layout DT node named "nvmem-layout". + +While NVMEM subsystem supports layout drivers it has been discussed that +"fixed-layout" may actually be supperted internally. It's because: +1. It's a very basic layout +2. It allows sharing code with legacy syntax parsing +3. It's safer for soc_device_match() due to -EPROBE_DEFER +4. This will make the syntax transition easier + +Signed-off-by: Rafał Miłecki +Reviewed-by: Michael Walle +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-26-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/core.c | 32 +++++++++++++++++++++++++++++--- + 1 file changed, 29 insertions(+), 3 deletions(-) + +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -696,7 +696,7 @@ static int nvmem_validate_keepouts(struc + return 0; + } + +-static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) ++static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) + { + struct nvmem_layout *layout = nvmem->layout; + struct device *dev = &nvmem->dev; +@@ -704,7 +704,7 @@ static int nvmem_add_cells_from_of(struc + const __be32 *addr; + int len, ret; + +- for_each_child_of_node(dev->of_node, child) { ++ for_each_child_of_node(np, child) { + struct nvmem_cell_info info = {0}; + + addr = of_get_property(child, "reg", &len); +@@ -742,6 +742,28 @@ static int nvmem_add_cells_from_of(struc + return 0; + } + ++static int nvmem_add_cells_from_legacy_of(struct nvmem_device *nvmem) ++{ ++ return nvmem_add_cells_from_dt(nvmem, nvmem->dev.of_node); ++} ++ ++static int nvmem_add_cells_from_fixed_layout(struct nvmem_device *nvmem) ++{ ++ struct device_node *layout_np; ++ int err = 0; ++ ++ layout_np = of_nvmem_layout_get_container(nvmem); ++ if (!layout_np) ++ return 0; ++ ++ if (of_device_is_compatible(layout_np, "fixed-layout")) ++ err = nvmem_add_cells_from_dt(nvmem, layout_np); ++ ++ of_node_put(layout_np); ++ ++ return err; ++} ++ + int __nvmem_layout_register(struct nvmem_layout *layout, struct module *owner) + { + layout->owner = owner; +@@ -972,7 +994,7 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + +- rval = nvmem_add_cells_from_of(nvmem); ++ rval = nvmem_add_cells_from_legacy_of(nvmem); + if (rval) + goto err_remove_cells; + +@@ -982,6 +1004,10 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + ++ rval = nvmem_add_cells_from_fixed_layout(nvmem); ++ if (rval) ++ goto err_remove_cells; ++ + rval = nvmem_add_cells_from_layout(nvmem); + if (rval) + goto err_remove_cells; diff --git a/target/linux/generic/backport-5.15/830-v6.2-ata-ahci-fix-enum-constants-for-gcc-13.patch b/target/linux/generic/backport-5.15/830-v6.2-ata-ahci-fix-enum-constants-for-gcc-13.patch deleted file mode 100644 index 0d81d24e09c..00000000000 --- a/target/linux/generic/backport-5.15/830-v6.2-ata-ahci-fix-enum-constants-for-gcc-13.patch +++ /dev/null @@ -1,348 +0,0 @@ -From f07788079f515ca4a681c5f595bdad19cfbd7b1d Mon Sep 17 00:00:00 2001 -From: Arnd Bergmann -Date: Sat, 3 Dec 2022 11:54:25 +0100 -Subject: [PATCH] ata: ahci: fix enum constants for gcc-13 - -gcc-13 slightly changes the type of constant expressions that are defined -in an enum, which triggers a compile time sanity check in libata: - -linux/drivers/ata/libahci.c: In function 'ahci_led_store': -linux/include/linux/compiler_types.h:357:45: error: call to '__compiletime_assert_302' declared with attribute error: BUILD_BUG_ON failed: sizeof(_s) > sizeof(long) -357 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) - -The new behavior is that sizeof() returns the same value for the -constant as it does for the enum type, which is generally more sensible -and consistent. - -The problem in libata is that it contains a single enum definition for -lots of unrelated constants, some of which are large positive (unsigned) -integers like 0xffffffff, while others like (1<<31) are interpreted as -negative integers, and this forces the enum type to become 64 bit wide -even though most constants would still fit into a signed 32-bit 'int'. - -Fix this by changing the entire enum definition to use BIT(x) in place -of (1< -Cc: linux-ide@vger.kernel.org -Cc: Damien Le Moal -Cc: stable@vger.kernel.org -Cc: Randy Dunlap -Signed-off-by: Arnd Bergmann -Tested-by: Luis Machado -Signed-off-by: Damien Le Moal ---- - drivers/ata/ahci.h | 245 +++++++++++++++++++++++---------------------- - 1 file changed, 123 insertions(+), 122 deletions(-) - ---- a/drivers/ata/ahci.h -+++ b/drivers/ata/ahci.h -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - /* Enclosure Management Control */ - #define EM_CTRL_MSG_TYPE 0x000f0000 -@@ -54,12 +55,12 @@ enum { - AHCI_PORT_PRIV_FBS_DMA_SZ = AHCI_CMD_SLOT_SZ + - AHCI_CMD_TBL_AR_SZ + - (AHCI_RX_FIS_SZ * 16), -- AHCI_IRQ_ON_SG = (1 << 31), -- AHCI_CMD_ATAPI = (1 << 5), -- AHCI_CMD_WRITE = (1 << 6), -- AHCI_CMD_PREFETCH = (1 << 7), -- AHCI_CMD_RESET = (1 << 8), -- AHCI_CMD_CLR_BUSY = (1 << 10), -+ AHCI_IRQ_ON_SG = BIT(31), -+ AHCI_CMD_ATAPI = BIT(5), -+ AHCI_CMD_WRITE = BIT(6), -+ AHCI_CMD_PREFETCH = BIT(7), -+ AHCI_CMD_RESET = BIT(8), -+ AHCI_CMD_CLR_BUSY = BIT(10), - - RX_FIS_PIO_SETUP = 0x20, /* offset of PIO Setup FIS data */ - RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */ -@@ -77,37 +78,37 @@ enum { - HOST_CAP2 = 0x24, /* host capabilities, extended */ - - /* HOST_CTL bits */ -- HOST_RESET = (1 << 0), /* reset controller; self-clear */ -- HOST_IRQ_EN = (1 << 1), /* global IRQ enable */ -- HOST_MRSM = (1 << 2), /* MSI Revert to Single Message */ -- HOST_AHCI_EN = (1 << 31), /* AHCI enabled */ -+ HOST_RESET = BIT(0), /* reset controller; self-clear */ -+ HOST_IRQ_EN = BIT(1), /* global IRQ enable */ -+ HOST_MRSM = BIT(2), /* MSI Revert to Single Message */ -+ HOST_AHCI_EN = BIT(31), /* AHCI enabled */ - - /* HOST_CAP bits */ -- HOST_CAP_SXS = (1 << 5), /* Supports External SATA */ -- HOST_CAP_EMS = (1 << 6), /* Enclosure Management support */ -- HOST_CAP_CCC = (1 << 7), /* Command Completion Coalescing */ -- HOST_CAP_PART = (1 << 13), /* Partial state capable */ -- HOST_CAP_SSC = (1 << 14), /* Slumber state capable */ -- HOST_CAP_PIO_MULTI = (1 << 15), /* PIO multiple DRQ support */ -- HOST_CAP_FBS = (1 << 16), /* FIS-based switching support */ -- HOST_CAP_PMP = (1 << 17), /* Port Multiplier support */ -- HOST_CAP_ONLY = (1 << 18), /* Supports AHCI mode only */ -- HOST_CAP_CLO = (1 << 24), /* Command List Override support */ -- HOST_CAP_LED = (1 << 25), /* Supports activity LED */ -- HOST_CAP_ALPM = (1 << 26), /* Aggressive Link PM support */ -- HOST_CAP_SSS = (1 << 27), /* Staggered Spin-up */ -- HOST_CAP_MPS = (1 << 28), /* Mechanical presence switch */ -- HOST_CAP_SNTF = (1 << 29), /* SNotification register */ -- HOST_CAP_NCQ = (1 << 30), /* Native Command Queueing */ -- HOST_CAP_64 = (1 << 31), /* PCI DAC (64-bit DMA) support */ -+ HOST_CAP_SXS = BIT(5), /* Supports External SATA */ -+ HOST_CAP_EMS = BIT(6), /* Enclosure Management support */ -+ HOST_CAP_CCC = BIT(7), /* Command Completion Coalescing */ -+ HOST_CAP_PART = BIT(13), /* Partial state capable */ -+ HOST_CAP_SSC = BIT(14), /* Slumber state capable */ -+ HOST_CAP_PIO_MULTI = BIT(15), /* PIO multiple DRQ support */ -+ HOST_CAP_FBS = BIT(16), /* FIS-based switching support */ -+ HOST_CAP_PMP = BIT(17), /* Port Multiplier support */ -+ HOST_CAP_ONLY = BIT(18), /* Supports AHCI mode only */ -+ HOST_CAP_CLO = BIT(24), /* Command List Override support */ -+ HOST_CAP_LED = BIT(25), /* Supports activity LED */ -+ HOST_CAP_ALPM = BIT(26), /* Aggressive Link PM support */ -+ HOST_CAP_SSS = BIT(27), /* Staggered Spin-up */ -+ HOST_CAP_MPS = BIT(28), /* Mechanical presence switch */ -+ HOST_CAP_SNTF = BIT(29), /* SNotification register */ -+ HOST_CAP_NCQ = BIT(30), /* Native Command Queueing */ -+ HOST_CAP_64 = BIT(31), /* PCI DAC (64-bit DMA) support */ - - /* HOST_CAP2 bits */ -- HOST_CAP2_BOH = (1 << 0), /* BIOS/OS handoff supported */ -- HOST_CAP2_NVMHCI = (1 << 1), /* NVMHCI supported */ -- HOST_CAP2_APST = (1 << 2), /* Automatic partial to slumber */ -- HOST_CAP2_SDS = (1 << 3), /* Support device sleep */ -- HOST_CAP2_SADM = (1 << 4), /* Support aggressive DevSlp */ -- HOST_CAP2_DESO = (1 << 5), /* DevSlp from slumber only */ -+ HOST_CAP2_BOH = BIT(0), /* BIOS/OS handoff supported */ -+ HOST_CAP2_NVMHCI = BIT(1), /* NVMHCI supported */ -+ HOST_CAP2_APST = BIT(2), /* Automatic partial to slumber */ -+ HOST_CAP2_SDS = BIT(3), /* Support device sleep */ -+ HOST_CAP2_SADM = BIT(4), /* Support aggressive DevSlp */ -+ HOST_CAP2_DESO = BIT(5), /* DevSlp from slumber only */ - - /* registers for each SATA port */ - PORT_LST_ADDR = 0x00, /* command list DMA addr */ -@@ -129,24 +130,24 @@ enum { - PORT_DEVSLP = 0x44, /* device sleep */ - - /* PORT_IRQ_{STAT,MASK} bits */ -- PORT_IRQ_COLD_PRES = (1 << 31), /* cold presence detect */ -- PORT_IRQ_TF_ERR = (1 << 30), /* task file error */ -- PORT_IRQ_HBUS_ERR = (1 << 29), /* host bus fatal error */ -- PORT_IRQ_HBUS_DATA_ERR = (1 << 28), /* host bus data error */ -- PORT_IRQ_IF_ERR = (1 << 27), /* interface fatal error */ -- PORT_IRQ_IF_NONFATAL = (1 << 26), /* interface non-fatal error */ -- PORT_IRQ_OVERFLOW = (1 << 24), /* xfer exhausted available S/G */ -- PORT_IRQ_BAD_PMP = (1 << 23), /* incorrect port multiplier */ -- -- PORT_IRQ_PHYRDY = (1 << 22), /* PhyRdy changed */ -- PORT_IRQ_DEV_ILCK = (1 << 7), /* device interlock */ -- PORT_IRQ_CONNECT = (1 << 6), /* port connect change status */ -- PORT_IRQ_SG_DONE = (1 << 5), /* descriptor processed */ -- PORT_IRQ_UNK_FIS = (1 << 4), /* unknown FIS rx'd */ -- PORT_IRQ_SDB_FIS = (1 << 3), /* Set Device Bits FIS rx'd */ -- PORT_IRQ_DMAS_FIS = (1 << 2), /* DMA Setup FIS rx'd */ -- PORT_IRQ_PIOS_FIS = (1 << 1), /* PIO Setup FIS rx'd */ -- PORT_IRQ_D2H_REG_FIS = (1 << 0), /* D2H Register FIS rx'd */ -+ PORT_IRQ_COLD_PRES = BIT(31), /* cold presence detect */ -+ PORT_IRQ_TF_ERR = BIT(30), /* task file error */ -+ PORT_IRQ_HBUS_ERR = BIT(29), /* host bus fatal error */ -+ PORT_IRQ_HBUS_DATA_ERR = BIT(28), /* host bus data error */ -+ PORT_IRQ_IF_ERR = BIT(27), /* interface fatal error */ -+ PORT_IRQ_IF_NONFATAL = BIT(26), /* interface non-fatal error */ -+ PORT_IRQ_OVERFLOW = BIT(24), /* xfer exhausted available S/G */ -+ PORT_IRQ_BAD_PMP = BIT(23), /* incorrect port multiplier */ -+ -+ PORT_IRQ_PHYRDY = BIT(22), /* PhyRdy changed */ -+ PORT_IRQ_DEV_ILCK = BIT(7), /* device interlock */ -+ PORT_IRQ_CONNECT = BIT(6), /* port connect change status */ -+ PORT_IRQ_SG_DONE = BIT(5), /* descriptor processed */ -+ PORT_IRQ_UNK_FIS = BIT(4), /* unknown FIS rx'd */ -+ PORT_IRQ_SDB_FIS = BIT(3), /* Set Device Bits FIS rx'd */ -+ PORT_IRQ_DMAS_FIS = BIT(2), /* DMA Setup FIS rx'd */ -+ PORT_IRQ_PIOS_FIS = BIT(1), /* PIO Setup FIS rx'd */ -+ PORT_IRQ_D2H_REG_FIS = BIT(0), /* D2H Register FIS rx'd */ - - PORT_IRQ_FREEZE = PORT_IRQ_HBUS_ERR | - PORT_IRQ_IF_ERR | -@@ -162,34 +163,34 @@ enum { - PORT_IRQ_PIOS_FIS | PORT_IRQ_D2H_REG_FIS, - - /* PORT_CMD bits */ -- PORT_CMD_ASP = (1 << 27), /* Aggressive Slumber/Partial */ -- PORT_CMD_ALPE = (1 << 26), /* Aggressive Link PM enable */ -- PORT_CMD_ATAPI = (1 << 24), /* Device is ATAPI */ -- PORT_CMD_FBSCP = (1 << 22), /* FBS Capable Port */ -- PORT_CMD_ESP = (1 << 21), /* External Sata Port */ -- PORT_CMD_HPCP = (1 << 18), /* HotPlug Capable Port */ -- PORT_CMD_PMP = (1 << 17), /* PMP attached */ -- PORT_CMD_LIST_ON = (1 << 15), /* cmd list DMA engine running */ -- PORT_CMD_FIS_ON = (1 << 14), /* FIS DMA engine running */ -- PORT_CMD_FIS_RX = (1 << 4), /* Enable FIS receive DMA engine */ -- PORT_CMD_CLO = (1 << 3), /* Command list override */ -- PORT_CMD_POWER_ON = (1 << 2), /* Power up device */ -- PORT_CMD_SPIN_UP = (1 << 1), /* Spin up device */ -- PORT_CMD_START = (1 << 0), /* Enable port DMA engine */ -- -- PORT_CMD_ICC_MASK = (0xf << 28), /* i/f ICC state mask */ -- PORT_CMD_ICC_ACTIVE = (0x1 << 28), /* Put i/f in active state */ -- PORT_CMD_ICC_PARTIAL = (0x2 << 28), /* Put i/f in partial state */ -- PORT_CMD_ICC_SLUMBER = (0x6 << 28), /* Put i/f in slumber state */ -+ PORT_CMD_ASP = BIT(27), /* Aggressive Slumber/Partial */ -+ PORT_CMD_ALPE = BIT(26), /* Aggressive Link PM enable */ -+ PORT_CMD_ATAPI = BIT(24), /* Device is ATAPI */ -+ PORT_CMD_FBSCP = BIT(22), /* FBS Capable Port */ -+ PORT_CMD_ESP = BIT(21), /* External Sata Port */ -+ PORT_CMD_HPCP = BIT(18), /* HotPlug Capable Port */ -+ PORT_CMD_PMP = BIT(17), /* PMP attached */ -+ PORT_CMD_LIST_ON = BIT(15), /* cmd list DMA engine running */ -+ PORT_CMD_FIS_ON = BIT(14), /* FIS DMA engine running */ -+ PORT_CMD_FIS_RX = BIT(4), /* Enable FIS receive DMA engine */ -+ PORT_CMD_CLO = BIT(3), /* Command list override */ -+ PORT_CMD_POWER_ON = BIT(2), /* Power up device */ -+ PORT_CMD_SPIN_UP = BIT(1), /* Spin up device */ -+ PORT_CMD_START = BIT(0), /* Enable port DMA engine */ -+ -+ PORT_CMD_ICC_MASK = (0xfu << 28), /* i/f ICC state mask */ -+ PORT_CMD_ICC_ACTIVE = (0x1u << 28), /* Put i/f in active state */ -+ PORT_CMD_ICC_PARTIAL = (0x2u << 28), /* Put i/f in partial state */ -+ PORT_CMD_ICC_SLUMBER = (0x6u << 28), /* Put i/f in slumber state */ - - /* PORT_FBS bits */ - PORT_FBS_DWE_OFFSET = 16, /* FBS device with error offset */ - PORT_FBS_ADO_OFFSET = 12, /* FBS active dev optimization offset */ - PORT_FBS_DEV_OFFSET = 8, /* FBS device to issue offset */ - PORT_FBS_DEV_MASK = (0xf << PORT_FBS_DEV_OFFSET), /* FBS.DEV */ -- PORT_FBS_SDE = (1 << 2), /* FBS single device error */ -- PORT_FBS_DEC = (1 << 1), /* FBS device error clear */ -- PORT_FBS_EN = (1 << 0), /* Enable FBS */ -+ PORT_FBS_SDE = BIT(2), /* FBS single device error */ -+ PORT_FBS_DEC = BIT(1), /* FBS device error clear */ -+ PORT_FBS_EN = BIT(0), /* Enable FBS */ - - /* PORT_DEVSLP bits */ - PORT_DEVSLP_DM_OFFSET = 25, /* DITO multiplier offset */ -@@ -197,50 +198,50 @@ enum { - PORT_DEVSLP_DITO_OFFSET = 15, /* DITO offset */ - PORT_DEVSLP_MDAT_OFFSET = 10, /* Minimum assertion time */ - PORT_DEVSLP_DETO_OFFSET = 2, /* DevSlp exit timeout */ -- PORT_DEVSLP_DSP = (1 << 1), /* DevSlp present */ -- PORT_DEVSLP_ADSE = (1 << 0), /* Aggressive DevSlp enable */ -+ PORT_DEVSLP_DSP = BIT(1), /* DevSlp present */ -+ PORT_DEVSLP_ADSE = BIT(0), /* Aggressive DevSlp enable */ - - /* hpriv->flags bits */ - - #define AHCI_HFLAGS(flags) .private_data = (void *)(flags) - -- AHCI_HFLAG_NO_NCQ = (1 << 0), -- AHCI_HFLAG_IGN_IRQ_IF_ERR = (1 << 1), /* ignore IRQ_IF_ERR */ -- AHCI_HFLAG_IGN_SERR_INTERNAL = (1 << 2), /* ignore SERR_INTERNAL */ -- AHCI_HFLAG_32BIT_ONLY = (1 << 3), /* force 32bit */ -- AHCI_HFLAG_MV_PATA = (1 << 4), /* PATA port */ -- AHCI_HFLAG_NO_MSI = (1 << 5), /* no PCI MSI */ -- AHCI_HFLAG_NO_PMP = (1 << 6), /* no PMP */ -- AHCI_HFLAG_SECT255 = (1 << 8), /* max 255 sectors */ -- AHCI_HFLAG_YES_NCQ = (1 << 9), /* force NCQ cap on */ -- AHCI_HFLAG_NO_SUSPEND = (1 << 10), /* don't suspend */ -- AHCI_HFLAG_SRST_TOUT_IS_OFFLINE = (1 << 11), /* treat SRST timeout as -+ AHCI_HFLAG_NO_NCQ = BIT(0), -+ AHCI_HFLAG_IGN_IRQ_IF_ERR = BIT(1), /* ignore IRQ_IF_ERR */ -+ AHCI_HFLAG_IGN_SERR_INTERNAL = BIT(2), /* ignore SERR_INTERNAL */ -+ AHCI_HFLAG_32BIT_ONLY = BIT(3), /* force 32bit */ -+ AHCI_HFLAG_MV_PATA = BIT(4), /* PATA port */ -+ AHCI_HFLAG_NO_MSI = BIT(5), /* no PCI MSI */ -+ AHCI_HFLAG_NO_PMP = BIT(6), /* no PMP */ -+ AHCI_HFLAG_SECT255 = BIT(8), /* max 255 sectors */ -+ AHCI_HFLAG_YES_NCQ = BIT(9), /* force NCQ cap on */ -+ AHCI_HFLAG_NO_SUSPEND = BIT(10), /* don't suspend */ -+ AHCI_HFLAG_SRST_TOUT_IS_OFFLINE = BIT(11), /* treat SRST timeout as - link offline */ -- AHCI_HFLAG_NO_SNTF = (1 << 12), /* no sntf */ -- AHCI_HFLAG_NO_FPDMA_AA = (1 << 13), /* no FPDMA AA */ -- AHCI_HFLAG_YES_FBS = (1 << 14), /* force FBS cap on */ -- AHCI_HFLAG_DELAY_ENGINE = (1 << 15), /* do not start engine on -+ AHCI_HFLAG_NO_SNTF = BIT(12), /* no sntf */ -+ AHCI_HFLAG_NO_FPDMA_AA = BIT(13), /* no FPDMA AA */ -+ AHCI_HFLAG_YES_FBS = BIT(14), /* force FBS cap on */ -+ AHCI_HFLAG_DELAY_ENGINE = BIT(15), /* do not start engine on - port start (wait until - error-handling stage) */ -- AHCI_HFLAG_NO_DEVSLP = (1 << 17), /* no device sleep */ -- AHCI_HFLAG_NO_FBS = (1 << 18), /* no FBS */ -+ AHCI_HFLAG_NO_DEVSLP = BIT(17), /* no device sleep */ -+ AHCI_HFLAG_NO_FBS = BIT(18), /* no FBS */ - - #ifdef CONFIG_PCI_MSI -- AHCI_HFLAG_MULTI_MSI = (1 << 20), /* per-port MSI(-X) */ -+ AHCI_HFLAG_MULTI_MSI = BIT(20), /* per-port MSI(-X) */ - #else - /* compile out MSI infrastructure */ - AHCI_HFLAG_MULTI_MSI = 0, - #endif -- AHCI_HFLAG_WAKE_BEFORE_STOP = (1 << 22), /* wake before DMA stop */ -- AHCI_HFLAG_YES_ALPM = (1 << 23), /* force ALPM cap on */ -- AHCI_HFLAG_NO_WRITE_TO_RO = (1 << 24), /* don't write to read -+ AHCI_HFLAG_WAKE_BEFORE_STOP = BIT(22), /* wake before DMA stop */ -+ AHCI_HFLAG_YES_ALPM = BIT(23), /* force ALPM cap on */ -+ AHCI_HFLAG_NO_WRITE_TO_RO = BIT(24), /* don't write to read - only registers */ -- AHCI_HFLAG_IS_MOBILE = (1 << 25), /* mobile chipset, use -+ AHCI_HFLAG_IS_MOBILE = BIT(25), /* mobile chipset, use - SATA_MOBILE_LPM_POLICY - as default lpm_policy */ -- AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during -+ AHCI_HFLAG_SUSPEND_PHYS = BIT(26), /* handle PHYs during - suspend/resume */ -- AHCI_HFLAG_NO_SXS = (1 << 28), /* SXS not supported */ -+ AHCI_HFLAG_NO_SXS = BIT(28), /* SXS not supported */ - - /* ap->flags bits */ - -@@ -256,22 +257,22 @@ enum { - EM_MAX_RETRY = 5, - - /* em_ctl bits */ -- EM_CTL_RST = (1 << 9), /* Reset */ -- EM_CTL_TM = (1 << 8), /* Transmit Message */ -- EM_CTL_MR = (1 << 0), /* Message Received */ -- EM_CTL_ALHD = (1 << 26), /* Activity LED */ -- EM_CTL_XMT = (1 << 25), /* Transmit Only */ -- EM_CTL_SMB = (1 << 24), /* Single Message Buffer */ -- EM_CTL_SGPIO = (1 << 19), /* SGPIO messages supported */ -- EM_CTL_SES = (1 << 18), /* SES-2 messages supported */ -- EM_CTL_SAFTE = (1 << 17), /* SAF-TE messages supported */ -- EM_CTL_LED = (1 << 16), /* LED messages supported */ -+ EM_CTL_RST = BIT(9), /* Reset */ -+ EM_CTL_TM = BIT(8), /* Transmit Message */ -+ EM_CTL_MR = BIT(0), /* Message Received */ -+ EM_CTL_ALHD = BIT(26), /* Activity LED */ -+ EM_CTL_XMT = BIT(25), /* Transmit Only */ -+ EM_CTL_SMB = BIT(24), /* Single Message Buffer */ -+ EM_CTL_SGPIO = BIT(19), /* SGPIO messages supported */ -+ EM_CTL_SES = BIT(18), /* SES-2 messages supported */ -+ EM_CTL_SAFTE = BIT(17), /* SAF-TE messages supported */ -+ EM_CTL_LED = BIT(16), /* LED messages supported */ - - /* em message type */ -- EM_MSG_TYPE_LED = (1 << 0), /* LED */ -- EM_MSG_TYPE_SAFTE = (1 << 1), /* SAF-TE */ -- EM_MSG_TYPE_SES2 = (1 << 2), /* SES-2 */ -- EM_MSG_TYPE_SGPIO = (1 << 3), /* SGPIO */ -+ EM_MSG_TYPE_LED = BIT(0), /* LED */ -+ EM_MSG_TYPE_SAFTE = BIT(1), /* SAF-TE */ -+ EM_MSG_TYPE_SES2 = BIT(2), /* SES-2 */ -+ EM_MSG_TYPE_SGPIO = BIT(3), /* SGPIO */ - }; - - struct ahci_cmd_hdr { diff --git a/target/linux/generic/backport-6.1/805-v6.5-01-leds-trigger-netdev-add-additional-specific-link-spe.patch b/target/linux/generic/backport-6.1/805-v6.5-01-leds-trigger-netdev-add-additional-specific-link-spe.patch new file mode 100644 index 00000000000..1c564b38970 --- /dev/null +++ b/target/linux/generic/backport-6.1/805-v6.5-01-leds-trigger-netdev-add-additional-specific-link-spe.patch @@ -0,0 +1,242 @@ +From d5e01266e7f5fa12400d4c8aa4e86fe89dcc61e9 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 19 Jun 2023 22:46:58 +0200 +Subject: [PATCH 1/3] leds: trigger: netdev: add additional specific link speed + mode + +Add additional modes for specific link speed. Use ethtool APIs to get the +current link speed and enable the LED accordingly. Under netdev event +handler the rtnl lock is already held and is not needed to be set to +access ethtool APIs. + +This is especially useful for PHY and Switch that supports LEDs hw +control for specific link speed. (example scenario a PHY that have 2 LED +connected one green and one orange where the green is turned on with +1000mbps speed and orange is turned on with 10mpbs speed) + +On mode set from sysfs we check if we have enabled split link speed mode +and reject enabling generic link mode to prevent wrong and redundant +configuration. + +Rework logic on the set baseline state to support these new modes to +select if we need to turn on or off the LED. + +Add additional modes: +- link_10: Turn on LED when link speed is 10mbps +- link_100: Turn on LED when link speed is 100mbps +- link_1000: Turn on LED when link speed is 1000mbps + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Acked-by: Lee Jones +Signed-off-by: Jakub Kicinski +--- + drivers/leds/trigger/ledtrig-netdev.c | 80 +++++++++++++++++++++++---- + include/linux/leds.h | 3 + + 2 files changed, 73 insertions(+), 10 deletions(-) + +--- a/drivers/leds/trigger/ledtrig-netdev.c ++++ b/drivers/leds/trigger/ledtrig-netdev.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -21,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include "../leds.h" + +@@ -52,6 +54,8 @@ struct led_netdev_data { + unsigned int last_activity; + + unsigned long mode; ++ int link_speed; ++ + bool carrier_link_up; + bool hw_control; + }; +@@ -77,7 +81,24 @@ static void set_baseline_state(struct le + if (!trigger_data->carrier_link_up) { + led_set_brightness(led_cdev, LED_OFF); + } else { ++ bool blink_on = false; ++ + if (test_bit(TRIGGER_NETDEV_LINK, &trigger_data->mode)) ++ blink_on = true; ++ ++ if (test_bit(TRIGGER_NETDEV_LINK_10, &trigger_data->mode) && ++ trigger_data->link_speed == SPEED_10) ++ blink_on = true; ++ ++ if (test_bit(TRIGGER_NETDEV_LINK_100, &trigger_data->mode) && ++ trigger_data->link_speed == SPEED_100) ++ blink_on = true; ++ ++ if (test_bit(TRIGGER_NETDEV_LINK_1000, &trigger_data->mode) && ++ trigger_data->link_speed == SPEED_1000) ++ blink_on = true; ++ ++ if (blink_on) + led_set_brightness(led_cdev, + led_cdev->blink_brightness); + else +@@ -161,6 +182,18 @@ static bool can_hw_control(struct led_ne + return true; + } + ++static void get_device_state(struct led_netdev_data *trigger_data) ++{ ++ struct ethtool_link_ksettings cmd; ++ ++ trigger_data->carrier_link_up = netif_carrier_ok(trigger_data->net_dev); ++ if (!trigger_data->carrier_link_up) ++ return; ++ ++ if (!__ethtool_get_link_ksettings(trigger_data->net_dev, &cmd)) ++ trigger_data->link_speed = cmd.base.speed; ++} ++ + static ssize_t device_name_show(struct device *dev, + struct device_attribute *attr, char *buf) + { +@@ -196,8 +229,12 @@ static int set_device_name(struct led_ne + dev_get_by_name(&init_net, trigger_data->device_name); + + trigger_data->carrier_link_up = false; +- if (trigger_data->net_dev != NULL) +- trigger_data->carrier_link_up = netif_carrier_ok(trigger_data->net_dev); ++ trigger_data->link_speed = SPEED_UNKNOWN; ++ if (trigger_data->net_dev != NULL) { ++ rtnl_lock(); ++ get_device_state(trigger_data); ++ rtnl_unlock(); ++ } + + trigger_data->last_activity = 0; + +@@ -234,6 +271,9 @@ static ssize_t netdev_led_attr_show(stru + + switch (attr) { + case TRIGGER_NETDEV_LINK: ++ case TRIGGER_NETDEV_LINK_10: ++ case TRIGGER_NETDEV_LINK_100: ++ case TRIGGER_NETDEV_LINK_1000: + case TRIGGER_NETDEV_TX: + case TRIGGER_NETDEV_RX: + bit = attr; +@@ -249,7 +289,7 @@ static ssize_t netdev_led_attr_store(str + size_t size, enum led_trigger_netdev_modes attr) + { + struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev); +- unsigned long state; ++ unsigned long state, mode = trigger_data->mode; + int ret; + int bit; + +@@ -259,6 +299,9 @@ static ssize_t netdev_led_attr_store(str + + switch (attr) { + case TRIGGER_NETDEV_LINK: ++ case TRIGGER_NETDEV_LINK_10: ++ case TRIGGER_NETDEV_LINK_100: ++ case TRIGGER_NETDEV_LINK_1000: + case TRIGGER_NETDEV_TX: + case TRIGGER_NETDEV_RX: + bit = attr; +@@ -267,13 +310,20 @@ static ssize_t netdev_led_attr_store(str + return -EINVAL; + } + +- cancel_delayed_work_sync(&trigger_data->work); +- + if (state) +- set_bit(bit, &trigger_data->mode); ++ set_bit(bit, &mode); + else +- clear_bit(bit, &trigger_data->mode); ++ clear_bit(bit, &mode); ++ ++ if (test_bit(TRIGGER_NETDEV_LINK, &mode) && ++ (test_bit(TRIGGER_NETDEV_LINK_10, &mode) || ++ test_bit(TRIGGER_NETDEV_LINK_100, &mode) || ++ test_bit(TRIGGER_NETDEV_LINK_1000, &mode))) ++ return -EINVAL; ++ ++ cancel_delayed_work_sync(&trigger_data->work); + ++ trigger_data->mode = mode; + trigger_data->hw_control = can_hw_control(trigger_data); + + set_baseline_state(trigger_data); +@@ -295,6 +345,9 @@ static ssize_t netdev_led_attr_store(str + static DEVICE_ATTR_RW(trigger_name) + + DEFINE_NETDEV_TRIGGER(link, TRIGGER_NETDEV_LINK); ++DEFINE_NETDEV_TRIGGER(link_10, TRIGGER_NETDEV_LINK_10); ++DEFINE_NETDEV_TRIGGER(link_100, TRIGGER_NETDEV_LINK_100); ++DEFINE_NETDEV_TRIGGER(link_1000, TRIGGER_NETDEV_LINK_1000); + DEFINE_NETDEV_TRIGGER(tx, TRIGGER_NETDEV_TX); + DEFINE_NETDEV_TRIGGER(rx, TRIGGER_NETDEV_RX); + +@@ -338,6 +391,9 @@ static DEVICE_ATTR_RW(interval); + static struct attribute *netdev_trig_attrs[] = { + &dev_attr_device_name.attr, + &dev_attr_link.attr, ++ &dev_attr_link_10.attr, ++ &dev_attr_link_100.attr, ++ &dev_attr_link_1000.attr, + &dev_attr_rx.attr, + &dev_attr_tx.attr, + &dev_attr_interval.attr, +@@ -368,9 +424,10 @@ static int netdev_trig_notify(struct not + mutex_lock(&trigger_data->lock); + + trigger_data->carrier_link_up = false; ++ trigger_data->link_speed = SPEED_UNKNOWN; + switch (evt) { + case NETDEV_CHANGENAME: +- trigger_data->carrier_link_up = netif_carrier_ok(dev); ++ get_device_state(trigger_data); + fallthrough; + case NETDEV_REGISTER: + if (trigger_data->net_dev) +@@ -384,7 +441,7 @@ static int netdev_trig_notify(struct not + break; + case NETDEV_UP: + case NETDEV_CHANGE: +- trigger_data->carrier_link_up = netif_carrier_ok(dev); ++ get_device_state(trigger_data); + break; + } + +@@ -427,7 +484,10 @@ static void netdev_trig_work(struct work + if (trigger_data->last_activity != new_activity) { + led_stop_software_blink(trigger_data->led_cdev); + +- invert = test_bit(TRIGGER_NETDEV_LINK, &trigger_data->mode); ++ invert = test_bit(TRIGGER_NETDEV_LINK, &trigger_data->mode) || ++ test_bit(TRIGGER_NETDEV_LINK_10, &trigger_data->mode) || ++ test_bit(TRIGGER_NETDEV_LINK_100, &trigger_data->mode) || ++ test_bit(TRIGGER_NETDEV_LINK_1000, &trigger_data->mode); + interval = jiffies_to_msecs( + atomic_read(&trigger_data->interval)); + /* base state is ON (link present) */ +--- a/include/linux/leds.h ++++ b/include/linux/leds.h +@@ -530,6 +530,9 @@ static inline void *led_get_trigger_data + /* Trigger specific enum */ + enum led_trigger_netdev_modes { + TRIGGER_NETDEV_LINK = 0, ++ TRIGGER_NETDEV_LINK_10, ++ TRIGGER_NETDEV_LINK_100, ++ TRIGGER_NETDEV_LINK_1000, + TRIGGER_NETDEV_TX, + TRIGGER_NETDEV_RX, + diff --git a/target/linux/generic/backport-6.1/805-v6.5-02-leds-trigger-netdev-add-additional-specific-link-dup.patch b/target/linux/generic/backport-6.1/805-v6.5-02-leds-trigger-netdev-add-additional-specific-link-dup.patch new file mode 100644 index 00000000000..a5ab4618281 --- /dev/null +++ b/target/linux/generic/backport-6.1/805-v6.5-02-leds-trigger-netdev-add-additional-specific-link-dup.patch @@ -0,0 +1,138 @@ +From f22f95b9ff1551c9bab13104131929f33d51f23f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 19 Jun 2023 22:46:59 +0200 +Subject: [PATCH 2/3] leds: trigger: netdev: add additional specific link + duplex mode + +Add additional modes for specific link duplex. Use ethtool APIs to get the +current link duplex and enable the LED accordingly. Under netdev event +handler the rtnl lock is already held and is not needed to be set to +access ethtool APIs. + +This is especially useful for PHY and Switch that supports LEDs hw +control for specific link duplex. + +Add additional modes: +- half_duplex: Turn on LED when link is half duplex +- full_duplex: Turn on LED when link is full duplex + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Acked-by: Lee Jones +Signed-off-by: Jakub Kicinski +--- + drivers/leds/trigger/ledtrig-netdev.c | 27 +++++++++++++++++++++++++-- + include/linux/leds.h | 2 ++ + 2 files changed, 27 insertions(+), 2 deletions(-) + +--- a/drivers/leds/trigger/ledtrig-netdev.c ++++ b/drivers/leds/trigger/ledtrig-netdev.c +@@ -55,6 +55,7 @@ struct led_netdev_data { + + unsigned long mode; + int link_speed; ++ u8 duplex; + + bool carrier_link_up; + bool hw_control; +@@ -98,6 +99,14 @@ static void set_baseline_state(struct le + trigger_data->link_speed == SPEED_1000) + blink_on = true; + ++ if (test_bit(TRIGGER_NETDEV_HALF_DUPLEX, &trigger_data->mode) && ++ trigger_data->duplex == DUPLEX_HALF) ++ blink_on = true; ++ ++ if (test_bit(TRIGGER_NETDEV_FULL_DUPLEX, &trigger_data->mode) && ++ trigger_data->duplex == DUPLEX_FULL) ++ blink_on = true; ++ + if (blink_on) + led_set_brightness(led_cdev, + led_cdev->blink_brightness); +@@ -190,8 +199,10 @@ static void get_device_state(struct led_ + if (!trigger_data->carrier_link_up) + return; + +- if (!__ethtool_get_link_ksettings(trigger_data->net_dev, &cmd)) ++ if (!__ethtool_get_link_ksettings(trigger_data->net_dev, &cmd)) { + trigger_data->link_speed = cmd.base.speed; ++ trigger_data->duplex = cmd.base.duplex; ++ } + } + + static ssize_t device_name_show(struct device *dev, +@@ -230,6 +241,7 @@ static int set_device_name(struct led_ne + + trigger_data->carrier_link_up = false; + trigger_data->link_speed = SPEED_UNKNOWN; ++ trigger_data->duplex = DUPLEX_UNKNOWN; + if (trigger_data->net_dev != NULL) { + rtnl_lock(); + get_device_state(trigger_data); +@@ -274,6 +286,8 @@ static ssize_t netdev_led_attr_show(stru + case TRIGGER_NETDEV_LINK_10: + case TRIGGER_NETDEV_LINK_100: + case TRIGGER_NETDEV_LINK_1000: ++ case TRIGGER_NETDEV_HALF_DUPLEX: ++ case TRIGGER_NETDEV_FULL_DUPLEX: + case TRIGGER_NETDEV_TX: + case TRIGGER_NETDEV_RX: + bit = attr; +@@ -302,6 +316,8 @@ static ssize_t netdev_led_attr_store(str + case TRIGGER_NETDEV_LINK_10: + case TRIGGER_NETDEV_LINK_100: + case TRIGGER_NETDEV_LINK_1000: ++ case TRIGGER_NETDEV_HALF_DUPLEX: ++ case TRIGGER_NETDEV_FULL_DUPLEX: + case TRIGGER_NETDEV_TX: + case TRIGGER_NETDEV_RX: + bit = attr; +@@ -348,6 +364,8 @@ DEFINE_NETDEV_TRIGGER(link, TRIGGER_NETD + DEFINE_NETDEV_TRIGGER(link_10, TRIGGER_NETDEV_LINK_10); + DEFINE_NETDEV_TRIGGER(link_100, TRIGGER_NETDEV_LINK_100); + DEFINE_NETDEV_TRIGGER(link_1000, TRIGGER_NETDEV_LINK_1000); ++DEFINE_NETDEV_TRIGGER(half_duplex, TRIGGER_NETDEV_HALF_DUPLEX); ++DEFINE_NETDEV_TRIGGER(full_duplex, TRIGGER_NETDEV_FULL_DUPLEX); + DEFINE_NETDEV_TRIGGER(tx, TRIGGER_NETDEV_TX); + DEFINE_NETDEV_TRIGGER(rx, TRIGGER_NETDEV_RX); + +@@ -394,6 +412,8 @@ static struct attribute *netdev_trig_att + &dev_attr_link_10.attr, + &dev_attr_link_100.attr, + &dev_attr_link_1000.attr, ++ &dev_attr_full_duplex.attr, ++ &dev_attr_half_duplex.attr, + &dev_attr_rx.attr, + &dev_attr_tx.attr, + &dev_attr_interval.attr, +@@ -425,6 +445,7 @@ static int netdev_trig_notify(struct not + + trigger_data->carrier_link_up = false; + trigger_data->link_speed = SPEED_UNKNOWN; ++ trigger_data->duplex = DUPLEX_UNKNOWN; + switch (evt) { + case NETDEV_CHANGENAME: + get_device_state(trigger_data); +@@ -487,7 +508,9 @@ static void netdev_trig_work(struct work + invert = test_bit(TRIGGER_NETDEV_LINK, &trigger_data->mode) || + test_bit(TRIGGER_NETDEV_LINK_10, &trigger_data->mode) || + test_bit(TRIGGER_NETDEV_LINK_100, &trigger_data->mode) || +- test_bit(TRIGGER_NETDEV_LINK_1000, &trigger_data->mode); ++ test_bit(TRIGGER_NETDEV_LINK_1000, &trigger_data->mode) || ++ test_bit(TRIGGER_NETDEV_HALF_DUPLEX, &trigger_data->mode) || ++ test_bit(TRIGGER_NETDEV_FULL_DUPLEX, &trigger_data->mode); + interval = jiffies_to_msecs( + atomic_read(&trigger_data->interval)); + /* base state is ON (link present) */ +--- a/include/linux/leds.h ++++ b/include/linux/leds.h +@@ -533,6 +533,8 @@ enum led_trigger_netdev_modes { + TRIGGER_NETDEV_LINK_10, + TRIGGER_NETDEV_LINK_100, + TRIGGER_NETDEV_LINK_1000, ++ TRIGGER_NETDEV_HALF_DUPLEX, ++ TRIGGER_NETDEV_FULL_DUPLEX, + TRIGGER_NETDEV_TX, + TRIGGER_NETDEV_RX, + diff --git a/target/linux/generic/backport-6.1/805-v6.5-03-leds-trigger-netdev-expose-hw_control-status-via-sys.patch b/target/linux/generic/backport-6.1/805-v6.5-03-leds-trigger-netdev-expose-hw_control-status-via-sys.patch new file mode 100644 index 00000000000..67528cafe09 --- /dev/null +++ b/target/linux/generic/backport-6.1/805-v6.5-03-leds-trigger-netdev-expose-hw_control-status-via-sys.patch @@ -0,0 +1,45 @@ +From b655892ffd6d89b0c7407e099c40dbde82ee3f03 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 19 Jun 2023 22:47:00 +0200 +Subject: [PATCH 3/3] leds: trigger: netdev: expose hw_control status via sysfs + +Expose hw_control status via sysfs for the netdev trigger to give +userspace better understanding of the current state of the trigger and +the LED. + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Reviewed-by: Kalesh AP +Acked-by: Lee Jones +Signed-off-by: Jakub Kicinski +--- + drivers/leds/trigger/ledtrig-netdev.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/leds/trigger/ledtrig-netdev.c ++++ b/drivers/leds/trigger/ledtrig-netdev.c +@@ -406,6 +406,16 @@ static ssize_t interval_store(struct dev + + static DEVICE_ATTR_RW(interval); + ++static ssize_t hw_control_show(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev); ++ ++ return sprintf(buf, "%d\n", trigger_data->hw_control); ++} ++ ++static DEVICE_ATTR_RO(hw_control); ++ + static struct attribute *netdev_trig_attrs[] = { + &dev_attr_device_name.attr, + &dev_attr_link.attr, +@@ -417,6 +427,7 @@ static struct attribute *netdev_trig_att + &dev_attr_rx.attr, + &dev_attr_tx.attr, + &dev_attr_interval.attr, ++ &dev_attr_hw_control.attr, + NULL + }; + ATTRIBUTE_GROUPS(netdev_trig); diff --git a/target/linux/generic/backport-6.1/806-v6.5-net-dsa-qca8k-add-support-for-additional-modes-for-n.patch b/target/linux/generic/backport-6.1/806-v6.5-net-dsa-qca8k-add-support-for-additional-modes-for-n.patch new file mode 100644 index 00000000000..ac322e19390 --- /dev/null +++ b/target/linux/generic/backport-6.1/806-v6.5-net-dsa-qca8k-add-support-for-additional-modes-for-n.patch @@ -0,0 +1,64 @@ +From 2555f35a4f428a9bfdf09aa0459dbfdf59a24a9a Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Wed, 21 Jun 2023 11:54:09 +0200 +Subject: [PATCH] net: dsa: qca8k: add support for additional modes for netdev + trigger + +The QCA8K switch supports additional modes that can be handled in +hardware for the LED netdev trigger. + +Add these additional modes to further support the Switch LEDs and +offload more blink modes. + +Add additional modes: +- link_10 +- link_100 +- link_1000 +- half_duplex +- full_duplex + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Link: https://lore.kernel.org/r/20230621095409.25859-1-ansuelsmth@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/qca/qca8k-leds.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +--- a/drivers/net/dsa/qca/qca8k-leds.c ++++ b/drivers/net/dsa/qca/qca8k-leds.c +@@ -68,6 +68,16 @@ qca8k_parse_netdev(unsigned long rules, + *offload_trigger |= QCA8K_LED_TX_BLINK_MASK; + if (test_bit(TRIGGER_NETDEV_RX, &rules)) + *offload_trigger |= QCA8K_LED_RX_BLINK_MASK; ++ if (test_bit(TRIGGER_NETDEV_LINK_10, &rules)) ++ *offload_trigger |= QCA8K_LED_LINK_10M_EN_MASK; ++ if (test_bit(TRIGGER_NETDEV_LINK_100, &rules)) ++ *offload_trigger |= QCA8K_LED_LINK_100M_EN_MASK; ++ if (test_bit(TRIGGER_NETDEV_LINK_1000, &rules)) ++ *offload_trigger |= QCA8K_LED_LINK_1000M_EN_MASK; ++ if (test_bit(TRIGGER_NETDEV_HALF_DUPLEX, &rules)) ++ *offload_trigger |= QCA8K_LED_HALF_DUPLEX_MASK; ++ if (test_bit(TRIGGER_NETDEV_FULL_DUPLEX, &rules)) ++ *offload_trigger |= QCA8K_LED_FULL_DUPLEX_MASK; + + if (rules && !*offload_trigger) + return -EOPNOTSUPP; +@@ -322,6 +332,16 @@ qca8k_cled_hw_control_get(struct led_cla + set_bit(TRIGGER_NETDEV_TX, rules); + if (val & QCA8K_LED_RX_BLINK_MASK) + set_bit(TRIGGER_NETDEV_RX, rules); ++ if (val & QCA8K_LED_LINK_10M_EN_MASK) ++ set_bit(TRIGGER_NETDEV_LINK_10, rules); ++ if (val & QCA8K_LED_LINK_100M_EN_MASK) ++ set_bit(TRIGGER_NETDEV_LINK_100, rules); ++ if (val & QCA8K_LED_LINK_1000M_EN_MASK) ++ set_bit(TRIGGER_NETDEV_LINK_1000, rules); ++ if (val & QCA8K_LED_HALF_DUPLEX_MASK) ++ set_bit(TRIGGER_NETDEV_HALF_DUPLEX, rules); ++ if (val & QCA8K_LED_FULL_DUPLEX_MASK) ++ set_bit(TRIGGER_NETDEV_FULL_DUPLEX, rules); + + return 0; + } diff --git a/target/linux/generic/backport-6.1/813-v6.5-0001-nvmem-imx-ocotp-set-varaiable-imx_ocotp_layout-stora.patch b/target/linux/generic/backport-6.1/813-v6.5-0001-nvmem-imx-ocotp-set-varaiable-imx_ocotp_layout-stora.patch new file mode 100644 index 00000000000..38cfccd5ef9 --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0001-nvmem-imx-ocotp-set-varaiable-imx_ocotp_layout-stora.patch @@ -0,0 +1,31 @@ +From eebc6573ad940b62a87776db3917e912b4f52d78 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Sun, 11 Jun 2023 15:03:05 +0100 +Subject: [PATCH] nvmem: imx-ocotp: set varaiable imx_ocotp_layout + storage-class-specifier to static + +smatch reports +drivers/nvmem/imx-ocotp.c:599:21: warning: symbol + 'imx_ocotp_layout' was not declared. Should it be static? + +This variable is only used in one file so should be static. + +Signed-off-by: Tom Rix +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-2-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/imx-ocotp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/imx-ocotp.c ++++ b/drivers/nvmem/imx-ocotp.c +@@ -596,7 +596,7 @@ static void imx_ocotp_fixup_cell_info(st + cell->read_post_process = imx_ocotp_cell_pp; + } + +-struct nvmem_layout imx_ocotp_layout = { ++static struct nvmem_layout imx_ocotp_layout = { + .fixup_cell_info = imx_ocotp_fixup_cell_info, + }; + diff --git a/target/linux/generic/backport-6.1/813-v6.5-0002-nvmem-imx-ocotp-Reverse-MAC-addresses-on-all-i.MX-de.patch b/target/linux/generic/backport-6.1/813-v6.5-0002-nvmem-imx-ocotp-Reverse-MAC-addresses-on-all-i.MX-de.patch new file mode 100644 index 00000000000..7523e5ebf64 --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0002-nvmem-imx-ocotp-Reverse-MAC-addresses-on-all-i.MX-de.patch @@ -0,0 +1,71 @@ +From 8a00fc606312c68b98add8fe8e6f7a013ce29e78 Mon Sep 17 00:00:00 2001 +From: Alexander Stein +Date: Sun, 11 Jun 2023 15:03:06 +0100 +Subject: [PATCH] nvmem: imx-ocotp: Reverse MAC addresses on all i.MX derivates + +Not just i.MX8M, but all i.MX6/7 (and subtypes) need to reverse the +MAC address read from fuses. Exceptions are i.MX6SLL and i.MX7ULP which +do not support ethernet at all. + +Fixes: d0221a780cbc ("nvmem: imx-ocotp: add support for post processing") +Signed-off-by: Alexander Stein +Tested-by: Richard Leitner # imx6q +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-3-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/imx-ocotp.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/drivers/nvmem/imx-ocotp.c ++++ b/drivers/nvmem/imx-ocotp.c +@@ -97,7 +97,6 @@ struct ocotp_params { + unsigned int bank_address_words; + void (*set_timing)(struct ocotp_priv *priv); + struct ocotp_ctrl_reg ctrl; +- bool reverse_mac_address; + }; + + static int imx_ocotp_wait_for_busy(struct ocotp_priv *priv, u32 flags) +@@ -545,7 +544,6 @@ static const struct ocotp_params imx8mq_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, +- .reverse_mac_address = true, + }; + + static const struct ocotp_params imx8mm_params = { +@@ -553,7 +551,6 @@ static const struct ocotp_params imx8mm_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, +- .reverse_mac_address = true, + }; + + static const struct ocotp_params imx8mn_params = { +@@ -561,7 +558,6 @@ static const struct ocotp_params imx8mn_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, +- .reverse_mac_address = true, + }; + + static const struct ocotp_params imx8mp_params = { +@@ -569,7 +565,6 @@ static const struct ocotp_params imx8mp_ + .bank_address_words = 0, + .set_timing = imx_ocotp_set_imx6_timing, + .ctrl = IMX_OCOTP_BM_CTRL_8MP, +- .reverse_mac_address = true, + }; + + static const struct of_device_id imx_ocotp_dt_ids[] = { +@@ -624,8 +619,7 @@ static int imx_ocotp_probe(struct platfo + imx_ocotp_nvmem_config.size = 4 * priv->params->nregs; + imx_ocotp_nvmem_config.dev = dev; + imx_ocotp_nvmem_config.priv = priv; +- if (priv->params->reverse_mac_address) +- imx_ocotp_nvmem_config.layout = &imx_ocotp_layout; ++ imx_ocotp_nvmem_config.layout = &imx_ocotp_layout; + + priv->config = &imx_ocotp_nvmem_config; + diff --git a/target/linux/generic/backport-6.1/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch b/target/linux/generic/backport-6.1/813-v6.5-0003-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch similarity index 87% rename from target/linux/generic/backport-6.1/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch rename to target/linux/generic/backport-6.1/813-v6.5-0003-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch index 8749cad7f77..fb4d346a95a 100644 --- a/target/linux/generic/backport-6.1/813-v6.5-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch +++ b/target/linux/generic/backport-6.1/813-v6.5-0003-nvmem-brcm_nvram-add-.read_post_process-for-MACs.patch @@ -1,5 +1,6 @@ +From 73bcd133c910bff3b6d3b3834d0d14be9444e90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 6 Apr 2023 12:46:16 +0200 +Date: Sun, 11 Jun 2023 15:03:08 +0100 Subject: [PATCH] nvmem: brcm_nvram: add .read_post_process() for MACs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -9,6 +10,9 @@ Content-Transfer-Encoding: 8bit 2. Calculate relative addresses based on index argument Signed-off-by: Rafał Miłecki +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-5-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman --- drivers/nvmem/Kconfig | 1 + drivers/nvmem/brcm_nvram.c | 28 ++++++++++++++++++++++++++++ diff --git a/target/linux/generic/backport-6.1/813-v6.5-0004-nvmem-rockchip-otp-Add-clks-and-reg_read-to-rockchip.patch b/target/linux/generic/backport-6.1/813-v6.5-0004-nvmem-rockchip-otp-Add-clks-and-reg_read-to-rockchip.patch new file mode 100644 index 00000000000..3b6e6e57f52 --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0004-nvmem-rockchip-otp-Add-clks-and-reg_read-to-rockchip.patch @@ -0,0 +1,166 @@ +From 8dc61364164e79e44c07fa2ac0a7b6939f00d5db Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:13 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Add clks and reg_read to rockchip_data + +In preparation to support new Rockchip OTP memory devices with different +clock configurations and register layout, extend rockchip_data struct +with the related members: clks, num_clks, reg_read. + +Additionally, to avoid managing redundant driver data, drop num_clks +member from rockchip_otp struct and update all references to point to +the equivalent member in rockchip_data. + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-10-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 79 ++++++++++++++++++++++-------------- + 1 file changed, 49 insertions(+), 30 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -54,21 +54,19 @@ + + #define OTPC_TIMEOUT 10000 + ++struct rockchip_data { ++ int size; ++ const char * const *clks; ++ int num_clks; ++ nvmem_reg_read_t reg_read; ++}; ++ + struct rockchip_otp { + struct device *dev; + void __iomem *base; +- struct clk_bulk_data *clks; +- int num_clks; ++ struct clk_bulk_data *clks; + struct reset_control *rst; +-}; +- +-/* list of required clocks */ +-static const char * const rockchip_otp_clocks[] = { +- "otp", "apb_pclk", "phy", +-}; +- +-struct rockchip_data { +- int size; ++ const struct rockchip_data *data; + }; + + static int rockchip_otp_reset(struct rockchip_otp *otp) +@@ -132,29 +130,23 @@ static int rockchip_otp_ecc_enable(struc + return ret; + } + +-static int rockchip_otp_read(void *context, unsigned int offset, +- void *val, size_t bytes) ++static int px30_otp_read(void *context, unsigned int offset, ++ void *val, size_t bytes) + { + struct rockchip_otp *otp = context; + u8 *buf = val; +- int ret = 0; +- +- ret = clk_bulk_prepare_enable(otp->num_clks, otp->clks); +- if (ret < 0) { +- dev_err(otp->dev, "failed to prepare/enable clks\n"); +- return ret; +- } ++ int ret; + + ret = rockchip_otp_reset(otp); + if (ret) { + dev_err(otp->dev, "failed to reset otp phy\n"); +- goto disable_clks; ++ return ret; + } + + ret = rockchip_otp_ecc_enable(otp, false); + if (ret < 0) { + dev_err(otp->dev, "rockchip_otp_ecc_enable err\n"); +- goto disable_clks; ++ return ret; + } + + writel(OTPC_USE_USER | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL); +@@ -174,8 +166,28 @@ static int rockchip_otp_read(void *conte + + read_end: + writel(0x0 | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL); +-disable_clks: +- clk_bulk_disable_unprepare(otp->num_clks, otp->clks); ++ ++ return ret; ++} ++ ++static int rockchip_otp_read(void *context, unsigned int offset, ++ void *val, size_t bytes) ++{ ++ struct rockchip_otp *otp = context; ++ int ret; ++ ++ if (!otp->data || !otp->data->reg_read) ++ return -EINVAL; ++ ++ ret = clk_bulk_prepare_enable(otp->data->num_clks, otp->clks); ++ if (ret < 0) { ++ dev_err(otp->dev, "failed to prepare/enable clks\n"); ++ return ret; ++ } ++ ++ ret = otp->data->reg_read(context, offset, val, bytes); ++ ++ clk_bulk_disable_unprepare(otp->data->num_clks, otp->clks); + + return ret; + } +@@ -189,8 +201,15 @@ static struct nvmem_config otp_config = + .reg_read = rockchip_otp_read, + }; + ++static const char * const px30_otp_clocks[] = { ++ "otp", "apb_pclk", "phy", ++}; ++ + static const struct rockchip_data px30_data = { + .size = 0x40, ++ .clks = px30_otp_clocks, ++ .num_clks = ARRAY_SIZE(px30_otp_clocks), ++ .reg_read = px30_otp_read, + }; + + static const struct of_device_id rockchip_otp_match[] = { +@@ -225,21 +244,21 @@ static int rockchip_otp_probe(struct pla + if (!otp) + return -ENOMEM; + ++ otp->data = data; + otp->dev = dev; + otp->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(otp->base)) + return PTR_ERR(otp->base); + +- otp->num_clks = ARRAY_SIZE(rockchip_otp_clocks); +- otp->clks = devm_kcalloc(dev, otp->num_clks, +- sizeof(*otp->clks), GFP_KERNEL); ++ otp->clks = devm_kcalloc(dev, data->num_clks, sizeof(*otp->clks), ++ GFP_KERNEL); + if (!otp->clks) + return -ENOMEM; + +- for (i = 0; i < otp->num_clks; ++i) +- otp->clks[i].id = rockchip_otp_clocks[i]; ++ for (i = 0; i < data->num_clks; ++i) ++ otp->clks[i].id = data->clks[i]; + +- ret = devm_clk_bulk_get(dev, otp->num_clks, otp->clks); ++ ret = devm_clk_bulk_get(dev, data->num_clks, otp->clks); + if (ret) + return ret; + diff --git a/target/linux/generic/backport-6.1/813-v6.5-0005-nvmem-rockchip-otp-Generalize-rockchip_otp_wait_stat.patch b/target/linux/generic/backport-6.1/813-v6.5-0005-nvmem-rockchip-otp-Generalize-rockchip_otp_wait_stat.patch new file mode 100644 index 00000000000..b5b66cfc5ac --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0005-nvmem-rockchip-otp-Generalize-rockchip_otp_wait_stat.patch @@ -0,0 +1,62 @@ +From 30fd21cfb1e64ef20035559a8246f5fbf682c40e Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:14 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Generalize rockchip_otp_wait_status() + +In preparation to support additional Rockchip OTP memory devices with +different register layout, generalize rockchip_otp_wait_status() to +accept a new parameter for specifying the offset of the status register. + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-11-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -90,18 +90,19 @@ static int rockchip_otp_reset(struct roc + return 0; + } + +-static int rockchip_otp_wait_status(struct rockchip_otp *otp, u32 flag) ++static int rockchip_otp_wait_status(struct rockchip_otp *otp, ++ unsigned int reg, u32 flag) + { + u32 status = 0; + int ret; + +- ret = readl_poll_timeout_atomic(otp->base + OTPC_INT_STATUS, status, ++ ret = readl_poll_timeout_atomic(otp->base + reg, status, + (status & flag), 1, OTPC_TIMEOUT); + if (ret) + return ret; + + /* clean int status */ +- writel(flag, otp->base + OTPC_INT_STATUS); ++ writel(flag, otp->base + reg); + + return 0; + } +@@ -123,7 +124,7 @@ static int rockchip_otp_ecc_enable(struc + + writel(SBPI_ENABLE_MASK | SBPI_ENABLE, otp->base + OTPC_SBPI_CTRL); + +- ret = rockchip_otp_wait_status(otp, OTPC_SBPI_DONE); ++ ret = rockchip_otp_wait_status(otp, OTPC_INT_STATUS, OTPC_SBPI_DONE); + if (ret < 0) + dev_err(otp->dev, "timeout during ecc_enable\n"); + +@@ -156,7 +157,7 @@ static int px30_otp_read(void *context, + otp->base + OTPC_USER_ADDR); + writel(OTPC_USER_FSM_ENABLE | OTPC_USER_FSM_ENABLE_MASK, + otp->base + OTPC_USER_ENABLE); +- ret = rockchip_otp_wait_status(otp, OTPC_USER_DONE); ++ ret = rockchip_otp_wait_status(otp, OTPC_INT_STATUS, OTPC_USER_DONE); + if (ret < 0) { + dev_err(otp->dev, "timeout during read setup\n"); + goto read_end; diff --git a/target/linux/generic/backport-6.1/813-v6.5-0006-nvmem-rockchip-otp-Use-devm_reset_control_array_get_.patch b/target/linux/generic/backport-6.1/813-v6.5-0006-nvmem-rockchip-otp-Use-devm_reset_control_array_get_.patch new file mode 100644 index 00000000000..3a17479d959 --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0006-nvmem-rockchip-otp-Use-devm_reset_control_array_get_.patch @@ -0,0 +1,31 @@ +From d325c9dd2b6e94040ca722ddcadcd6af358dd2be Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:15 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Use + devm_reset_control_array_get_exclusive() + +In preparation to support new Rockchip OTP memory devices having +specific reset configurations, switch devm_reset_control_get() to +devm_reset_control_array_get_exclusive(). + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-12-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -263,7 +263,7 @@ static int rockchip_otp_probe(struct pla + if (ret) + return ret; + +- otp->rst = devm_reset_control_get(dev, "phy"); ++ otp->rst = devm_reset_control_array_get_exclusive(dev); + if (IS_ERR(otp->rst)) + return PTR_ERR(otp->rst); + diff --git a/target/linux/generic/backport-6.1/813-v6.5-0007-nvmem-rockchip-otp-Improve-probe-error-handling.patch b/target/linux/generic/backport-6.1/813-v6.5-0007-nvmem-rockchip-otp-Improve-probe-error-handling.patch new file mode 100644 index 00000000000..37cb927b100 --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0007-nvmem-rockchip-otp-Improve-probe-error-handling.patch @@ -0,0 +1,71 @@ +From 912517345b867a69542dc9f5c2cc3e9d8beaccf5 Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:16 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Improve probe error handling + +Enhance error handling in the probe function by making use of +dev_err_probe(), which ensures the error code is always printed, in +addition to the specified error message. + +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-13-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -235,10 +235,8 @@ static int rockchip_otp_probe(struct pla + int ret, i; + + data = of_device_get_match_data(dev); +- if (!data) { +- dev_err(dev, "failed to get match data\n"); +- return -EINVAL; +- } ++ if (!data) ++ return dev_err_probe(dev, -EINVAL, "failed to get match data\n"); + + otp = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_otp), + GFP_KERNEL); +@@ -249,7 +247,8 @@ static int rockchip_otp_probe(struct pla + otp->dev = dev; + otp->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(otp->base)) +- return PTR_ERR(otp->base); ++ return dev_err_probe(dev, PTR_ERR(otp->base), ++ "failed to ioremap resource\n"); + + otp->clks = devm_kcalloc(dev, data->num_clks, sizeof(*otp->clks), + GFP_KERNEL); +@@ -261,18 +260,22 @@ static int rockchip_otp_probe(struct pla + + ret = devm_clk_bulk_get(dev, data->num_clks, otp->clks); + if (ret) +- return ret; ++ return dev_err_probe(dev, ret, "failed to get clocks\n"); + + otp->rst = devm_reset_control_array_get_exclusive(dev); + if (IS_ERR(otp->rst)) +- return PTR_ERR(otp->rst); ++ return dev_err_probe(dev, PTR_ERR(otp->rst), ++ "failed to get resets\n"); + + otp_config.size = data->size; + otp_config.priv = otp; + otp_config.dev = dev; +- nvmem = devm_nvmem_register(dev, &otp_config); + +- return PTR_ERR_OR_ZERO(nvmem); ++ nvmem = devm_nvmem_register(dev, &otp_config); ++ if (IS_ERR(nvmem)) ++ return dev_err_probe(dev, PTR_ERR(nvmem), ++ "failed to register nvmem device\n"); ++ return 0; + } + + static struct platform_driver rockchip_otp_driver = { diff --git a/target/linux/generic/backport-6.1/813-v6.5-0008-nvmem-rockchip-otp-Add-support-for-RK3588.patch b/target/linux/generic/backport-6.1/813-v6.5-0008-nvmem-rockchip-otp-Add-support-for-RK3588.patch new file mode 100644 index 00000000000..c1e2231c9ec --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0008-nvmem-rockchip-otp-Add-support-for-RK3588.patch @@ -0,0 +1,129 @@ +From 8ab099fafbbc8c9607c399d21a774784a6cb8b45 Mon Sep 17 00:00:00 2001 +From: Cristian Ciocaltea +Date: Sun, 11 Jun 2023 15:03:17 +0100 +Subject: [PATCH] nvmem: rockchip-otp: Add support for RK3588 + +Add support for the OTP memory device found on the Rockchip RK3588 SoC. + +While here, remove the unnecessary 'void *' casts in the OF device ID +table. + +Co-developed-by: Finley Xiao +Signed-off-by: Finley Xiao +Signed-off-by: Cristian Ciocaltea +Tested-by: Vincent Legoll +Reviewed-by: Heiko Stuebner +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-14-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/rockchip-otp.c | 78 +++++++++++++++++++++++++++++++++++- + 1 file changed, 76 insertions(+), 2 deletions(-) + +--- a/drivers/nvmem/rockchip-otp.c ++++ b/drivers/nvmem/rockchip-otp.c +@@ -54,6 +54,19 @@ + + #define OTPC_TIMEOUT 10000 + ++/* RK3588 Register */ ++#define RK3588_OTPC_AUTO_CTRL 0x04 ++#define RK3588_OTPC_AUTO_EN 0x08 ++#define RK3588_OTPC_INT_ST 0x84 ++#define RK3588_OTPC_DOUT0 0x20 ++#define RK3588_NO_SECURE_OFFSET 0x300 ++#define RK3588_NBYTES 4 ++#define RK3588_BURST_NUM 1 ++#define RK3588_BURST_SHIFT 8 ++#define RK3588_ADDR_SHIFT 16 ++#define RK3588_AUTO_EN BIT(0) ++#define RK3588_RD_DONE BIT(1) ++ + struct rockchip_data { + int size; + const char * const *clks; +@@ -171,6 +184,52 @@ read_end: + return ret; + } + ++static int rk3588_otp_read(void *context, unsigned int offset, ++ void *val, size_t bytes) ++{ ++ struct rockchip_otp *otp = context; ++ unsigned int addr_start, addr_end, addr_len; ++ int ret, i = 0; ++ u32 data; ++ u8 *buf; ++ ++ addr_start = round_down(offset, RK3588_NBYTES) / RK3588_NBYTES; ++ addr_end = round_up(offset + bytes, RK3588_NBYTES) / RK3588_NBYTES; ++ addr_len = addr_end - addr_start; ++ addr_start += RK3588_NO_SECURE_OFFSET; ++ ++ buf = kzalloc(array_size(addr_len, RK3588_NBYTES), GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; ++ ++ while (addr_len--) { ++ writel((addr_start << RK3588_ADDR_SHIFT) | ++ (RK3588_BURST_NUM << RK3588_BURST_SHIFT), ++ otp->base + RK3588_OTPC_AUTO_CTRL); ++ writel(RK3588_AUTO_EN, otp->base + RK3588_OTPC_AUTO_EN); ++ ++ ret = rockchip_otp_wait_status(otp, RK3588_OTPC_INT_ST, ++ RK3588_RD_DONE); ++ if (ret < 0) { ++ dev_err(otp->dev, "timeout during read setup\n"); ++ goto read_end; ++ } ++ ++ data = readl(otp->base + RK3588_OTPC_DOUT0); ++ memcpy(&buf[i], &data, RK3588_NBYTES); ++ ++ i += RK3588_NBYTES; ++ addr_start++; ++ } ++ ++ memcpy(val, buf + offset % RK3588_NBYTES, bytes); ++ ++read_end: ++ kfree(buf); ++ ++ return ret; ++} ++ + static int rockchip_otp_read(void *context, unsigned int offset, + void *val, size_t bytes) + { +@@ -213,14 +272,29 @@ static const struct rockchip_data px30_d + .reg_read = px30_otp_read, + }; + ++static const char * const rk3588_otp_clocks[] = { ++ "otp", "apb_pclk", "phy", "arb", ++}; ++ ++static const struct rockchip_data rk3588_data = { ++ .size = 0x400, ++ .clks = rk3588_otp_clocks, ++ .num_clks = ARRAY_SIZE(rk3588_otp_clocks), ++ .reg_read = rk3588_otp_read, ++}; ++ + static const struct of_device_id rockchip_otp_match[] = { + { + .compatible = "rockchip,px30-otp", +- .data = (void *)&px30_data, ++ .data = &px30_data, + }, + { + .compatible = "rockchip,rk3308-otp", +- .data = (void *)&px30_data, ++ .data = &px30_data, ++ }, ++ { ++ .compatible = "rockchip,rk3588-otp", ++ .data = &rk3588_data, + }, + { /* sentinel */ }, + }; diff --git a/target/linux/generic/backport-6.1/813-v6.5-0009-nvmem-zynqmp-Switch-xilinx.com-emails-to-amd.com.patch b/target/linux/generic/backport-6.1/813-v6.5-0009-nvmem-zynqmp-Switch-xilinx.com-emails-to-amd.com.patch new file mode 100644 index 00000000000..220e3e9a05f --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0009-nvmem-zynqmp-Switch-xilinx.com-emails-to-amd.com.patch @@ -0,0 +1,26 @@ +From 9734408969e978a1c0d5d752be63dd638288e374 Mon Sep 17 00:00:00 2001 +From: Michal Simek +Date: Sun, 11 Jun 2023 15:03:23 +0100 +Subject: [PATCH] nvmem: zynqmp: Switch @xilinx.com emails to @amd.com + +@xilinx.com is still working but better to switch to new amd.com after +AMD/Xilinx acquisition. + +Signed-off-by: Michal Simek +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-20-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/zynqmp_nvmem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/zynqmp_nvmem.c ++++ b/drivers/nvmem/zynqmp_nvmem.c +@@ -76,6 +76,6 @@ static struct platform_driver zynqmp_nvm + + module_platform_driver(zynqmp_nvmem_driver); + +-MODULE_AUTHOR("Michal Simek , Nava kishore Manne "); ++MODULE_AUTHOR("Michal Simek , Nava kishore Manne "); + MODULE_DESCRIPTION("ZynqMP NVMEM driver"); + MODULE_LICENSE("GPL"); diff --git a/target/linux/generic/backport-6.1/813-v6.5-0010-nvmem-imx-support-i.MX93-OCOTP.patch b/target/linux/generic/backport-6.1/813-v6.5-0010-nvmem-imx-support-i.MX93-OCOTP.patch new file mode 100644 index 00000000000..f8e6be42416 --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0010-nvmem-imx-support-i.MX93-OCOTP.patch @@ -0,0 +1,230 @@ +From 22e9e6fcfb5042cb6d6c7874c459b034800092f1 Mon Sep 17 00:00:00 2001 +From: Peng Fan +Date: Sun, 11 Jun 2023 15:03:25 +0100 +Subject: [PATCH] nvmem: imx: support i.MX93 OCOTP + +Add i.MX93 OCOTP support. i.MX93 OCOTP has two parts: Fuse shadow +block(fsb) and fuse managed by ELE. The FSB part could be directly +accessed with MMIO, the ELE could only be accessed with ELE API. + +Currently the ELE API is not ready, so NULL function callback is used, +but it was tested with downstream ELE API. + +Signed-off-by: Peng Fan +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-22-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/Kconfig | 9 ++ + drivers/nvmem/Makefile | 2 + + drivers/nvmem/imx-ocotp-ele.c | 175 ++++++++++++++++++++++++++++++++++ + 3 files changed, 186 insertions(+) + create mode 100644 drivers/nvmem/imx-ocotp-ele.c + +--- a/drivers/nvmem/Kconfig ++++ b/drivers/nvmem/Kconfig +@@ -83,6 +83,15 @@ config NVMEM_IMX_OCOTP + This driver can also be built as a module. If so, the module + will be called nvmem-imx-ocotp. + ++config NVMEM_IMX_OCOTP_ELE ++ tristate "i.MX On-Chip OTP Controller support" ++ depends on ARCH_MXC || COMPILE_TEST ++ depends on HAS_IOMEM ++ depends on OF ++ help ++ This is a driver for the On-Chip OTP Controller (OCOTP) ++ available on i.MX SoCs which has ELE. ++ + config NVMEM_IMX_OCOTP_SCU + tristate "i.MX8 SCU On-Chip OTP Controller support" + depends on IMX_SCU +--- a/drivers/nvmem/Makefile ++++ b/drivers/nvmem/Makefile +@@ -18,6 +18,8 @@ obj-$(CONFIG_NVMEM_IMX_IIM) += nvmem-im + nvmem-imx-iim-y := imx-iim.o + obj-$(CONFIG_NVMEM_IMX_OCOTP) += nvmem-imx-ocotp.o + nvmem-imx-ocotp-y := imx-ocotp.o ++obj-$(CONFIG_NVMEM_IMX_OCOTP_ELE) += nvmem-imx-ocotp-ele.o ++nvmem-imx-ocotp-ele-y := imx-ocotp-ele.o + obj-$(CONFIG_NVMEM_IMX_OCOTP_SCU) += nvmem-imx-ocotp-scu.o + nvmem-imx-ocotp-scu-y := imx-ocotp-scu.o + obj-$(CONFIG_NVMEM_JZ4780_EFUSE) += nvmem_jz4780_efuse.o +--- /dev/null ++++ b/drivers/nvmem/imx-ocotp-ele.c +@@ -0,0 +1,175 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++/* ++ * i.MX9 OCOTP fusebox driver ++ * ++ * Copyright 2023 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++enum fuse_type { ++ FUSE_FSB = 1, ++ FUSE_ELE = 2, ++ FUSE_INVALID = -1 ++}; ++ ++struct ocotp_map_entry { ++ u32 start; /* start word */ ++ u32 num; /* num words */ ++ enum fuse_type type; ++}; ++ ++struct ocotp_devtype_data { ++ u32 reg_off; ++ char *name; ++ u32 size; ++ u32 num_entry; ++ u32 flag; ++ nvmem_reg_read_t reg_read; ++ struct ocotp_map_entry entry[]; ++}; ++ ++struct imx_ocotp_priv { ++ struct device *dev; ++ void __iomem *base; ++ struct nvmem_config config; ++ struct mutex lock; ++ const struct ocotp_devtype_data *data; ++}; ++ ++static enum fuse_type imx_ocotp_fuse_type(void *context, u32 index) ++{ ++ struct imx_ocotp_priv *priv = context; ++ const struct ocotp_devtype_data *data = priv->data; ++ u32 start, end; ++ int i; ++ ++ for (i = 0; i < data->num_entry; i++) { ++ start = data->entry[i].start; ++ end = data->entry[i].start + data->entry[i].num; ++ ++ if (index >= start && index < end) ++ return data->entry[i].type; ++ } ++ ++ return FUSE_INVALID; ++} ++ ++static int imx_ocotp_reg_read(void *context, unsigned int offset, void *val, size_t bytes) ++{ ++ struct imx_ocotp_priv *priv = context; ++ void __iomem *reg = priv->base + priv->data->reg_off; ++ u32 count, index, num_bytes; ++ enum fuse_type type; ++ u32 *buf; ++ void *p; ++ int i; ++ ++ index = offset; ++ num_bytes = round_up(bytes, 4); ++ count = num_bytes >> 2; ++ ++ if (count > ((priv->data->size >> 2) - index)) ++ count = (priv->data->size >> 2) - index; ++ ++ p = kzalloc(num_bytes, GFP_KERNEL); ++ if (!p) ++ return -ENOMEM; ++ ++ mutex_lock(&priv->lock); ++ ++ buf = p; ++ ++ for (i = index; i < (index + count); i++) { ++ type = imx_ocotp_fuse_type(context, i); ++ if (type == FUSE_INVALID || type == FUSE_ELE) { ++ *buf++ = 0; ++ continue; ++ } ++ ++ *buf++ = readl_relaxed(reg + (i << 2)); ++ } ++ ++ memcpy(val, (u8 *)p, bytes); ++ ++ mutex_unlock(&priv->lock); ++ ++ kfree(p); ++ ++ return 0; ++}; ++ ++static int imx_ele_ocotp_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct imx_ocotp_priv *priv; ++ struct nvmem_device *nvmem; ++ ++ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ priv->data = of_device_get_match_data(dev); ++ ++ priv->base = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(priv->base)) ++ return PTR_ERR(priv->base); ++ ++ priv->config.dev = dev; ++ priv->config.name = "ELE-OCOTP"; ++ priv->config.id = NVMEM_DEVID_AUTO; ++ priv->config.owner = THIS_MODULE; ++ priv->config.size = priv->data->size; ++ priv->config.reg_read = priv->data->reg_read; ++ priv->config.word_size = 4; ++ priv->config.stride = 1; ++ priv->config.priv = priv; ++ priv->config.read_only = true; ++ mutex_init(&priv->lock); ++ ++ nvmem = devm_nvmem_register(dev, &priv->config); ++ if (IS_ERR(nvmem)) ++ return PTR_ERR(nvmem); ++ ++ return 0; ++} ++ ++static const struct ocotp_devtype_data imx93_ocotp_data = { ++ .reg_off = 0x8000, ++ .reg_read = imx_ocotp_reg_read, ++ .size = 2048, ++ .num_entry = 6, ++ .entry = { ++ { 0, 52, FUSE_FSB }, ++ { 63, 1, FUSE_ELE}, ++ { 128, 16, FUSE_ELE }, ++ { 182, 1, FUSE_ELE }, ++ { 188, 1, FUSE_ELE }, ++ { 312, 200, FUSE_FSB } ++ }, ++}; ++ ++static const struct of_device_id imx_ele_ocotp_dt_ids[] = { ++ { .compatible = "fsl,imx93-ocotp", .data = &imx93_ocotp_data, }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, imx_ele_ocotp_dt_ids); ++ ++static struct platform_driver imx_ele_ocotp_driver = { ++ .driver = { ++ .name = "imx_ele_ocotp", ++ .of_match_table = imx_ele_ocotp_dt_ids, ++ }, ++ .probe = imx_ele_ocotp_probe, ++}; ++module_platform_driver(imx_ele_ocotp_driver); ++ ++MODULE_DESCRIPTION("i.MX OCOTP/ELE driver"); ++MODULE_AUTHOR("Peng Fan "); ++MODULE_LICENSE("GPL"); diff --git a/target/linux/generic/backport-6.1/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch b/target/linux/generic/backport-6.1/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch new file mode 100644 index 00000000000..59b2f9fa2c6 --- /dev/null +++ b/target/linux/generic/backport-6.1/813-v6.5-0011-nvmem-core-add-support-for-fixed-cells-layout.patch @@ -0,0 +1,96 @@ +From 27f699e578b1a72df89dfa3bc42e093a01dc8d10 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sun, 11 Jun 2023 15:03:29 +0100 +Subject: [PATCH] nvmem: core: add support for fixed cells *layout* +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This adds support for the "fixed-layout" NVMEM layout binding. It allows +defining NVMEM cells in a layout DT node named "nvmem-layout". + +While NVMEM subsystem supports layout drivers it has been discussed that +"fixed-layout" may actually be supperted internally. It's because: +1. It's a very basic layout +2. It allows sharing code with legacy syntax parsing +3. It's safer for soc_device_match() due to -EPROBE_DEFER +4. This will make the syntax transition easier + +Signed-off-by: Rafał Miłecki +Reviewed-by: Michael Walle +Signed-off-by: Srinivas Kandagatla +Message-ID: <20230611140330.154222-26-srinivas.kandagatla@linaro.org> +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/core.c | 32 +++++++++++++++++++++++++++++--- + 1 file changed, 29 insertions(+), 3 deletions(-) + +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -696,7 +696,7 @@ static int nvmem_validate_keepouts(struc + return 0; + } + +-static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) ++static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) + { + struct nvmem_layout *layout = nvmem->layout; + struct device *dev = &nvmem->dev; +@@ -704,7 +704,7 @@ static int nvmem_add_cells_from_of(struc + const __be32 *addr; + int len, ret; + +- for_each_child_of_node(dev->of_node, child) { ++ for_each_child_of_node(np, child) { + struct nvmem_cell_info info = {0}; + + addr = of_get_property(child, "reg", &len); +@@ -742,6 +742,28 @@ static int nvmem_add_cells_from_of(struc + return 0; + } + ++static int nvmem_add_cells_from_legacy_of(struct nvmem_device *nvmem) ++{ ++ return nvmem_add_cells_from_dt(nvmem, nvmem->dev.of_node); ++} ++ ++static int nvmem_add_cells_from_fixed_layout(struct nvmem_device *nvmem) ++{ ++ struct device_node *layout_np; ++ int err = 0; ++ ++ layout_np = of_nvmem_layout_get_container(nvmem); ++ if (!layout_np) ++ return 0; ++ ++ if (of_device_is_compatible(layout_np, "fixed-layout")) ++ err = nvmem_add_cells_from_dt(nvmem, layout_np); ++ ++ of_node_put(layout_np); ++ ++ return err; ++} ++ + int __nvmem_layout_register(struct nvmem_layout *layout, struct module *owner) + { + layout->owner = owner; +@@ -972,7 +994,7 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + +- rval = nvmem_add_cells_from_of(nvmem); ++ rval = nvmem_add_cells_from_legacy_of(nvmem); + if (rval) + goto err_remove_cells; + +@@ -982,6 +1004,10 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + ++ rval = nvmem_add_cells_from_fixed_layout(nvmem); ++ if (rval) ++ goto err_remove_cells; ++ + rval = nvmem_add_cells_from_layout(nvmem); + if (rval) + goto err_remove_cells; diff --git a/target/linux/generic/backport-6.1/890-v6.2-mtd-spinand-winbond-fix-flash-detection.patch b/target/linux/generic/backport-6.1/890-v6.2-mtd-spinand-winbond-fix-flash-detection.patch new file mode 100644 index 00000000000..38fbc3a3d73 --- /dev/null +++ b/target/linux/generic/backport-6.1/890-v6.2-mtd-spinand-winbond-fix-flash-detection.patch @@ -0,0 +1,40 @@ +From dbf70fc204d2fbb0d8ad8f42038a60846502efda Mon Sep 17 00:00:00 2001 +From: Mikhail Kshevetskiy +Date: Mon, 10 Oct 2022 13:51:09 +0300 +Subject: [PATCH] mtd: spinand: winbond: fix flash identification + +Winbond uses 3 bytes to identify flash: vendor_id, dev_id_0, dev_id_1, +but current driver uses only first 2 bytes of it for devices +identification. As result Winbond W25N02KV flash (id_bytes: EF, AA, 22) +is identified as W25N01GV (id_bytes: EF, AA, 21). + +Fix this by adding missed identification bytes. + +Signed-off-by: Mikhail Kshevetskiy +Reviewed-by: Frieder Schrempf +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20221010105110.446674-1-mikhail.kshevetskiy@iopsys.eu +--- + drivers/mtd/nand/spi/winbond.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/mtd/nand/spi/winbond.c ++++ b/drivers/mtd/nand/spi/winbond.c +@@ -76,7 +76,7 @@ static int w25m02gv_select_target(struct + + static const struct spinand_info winbond_spinand_table[] = { + SPINAND_INFO("W25M02GV", +- SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab), ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21), + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 2), + NAND_ECCREQ(1, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, +@@ -86,7 +86,7 @@ static const struct spinand_info winbond + SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL), + SPINAND_SELECT_TARGET(w25m02gv_select_target)), + SPINAND_INFO("W25N01GV", +- SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa), ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x21), + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), + NAND_ECCREQ(1, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, diff --git a/target/linux/generic/backport-6.1/891-v6.2-mtd-spinand-winbond-add-W25N02KV.patch b/target/linux/generic/backport-6.1/891-v6.2-mtd-spinand-winbond-add-W25N02KV.patch new file mode 100644 index 00000000000..d75a1acc57c --- /dev/null +++ b/target/linux/generic/backport-6.1/891-v6.2-mtd-spinand-winbond-add-W25N02KV.patch @@ -0,0 +1,106 @@ +From 6154c7a583483d7b69f53bea868efdc369edd563 Mon Sep 17 00:00:00 2001 +From: Mikhail Kshevetskiy +Date: Mon, 10 Oct 2022 13:51:10 +0300 +Subject: [PATCH] mtd: spinand: winbond: add Winbond W25N02KV flash support + +Add support of Winbond W25N02KV flash + +Signed-off-by: Mikhail Kshevetskiy +Reviewed-by: Frieder Schrempf +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20221010105110.446674-2-mikhail.kshevetskiy@iopsys.eu +--- + drivers/mtd/nand/spi/winbond.c | 75 ++++++++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + +--- a/drivers/mtd/nand/spi/winbond.c ++++ b/drivers/mtd/nand/spi/winbond.c +@@ -74,6 +74,72 @@ static int w25m02gv_select_target(struct + return spi_mem_exec_op(spinand->spimem, &op); + } + ++static int w25n02kv_ooblayout_ecc(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ if (section > 3) ++ return -ERANGE; ++ ++ region->offset = 64 + (16 * section); ++ region->length = 13; ++ ++ return 0; ++} ++ ++static int w25n02kv_ooblayout_free(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ if (section > 3) ++ return -ERANGE; ++ ++ region->offset = (16 * section) + 2; ++ region->length = 14; ++ ++ return 0; ++} ++ ++static const struct mtd_ooblayout_ops w25n02kv_ooblayout = { ++ .ecc = w25n02kv_ooblayout_ecc, ++ .free = w25n02kv_ooblayout_free, ++}; ++ ++static int w25n02kv_ecc_get_status(struct spinand_device *spinand, ++ u8 status) ++{ ++ struct nand_device *nand = spinand_to_nand(spinand); ++ u8 mbf = 0; ++ struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, &mbf); ++ ++ switch (status & STATUS_ECC_MASK) { ++ case STATUS_ECC_NO_BITFLIPS: ++ return 0; ++ ++ case STATUS_ECC_UNCOR_ERROR: ++ return -EBADMSG; ++ ++ case STATUS_ECC_HAS_BITFLIPS: ++ /* ++ * Let's try to retrieve the real maximum number of bitflips ++ * in order to avoid forcing the wear-leveling layer to move ++ * data around if it's not necessary. ++ */ ++ if (spi_mem_exec_op(spinand->spimem, &op)) ++ return nanddev_get_ecc_conf(nand)->strength; ++ ++ mbf >>= 4; ++ ++ if (WARN_ON(mbf > nanddev_get_ecc_conf(nand)->strength || !mbf)) ++ return nanddev_get_ecc_conf(nand)->strength; ++ ++ return mbf; ++ ++ default: ++ break; ++ } ++ ++ return -EINVAL; ++} ++ + static const struct spinand_info winbond_spinand_table[] = { + SPINAND_INFO("W25M02GV", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21), +@@ -94,6 +160,15 @@ static const struct spinand_info winbond + &update_cache_variants), + 0, + SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)), ++ SPINAND_INFO("W25N02KV", ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x22), ++ NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1), ++ NAND_ECCREQ(8, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, ++ &write_cache_variants, ++ &update_cache_variants), ++ 0, ++ SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)), + }; + + static int winbond_spinand_init(struct spinand_device *spinand) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 251a6fbcc32..a7308ede9d8 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -7472,7 +7472,7 @@ CONFIG_WATCHDOG_OPEN_TIMEOUT=0 # CONFIG_WD80x3 is not set # CONFIG_WDAT_WDT is not set # CONFIG_WDTPCI is not set -CONFIG_WERROR=y +# CONFIG_WERROR is not set # CONFIG_WEXT_CORE is not set # CONFIG_WEXT_PRIV is not set # CONFIG_WEXT_PROC is not set diff --git a/target/linux/generic/config-6.1 b/target/linux/generic/config-6.1 index 6252e668965..8bf9d4a3d85 100644 --- a/target/linux/generic/config-6.1 +++ b/target/linux/generic/config-6.1 @@ -239,6 +239,7 @@ CONFIG_ARCH_BINFMT_ELF_STATE=y # CONFIG_ARCH_EXYNOS is not set CONFIG_ARCH_FLATMEM_ENABLE=y # CONFIG_ARCH_FOOTBRIDGE is not set +CONFIG_ARCH_FORCE_MAX_ORDER=11 # CONFIG_ARCH_GEMINI is not set # CONFIG_ARCH_HI3xxx is not set # CONFIG_ARCH_HIGHBANK is not set @@ -2160,7 +2161,6 @@ CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_FONT_6x8 is not set # CONFIG_FONT_TER16x32 is not set # CONFIG_FORCEDETH is not set -CONFIG_FORCE_MAX_ZONEORDER=11 # CONFIG_FORCE_NR_CPUS is not set CONFIG_FORTIFY_SOURCE=y # CONFIG_FPGA is not set @@ -7731,7 +7731,7 @@ CONFIG_WATCHDOG_OPEN_TIMEOUT=0 # CONFIG_WD80x3 is not set # CONFIG_WDAT_WDT is not set # CONFIG_WDTPCI is not set -CONFIG_WERROR=y +# CONFIG_WERROR is not set # CONFIG_WEXT_CORE is not set # CONFIG_WEXT_PRIV is not set # CONFIG_WEXT_PROC is not set diff --git a/target/linux/generic/config-filter b/target/linux/generic/config-filter index e7aa90f8b54..e7eda471d04 100644 --- a/target/linux/generic/config-filter +++ b/target/linux/generic/config-filter @@ -5,6 +5,7 @@ # CONFIG_CC_(CAN|HAS|IS|VERSION)_.* is not set CONFIG_CLANG_VERSION=.* # CONFIG_GCC_VERSION is not set +CONFIG_FRAME_WARN=.* # CONFIG_HAVE_(?!(ARCH_TIMER|TCM|SMP)).* is not set # CONFIG_INLINE_.* is not set # CONFIG_LD_.* is not set diff --git a/target/linux/generic/hack-5.15/251-kconfig.patch b/target/linux/generic/hack-5.15/251-kconfig.patch index 0e24c3e8041..9350e366d86 100644 --- a/target/linux/generic/hack-5.15/251-kconfig.patch +++ b/target/linux/generic/hack-5.15/251-kconfig.patch @@ -199,7 +199,7 @@ Signed-off-by: John Crispin bool --- a/net/Kconfig +++ b/net/Kconfig -@@ -432,7 +432,7 @@ config NET_DEVLINK +@@ -430,7 +430,7 @@ config NET_DEVLINK default n config PAGE_POOL diff --git a/target/linux/generic/hack-5.15/280-rfkill-stubs.patch b/target/linux/generic/hack-5.15/280-rfkill-stubs.patch index 7a650d132eb..ff6638f7a05 100644 --- a/target/linux/generic/hack-5.15/280-rfkill-stubs.patch +++ b/target/linux/generic/hack-5.15/280-rfkill-stubs.patch @@ -26,7 +26,7 @@ Signed-off-by: John Crispin * @name: name of the struct -- the string is not copied internally --- a/net/Makefile +++ b/net/Makefile -@@ -52,7 +52,7 @@ obj-$(CONFIG_TIPC) += tipc/ +@@ -51,7 +51,7 @@ obj-$(CONFIG_TIPC) += tipc/ obj-$(CONFIG_NETLABEL) += netlabel/ obj-$(CONFIG_IUCV) += iucv/ obj-$(CONFIG_SMC) += smc/ diff --git a/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch b/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch index 683aa8a8df3..2fa91deece4 100644 --- a/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch +++ b/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch @@ -14,7 +14,7 @@ Signed-off-by: Rui Salvaterra --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2735,7 +2735,7 @@ int nf_conntrack_init_start(void) +@@ -2738,7 +2738,7 @@ int nf_conntrack_init_start(void) if (!nf_conntrack_htable_size) { nf_conntrack_htable_size diff --git a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch index 2593f7c0fcb..69771cef398 100644 --- a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1679,6 +1679,10 @@ enum netdev_priv_flags { +@@ -1682,6 +1682,10 @@ enum netdev_priv_flags { IFF_TX_SKB_NO_LINEAR = BIT_ULL(31), }; @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN #define IFF_EBRIDGE IFF_EBRIDGE #define IFF_BONDING IFF_BONDING -@@ -1711,6 +1715,7 @@ enum netdev_priv_flags { +@@ -1714,6 +1718,7 @@ enum netdev_priv_flags { #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER #define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK #define IFF_TX_SKB_NO_LINEAR IFF_TX_SKB_NO_LINEAR @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* Specifies the type of the struct net_device::ml_priv pointer */ enum netdev_ml_priv_type { -@@ -2012,6 +2017,7 @@ struct net_device { +@@ -2014,6 +2019,7 @@ struct net_device { /* Read-mostly cache-line for fast-path access */ unsigned int flags; unsigned int priv_flags; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau const struct net_device_ops *netdev_ops; int ifindex; unsigned short gflags; -@@ -2072,6 +2078,11 @@ struct net_device { +@@ -2074,6 +2080,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -58,7 +58,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned char operstate; -@@ -2146,6 +2157,10 @@ struct net_device { +@@ -2145,6 +2156,10 @@ struct net_device { struct mctp_dev __rcu *mctp_ptr; #endif diff --git a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch index 367d66fc666..96d800669a8 100644 --- a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch @@ -29,7 +29,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1169,6 +1171,11 @@ static const struct usb_device_id option +@@ -1173,6 +1175,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/hack-6.1/661-kernel-ct-size-the-hashtable-more-adequately.patch b/target/linux/generic/hack-6.1/661-kernel-ct-size-the-hashtable-more-adequately.patch index b9dda6cadab..fe94a9da0c4 100644 --- a/target/linux/generic/hack-6.1/661-kernel-ct-size-the-hashtable-more-adequately.patch +++ b/target/linux/generic/hack-6.1/661-kernel-ct-size-the-hashtable-more-adequately.patch @@ -14,7 +14,7 @@ Signed-off-by: Rui Salvaterra --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2702,7 +2702,7 @@ int nf_conntrack_init_start(void) +@@ -2705,7 +2705,7 @@ int nf_conntrack_init_start(void) if (!nf_conntrack_htable_size) { nf_conntrack_htable_size diff --git a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch index ff23e781a62..91dc3e01108 100644 --- a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1704,6 +1704,7 @@ enum netdev_priv_flags { +@@ -1707,6 +1707,7 @@ enum netdev_priv_flags { IFF_LIVE_RENAME_OK = 1<<30, IFF_TX_SKB_NO_LINEAR = BIT_ULL(31), IFF_CHANGE_PROTO_DOWN = BIT_ULL(32), @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1738,6 +1739,7 @@ enum netdev_priv_flags { +@@ -1741,6 +1742,7 @@ enum netdev_priv_flags { #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER #define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK #define IFF_TX_SKB_NO_LINEAR IFF_TX_SKB_NO_LINEAR @@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau /* Specifies the type of the struct net_device::ml_priv pointer */ enum netdev_ml_priv_type { -@@ -2106,6 +2108,11 @@ struct net_device { +@@ -2109,6 +2111,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned char operstate; -@@ -2181,6 +2188,10 @@ struct net_device { +@@ -2184,6 +2191,10 @@ struct net_device { struct mctp_dev __rcu *mctp_ptr; #endif diff --git a/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch index 23f8be5d264..7257f7010bb 100644 --- a/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch @@ -29,7 +29,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1169,6 +1171,11 @@ static const struct usb_device_id option +@@ -1173,6 +1175,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/hack-6.1/790-SFP-GE-T-ignore-TX_FAULT.patch b/target/linux/generic/hack-6.1/790-SFP-GE-T-ignore-TX_FAULT.patch index 6e14d04c5fd..afb9f3d9076 100644 --- a/target/linux/generic/hack-6.1/790-SFP-GE-T-ignore-TX_FAULT.patch +++ b/target/linux/generic/hack-6.1/790-SFP-GE-T-ignore-TX_FAULT.patch @@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report // 2500MBd NRZ in their EEPROM SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex), -@@ -2334,7 +2337,8 @@ static void sfp_sm_main(struct sfp *sfp, +@@ -2339,7 +2342,8 @@ static void sfp_sm_main(struct sfp *sfp, * or t_start_up, so assume there is a fault. */ sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT, @@ -46,7 +46,7 @@ Signed-off-by: Daniel Golle } else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) { init_done: /* Create mdiobus and start trying for PHY */ -@@ -2563,10 +2567,12 @@ static void sfp_check_state(struct sfp * +@@ -2568,10 +2572,12 @@ static void sfp_check_state(struct sfp * mutex_lock(&sfp->st_mutex); state = sfp_get_state(sfp); changed = state ^ sfp->state; diff --git a/target/linux/generic/pending-5.15/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-5.15/300-mips_expose_boot_raw.patch index 05d024925df..436c2cc767c 100644 --- a/target/linux/generic/pending-5.15/300-mips_expose_boot_raw.patch +++ b/target/linux/generic/pending-5.15/300-mips_expose_boot_raw.patch @@ -9,7 +9,7 @@ Acked-by: Rob Landley --- --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1100,9 +1100,6 @@ config FW_ARC +@@ -1101,9 +1101,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -19,7 +19,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -3182,6 +3179,18 @@ choice +@@ -3183,6 +3180,18 @@ choice bool "Extend builtin kernel arguments with bootloader arguments" endchoice diff --git a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index e56fd325123..f01348d349d 100644 --- a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2098,6 +2098,8 @@ struct net_device { +@@ -2100,6 +2100,8 @@ struct net_device { struct netdev_hw_addr_list mc; struct netdev_hw_addr_list dev_addrs; @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u8 inner_protocol_type:1; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6067,6 +6067,9 @@ static enum gro_result dev_gro_receive(s +@@ -6069,6 +6069,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -8081,6 +8084,48 @@ static void __netdev_adjacent_dev_unlink +@@ -8083,6 +8086,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -8132,6 +8177,7 @@ static int __netdev_upper_dev_link(struc +@@ -8134,6 +8179,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -8228,6 +8274,7 @@ static void __netdev_upper_dev_unlink(st +@@ -8230,6 +8276,7 @@ static void __netdev_upper_dev_unlink(st __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -9047,6 +9094,7 @@ int dev_set_mac_address(struct net_devic +@@ -9049,6 +9096,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch b/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch index a3274906a43..4ff7f321de9 100644 --- a/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch +++ b/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch @@ -15,7 +15,7 @@ Signed-off-by: Alexander Couzens --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2412,7 +2412,7 @@ mt7531_setup(struct dsa_switch *ds) +@@ -2422,7 +2422,7 @@ mt7531_setup(struct dsa_switch *ds) struct mt7530_priv *priv = ds->priv; struct mt7530_dummy_poll p; u32 val, id; @@ -24,7 +24,7 @@ Signed-off-by: Alexander Couzens /* Reset whole chip through gpio pin or memory-mapped registers for * different type of hardware -@@ -2444,6 +2444,10 @@ mt7531_setup(struct dsa_switch *ds) +@@ -2454,6 +2454,10 @@ mt7531_setup(struct dsa_switch *ds) return -ENODEV; } diff --git a/target/linux/generic/pending-5.15/729-net-phy-realtek-introduce-rtl822x_probe.patch b/target/linux/generic/pending-5.15/729-net-phy-realtek-introduce-rtl822x_probe.patch index 87102d38187..cea3511b830 100644 --- a/target/linux/generic/pending-5.15/729-net-phy-realtek-introduce-rtl822x_probe.patch +++ b/target/linux/generic/pending-5.15/729-net-phy-realtek-introduce-rtl822x_probe.patch @@ -50,23 +50,7 @@ Signed-off-by: Daniel Golle static int rtlgen_resume(struct phy_device *phydev) { int ret = genphy_resume(phydev); -@@ -1013,6 +1036,7 @@ static struct phy_driver realtek_drvs[] - .match_phy_device = rtl8226_match_phy_device, - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, -+ .probe = rtl822x_probe, - .read_status = rtl822x_read_status, - .suspend = genphy_suspend, - .resume = rtlgen_resume, -@@ -1026,6 +1050,7 @@ static struct phy_driver realtek_drvs[] - .name = "RTL8226B_RTL8221B 2.5Gbps PHY", - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, -+ .probe = rtl822x_probe, - .read_status = rtl822x_read_status, - .suspend = genphy_suspend, - .resume = rtlgen_resume, -@@ -1039,6 +1064,7 @@ static struct phy_driver realtek_drvs[] +@@ -1039,6 +1062,7 @@ static struct phy_driver realtek_drvs[] .name = "RTL8226-CG 2.5Gbps PHY", .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, @@ -74,7 +58,7 @@ Signed-off-by: Daniel Golle .read_status = rtl822x_read_status, .suspend = genphy_suspend, .resume = rtlgen_resume, -@@ -1050,6 +1076,7 @@ static struct phy_driver realtek_drvs[] +@@ -1050,6 +1074,7 @@ static struct phy_driver realtek_drvs[] .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY", .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, @@ -82,7 +66,7 @@ Signed-off-by: Daniel Golle .read_status = rtl822x_read_status, .suspend = genphy_suspend, .resume = rtlgen_resume, -@@ -1062,6 +1089,7 @@ static struct phy_driver realtek_drvs[] +@@ -1062,6 +1087,7 @@ static struct phy_driver realtek_drvs[] .get_features = rtl822x_get_features, .config_init = rtl8221b_config_init, .config_aneg = rtl822x_config_aneg, @@ -90,7 +74,7 @@ Signed-off-by: Daniel Golle .read_status = rtl822x_read_status, .suspend = genphy_suspend, .resume = rtlgen_resume, -@@ -1074,6 +1102,7 @@ static struct phy_driver realtek_drvs[] +@@ -1074,6 +1100,7 @@ static struct phy_driver realtek_drvs[] .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .config_init = rtl8221b_config_init, diff --git a/target/linux/generic/pending-5.15/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch b/target/linux/generic/pending-5.15/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch index 6d414bfbade..b1e7a35a556 100644 --- a/target/linux/generic/pending-5.15/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch +++ b/target/linux/generic/pending-5.15/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle static int rtl822x_probe(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; -@@ -1084,7 +1116,7 @@ static struct phy_driver realtek_drvs[] +@@ -1082,7 +1114,7 @@ static struct phy_driver realtek_drvs[] .write_page = rtl821x_write_page, .soft_reset = genphy_soft_reset, }, { diff --git a/target/linux/generic/pending-5.15/740-net-phy-motorcomm-Add-missing-include.patch b/target/linux/generic/pending-5.15/740-net-phy-motorcomm-Add-missing-include.patch new file mode 100644 index 00000000000..2a1f908cfb3 --- /dev/null +++ b/target/linux/generic/pending-5.15/740-net-phy-motorcomm-Add-missing-include.patch @@ -0,0 +1,22 @@ +From 6f291aa7da199c6486cc229b055dcbcd5cee7a21 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 21 May 2023 22:24:56 +0200 +Subject: [PATCH] net: phy: motorcomm: Add missing include + +Directly include linux/bitfield.h which provides FIELD_PREP. + +Signed-off-by: Hauke Mehrtens +--- + drivers/net/phy/motorcomm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -6,6 +6,7 @@ + * Author: Frank + */ + ++#include + #include + #include + #include diff --git a/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch b/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch index 67e9d6419bc..1ccdea6d993 100644 --- a/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch +++ b/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau /** * napi_disable - prevent NAPI from scheduling -@@ -3365,6 +3366,7 @@ struct softnet_data { +@@ -3364,6 +3365,7 @@ struct softnet_data { unsigned int processed; unsigned int time_squeeze; unsigned int received_rps; @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #endif --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4576,7 +4576,7 @@ static int rps_ipi_queued(struct softnet +@@ -4578,7 +4578,7 @@ static int rps_ipi_queued(struct softnet #ifdef CONFIG_RPS struct softnet_data *mysd = this_cpu_ptr(&softnet_data); @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; -@@ -5757,6 +5757,8 @@ static DEFINE_PER_CPU(struct work_struct +@@ -5759,6 +5759,8 @@ static DEFINE_PER_CPU(struct work_struct /* Network device is going away, flush any packets still pending */ static void flush_backlog(struct work_struct *work) { @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau struct sk_buff *skb, *tmp; struct softnet_data *sd; -@@ -5772,9 +5774,18 @@ static void flush_backlog(struct work_st +@@ -5774,9 +5776,18 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); -@@ -5782,7 +5793,18 @@ static void flush_backlog(struct work_st +@@ -5784,7 +5795,18 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -86,7 +86,7 @@ Signed-off-by: Felix Fietkau } static bool flush_required(int cpu) -@@ -6465,6 +6487,7 @@ static int process_backlog(struct napi_s +@@ -6467,6 +6489,7 @@ static int process_backlog(struct napi_s local_irq_disable(); rps_lock(sd); @@ -94,7 +94,7 @@ Signed-off-by: Felix Fietkau if (skb_queue_empty(&sd->input_pkt_queue)) { /* * Inline a custom version of __napi_complete(). -@@ -6474,7 +6497,8 @@ static int process_backlog(struct napi_s +@@ -6476,7 +6499,8 @@ static int process_backlog(struct napi_s * We can use a plain write instead of clear_bit(), * and we dont need an smp_mb() memory barrier. */ @@ -104,7 +104,7 @@ Signed-off-by: Felix Fietkau again = false; } else { skb_queue_splice_tail_init(&sd->input_pkt_queue, -@@ -6891,6 +6915,57 @@ int dev_set_threaded(struct net_device * +@@ -6893,6 +6917,57 @@ int dev_set_threaded(struct net_device * } EXPORT_SYMBOL(dev_set_threaded); diff --git a/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch b/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch index 8a64a2a985e..98fd6e9c7a7 100644 --- a/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch +++ b/target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch @@ -16,7 +16,7 @@ Signed-off-by: David Bauer --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2121,10 +2121,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr +@@ -2129,10 +2129,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr { struct dsa_switch *ds = priv->ds; struct device *dev = priv->dev; @@ -30,7 +30,7 @@ Signed-off-by: David Bauer bus = devm_mdiobus_alloc(dev); if (!bus) return -ENOMEM; -@@ -2141,7 +2144,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr +@@ -2149,7 +2152,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr if (priv->irq) mt7530_setup_mdio_irq(priv); diff --git a/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch index a4413e919b4..82576d644d7 100644 --- a/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch +++ b/target/linux/generic/pending-6.1/300-mips_expose_boot_raw.patch @@ -9,7 +9,7 @@ Acked-by: Rob Landley --- --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1032,9 +1032,6 @@ config FW_ARC +@@ -1033,9 +1033,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -19,7 +19,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -3089,6 +3086,18 @@ choice +@@ -3090,6 +3087,18 @@ choice bool "Extend builtin kernel arguments with bootloader arguments" endchoice diff --git a/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 9e508fd2e7f..9b264b3a05a 100644 --- a/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2132,6 +2132,8 @@ struct net_device { +@@ -2135,6 +2135,8 @@ struct net_device { struct netdev_hw_addr_list mc; struct netdev_hw_addr_list dev_addrs; @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -7606,6 +7606,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7608,6 +7608,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7657,6 +7699,7 @@ static int __netdev_upper_dev_link(struc +@@ -7659,6 +7701,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7753,6 +7796,7 @@ static void __netdev_upper_dev_unlink(st +@@ -7755,6 +7798,7 @@ static void __netdev_upper_dev_unlink(st __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -109,7 +109,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8805,6 +8849,7 @@ int dev_set_mac_address(struct net_devic +@@ -8807,6 +8851,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-6.1/729-net-phy-realtek-introduce-rtl822x_probe.patch b/target/linux/generic/pending-6.1/729-net-phy-realtek-introduce-rtl822x_probe.patch index b5dbfa383a2..2eca27310f0 100644 --- a/target/linux/generic/pending-6.1/729-net-phy-realtek-introduce-rtl822x_probe.patch +++ b/target/linux/generic/pending-6.1/729-net-phy-realtek-introduce-rtl822x_probe.patch @@ -50,23 +50,7 @@ Signed-off-by: Daniel Golle static int rtlgen_resume(struct phy_device *phydev) { int ret = genphy_resume(phydev); -@@ -1033,6 +1056,7 @@ static struct phy_driver realtek_drvs[] - .match_phy_device = rtl8226_match_phy_device, - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, -+ .probe = rtl822x_probe, - .read_status = rtl822x_read_status, - .suspend = genphy_suspend, - .resume = rtlgen_resume, -@@ -1046,6 +1070,7 @@ static struct phy_driver realtek_drvs[] - .name = "RTL8226B_RTL8221B 2.5Gbps PHY", - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, -+ .probe = rtl822x_probe, - .read_status = rtl822x_read_status, - .suspend = genphy_suspend, - .resume = rtlgen_resume, -@@ -1059,6 +1084,7 @@ static struct phy_driver realtek_drvs[] +@@ -1059,6 +1082,7 @@ static struct phy_driver realtek_drvs[] .name = "RTL8226-CG 2.5Gbps PHY", .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, @@ -74,7 +58,7 @@ Signed-off-by: Daniel Golle .read_status = rtl822x_read_status, .suspend = genphy_suspend, .resume = rtlgen_resume, -@@ -1070,6 +1096,7 @@ static struct phy_driver realtek_drvs[] +@@ -1070,6 +1094,7 @@ static struct phy_driver realtek_drvs[] .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY", .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, @@ -82,7 +66,7 @@ Signed-off-by: Daniel Golle .read_status = rtl822x_read_status, .suspend = genphy_suspend, .resume = rtlgen_resume, -@@ -1082,6 +1109,7 @@ static struct phy_driver realtek_drvs[] +@@ -1082,6 +1107,7 @@ static struct phy_driver realtek_drvs[] .get_features = rtl822x_get_features, .config_init = rtl8221b_config_init, .config_aneg = rtl822x_config_aneg, @@ -90,7 +74,7 @@ Signed-off-by: Daniel Golle .read_status = rtl822x_read_status, .suspend = genphy_suspend, .resume = rtlgen_resume, -@@ -1094,6 +1122,7 @@ static struct phy_driver realtek_drvs[] +@@ -1094,6 +1120,7 @@ static struct phy_driver realtek_drvs[] .get_features = rtl822x_get_features, .config_aneg = rtl822x_config_aneg, .config_init = rtl8221b_config_init, diff --git a/target/linux/generic/pending-6.1/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch b/target/linux/generic/pending-6.1/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch index ac385551516..97e128ccdb7 100644 --- a/target/linux/generic/pending-6.1/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch +++ b/target/linux/generic/pending-6.1/730-net-phy-realtek-detect-early-version-of-RTL8221B.patch @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle static int rtl822x_probe(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; -@@ -1104,7 +1136,7 @@ static struct phy_driver realtek_drvs[] +@@ -1102,7 +1134,7 @@ static struct phy_driver realtek_drvs[] .write_page = rtl821x_write_page, .soft_reset = genphy_soft_reset, }, { diff --git a/target/linux/generic/pending-6.1/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch b/target/linux/generic/pending-6.1/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch index 204440c41fb..d1203d76ce8 100644 --- a/target/linux/generic/pending-6.1/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch +++ b/target/linux/generic/pending-6.1/731-net-permit-ieee80211_ptr-even-with-no-CFG82111-suppo.patch @@ -17,7 +17,7 @@ Signed-off-by: Christian Marangi --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2167,7 +2167,7 @@ struct net_device { +@@ -2170,7 +2170,7 @@ struct net_device { #if IS_ENABLED(CONFIG_AX25) void *ax25_ptr; #endif diff --git a/target/linux/generic/pending-6.1/740-net-phy-motorcomm-Add-missing-include.patch b/target/linux/generic/pending-6.1/740-net-phy-motorcomm-Add-missing-include.patch new file mode 100644 index 00000000000..2a1f908cfb3 --- /dev/null +++ b/target/linux/generic/pending-6.1/740-net-phy-motorcomm-Add-missing-include.patch @@ -0,0 +1,22 @@ +From 6f291aa7da199c6486cc229b055dcbcd5cee7a21 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 21 May 2023 22:24:56 +0200 +Subject: [PATCH] net: phy: motorcomm: Add missing include + +Directly include linux/bitfield.h which provides FIELD_PREP. + +Signed-off-by: Hauke Mehrtens +--- + drivers/net/phy/motorcomm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -6,6 +6,7 @@ + * Author: Frank + */ + ++#include + #include + #include + #include diff --git a/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch b/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch index ae06c9d4b95..d4fb672eaa3 100644 --- a/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch +++ b/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau /** * napi_disable - prevent NAPI from scheduling -@@ -3127,6 +3128,7 @@ struct softnet_data { +@@ -3130,6 +3131,7 @@ struct softnet_data { unsigned int processed; unsigned int time_squeeze; unsigned int received_rps; @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #endif --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4606,7 +4606,7 @@ static int napi_schedule_rps(struct soft +@@ -4608,7 +4608,7 @@ static int napi_schedule_rps(struct soft struct softnet_data *mysd = this_cpu_ptr(&softnet_data); #ifdef CONFIG_RPS @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; -@@ -5787,6 +5787,8 @@ static DEFINE_PER_CPU(struct work_struct +@@ -5789,6 +5789,8 @@ static DEFINE_PER_CPU(struct work_struct /* Network device is going away, flush any packets still pending */ static void flush_backlog(struct work_struct *work) { @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau struct sk_buff *skb, *tmp; struct softnet_data *sd; -@@ -5801,8 +5803,17 @@ static void flush_backlog(struct work_st +@@ -5803,8 +5805,17 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); -@@ -5810,7 +5821,16 @@ static void flush_backlog(struct work_st +@@ -5812,7 +5823,16 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau } static bool flush_required(int cpu) -@@ -5942,6 +5962,7 @@ static int process_backlog(struct napi_s +@@ -5944,6 +5964,7 @@ static int process_backlog(struct napi_s } rps_lock_irq_disable(sd); @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (skb_queue_empty(&sd->input_pkt_queue)) { /* * Inline a custom version of __napi_complete(). -@@ -5951,7 +5972,8 @@ static int process_backlog(struct napi_s +@@ -5953,7 +5974,8 @@ static int process_backlog(struct napi_s * We can use a plain write instead of clear_bit(), * and we dont need an smp_mb() memory barrier. */ @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau again = false; } else { skb_queue_splice_tail_init(&sd->input_pkt_queue, -@@ -6367,6 +6389,55 @@ int dev_set_threaded(struct net_device * +@@ -6369,6 +6391,55 @@ int dev_set_threaded(struct net_device * } EXPORT_SYMBOL(dev_set_threaded); @@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi, int (*poll)(struct napi_struct *, int), int weight) { -@@ -11139,6 +11210,9 @@ static int dev_cpu_dead(unsigned int old +@@ -11141,6 +11212,9 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau #ifdef CONFIG_RPS remsd = oldsd->rps_ipi_list; oldsd->rps_ipi_list = NULL; -@@ -11442,6 +11516,7 @@ static int __init net_dev_init(void) +@@ -11444,6 +11518,7 @@ static int __init net_dev_init(void) INIT_CSD(&sd->defer_csd, trigger_rx_softirq, sd); spin_lock_init(&sd->defer_lock); diff --git a/target/linux/imx/config-5.15 b/target/linux/imx/config-5.15 index 73d0b3fe786..7caaacbed70 100644 --- a/target/linux/imx/config-5.15 +++ b/target/linux/imx/config-5.15 @@ -295,6 +295,7 @@ CONFIG_NR_CPUS=4 CONFIG_NVMEM=y # CONFIG_NVMEM_IMX_IIM is not set CONFIG_NVMEM_IMX_OCOTP=y +# CONFIG_NVMEM_IMX_OCOTP_ELE is not set # CONFIG_NVMEM_SNVS_LPGPR is not set CONFIG_NVMEM_SYSFS=y CONFIG_OF=y diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index b131d0d6182..1a74fb792ce 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -107,6 +107,10 @@ ipq40xx_setup_interfaces() zte,mf286d) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan" ;; + zte,mf287plus) + ucidef_set_interface_lan "lan1 lan2 lan3 lan4" + ucidef_set_interface "wan" device "/dev/cdc-wdm0" protocol "qmi" + ;; *) echo "Unsupported hardware. Network interfaces not initialized" ;; diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 988921fa8c1..e6e99b9d212 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -27,6 +27,7 @@ EOF ;; zte,mf18a |\ zte,mf286d |\ + zte,mf287plus |\ zte,mf289f) CI_UBIPART="rootfs" local mtdnum="$( find_mtd_index $CI_UBIPART )" @@ -208,6 +209,7 @@ platform_do_upgrade() { teltonika,rutx10 |\ zte,mf18a |\ zte,mf286d |\ + zte,mf287plus |\ zte,mf289f) CI_UBIPART="rootfs" nand_do_upgrade "$1" diff --git a/target/linux/ipq40xx/config-5.15 b/target/linux/ipq40xx/config-5.15 index d5bde551783..0acc013a813 100644 --- a/target/linux/ipq40xx/config-5.15 +++ b/target/linux/ipq40xx/config-5.15 @@ -376,6 +376,7 @@ CONFIG_PINCTRL_MSM=y # CONFIG_PINCTRL_SM8250 is not set CONFIG_PM_OPP=y CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO_RESTART=y CONFIG_POWER_RESET_MSM=y CONFIG_POWER_SUPPLY=y CONFIG_PPS=y diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts new file mode 100644 index 00000000000..6c285f4b8ad --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts @@ -0,0 +1,384 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2022, Pawel Dembicki . +// Copyright (c) 2022, Giammarco Marzano . +// Copyright (c) 2023, Andreas Böhler + +#include "qcom-ipq4019.dtsi" +#include +#include +#include +#include + +/ { + model = "ZTE MF287Plus"; + compatible = "zte,mf287plus"; + + aliases { + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + /* + * bootargs forced by u-boot bootipq command: + * 'ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs rootwait' + */ + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + /* + * This node is used to restart modem module to avoid anomalous + * behaviours on initial communication. + */ + gpio-restart { + compatible = "gpio-restart"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + }; + + leds { + compatible = "gpio-leds"; + + led_status: led-0 { + label = "blue:power"; + function = LED_FUNCTION_POWER; + color = ; + gpios = <&tlmm 0 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + key-reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + }; + + key-wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + }; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + }; +}; + +&mdio { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&blsp_dma { + status = "okay"; +}; + +&usb2 { + status = "okay"; +}; + +&usb3 { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, + <&tlmm 59 GPIO_ACTIVE_HIGH>, + <&tlmm 1 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0xc0000>; + read-only; + }; + + partition@1b0000 { + label = "0:reserved1"; + reg = <0x1b0000 0x50000>; + read-only; + }; + }; + }; + + spi-nand@1 { /* flash@1 ? */ + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = <0x0 0x140000>; + read-only; + }; + + partition@140000 { + label = "ART"; + reg = <0x140000 0x140000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@280000 { + label = "mac"; + reg = <0x280000 0x140000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + partition@3c0000 { + label = "cfg-param"; + reg = <0x3c0000 0x600000>; + read-only; + }; + + partition@9c0000 { + label = "oops"; + reg = <0x9c0000 0x140000>; + }; + + partition@b00000 { + label = "web"; + reg = <0xb00000 0x800000>; + }; + + partition@1300000 { + label = "rootfs"; + reg = <0x1300000 0x2200000>; + }; + + partition@3500000 { + label = "data"; + reg = <0x3500000 0x1900000>; + }; + + partition@4e00000 { + label = "fota"; + reg = <0x4e00000 0x3200000>; + }; + }; + }; + + zigbee@2 { + #address-cells = <1>; + #size-cells = <0>; + + compatible = "silabs,em3581"; + reg = <2>; + spi-max-frequency = <12000000>; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac { + status = "okay"; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_mac_0>; + mac-address-increment = <2>; +}; + +&switch { + status = "okay"; +}; + +&swport2 { + status = "okay"; + + label = "lan1"; +}; + +&swport3 { + status = "okay"; + + label = "lan2"; +}; + +&swport4 { + status = "okay"; + + label = "lan3"; +}; + +&swport5 { + status = "okay"; + + label = "lan4"; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59", "gpio1"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0>; + qcom,ath10k-calibration-variant = "zte,mf287plus"; +}; + +&wifi1 { + status = "okay"; + nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0>; + mac-address-increment = <1>; + qcom,ath10k-calibration-variant = "zte,mf287plus"; +}; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 59d4f082ff8..b9e9e478d9f 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -764,6 +764,7 @@ define Device/meraki_mr33 BLOCKSIZE := 128k PAGESIZE := 2048 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct + DEFAULT := n endef TARGET_DEVICES += meraki_mr33 @@ -776,6 +777,7 @@ define Device/meraki_mr74 PAGESIZE := 2048 DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct DEVICE_DTS_CONFIG := config@3 + DEFAULT := n endef TARGET_DEVICES += meraki_mr74 @@ -1146,6 +1148,24 @@ define Device/zte_mf286d endef TARGET_DEVICES += zte_mf286d +define Device/zte_mf287plus + $(call Device/zte_mf28x_common) + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + DEVICE_MODEL := MF287Plus + DEVICE_ALT0_VENDOR := ZTE + DEVICE_ALT0_MODEL := MF287 + DEVICE_PACKAGES += ipq-wifi-zte_mf287plus + SOC := qcom-ipq4018 +# The recovery image is used to return back to stock (an initramfs-based image +# that can be flashed to the device via sysupgrade +# The factory image is used to install from the stock firmware by using an +# exploit for the web interface + IMAGES += factory.bin recovery.bin + IMAGE/factory.bin := append-ubi + IMAGE/recovery.bin := append-squashfs4-fakeroot | sysupgrade-tar kernel=$$$$(BIN_DIR)/openwrt-$$(BOARD)$$(if $$(SUBTARGET),-$$(SUBTARGET))-$$(DEVICE_NAME)-initramfs-zImage.itb rootfs=$$$$@ | append-metadata +endef +TARGET_DEVICES += zte_mf287plus + define Device/zte_mf289f $(call Device/zte_mf28x_common) DEVICE_MODEL := MF289F diff --git a/target/linux/ipq806x/config-5.15 b/target/linux/ipq806x/config-5.15 index 902da148130..1f456b2ce9f 100644 --- a/target/linux/ipq806x/config-5.15 +++ b/target/linux/ipq806x/config-5.15 @@ -35,8 +35,8 @@ CONFIG_ARM_CPU_SUSPEND=y CONFIG_ARM_CRYPTO=y CONFIG_ARM_GIC=y CONFIG_ARM_HAS_SG_CHAIN=y -# CONFIG_ARM_IPQ806X_FAB_DEVFREQ is not set -# CONFIG_ARM_KRAIT_CACHE_DEVFREQ is not set +CONFIG_ARM_IPQ806X_FAB_DEVFREQ=y +CONFIG_ARM_KRAIT_CACHE_DEVFREQ=y CONFIG_ARM_L1_CACHE_SHIFT=6 CONFIG_ARM_L1_CACHE_SHIFT_6=y CONFIG_ARM_PATCH_IDIV=y @@ -71,8 +71,8 @@ CONFIG_CPU_COPY_V6=y CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_ATTR_SET=y CONFIG_CPU_FREQ_GOV_COMMON=y # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set diff --git a/target/linux/ipq806x/config-6.1 b/target/linux/ipq806x/config-6.1 index 02d310653bc..b30a6353967 100644 --- a/target/linux/ipq806x/config-6.1 +++ b/target/linux/ipq806x/config-6.1 @@ -3,7 +3,6 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_APQ_MMCC_8084 is not set CONFIG_AR8216_PHY=y CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_HIBERNATION_POSSIBLE=y # CONFIG_ARCH_IPQ40XX is not set CONFIG_ARCH_IPQ806X=y @@ -39,8 +38,8 @@ CONFIG_ARM_CPU_SUSPEND=y CONFIG_ARM_CRYPTO=y CONFIG_ARM_GIC=y CONFIG_ARM_HAS_SG_CHAIN=y -# CONFIG_ARM_IPQ806X_FAB_DEVFREQ is not set -# CONFIG_ARM_KRAIT_CACHE_DEVFREQ is not set +CONFIG_ARM_IPQ806X_FAB_DEVFREQ=y +CONFIG_ARM_KRAIT_CACHE_DEVFREQ=y CONFIG_ARM_L1_CACHE_SHIFT=6 CONFIG_ARM_L1_CACHE_SHIFT_6=y CONFIG_ARM_PATCH_IDIV=y @@ -75,8 +74,8 @@ CONFIG_CPU_COPY_V6=y CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_ATTR_SET=y CONFIG_CPU_FREQ_GOV_COMMON=y # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set diff --git a/target/linux/ipq806x/files-6.1/arch/arm/boot/dts/qcom-ipq8065-xr450.dts b/target/linux/ipq806x/files-6.1/arch/arm/boot/dts/qcom-ipq8065-xr450.dts new file mode 100644 index 00000000000..4353aec7ac0 --- /dev/null +++ b/target/linux/ipq806x/files-6.1/arch/arm/boot/dts/qcom-ipq8065-xr450.dts @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8065-nighthawk.dtsi" + +/ { + model = "Netgear Nighthawk XR450"; + compatible = "netgear,xr450", "qcom,ipq8065", "qcom,ipq8064"; + +}; + +&leds { + usb1 { + label = "white:usb1"; + gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; + }; + + usb2 { + label = "white:usb2"; + gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>; + }; +}; + +&partitions { + partition@1880000 { + label = "ubi"; + reg = <0x1880000 0xce00000>; + }; + + partition@e680000 { + label = "reserve"; + reg = <0xe680000 0x0780000>; + read-only; + }; +}; + +&wifi0 { + nvmem-cells = <&macaddr_art_c>, <&precal_art_1000>; + nvmem-cell-names = "mac-address", "pre-calibration"; +}; + +&wifi1 { + nvmem-cells = <&macaddr_art_0>, <&precal_art_5000>; + nvmem-cell-names = "mac-address", "pre-calibration"; +}; + +&art { + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; +}; diff --git a/target/linux/ipq807x/generic/target.mk b/target/linux/ipq807x/generic/target.mk deleted file mode 100644 index f5cb1fb19b9..00000000000 --- a/target/linux/ipq807x/generic/target.mk +++ /dev/null @@ -1 +0,0 @@ -BOARDNAME:=Generic diff --git a/target/linux/lantiq/patches-5.15/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-5.15/0152-lantiq-VPE.patch index bf2962a3ffb..6776d35ecec 100644 --- a/target/linux/lantiq/patches-5.15/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-5.15/0152-lantiq-VPE.patch @@ -15,7 +15,7 @@ Signed-off-by: Stefan Koch --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2429,6 +2429,12 @@ config MIPS_VPE_LOADER +@@ -2430,6 +2430,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. diff --git a/target/linux/layerscape/armv7/config-5.15 b/target/linux/layerscape/armv7/config-5.15 index d7f151438b6..b5df343f4eb 100644 --- a/target/linux/layerscape/armv7/config-5.15 +++ b/target/linux/layerscape/armv7/config-5.15 @@ -413,6 +413,7 @@ CONFIG_NR_CPUS=16 CONFIG_NTFS_FS=y CONFIG_NVMEM=y # CONFIG_NVMEM_IMX_IIM is not set +# CONFIG_NVMEM_IMX_OCOTP_ELE is not set # CONFIG_NVMEM_SNVS_LPGPR is not set # CONFIG_NVMEM_SPMI_SDAM is not set CONFIG_NVMEM_SYSFS=y diff --git a/target/linux/layerscape/armv8_64b/config-5.15 b/target/linux/layerscape/armv8_64b/config-5.15 index 69edc7a3f07..0e8ab0c2534 100644 --- a/target/linux/layerscape/armv8_64b/config-5.15 +++ b/target/linux/layerscape/armv8_64b/config-5.15 @@ -508,6 +508,7 @@ CONFIG_MTD_NAND_ECC_SW_HAMMING=y CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_SPI_NAND=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y CONFIG_MTD_SPLIT_FIRMWARE=y @@ -515,7 +516,7 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_SST25L=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_BLOCK is not set +CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MULTIPLEXER=y CONFIG_MUTEX_SPIN_ON_OWNER=y diff --git a/target/linux/layerscape/base-files/etc/board.d/01_led b/target/linux/layerscape/base-files/etc/board.d/01_led index 7fddfa08245..8a0e5c4b956 100644 --- a/target/linux/layerscape/base-files/etc/board.d/01_led +++ b/target/linux/layerscape/base-files/etc/board.d/01_led @@ -9,13 +9,9 @@ board_config_update board=$(board_name) case "$board" in -traverse,ls1043v) - ucidef_set_led_netdev "wan" "WAN LED" "ls1043v:yellow:wan" "eth4" - ;; -traverse,ls1043s) - ucidef_set_led_netdev "wan" "WAN LED" "ls1043s:yellow:wan" "eth4" - ucidef_set_led_netdev "xgact" "10G Activity" "ls1043s:yellow:10gact" "eth6" - ucidef_set_led_netdev "xglink" "10G Link" "ls1043s:green:10glink" "eth6" +traverse,ten64) + ucidef_set_led_netdev "sfp1" "SFP 1" "ten64:green:sfp1:down" "eth8" "link tx rx" + ucidef_set_led_netdev "sfp2" "SFP 2" "ten64:green:sfp2:up" "eth9" "link tx rx" ;; esac diff --git a/target/linux/layerscape/base-files/etc/board.d/02_network b/target/linux/layerscape/base-files/etc/board.d/02_network index 172172c12c6..0a423238011 100644 --- a/target/linux/layerscape/base-files/etc/board.d/02_network +++ b/target/linux/layerscape/base-files/etc/board.d/02_network @@ -9,13 +9,9 @@ case "$(board_name)" in fsl,ls1028a-rdb-sdboot) ucidef_set_interfaces_lan_wan "swp0 swp1 swp2 swp3" "eth0" ;; - traverse,ls1043v) + traverse,ten64) ucidef_set_interface_lan "eth0 eth1 eth2 eth3" - ucidef_set_interface_wan "eth4" - ;; - traverse,ls1043s) - ucidef_set_interface_lan "eth0 eth1 eth2 eth3 eth6" - ucidef_set_interface_wan "eth4" + ucidef_set_interface_wan "eth6" ;; esac diff --git a/target/linux/layerscape/base-files/etc/board.d/03_gpio_switches b/target/linux/layerscape/base-files/etc/board.d/03_gpio_switches index df3b759916d..46e54b960da 100644 --- a/target/linux/layerscape/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/layerscape/base-files/etc/board.d/03_gpio_switches @@ -9,16 +9,13 @@ board_config_update board=$(board_name) case "$board" in -traverse,ls1043v) - ucidef_add_gpio_switch "lte_reset" "LTE Reset" "377" - ucidef_add_gpio_switch "lte_disable" "LTE Airplane mode" "378" - ;; -traverse,ls1043s) - ucidef_add_gpio_switch "tensfp_txdisable" "SFP+ TX Disable" "378" - ucidef_add_gpio_switch "gigsfp_txdisable" "SFP TX Disable" "381" - ucidef_add_gpio_switch "lte_reset" "LTE Reset" "502" - ucidef_add_gpio_switch "lte_disable" "LTE Airplane Mode" "394" - ucidef_add_gpio_switch "lte_power" "LTE Power" "395" +traverse,ten64) + ucidef_add_gpio_switch "lte_reset" "Cell Modem Reset" "376" + ucidef_add_gpio_switch "lte_power" "Cell Modem Power" "377" + ucidef_add_gpio_switch "lte_disable" "Cell Modem Airplane mode" "378" + ucidef_add_gpio_switch "gnss_disable" "Cell Modem Disable GNSS receiver" "379" + ucidef_add_gpio_switch "lower_sfp_txidsable" "Lower SFP+ TX Disable" "369" + ucidef_add_gpio_switch "upper_sfp_txdisable" "Upper SFP+ TX Disable" "373" ;; esac diff --git a/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth b/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth deleted file mode 100644 index c6b741a5ce3..00000000000 --- a/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth +++ /dev/null @@ -1,26 +0,0 @@ -reorder_layerscape_interfaces() { - if [ ! -f /tmp/sysinfo/board_name ]; then - echo "No board name found, not doing reorder_layerscape_interfaces" - return 0 - fi - - board=$(cat /tmp/sysinfo/board_name) - case "$board" in - traverse,ls1043v|\ - traverse,ls1043s) - - # Reorder ethernet interfaces to match the physical order - ip link set eth2 name fm1-mac3 - ip link set eth4 name eth2 - ip link set eth3 name fm1-mac4 - ip link set eth5 name eth3 - ip link set fm1-mac3 name eth4 - ip link set fm1-mac4 name eth5 - ;; - default) - echo "Unknown board $board" - ;; - esac -} - -boot_hook_add preinit_main reorder_layerscape_interfaces diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index e88dfdf145c..0b5d14b579c 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -32,23 +32,26 @@ platform_do_upgrade_sdboot() { tar xf $tar_file ${board_dir}/root -O | dd of=/dev/mmcblk0p2 bs=512k > /dev/null 2>&1 } -platform_do_upgrade_traverse_nandubi() { - bootsys=$(fw_printenv bootsys | awk -F= '{{print $2}}') - newbootsys=2 - if [ "$bootsys" -eq "2" ]; then - newbootsys=1 + +platform_do_upgrade_traverse_slotubi() { + part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')" + echo "Active boot slot: ${part}" + new_active_sys="b" + + if [ ! -z "${part}" ]; then + if [ "${part}" = "ubia" ]; then + CI_UBIPART="ubib" + else + CI_UBIPART="ubia" + new_active_sys="a" + fi fi - - # If nand_do_upgrade succeeds, we don't have an opportunity to add any actions of - # our own, so do it here and set back on failure - echo "Setting bootsys to #${newbootsys}" - fw_setenv bootsys $newbootsys - CI_UBIPART="nandubi" - CI_KERNPART="kernel${newbootsys}" - CI_ROOTPART="rootfs${newbootsys}" - nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys) - + echo "Updating UBI part ${CI_UBIPART}" + fw_setenv "openwrt_active_sys" "${new_active_sys}" + nand_do_upgrade "$1" + return $? } + platform_copy_config_sdboot() { local diskdev partdev parttype=ext4 @@ -85,9 +88,8 @@ platform_check_image() { local board=$(board_name) case "$board" in - traverse,ls1043v | \ - traverse,ls1043s) - nand_do_platform_check "traverse-ls1043" $1 + traverse,ten64) + nand_do_platform_check "ten64-mtd" $1 return $? ;; fsl,ls1012a-frdm | \ @@ -126,9 +128,8 @@ platform_do_upgrade() { touch /var/lock/fw_printenv.lock case "$board" in - traverse,ls1043v | \ - traverse,ls1043s) - platform_do_upgrade_traverse_nandubi "$1" + traverse,ten64) + platform_do_upgrade_traverse_slotubi "${1}" ;; fsl,ls1012a-frdm | \ fsl,ls1012a-rdb | \ diff --git a/target/linux/layerscape/files/arch/arm64/boot/dts/freescale/traverse-ls1043s.dts b/target/linux/layerscape/files/arch/arm64/boot/dts/freescale/traverse-ls1043s.dts deleted file mode 100644 index 81044aab3ac..00000000000 --- a/target/linux/layerscape/files/arch/arm64/boot/dts/freescale/traverse-ls1043s.dts +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Device Tree Include file for Traverse LS1043S board. - * - * Copyright 2014-2015, Freescale Semiconductor - * Copyright 2017-2018, Traverse Technologies - * - * This file is dual-licensed: you can use it either under the terms - * of the GPLv2 or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/dts-v1/; -#include "fsl-ls1043a.dtsi" -#include -#include - -/ { - model = "Traverse LS1043S"; - compatible = "traverse,ls1043s"; - - aliases { - crypto = &crypto; - ethernet0 = &EMAC0; - ethernet1 = &EMAC1; - ethernet2 = &EMAC2; - ethernet3 = &EMAC3; - ethernet4 = &EMAC4; - ethernet5 = &EMAC5; - }; - - leds { - compatible = "gpio-leds"; - gpio0 { - label = "ls1043s:green:user0"; - gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; - }; - gpio1 { - label = "ls1043s:green:user1"; - gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; - }; - /* LED D17 */ - gpio2 { - label = "ls1043s:green:wan"; - gpios = <&gpio1 26 GPIO_ACTIVE_LOW>; - }; - gpio3 { - label = "ls1043s:yellow:wan"; - gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; - }; - /* LED D18 */ - gpio4 { - label = "ls1043s:green:mgmt"; - gpios = <&gpio1 28 GPIO_ACTIVE_LOW>; - }; - gpio5 { - label = "ls1043s:yellow:mgmt"; - gpios = <&gpio1 29 GPIO_ACTIVE_LOW>; - }; - /* LED D6 */ - gpio6 { - label = "ls1043s:green:user2"; - gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>; - }; - - /* SFP+ LEDs - these are for chassis - * with lightpipes only - */ - teng_act { - label = "ls1043s:yellow:10gact"; - gpios = <&gpio4 0 GPIO_ACTIVE_LOW>; - }; - - teng_link { - label = "ls1043s:green:10glink"; - gpios = <&gpio4 1 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - poll-interval = <1000>; - /* This button may not be loaded on all boards */ - button@0 { - label = "Front button"; - linux,code = ; - gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; - }; - /* This is wired to header S3 */ - button@1 { - label = "Rear button"; - linux,code = ; - gpios = <&gpio1 30 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&esdhc { - mmc-hs200-1_8v; - sd-uhs-sdr104; - sd-uhs-sdr50; - sd-uhs-sdr25; - sd-uhs-sdr12; -}; - -&i2c0 { - status = "okay"; - rtc@6f { - compatible = "intersil,isl1208"; - reg = <0x6f>; - }; - - sfp_pca9534: pca9534@24 { - compatible = "ti,tca9534", "nxp,pca9534"; - gpio-controller; - #gpio-cells = <2>; - reg = <0x24>; - gpio-base = <100>; - }; - - controller@50 { - compatible = "traverse,controller"; - reg = <0x50>; - }; - - ds125df111@18 { - compatible = "ti,ds125df111"; - reg = <0x18>; - }; - - emc1704@4c { - compatible = "microchip,emc1704"; - reg = <0x4c>; - }; - - pac1934@16 { - compatible = "microchip,pac1934"; - reg = <0x16>; - /* Monitoring 3.3V, 5V, Vin/12V (voltage only), Vbat/RTC (voltage only) */ - shunt-resistors = <4000 12000 0 0>; - }; - - pmic@8 { - compatible = "freescale,mc34vr500"; - reg = <0x08>; - }; -}; - -/* I2C Bus for SFP EEPROM and control - * These are multiplexed so - * they don't collide when loaded - */ -&i2c3 { - status = "okay"; - i2c-switch@70 { - compatible = "nxp,pca9540"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - - gigsfp_i2c: i2c@0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - tensfp_i2c: i2c@1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - }; -}; - -&ifc { - status = "okay"; - #address-cells = <2>; - #size-cells = <1>; - /* Only NAND flash is used on this board */ - ranges = <0x0 0x0 0x0 0x7e800000 0x00010000>; - - nand@1,0 { - compatible = "fsl,ifc-nand"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x0 0x0 0x10000>; - }; -}; - -&duart0 { - status = "okay"; -}; - -&duart1 { - status = "okay"; -}; - -#include "fsl-ls1043-post.dtsi" - -&fman0 { - EMAC0: ethernet@e0000 { - phy-handle = <&qsgmii_phy1>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 01]; - }; - - EMAC1: ethernet@e2000 { - phy-handle = <&qsgmii_phy2>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 02]; - }; - - EMAC2: ethernet@e8000 { - phy-handle = <&qsgmii_phy3>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 03]; - }; - - EMAC3: ethernet@ea000 { - phy-handle = <&qsgmii_phy4>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 04]; - }; - - /* SFP via AR8031 - * We treat this as a fixed-link as the - * AR8031 is hard-configured into - * 1000BASE-X mode - * Should MII control be desired, remove - * fixed-link and add - * phy-handle = <&rgmii_phy1>; - */ - EMAC4: ethernet@e4000 { - phy-connection-type = "rgmii"; - local-mac-address = [0A 00 00 00 00 05]; - fixed-link { - speed = <1000>; - full-duplex; - }; - }; - - /* Connection to Expansion (M.2) slot - * Future WAN (i.e xDSL) plugin - */ - EMAC5: ethernet@e6000 { - phy-connection-type = "rgmii-id"; - local-mac-address = [00 00 00 00 00 06]; - fixed-link { - speed = <1000>; - full-duplex; - }; - }; - - /* 10G SFP+ interface - * This can also run at 1.25 and 2.5G with - * the appropriate SerDes protocol setting in RCW - */ - TENSFP: ethernet@f0000 { - status = "okay"; - phy-connection-type = "xgmii"; - fixed-link { - speed = <10000>; - full-duplex; - }; - }; - - mdio@fc000 { - rgmii_phy1: ethernet-phy@2 { - reg = <0x2>; - }; - qsgmii_phy1: ethernet-phy@4 { - reg = <0x4>; - }; - qsgmii_phy2: ethernet-phy@5 { - reg = <0x5>; - }; - qsgmii_phy3: ethernet-phy@6 { - reg = <0x6>; - }; - qsgmii_phy4: ethernet-phy@7 { - reg = <0x7>; - }; - }; -}; - -/* No QUICC engine functions on this board - - * pins are used for other functions (GPIO, I2C etc.) - */ -&uqe { - status = "disabled"; -}; - -/* LS1043S does not use the QorIQ AHCI - * controller. - */ -&sata { - status = "disabled"; -}; diff --git a/target/linux/layerscape/files/arch/arm64/boot/dts/freescale/traverse-ls1043v.dts b/target/linux/layerscape/files/arch/arm64/boot/dts/freescale/traverse-ls1043v.dts deleted file mode 100644 index 936875101f9..00000000000 --- a/target/linux/layerscape/files/arch/arm64/boot/dts/freescale/traverse-ls1043v.dts +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Device Tree Include file for Traverse LS1043V board. - * - * Copyright 2014-2015, Freescale Semiconductor - * Copyright 2017, Traverse Technologies - * - * This file is dual-licensed: you can use it either under the terms - * of the GPLv2 or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/dts-v1/; -#include "fsl-ls1043a.dtsi" -#include -#include - -/ { - model = "Traverse LS1043V"; - compatible = "traverse,ls1043v"; - - aliases { - crypto = &crypto; - ethernet0 = &EMAC0; - ethernet1 = &EMAC1; - ethernet2 = &EMAC2; - ethernet3 = &EMAC3; - ethernet4 = &EMAC4; - ethernet5 = &EMAC5; - pca9555 = &pca9555; - }; - - leds { - compatible = "gpio-leds"; - gpio0 { - label = "ls1043v:green:user0"; - gpios = <&pca9555 0 GPIO_ACTIVE_LOW>; - }; - gpio1 { - label = "ls1043v:yellow:user0"; - gpios = <&pca9555 1 GPIO_ACTIVE_LOW>; - }; - gpio2 { - label = "ls1043v:green:user1"; - gpios = <&pca9555 2 GPIO_ACTIVE_LOW>; - }; - gpio3 { - label = "ls1043v:yellow:user1"; - gpios = <&pca9555 3 GPIO_ACTIVE_LOW>; - }; - gpio4 { - label = "ls1043v:green:user2"; - gpios = <&pca9555 4 GPIO_ACTIVE_HIGH>; - }; - gpio5 { - label = "ls1043v:yellow:wlan"; - gpios = <&pca9555 5 GPIO_ACTIVE_HIGH>; - }; - gpio6 { - label = "ls1043v:yellow:wan"; - gpios = <&pca9555 6 GPIO_ACTIVE_HIGH>; - }; - }; - - keys { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - poll-interval = <1000>; - button@0 { - label = "Front button"; - linux,code = ; - gpios = <&pca9555 14 GPIO_ACTIVE_LOW>; - }; - button@1 { - label = "Rear button"; - linux,code = ; - gpios = <&pca9555 15 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&i2c0 { - status = "okay"; - rtc@6f { - compatible = "intersil,isl1208"; - reg = <0x6f>; - }; - - pca9555: pca9555@20 { - compatible = "nxp,pca9555"; - gpio-controller; - #gpio-cells = <2>; - reg = <0x20>; - gpio-base = <0>; - }; - - /* CPU core temp sensor and VDD (1.0V) sensor */ - ltc2990@4c { - compatible = "lltc,ltc2990"; - reg = <0x4C>; - lltc,meas-mode = <4 3>; - }; - - /* 3.3V and 5V monitor (may not be loaded on some SKUs) */ - ltc2990@4f { - compatible = "lltc,ltc2990"; - reg = <0x4F>; - lltc,meas-mode = <6 3>; - }; -}; - -&ifc { - status = "okay"; - #address-cells = <2>; - #size-cells = <1>; - /* Only NAND flash is used on this board */ - ranges = <0x0 0x0 0x0 0x7e800000 0x00010000>; - - nand@1,0 { - compatible = "fsl,ifc-nand"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0x0 0x0 0x10000>; - }; -}; - -&duart0 { - status = "okay"; -}; - -&duart1 { - status = "okay"; -}; - -#include "fsl-ls1043-post.dtsi" - -&fman0 { - EMAC0: ethernet@e0000 { - phy-handle = <&qsgmii_phy1>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 01]; - }; - - EMAC1: ethernet@e2000 { - phy-handle = <&qsgmii_phy2>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 02]; - }; - - EMAC2: ethernet@e8000 { - phy-handle = <&qsgmii_phy3>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 03]; - }; - - EMAC3: ethernet@ea000 { - phy-handle = <&qsgmii_phy4>; - phy-connection-type = "qsgmii"; - local-mac-address = [0A 00 00 00 00 04]; - }; - EMAC4: ethernet@e4000 { - phy-handle = <&rgmii_phy1>; - phy-connection-type = "rgmii"; - local-mac-address = [0A 00 00 00 00 05]; - }; - - /* Connection to VDSL SoC */ - EMAC5: ethernet@e6000 { - phy-connection-type = "rgmii-id"; - local-mac-address = [00 00 00 00 00 06]; - fixed-link { - speed = <1000>; - full-duplex; - }; - }; - - /* 10G XFI interface - not in use on this platform */ - TENSFP: ethernet@f0000 { - status = "disabled"; - - phy-connection-type = "sgmii"; - fixed-link { - /* NB: speed = 1000 and sgmii allows forward compatibility - * with both 1G and 10G, the same is not true - * in the reverse. - */ - speed = <1000>; - full-duplex; - }; - }; - - mdio@fc000 { - rgmii_phy1: ethernet-phy@3 { - reg = <0x3>; - }; - qsgmii_phy1: ethernet-phy@4 { - reg = <0x4>; - }; - qsgmii_phy2: ethernet-phy@5 { - reg = <0x5>; - }; - qsgmii_phy3: ethernet-phy@6 { - reg = <0x6>; - }; - qsgmii_phy4: ethernet-phy@7 { - reg = <0x7>; - }; - }; -}; - -/* No QUICC engine functions on this board */ -&uqe { - status = "disabled"; -}; - -/* No SATA/AHCI on this board */ -&sata { - status = "disabled"; -}; diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index 52dc532c34f..dfbda85b365 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -51,15 +51,15 @@ define Build/ls-append-sdhead dd if=$(STAGING_DIR_IMAGE)/$(1)-sdcard-head.img >> $@ endef -define Build/traverse-fit - ./mkits-multiple-config.sh -o $@.its -A $(LINUX_KARCH) \ - -v $(LINUX_VERSION) -k $@ -a $(KERNEL_LOADADDR) \ - -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -C gzip -c 1 -c 2 \ - -d $(DEVICE_DTS_DIR)/freescale/traverse-ls1043s.dtb \ - -D "Traverse_LS1043S" -n "ls1043s" -a $(FDT_LOADADDR) -c 1 \ - -d $(DEVICE_DTS_DIR)/freescale/traverse-ls1043v.dtb \ - -D "Traverse_LS1043V" -n "ls1043v" -a $(FDT_LOADADDR) -c 2 +define Build/traverse-fit-ls1088 + ./mkits-multiple-config.sh -o $@.its -A $(LINUX_KARCH) \ + -v $(LINUX_VERSION) -k $@ -a $(KERNEL_LOADADDR) \ + -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -C gzip -c 1 -c 2 \ + -d $(DTS_DIR)/freescale/fsl-ls1088a-ten64.dtb \ + -D "TEN64" -n "ten64" -a $(FDT_LOADADDR) -c 1 \ + -d $(DTS_DIR)/freescale/fsl-ls1088a-rdb.dtb \ + -D "LS1088ARDB" -n "ls1088ardb" -a $(FDT_LOADADDR) -c 2 PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new @mv -f $@.new $@ endef diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index f5a6a055fb2..259bacee314 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -420,34 +420,34 @@ define Device/fsl_lx2160a-rdb-sdboot endef TARGET_DEVICES += fsl_lx2160a-rdb-sdboot -define Device/traverse_ls1043 +define Device/traverse_ten64_mtd DEVICE_VENDOR := Traverse - DEVICE_MODEL := LS1043 Boards - KERNEL_NAME := Image - KERNEL_SUFFIX := -kernel.itb - KERNEL_INSTALL := 1 - FDT_LOADADDR = 0x90000000 - FILESYSTEMS := ubifs - MKUBIFS_OPTS := -m 1 -e 262016 -c 128 + DEVICE_MODEL := Ten64 (NAND boot) + DEVICE_NAME := ten64-mtd DEVICE_PACKAGES += \ - layerscape-fman \ uboot-envtools \ + kmod-rtc-rx8025 \ + kmod-sfp \ kmod-i2c-mux-pca954x \ - kmod-hwmon-core \ - kmod-gpio-pca953x kmod-input-gpio-keys-polled \ - kmod-rtc-isl1208 + restool DEVICE_DESCRIPTION = \ - Build images for Traverse LS1043 boards. This generates a single image \ - capable of booting on any of the boards in this family. - DEVICE_DTS = freescale/traverse-ls1043s - DEVICE_DTS_DIR = $(LINUX_DIR)/arch/arm64/boot/dts - DEVICE_DTS_CONFIG = ls1043s - KERNEL := kernel-bin | gzip | traverse-fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb - IMAGES = root sysupgrade.bin - IMAGE/root = append-rootfs - IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata - MKUBIFS_OPTS := -m 2048 -e 124KiB -c 4096 - SUPPORTED_DEVICES := traverse,ls1043s traverse,ls1043v + Generate images for booting from NAND/ubifs on Traverse Ten64 (LS1088A) \ + family boards. For disk (NVMe/USB/SD) boot, use the armvirt target instead. + FILESYSTEMS := squashfs + KERNEL_LOADADDR := 0x80000000 + KERNEL_ENTRY_POINT := 0x80000000 + FDT_LOADADDR := 0x90000000 + KERNEL_SUFFIX := -kernel.itb + DEVICE_DTS := freescale/fsl-ls1088a-ten64 + IMAGES := nand.ubi sysupgrade.bin + KERNEL := kernel-bin | gzip | traverse-fit-ls1088 gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb $$(FDT_LOADADDR) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/nand.ubi := append-ubi + KERNEL_IN_UBI := 1 + BLOCKSIZE := 128KiB + PAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 600 + SUPPORTED_DEVICES = traverse,ten64 endef -TARGET_DEVICES += traverse_ls1043 +TARGET_DEVICES += traverse_ten64_mtd + diff --git a/target/linux/layerscape/patches-5.15/300-add-DTS-for-Traverse-LS1043-Boards.patch b/target/linux/layerscape/patches-5.15/300-add-DTS-for-Traverse-LS1043-Boards.patch deleted file mode 100644 index 110afedefd5..00000000000 --- a/target/linux/layerscape/patches-5.15/300-add-DTS-for-Traverse-LS1043-Boards.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5b35aae22b4ca2400e49561c9267aa01346f91d4 Mon Sep 17 00:00:00 2001 -From: Mathew McBride -Date: Tue, 17 Apr 2018 10:01:03 +1000 -Subject: [PATCH] add DTS for Traverse LS1043 Boards - -Signed-off-by: Mathew McBride -[rebase] -Signed-off-by: Yangbo Lu ---- - arch/arm64/boot/dts/freescale/Makefile | 3 +++ - arch/arm64/boot/dts/freescale/traverse-ls1043s.dts | 29 ++++++++++++++++++++++ - arch/arm64/boot/dts/freescale/traverse-ls1043v.dts | 29 ++++++++++++++++++++++ - 3 files changed, 61 insertions(+) - ---- a/arch/arm64/boot/dts/freescale/Makefile -+++ b/arch/arm64/boot/dts/freescale/Makefile -@@ -31,6 +31,9 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2 - dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2160a-rdb.dtb - dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-lx2162a-qds.dtb - -+dtb-$(CONFIG_ARCH_LAYERSCAPE) += traverse-ls1043v.dtb -+dtb-$(CONFIG_ARCH_LAYERSCAPE) += traverse-ls1043s.dtb -+ - dtb-$(CONFIG_ARCH_MXC) += imx8mm-beacon-kit.dtb - dtb-$(CONFIG_ARCH_MXC) += imx8mm-evk.dtb - dtb-$(CONFIG_ARCH_MXC) += imx8mm-ddr4-evk.dtb diff --git a/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch b/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch index 6130bf0030f..e8a69153500 100644 --- a/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch +++ b/target/linux/layerscape/patches-5.15/701-staging-add-fsl_ppfe-driver.patch @@ -854,7 +854,7 @@ Signed-off-by: Pawel Dembicki +}; --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -7526,6 +7526,14 @@ F: drivers/ptp/ptp_qoriq.c +@@ -7519,6 +7519,14 @@ F: drivers/ptp/ptp_qoriq.c F: drivers/ptp/ptp_qoriq_debugfs.c F: include/linux/fsl/ptp_qoriq.h diff --git a/target/linux/layerscape/patches-5.15/703-net-dpaa2-mac-add-support-for-more-10G-modes.patch b/target/linux/layerscape/patches-5.15/703-net-dpaa2-mac-add-support-for-more-10G-modes.patch new file mode 100644 index 00000000000..0bd96f1f4f7 --- /dev/null +++ b/target/linux/layerscape/patches-5.15/703-net-dpaa2-mac-add-support-for-more-10G-modes.patch @@ -0,0 +1,34 @@ +From c314138bd045e050432158ab021160de3ba51c5e Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Thu, 30 Jan 2020 22:42:38 +0000 +Subject: [PATCH 2/4] net: dpaa2-mac: add support for more 10G modes + +Phylink documentation says: + * Note that the PHY may be able to transform from one connection + * technology to another, so, eg, don't clear 1000BaseX just + * because the MAC is unable to BaseX mode. This is more about + * clearing unsupported speeds and duplex settings. The port modes + * should not be cleared; phylink_set_port_modes() will help with this. + +So add the missing 10G modes. + +Signed-off-by: Russell King +--- + drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c ++++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +@@ -140,6 +140,12 @@ static void dpaa2_mac_validate(struct ph + case PHY_INTERFACE_MODE_10GBASER: + case PHY_INTERFACE_MODE_USXGMII: + phylink_set(mask, 10000baseT_Full); ++ phylink_set(mask, 10000baseKR_Full); ++ phylink_set(mask, 10000baseCR_Full); ++ phylink_set(mask, 10000baseSR_Full); ++ phylink_set(mask, 10000baseLR_Full); ++ phylink_set(mask, 10000baseLRM_Full); ++ phylink_set(mask, 10000baseER_Full); + if (state->interface == PHY_INTERFACE_MODE_10GBASER) + break; + phylink_set(mask, 5000baseT_Full); diff --git a/target/linux/layerscape/patches-5.15/704-dpaa2-eth-do-not-hold-rtnl_lock.patch b/target/linux/layerscape/patches-5.15/704-dpaa2-eth-do-not-hold-rtnl_lock.patch new file mode 100644 index 00000000000..c7d16e5c4c3 --- /dev/null +++ b/target/linux/layerscape/patches-5.15/704-dpaa2-eth-do-not-hold-rtnl_lock.patch @@ -0,0 +1,74 @@ +From d5af37ae22f0364be9ded773d737dd6e5b207b10 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Thu, 21 Nov 2019 21:15:25 +0200 +Subject: [PATCH 3/4] dpaa2-eth: do not hold rtnl_lock on phylink_create() or + _destroy() + +The rtnl_lock should not be held when calling phylink_create() or +phylink_destroy() since it leads to the deadlock listed below: + +[ 18.656576] rtnl_lock+0x18/0x20 +[ 18.659798] sfp_bus_add_upstream+0x28/0x90 +[ 18.663974] phylink_create+0x2cc/0x828 +[ 18.667803] dpaa2_mac_connect+0x14c/0x2a8 +[ 18.671890] dpaa2_eth_connect_mac+0x94/0xd8 + +Fix this by moving the _lock() and _unlock() calls just outside of +phylink_of_phy_connect() and phylink_disconnect_phy(). + +Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink") +Reported-by: Russell King +Signed-off-by: Ioana Ciornei +Signed-off-by: Russell King +--- + drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ---- + drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 4 ++++ + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c ++++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +@@ -4217,12 +4217,10 @@ static irqreturn_t dpni_irq0_handler_thr + dpaa2_eth_set_mac_addr(netdev_priv(net_dev)); + dpaa2_eth_update_tx_fqids(priv); + +- rtnl_lock(); + if (dpaa2_eth_has_mac(priv)) + dpaa2_eth_disconnect_mac(priv); + else + dpaa2_eth_connect_mac(priv); +- rtnl_unlock(); + } + + return IRQ_HANDLED; +@@ -4516,9 +4514,7 @@ static int dpaa2_eth_remove(struct fsl_m + #endif + + unregister_netdev(net_dev); +- rtnl_lock(); + dpaa2_eth_disconnect_mac(priv); +- rtnl_unlock(); + + dpaa2_eth_dl_port_del(priv); + dpaa2_eth_dl_traps_unregister(priv); +--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c ++++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +@@ -357,7 +357,9 @@ int dpaa2_mac_connect(struct dpaa2_mac * + if (mac->pcs) + phylink_set_pcs(mac->phylink, &mac->pcs->pcs); + ++ rtnl_lock(); + err = phylink_fwnode_phy_connect(mac->phylink, dpmac_node, 0); ++ rtnl_unlock(); + if (err) { + netdev_err(net_dev, "phylink_fwnode_phy_connect() = %d\n", err); + goto err_phylink_destroy; +@@ -378,7 +380,9 @@ void dpaa2_mac_disconnect(struct dpaa2_m + if (!mac->phylink) + return; + ++ rtnl_lock(); + phylink_disconnect_phy(mac->phylink); ++ rtnl_unlock(); + phylink_destroy(mac->phylink); + dpaa2_pcs_destroy(mac); + } diff --git a/target/linux/malta/config-6.1 b/target/linux/malta/config-6.1 index 9411879835b..8ab648069d2 100644 --- a/target/linux/malta/config-6.1 +++ b/target/linux/malta/config-6.1 @@ -1,5 +1,4 @@ CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_FORCE_MAX_ORDER=11 CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y diff --git a/target/linux/mediatek/dts/mt7629-netgear-ex6250-v2.dts b/target/linux/mediatek/dts/mt7629-netgear-ex6250-v2.dts new file mode 100644 index 00000000000..5645ad799e9 --- /dev/null +++ b/target/linux/mediatek/dts/mt7629-netgear-ex6250-v2.dts @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: GPL-2.0 + +/dts-v1/; +#include +#include "mt7629.dtsi" + +/ { + model = "Netgear EX6250 v2"; + compatible = "netgear,ex6250-v2", "mediatek,mt7629"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-override = "console=ttyS0,115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&pio 60 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&pio 58 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + ap_mode { + label = "ap_mode"; + gpios = <&pio 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + extender_mode { + label = "extender_mode"; + gpios = <&pio 53 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&pio 21 GPIO_ACTIVE_LOW>; + }; + + led_power_red: power_red { + label = "red:power"; + gpios = <&pio 61 GPIO_ACTIVE_LOW>; + }; + + client_green { + label = "green:client"; + gpios = <&pio 59 GPIO_ACTIVE_LOW>; + }; + + client_red { + label = "red:client"; + gpios = <&pio 24 GPIO_ACTIVE_LOW>; + }; + + router_green { + label = "green:router"; + gpios = <&pio 55 GPIO_ACTIVE_LOW>; + }; + + router_red { + label = "red:router"; + gpios = <&pio 56 GPIO_ACTIVE_LOW>; + }; + + wps_green { + label = "green:wps"; + gpios = <&pio 57 GPIO_ACTIVE_LOW>; + }; + + eth_green { + label = "green:eth"; + gpios = <&pio 16 GPIO_ACTIVE_LOW>; + }; + + eth_yellow { + label = "yellow:eth"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <ð_pins>; + pinctrl-1 = <&ephy_leds_pins>; + status = "okay"; + + mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&phy0>; + }; + + mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; +}; + +&qspi { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&qspi_pins>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x60000>; + read-only; + }; + + partition@60000 { + label = "Config"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + label = "Factory"; + reg = <0x70000 0x10000>; + read-only; + }; + + partition@80000 { + label = "firmware"; + reg = <0x80000 0xcd0000>; + compatible = "denx,fit"; + }; + + partition@d50000 { + label = "CFG"; + reg = <0xd50000 0x80000>; + read-only; + }; + + partition@dd0000 { + label = "RAE"; + reg = <0xdd0000 0x200000>; + read-only; + }; + + partition@fd0000 { + label = "POT"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "LOG"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; + +&pio { + eth_pins: eth-pins { + mux { + function = "eth"; + groups = "mdc_mdio"; + }; + }; + + ephy_leds_pins: ephy-leds-pins { + mux { + function = "led"; + groups = "ephy_leds"; + }; + }; + + qspi_pins: qspi-pins { + mux { + function = "flash"; + groups = "spi_nor"; + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0_txd_rxd" ; + }; + }; + + watchdog_pins: watchdog-pins { + mux { + function = "watchdog"; + groups = "watchdog"; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&watchdog { + pinctrl-names = "default"; + pinctrl-0 = <&watchdog_pins>; + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts b/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts new file mode 100644 index 00000000000..358365adba4 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include +#include + +#include "mt7981.dtsi" + +/ { + model = "H3C Magic NX30 Pro"; + compatible = "h3c,magic-nx30-pro", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x10000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: green { + label = "green:status"; + gpios = <&pio 4 GPIO_ACTIVE_LOW>; + }; + + led_status_red: red { + label = "red:status"; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&mdio_bus { + switch: switch@0 { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x0000000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x0180000 0x0200000>; + read-only; + }; + + partition@380000 { + label = "FIP"; + reg = <0x0380000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x0580000 0x4000000>; + }; + + /* yaffs partition */ + partition@4580000 { + label = "pdt_data"; + reg = <0x4580000 0x0600000>; + read-only; + }; + + /* yaffs partition */ + partition@4b80000 { + label = "pdt_data_1"; + reg = <0x4b80000 0x0600000>; + read-only; + }; + + partition@5180000 { + label = "exp"; + reg = <0x5180000 0x0100000>; + read-only; + }; + + partition@5280000 { + label = "plugin"; + reg = <0x5280000 0x2580000>; + read-only; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; diff --git a/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts b/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts new file mode 100644 index 00000000000..8b8858ccef7 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts @@ -0,0 +1,276 @@ +// SPDX-License-Identifier: (GL-2.0 OR MIT) + +/dts-v1/; +#include +#include + +#include "mt7986b.dtsi" + +/ { + compatible = "mercusys,mr90x-v1", "mediatek,mt7986b"; + model = "Mercusys MR90X v1"; + + aliases { + serial0 = &uart0; + + led-boot = &led_status_green; + led-failsafe = &led_status_green; + led-running = &led_status_green; + led-upgrade = &led_status_green; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x20000000>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "green:lan2"; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + }; + + led-1 { + label = "green:lan1"; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led-2 { + label = "green:lan0"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-3 { + label = "green:wan"; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + + led-4 { + label = "orange:status"; + gpios = <&pio 16 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: led-5 { + label = "green:status"; + gpios = <&pio 17 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + }; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-handle = <&phy6>; + phy-mode = "2500base-x"; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&mdio { + #address-cells = <1>; + #size-cells = <0>; + + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <1500000>; + reset-post-delay-us = <1000000>; + + /* WAN/LAN 2.5Gbps phy + MaxLinear GPY211C0VC (SLNW8) */ + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + }; + + switch: switch@0 { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + /* WAN/LAN 1Gbps port */ + port@0 { + reg = <0>; + label = "lan0"; + }; + + /* LAN1 port */ + port@1 { + reg = <1>; + label = "lan1"; + }; + + /* LAN2 port */ + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + status = "okay"; + + spi_nand_flash: flash@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + + spi-max-frequency = <20000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x0 0x200000>; + read-only; + }; + + partition@200000 { + label = "u-boot-env"; + reg = <0x200000 0x100000>; + }; + + partition@300000 { + label = "ubi0"; + reg = <0x300000 0x3200000>; + }; + + partition@3500000 { + label = "ubi1"; + reg = <0x3500000 0x3200000>; + read-only; + }; + + partition@6700000 { + label = "userconfig"; + reg = <0x6700000 0x800000>; + read-only; + }; + + partition@6f00000 { + label = "tp_data"; + reg = <0x6f00000 0x400000>; + read-only; + }; + }; + }; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&wf_2g_5g_pins>; +}; diff --git a/target/linux/mediatek/dts/mt7986b-netgear-wax220.dts b/target/linux/mediatek/dts/mt7986b-netgear-wax220.dts new file mode 100644 index 00000000000..ac2a4b08246 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986b-netgear-wax220.dts @@ -0,0 +1,293 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include +#include +#include + +#include "mt7986b.dtsi" + +/ { + #address-cells = <0x2>; + #size-cells = <0x2>; + model = "Netgear WAX220"; + compatible = "netgear,wax220", "mediatek,mt7986b-spim-snand-rfb"; + + aliases { + serial0 = &uart0; + led-boot = &led_power_blue; + led-failsafe = &led_power_amber; + led-running = &led_power_green; + led-upgrade = &led_power_amber; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + linux,code = ; + label = "reset"; + }; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + wlan5g_green { + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + label = "green:wlan5g"; + }; + + led_power_amber: power_amber { + gpios = <&pio 15 GPIO_ACTIVE_LOW>; + label = "amber:power"; + }; + + wlan2g_green { + gpios = <&pio 19 GPIO_ACTIVE_HIGH>; + label = "green:wlan2g"; + }; + + led_power_blue: power_blue { + gpios = <&pio 7 GPIO_ACTIVE_HIGH>; + label = "blue:power"; + }; + + led_power_green: power_green { + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + label = "green:power"; + }; + + wlan2g_blue { + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + label = "blue:wlan2g"; + }; + + lan_green { + gpios = <&pio 22 GPIO_ACTIVE_HIGH>; + label = "green:lan"; + }; + + lan_amber { + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + label = "amber:lan"; + }; + + wlan5g_blue { + gpios = <&pio 2 GPIO_ACTIVE_LOW>; + label = "blue:wlan5g"; + }; + }; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-handle = <&phy6>; + phy-mode = "2500base-x"; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&mdio { + #address-cells = <1>; + #size-cells = <0>; + phy6: ethernet-phy@6 { + reg = <6>; + reset-assert-us = <100000>; + reset-deassert-us = <100000>; + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + + +&pio { + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + wf_dbdc_pins: wf-dbdc-pins { + mux { + function = "wifi"; + groups = "wf_dbdc"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + status = "okay"; + + spi_nand_flash: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <20000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <256>; + mediatek,bmt-remap-range = <0x0 0x580000>; + + partitions: partitions { + #address-cells = <0x1>; + #size-cells = <0x1>; + compatible = "fixed-partitions"; + + partition@5fc0000 { + label = "Traffic"; + reg = <0x5fc0000 0x200000>; + }; + + partition@63c0000 { + label = "NTGRcryptD"; + reg = <0x63c0000 0x500000>; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x5140000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + }; + + partition@69c0000 { + label = "User_data"; + reg = <0x69c0000 0x640000>; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + partition@68c0000 { + label = "LOG"; + reg = <0x68c0000 0x100000>; + }; + + partition@5ac0000 { + label = "POT"; + reg = <0x5ac0000 0x100000>; + }; + + partition@0 { + label = "BL2"; + read-only; + reg = <0x0 0x100000>; + }; + + partition@5bc0000 { + label = "Language"; + reg = <0x5bc0000 0x400000>; + }; + + partition@61c0000 { + label = "Cert"; + reg = <0x61c0000 0x100000>; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + }; + + partition@56c0000 { + label = "RAE"; + reg = <0x56c0000 0x400000>; + }; + + partition@62c0000 { + label = "NTGRcryptK"; + reg = <0x62c0000 0x100000>; + }; + }; + }; + +}; + +&trng { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + pinctrl-names = "default", "dbdc"; + pinctrl-0 = <&wf_2g_5g_pins>; + pinctrl-1 = <&wf_dbdc_pins>; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index 1cb00ce26db..c81bd2cd975 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -9,6 +9,17 @@ case $board in cudy,wr3000-v1) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; +mercusys,mr90x-v1) + ucidef_set_led_netdev "lan0" "lan0" "green:lan0" "lan0" "link tx rx" + ucidef_set_led_netdev "lan1" "lan2" "green:lan1" "lan1" "link tx rx" + ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" "link tx rx" + ucidef_set_led_netdev "wan" "wan" "green:wan" "eth1" "link tx rx" + ;; +netgear,wax220) + ucidef_set_led_netdev "eth0" "LAN" "green:lan" "eth0" + ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "phy0-ap0" + ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0" + ;; xiaomi,redmi-router-ax6000-stock|\ xiaomi,redmi-router-ax6000-ubootmod) ucidef_set_led_netdev "wan" "wan" "rgb:network" "wan" diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index a327a46108a..6abc81a0b05 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -11,6 +11,9 @@ mediatek_setup_interfaces() asus,tuf-ax4200) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1 ;; + netgear,wax220) + ucidef_set_interface_lan "eth0" + ;; bananapi,bpi-r3) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" ;; @@ -20,6 +23,9 @@ mediatek_setup_interfaces() glinet,gl-mt3000) ucidef_set_interfaces_lan_wan eth1 eth0 ;; + h3c,magic-nx30-pro) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1 + ;; mediatek,mt7986a-rfb) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan6" "eth1 wan" ;; @@ -29,6 +35,9 @@ mediatek_setup_interfaces() mediatek,mt7988a-dsa-10g-spim-snand) ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "eth1 eth2" ;; + mercusys,mr90x-v1) + ucidef_set_interfaces_lan_wan "lan0 lan1 lan2" eth1 + ;; qihoo,360t7) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan ;; @@ -66,6 +75,19 @@ mediatek_setup_macs() bananapi,bpi-r3) wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1) ;; + h3c,magic-nx30-pro) + wan_mac=$(mtd_get_mac_ascii pdt_data_1 ethaddr) + lan_mac=$(macaddr_add "$wan_mac" 1) + label_mac=$wan_mac + ;; + mercusys,mr90x-v1) + label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0) + lan_mac=$label_mac + ;; + netgear,wax220) + lan_mac=$(mtd_get_mac_ascii u-boot-env mac) + label_mac=$lan_mac + ;; qihoo,360t7) lan_mac=$(mtd_get_mac_ascii factory lanMac) wan_mac=$(macaddr_add "$lan_mac" 1) diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index a3db00f5e8f..ab23b100444 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -32,6 +32,21 @@ case "$board" in [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress ;; + h3c,magic-nx30-pro) + addr=$(mtd_get_mac_ascii pdt_data_1 ethaddr) + [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress + ;; + mercusys,mr90x-v1) + addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0) + [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $addr -1 > /sys${DEVPATH}/macaddress + ;; + netgear,wax220) + hw_mac_addr=$(mtd_get_mac_ascii u-boot-env mac) + [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress + ;; qihoo,360t7) addr=$(mtd_get_mac_ascii factory lanMac) [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part new file mode 100644 index 00000000000..819df40d080 --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/09_mount_cfg_part @@ -0,0 +1,23 @@ +. /lib/functions/system.sh + +mount_ubi_part() { + local part_name="$1" + local mtd_num=$(grep $part_name /proc/mtd | cut -c4) + local ubi_num=$(ubiattach -m $mtd_num | \ + awk -F',' '/UBI device number [0-9]{1,}/{print $1}' | \ + awk '{print $4}') + mkdir /tmp/$part_name + mount -r -t ubifs ubi$ubi_num:$part_name /tmp/$part_name +} + +preinit_mount_cfg_part() { + case $(board_name) in + mercusys,mr90x-v1) + mount_ubi_part "tp_data" + ;; + *) + ;; + esac +} + +boot_hook_add preinit_main preinit_mount_cfg_part diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh index ec078741c98..cfddd9cedcc 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -8,6 +8,12 @@ preinit_set_mac_address() { ip link set dev eth0 address "$addr" ip link set dev eth1 address "$addr" ;; + mercusys,mr90x-v1) + addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0) + ip link set dev eth1 address "$(macaddr_add $addr 1)" + ;; + *) + ;; esac } diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/81_fix_eeprom b/target/linux/mediatek/filogic/base-files/lib/preinit/81_fix_eeprom new file mode 100644 index 00000000000..0a842facca8 --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/81_fix_eeprom @@ -0,0 +1,16 @@ +. /lib/functions/system.sh + +preinit_fix_eeprom() { + case $(board_name) in + mercusys,mr90x-v1) + eeprom="/lib/firmware/mediatek/mt7986_eeprom_mt7975_dual.bin" + oem="/tmp/tp_data/MT7986_EEPROM.bin" + [ ! -L $eeprom -a -e $oem ] && \ + mv -f $eeprom $eeprom.bak && ln -s $oem $eeprom + ;; + *) + ;; + esac +} + +boot_hook_add preinit_main preinit_fix_eeprom diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 5b624bc5517..186abfa5a8d 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -70,6 +70,11 @@ platform_do_upgrade() { cudy,wr3000-v1) default_do_upgrade "$1" ;; + mercusys,mr90x-v1) + CI_UBIPART="ubi0" + nand_do_upgrade "$1" + ;; + h3c,magic-nx30-pro|\ qihoo,360t7|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ diff --git a/target/linux/mediatek/image/Makefile b/target/linux/mediatek/image/Makefile index 97164428e05..d4f79ec9749 100644 --- a/target/linux/mediatek/image/Makefile +++ b/target/linux/mediatek/image/Makefile @@ -6,6 +6,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk +DEVICE_VARS += NETGEAR_ENC_MODEL NETGEAR_ENC_REGION NETGEAR_ENC_HW_ID_LIST NETGEAR_ENC_MODEL_LIST + loadaddr-$(CONFIG_TARGET_mediatek_mt7622) := 0x44000000 loadaddr-$(CONFIG_TARGET_mediatek_mt7623) := 0x80008000 loadaddr-$(CONFIG_TARGET_mediatek_mt7629) := 0x40008000 @@ -22,6 +24,10 @@ define Device/Default KERNEL_LOADADDR = $(loadaddr-y) FILESYSTEMS := squashfs DEVICE_DTS_DIR := $(DTS_DIR) + NETGEAR_ENC_MODEL := + NETGEAR_ENC_REGION := + NETGEAR_ENC_HW_ID_LIST := + NETGEAR_ENC_MODEL_LIST := IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | \ pad-rootfs | append-metadata diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 6323a05de2a..2ace305140b 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -176,6 +176,47 @@ define Device/glinet_gl-mt3000 endef TARGET_DEVICES += glinet_gl-mt3000 +define Device/h3c_magic-nx30-pro + DEVICE_VENDOR := H3C + DEVICE_MODEL := Magic NX30 Pro + DEVICE_DTS := mt7981b-h3c-magic-nx30-pro + DEVICE_DTS_DIR := ../dts + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGE_SIZE := 65536k + IMAGES := sysupgrade.itb + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot h3c_magic-nx30-pro +endef +TARGET_DEVICES += h3c_magic-nx30-pro + +define Device/netgear_wax220 + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WAX220 + DEVICE_DTS := mt7986b-netgear-wax220 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + IMAGES := sysupgrade.bin + KERNEL_IN_UBI := 1 + KERNEL := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += netgear_wax220 + define Device/mediatek_mt7986a-rfb-nand DEVICE_VENDOR := MediaTek DEVICE_MODEL := MT7986 rfba AP (NAND) @@ -234,6 +275,20 @@ define Device/mediatek_mt7988a-rfb-nand endef TARGET_DEVICES += mediatek_mt7988a-rfb-nand +define Device/mercusys_mr90x-v1 + DEVICE_VENDOR := Mercusys + DEVICE_MODEL := MR90X v1 + DEVICE_DTS := mt7986b-mercusys-mr90x-v1 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 51200k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += mercusys_mr90x-v1 + define Device/qihoo_360t7 DEVICE_VENDOR := Qihoo DEVICE_MODEL := 360T7 diff --git a/target/linux/mediatek/image/mt7629.mk b/target/linux/mediatek/image/mt7629.mk index 3f5b2e25794..33c557190f6 100644 --- a/target/linux/mediatek/image/mt7629.mk +++ b/target/linux/mediatek/image/mt7629.mk @@ -22,3 +22,29 @@ define Device/iptime_a6004mx IMAGE/recovery.bin := append-kernel | pad-to 128k | append-ubi | append-metadata endef TARGET_DEVICES += iptime_a6004mx + +define Device/netgear_ex6250-v2 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := EX6250 + DEVICE_VARIANT := v2 + DEVICE_ALT0_VENDOR := NETGEAR + DEVICE_ALT0_MODEL := EX6400 + DEVICE_ALT0_VARIANT := v3 + DEVICE_ALT1_VENDOR := NETGEAR + DEVICE_ALT1_MODEL := EX6410 + DEVICE_ALT1_VARIANT := v2 + DEVICE_ALT2_VENDOR := NETGEAR + DEVICE_ALT2_MODEL := EX6470 + DEVICE_DTS := mt7629-netgear-ex6250-v2 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := uboot-envtools + NETGEAR_ENC_MODEL := EX6250v2 + NETGEAR_ENC_REGION := US + NETGEAR_ENC_HW_ID_LIST := 1010000003630000_NETGEAR;1010000003540000_NETGEAR + NETGEAR_ENC_MODEL_LIST := EX6250v2;EX6400v3;EX6470;EX6410v2 + IMAGE_SIZE := 13120k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to 128k | append-rootfs | \ + pad-rootfs | check-size | netgear-encrypted-factory +endef +TARGET_DEVICES += netgear_ex6250-v2 diff --git a/target/linux/mediatek/mt7629/base-files/etc/board.d/01_leds b/target/linux/mediatek/mt7629/base-files/etc/board.d/01_leds index 42b6fcbbb35..c42ab4713b9 100644 --- a/target/linux/mediatek/mt7629/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/mt7629/base-files/etc/board.d/01_leds @@ -9,6 +9,10 @@ case $board in iptime,a6004mx) ucidef_set_led_netdev "wan" "WAN" "orange:wan" "eth1" ;; +netgear,ex6250-v2) + ucidef_set_led_netdev "eth_act" "LAN act" "yellow:eth" "eth0" "tx rx" + ucidef_set_led_netdev "eth_link" "LAN link" "green:eth" "eth0" "link" + ;; esac board_config_flush diff --git a/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network index 4254f39ca0a..db931c8334e 100644 --- a/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network @@ -16,6 +16,9 @@ mediatek_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "6@eth0" ;; + netgear,ex6250-v2) + ucidef_set_interface_lan "eth0" + ;; esac } @@ -24,7 +27,15 @@ mediatek_setup_macs() local board="$1" case $board in + netgear,ex6250-v2) + lan_mac=$(mtd_get_mac_ascii Config mac) + label_mac=$lan_mac + ;; esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac } board_config_update diff --git a/target/linux/mediatek/patches-5.15/730-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch b/target/linux/mediatek/patches-5.15/730-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch index 6af9e843357..43876deb66c 100644 --- a/target/linux/mediatek/patches-5.15/730-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch +++ b/target/linux/mediatek/patches-5.15/730-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch @@ -21,7 +21,7 @@ Signed-off-by: Daniel Golle --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -11797,6 +11797,15 @@ S: Maintained +@@ -11790,6 +11790,15 @@ S: Maintained F: drivers/net/pcs/pcs-mtk-lynxi.c F: include/linux/pcs/pcs-mtk-lynxi.h diff --git a/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch b/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch index 506689965d3..1520a6cbe6d 100644 --- a/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch +++ b/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch @@ -334,7 +334,7 @@ Signed-off-by: Wolfram Sang --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c -@@ -989,7 +989,7 @@ mv64xxx_i2c_probe(struct platform_device +@@ -1000,7 +1000,7 @@ mv64xxx_i2c_probe(struct platform_device if (IS_ERR(drv_data->reg_base)) return PTR_ERR(drv_data->reg_base); diff --git a/target/linux/mvebu/patches-5.15/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch b/target/linux/mvebu/patches-5.15/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch index b8accf180bb..242a6c1e00a 100644 --- a/target/linux/mvebu/patches-5.15/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch +++ b/target/linux/mvebu/patches-5.15/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch @@ -16,7 +16,7 @@ Cc: Robert Marko --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -9063,6 +9063,22 @@ F: include/net/nl802154.h +@@ -9056,6 +9056,22 @@ F: include/net/nl802154.h F: net/ieee802154/ F: net/mac802154/ diff --git a/target/linux/mxs/Makefile b/target/linux/mxs/Makefile index 6ae4814e95a..34e826dfbbf 100644 --- a/target/linux/mxs/Makefile +++ b/target/linux/mxs/Makefile @@ -12,6 +12,7 @@ CPU_TYPE:=arm926ej-s SUBTARGETS:=generic KERNEL_PATCHVER:=5.15 +KERNEL_TESTING_PATCHVER:=6.1 KERNELNAME:=zImage dtbs diff --git a/target/linux/mxs/config-6.1 b/target/linux/mxs/config-6.1 new file mode 100644 index 00000000000..b23aef69695 --- /dev/null +++ b/target/linux/mxs/config-6.1 @@ -0,0 +1,245 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_FORCE_MAX_ORDER=11 +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_CPU_AUTO=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +CONFIG_ARCH_MULTI_V4_V5=y +CONFIG_ARCH_MULTI_V5=y +CONFIG_ARCH_MXS=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_UNWIND=y +CONFIG_ATAGS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_PM=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="console=ttyAMA0,115200 root=/dev/mmcblk0p2 rw rootwait" +CONFIG_CMDLINE_FROM_BOOTLOADER=y +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_COREDUMP=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5TJ=y +CONFIG_CPU_ARM926T=y +# CONFIG_CPU_CACHE_ROUND_ROBIN is not set +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +# CONFIG_CPU_DCACHE_WRITETHROUGH is not set +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_PM=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CRC16=y +CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_DEV_MXS_DCP=y +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_RNG2=y +CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_OPS=y +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXT4_FS=y +CONFIG_EXTCON=y +CONFIG_FEC=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FWNODE_MDIO=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +# CONFIG_GIANFAR is not set +CONFIG_GLOB=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GENERIC_PLATFORM=y +CONFIG_GPIO_MXS=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_ALGOPCA=y +CONFIG_I2C_ALGOPCF=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PINCTRL=y +CONFIG_I2C_MXS=y +CONFIG_IIO=y +CONFIG_IIO_BUFFER=y +CONFIG_IIO_KFIFO_BUF=y +CONFIG_IIO_SYSFS_TRIGGER=y +CONFIG_IIO_TRIGGER=y +# CONFIG_IIO_TRIGGERED_BUFFER is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MXS=y +CONFIG_IRQ_WORK=y +# CONFIG_ISDN is not set +CONFIG_JBD2=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MEMFD_CREATE=y +CONFIG_MFD_CORE=y +CONFIG_MFD_MXS_LRADC=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_MXS=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MXS_DMA=y +# CONFIG_MXS_LRADC_ADC is not set +CONFIG_MXS_TIMER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_SELFTESTS=y +CONFIG_NLS=y +CONFIG_NVMEM=y +CONFIG_NVMEM_MXS_OCOTP=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX23=y +CONFIG_PINCTRL_IMX28=y +CONFIG_PINCTRL_MXS=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_PM=y +CONFIG_PM_CLK=y +CONFIG_POWER_SUPPLY=y +CONFIG_PPS=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RATIONAL=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_GPIO=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_STMP=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +# CONFIG_SERIAL_8250 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_MXS_AUART=y +CONFIG_SERIAL_MXS_AUART_CONSOLE=y +CONFIG_SMSC_PHY=y +CONFIG_SOC_BUS=y +CONFIG_SOC_IMX23=y +CONFIG_SOC_IMX28=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MXS=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRCU=y +CONFIG_STMP3XXX_RTC_WATCHDOG=y +CONFIG_STMP_DEVICE=y +CONFIG_SWPHY=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +# CONFIG_UNUSED_BOARD_FILES is not set +CONFIG_UNWINDER_ARM=y +CONFIG_USB=y +CONFIG_USB_CHIPIDEA=y +CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_CHIPIDEA_IMX=y +CONFIG_USB_CHIPIDEA_UDC=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_GADGET=y +CONFIG_USB_MXS_PHY=y +CONFIG_USB_OTG=y +CONFIG_USB_PHY=y +CONFIG_USB_ROLE_SWITCH=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_ULPI_BUS=y +CONFIG_USE_OF=y +# CONFIG_VFP is not set +CONFIG_WATCHDOG_CORE=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_ZBOOT_ROM_TEXT=0 diff --git a/target/linux/mxs/image/Config.in b/target/linux/mxs/image/Config.in index a04700a440b..b4318390c24 100644 --- a/target/linux/mxs/image/Config.in +++ b/target/linux/mxs/image/Config.in @@ -1,6 +1,6 @@ -config TARGET_BOOTFS_PARTSIZE +config MXS_SD_BOOT_PARTSIZE int "Boot (SD Card) filesystem partition size (in MB)" - depends on TARGET_mxs_generic_olinuxino-maxi || TARGET_mxs_generic_olinuxino-micro + depends on TARGET_mxs default 8 help On the Olimex OLinuXino boards, mainline U-Boot loads the diff --git a/target/linux/mxs/image/Makefile b/target/linux/mxs/image/Makefile index bcb6001bac2..f1847dec1ed 100644 --- a/target/linux/mxs/image/Makefile +++ b/target/linux/mxs/image/Makefile @@ -5,72 +5,77 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -BOARDS:= \ - imx23-olinuxino \ - imx28-duckbill - FAT32_BLOCK_SIZE=1024 -FAT32_BLOCKS=$(shell echo $$(($(CONFIG_TARGET_BOOTFS_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) +FAT32_BLOCKS=$(shell echo $$(($(CONFIG_MXS_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) -define Image/BuildKernel - mkimage -A arm -O linux -T kernel -C none \ - -a 0x40008000 -e 0x40008000 \ - -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \ - -d $(KDIR)/zImage $(KDIR)/uImage - cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage +KERNEL_LOADADDR:=0x40008000 + +define Build/mxs-sdcard-ext4-ext4 + ./gen_sdcard_ext4_ext4.sh \ + $@ \ + $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/u-boot.sb \ + $(IMAGE_ROOTFS) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) endef -define Image/InstallKernel - mkdir -p $(TARGET_DIR)/boot - cp \ - $(KDIR)/zImage $(KDIR)/uImage \ - $(foreach board,$(BOARDS),$(DTS_DIR)/$(board).dtb) \ - $(TARGET_DIR)/boot/ -endef +define Build/mxs-sdcard-vfat-ext4 + rm -f $@.boot + mkfs.fat $@.boot -C $(FAT32_BLOCKS) -define Image/Build/SDCard-vfat-ext4 - rm -f $(KDIR)/boot.img - mkfs.fat $(KDIR)/boot.img -C $(FAT32_BLOCKS) - - mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(3).dtb ::$(3).dtb - mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage + mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::$(DEVICE_DTS).dtb + mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage ./gen_sdcard_vfat_ext4.sh \ - $(BIN_DIR)/$(2) \ - $(STAGING_DIR_IMAGE)/$(4)-u-boot.sb \ - $(KDIR)/boot.img \ - $(KDIR)/root.$(1) \ - $(CONFIG_TARGET_BOOTFS_PARTSIZE) \ + $@ \ + $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/u-boot.sb \ + $@.boot \ + $(IMAGE_ROOTFS) \ + $(CONFIG_MXS_SD_BOOT_PARTSIZE) \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) - $(call Image/Gzip,$(BIN_DIR)/$(2)) endef -define Image/Build/SDCard-ext4-ext4 - ./gen_sdcard_ext4_ext4.sh \ - $(BIN_DIR)/$(2) \ - $(STAGING_DIR_IMAGE)/$(4)-u-boot.sb \ - $(KDIR)/root.$(1) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) - $(call Image/Gzip,$(BIN_DIR)/$(2)) +define Device/Default + PROFILES := Default + KERNEL_NAME := zImage + KERNEL := kernel-bin | uImage none + IMAGES := sdcard.img.gz + DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) endef -define Image/Build/Profile/olinuxino-maxi - $(call Image/Build/SDCard-vfat-ext4,$(1),$(2),imx23-olinuxino,mx23_olinuxino) +define Device/i2se_duckbill + DEVICE_VENDOR := I2SE + DEVICE_MODEL := Duckbill + DEVICE_PACKAGES := -dnsmasq -firewall -ppp -ip6tables -iptables -6relayd -mtd \ + uboot-envtools kmod-leds-gpio -kmod-ipt-nathelper + SUPPORTED_DEVICES:=i2se,duckbill + SOC:=imx28 + DEVICE_DTS:=imx28-duckbill + IMAGE/sdcard.img.gz = mxs-sdcard-ext4-ext4 | append-metadata | gzip endef +TARGET_DEVICES += i2se_duckbill -define Image/Build/Profile/olinuxino-micro - $(call Image/Build/SDCard-vfat-ext4,$(1),$(2),imx23-olinuxino,mx23_olinuxino) +define Device/olinuxino_maxi + DEVICE_VENDOR := Olimex + DEVICE_MODEL := OLinuXino Maxi + DEVICE_PACKAGES := kmod-usb-net-smsc95xx kmod-pinctrl-mcp23s08-i2c \ + kmod-pinctrl-mcp23s08-spi kmod-leds-gpio kmod-sound-core + SUPPORTED_DEVICES:=olimex,imx23-olinuxino + SOC:=imx23 + DEVICE_DTS:=imx23-olinuxino + IMAGE/sdcard.img.gz = mxs-sdcard-vfat-ext4 | append-metadata | gzip endef +TARGET_DEVICES += olinuxino_maxi -define Image/Build/Profile/duckbill - $(call Image/Build/SDCard-ext4-ext4,$(1),$(2),imx28-duckbill,duckbill) -endef - -define Image/Build - $(call Image/Build/$(1),$(1)) - $(call Image/Build/Profile/$(PROFILE),$(1),$(IMG_PREFIX)-$(PROFILE)-sdcard.img) - dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync - $(call Image/Gzip,$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)) +define Device/olinuxino_micro + DEVICE_VENDOR := Olimex + DEVICE_MODEL := OLinuXino Micro + DEVICE_PACKAGES := kmod-pinctrl-mcp23s08-spi kmod-pinctrl-mcp23s08-i2c \ + kmod-leds-gpio + SUPPORTED_DEVICES:=olimex,imx23-olinuxino + SOC:=imx23 + DEVICE_DTS:=imx23-olinuxino + IMAGE/sdcard.img.gz = mxs-sdcard-vfat-ext4 | append-metadata | gzip endef +TARGET_DEVICES += olinuxino_micro $(eval $(call BuildImage)) diff --git a/target/linux/mxs/profiles/01-duckbill.mk b/target/linux/mxs/profiles/01-duckbill.mk deleted file mode 100644 index d7202a44226..00000000000 --- a/target/linux/mxs/profiles/01-duckbill.mk +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (C) 2013 OpenWrt.org - -define Profile/duckbill - NAME:=I2SE Duckbill boards - FEATURES+=usbgadget - PACKAGES+= \ - -dnsmasq -firewall -ppp -ip6tables -iptables -6relayd -mtd uboot-envtools \ - kmod-leds-gpio -kmod-ipt-nathelper uboot-mxs-duckbill -endef - -define Profile/duckbill/Description - I2SE's Duckbill devices -endef - -$(eval $(call Profile,duckbill)) diff --git a/target/linux/mxs/profiles/02-olinuxino-maxi.mk b/target/linux/mxs/profiles/02-olinuxino-maxi.mk deleted file mode 100644 index dd333629b8d..00000000000 --- a/target/linux/mxs/profiles/02-olinuxino-maxi.mk +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (C) 2013 OpenWrt.org - -define Profile/olinuxino-maxi - NAME:=Olimex OLinuXino Maxi/Mini boards - PACKAGES += imx-bootlets uboot-mxs-mx23_olinuxino \ - kmod-usb-net-smsc95xx kmod-pinctrl-mcp23s08-i2c \ - kmod-pinctrl-mcp23s08-spi kmod-leds-gpio kmod-sound-core -endef - -define Profile/olinuxino-maxi/Description - Olimex OLinuXino Maxi/Mini boards -endef - -$(eval $(call Profile,olinuxino-maxi)) diff --git a/target/linux/mxs/profiles/03-olinuxino-micro.mk b/target/linux/mxs/profiles/03-olinuxino-micro.mk deleted file mode 100644 index 8413ebbdca0..00000000000 --- a/target/linux/mxs/profiles/03-olinuxino-micro.mk +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Copyright (C) 2013 OpenWrt.org - -define Profile/olinuxino-micro - NAME:=Olimex OLinuXino Micro/Nano boards - PACKAGES += imx-bootlets uboot-mxs-mx23_olinuxino \ - kmod-pinctrl-mcp23s08-spi kmod-pinctrl-mcp23s08-i2c \ - kmod-leds-gpio -endef - -define Profile/olinuxino-micro/Description - Olimex OLinuXino Micro/Nano boards -endef - -$(eval $(call Profile,olinuxino-micro)) diff --git a/target/linux/octeon/patches-5.15/100-mips_image_cmdline_hack.patch b/target/linux/octeon/patches-5.15/100-mips_image_cmdline_hack.patch index 15e233aceb2..4b225277f9d 100644 --- a/target/linux/octeon/patches-5.15/100-mips_image_cmdline_hack.patch +++ b/target/linux/octeon/patches-5.15/100-mips_image_cmdline_hack.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1180,6 +1180,10 @@ config MIPS_MSC +@@ -1181,6 +1181,10 @@ config MIPS_MSC config SYNC_R4K bool diff --git a/target/linux/ipq807x/Makefile b/target/linux/qualcommax/Makefile similarity index 72% rename from target/linux/ipq807x/Makefile rename to target/linux/qualcommax/Makefile index e4342883957..a9d4c06b77a 100644 --- a/target/linux/ipq807x/Makefile +++ b/target/linux/qualcommax/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk ARCH:=aarch64 -BOARD:=ipq807x -BOARDNAME:=Qualcomm Atheros IPQ807x +BOARD:=qualcommax +BOARDNAME:=Qualcomm Atheros 802.11ax WiSoC-s FEATURES:=squashfs ramdisk fpu nand rtc emmc KERNELNAME:=Image dtbs CPU_TYPE:=cortex-a53 -SUBTARGETS:=generic +SUBTARGETS:=ipq807x KERNEL_PATCHVER:=6.1 @@ -14,8 +14,7 @@ include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += \ kmod-usb3 kmod-usb-dwc3 kmod-usb-dwc3-qcom \ kmod-leds-gpio kmod-gpio-button-hotplug \ - kmod-phy-aquantia kmod-qca-nss-dp \ - ath11k-firmware-ipq8074 kmod-ath11k-ahb \ + kmod-qca-nss-dp kmod-ath11k-ahb \ wpad-basic-mbedtls uboot-envtools \ e2fsprogs kmod-fs-ext4 losetup diff --git a/target/linux/ipq807x/config-6.1 b/target/linux/qualcommax/config-6.1 similarity index 99% rename from target/linux/ipq807x/config-6.1 rename to target/linux/qualcommax/config-6.1 index 2fa4aa30bbf..ec44e936b44 100644 --- a/target/linux/ipq807x/config-6.1 +++ b/target/linux/qualcommax/config-6.1 @@ -4,7 +4,6 @@ CONFIG_64BIT=y CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=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_MHP_MEMMAP_ON_MEMORY_ENABLE=y diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax6.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax6.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax6.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax6.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-512m.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-512m.dtsi similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-512m.dtsi rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-512m.dtsi diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-ac-cpu.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ac-cpu.dtsi similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-ac-cpu.dtsi rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ac-cpu.dtsi diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-cpr-regulator.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-cpr-regulator.dtsi similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-cpr-regulator.dtsi rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-cpr-regulator.dtsi diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-hk-cpu.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-hk-cpu.dtsi similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-hk-cpu.dtsi rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-hk-cpu.dtsi diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts similarity index 100% rename from target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts rename to target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts diff --git a/target/linux/ipq807x/image/Makefile b/target/linux/qualcommax/image/Makefile similarity index 100% rename from target/linux/ipq807x/image/Makefile rename to target/linux/qualcommax/image/Makefile diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/qualcommax/image/ipq807x.mk similarity index 99% rename from target/linux/ipq807x/image/generic.mk rename to target/linux/qualcommax/image/ipq807x.mk index 6003f2a5c0e..54f8caf5d7a 100644 --- a/target/linux/ipq807x/image/generic.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -46,6 +46,7 @@ define Device/compex_wpq873 PAGESIZE := 2048 DEVICE_DTS_CONFIG := config@hk09.wpq873 SOC := ipq8072 + DEVICE_PACKAGES := ipq-wifi-compex_wpq873 IMAGE/factory.ubi := append-ubi | qsdk-ipq-factory-nand endef TARGET_DEVICES += compex_wpq873 diff --git a/target/linux/ipq807x/base-files/etc/board.d/01_leds b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds similarity index 100% rename from target/linux/ipq807x/base-files/etc/board.d/01_leds rename to target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network similarity index 100% rename from target/linux/ipq807x/base-files/etc/board.d/02_network rename to target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata similarity index 100% rename from target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata rename to target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata diff --git a/target/linux/ipq807x/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount similarity index 100% rename from target/linux/ipq807x/base-files/etc/init.d/bootcount rename to target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount diff --git a/target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/buffalo.sh similarity index 100% rename from target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh rename to target/linux/qualcommax/ipq807x/base-files/lib/upgrade/buffalo.sh diff --git a/target/linux/ipq807x/base-files/lib/upgrade/mmc.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh similarity index 100% rename from target/linux/ipq807x/base-files/lib/upgrade/mmc.sh rename to target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh diff --git a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh similarity index 100% rename from target/linux/ipq807x/base-files/lib/upgrade/platform.sh rename to target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh diff --git a/target/linux/qualcommax/ipq807x/target.mk b/target/linux/qualcommax/ipq807x/target.mk new file mode 100644 index 00000000000..22a9b78d592 --- /dev/null +++ b/target/linux/qualcommax/ipq807x/target.mk @@ -0,0 +1,7 @@ +SUBTARGET:=ipq807x +BOARDNAME:=Qualcomm Atheros IPQ807x +DEFAULT_PACKAGES += kmod-phy-aquantia ath11k-firmware-ipq8074 + +define Target/Description + Build firmware images for Qualcomm Atheros IPQ807x based boards. +endef diff --git a/target/linux/ipq807x/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch b/target/linux/qualcommax/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch rename to target/linux/qualcommax/patches-6.1/0001-v6.2-arm64-dts-qcom-ipq8074-add-A53-PLL-node.patch diff --git a/target/linux/ipq807x/patches-6.1/0002-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch b/target/linux/qualcommax/patches-6.1/0002-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0002-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch rename to target/linux/qualcommax/patches-6.1/0002-v6.2-thermal-drivers-tsens-Add-support-for-combined-inter.patch diff --git a/target/linux/ipq807x/patches-6.1/0003-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch b/target/linux/qualcommax/patches-6.1/0003-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0003-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch rename to target/linux/qualcommax/patches-6.1/0003-v6.2-thermal-drivers-tsens-Allow-configuring-min-and-max-.patch diff --git a/target/linux/ipq807x/patches-6.1/0004-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch b/target/linux/qualcommax/patches-6.1/0004-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0004-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch rename to target/linux/qualcommax/patches-6.1/0004-v6.2-thermal-drivers-tsens-Add-IPQ8074-support.patch diff --git a/target/linux/ipq807x/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch b/target/linux/qualcommax/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch rename to target/linux/qualcommax/patches-6.1/0005-v6.2-arm64-dts-qcom-ipq8074-add-thermal-nodes.patch diff --git a/target/linux/ipq807x/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch b/target/linux/qualcommax/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch rename to target/linux/qualcommax/patches-6.1/0006-v6.2-arm64-dts-qcom-ipq8074-add-clocks-to-APCS.patch diff --git a/target/linux/ipq807x/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch b/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch rename to target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch diff --git a/target/linux/ipq807x/patches-6.1/0008-v6.2-clk-qcom-reset-support-resetting-multiple-bits.patch b/target/linux/qualcommax/patches-6.1/0008-v6.2-clk-qcom-reset-support-resetting-multiple-bits.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0008-v6.2-clk-qcom-reset-support-resetting-multiple-bits.patch rename to target/linux/qualcommax/patches-6.1/0008-v6.2-clk-qcom-reset-support-resetting-multiple-bits.patch diff --git a/target/linux/ipq807x/patches-6.1/0009-v6.2-dt-bindings-clock-qcom-ipq8074-add-missing-networkin.patch b/target/linux/qualcommax/patches-6.1/0009-v6.2-dt-bindings-clock-qcom-ipq8074-add-missing-networkin.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0009-v6.2-dt-bindings-clock-qcom-ipq8074-add-missing-networkin.patch rename to target/linux/qualcommax/patches-6.1/0009-v6.2-dt-bindings-clock-qcom-ipq8074-add-missing-networkin.patch diff --git a/target/linux/ipq807x/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch b/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch rename to target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch diff --git a/target/linux/ipq807x/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch b/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch rename to target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch diff --git a/target/linux/ipq807x/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch b/target/linux/qualcommax/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch rename to target/linux/qualcommax/patches-6.1/0012-v6.2-arm64-dts-qcom-ipq8074-pass-XO-and-sleep-clocks-to-G.patch diff --git a/target/linux/ipq807x/patches-6.1/0013-v6.2-arm64-dts-qcom-add-PMP8074-DTSI.patch b/target/linux/qualcommax/patches-6.1/0013-v6.2-arm64-dts-qcom-add-PMP8074-DTSI.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0013-v6.2-arm64-dts-qcom-add-PMP8074-DTSI.patch rename to target/linux/qualcommax/patches-6.1/0013-v6.2-arm64-dts-qcom-add-PMP8074-DTSI.patch diff --git a/target/linux/ipq807x/patches-6.1/0014-v6.2-arm64-dts-qcom-ipq8074-hk01-add-VQMMC-supply.patch b/target/linux/qualcommax/patches-6.1/0014-v6.2-arm64-dts-qcom-ipq8074-hk01-add-VQMMC-supply.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0014-v6.2-arm64-dts-qcom-ipq8074-hk01-add-VQMMC-supply.patch rename to target/linux/qualcommax/patches-6.1/0014-v6.2-arm64-dts-qcom-ipq8074-hk01-add-VQMMC-supply.patch diff --git a/target/linux/ipq807x/patches-6.1/0015-v6.2-arm64-dts-qcom-hk01-use-GPIO-flags-for-tlmm.patch b/target/linux/qualcommax/patches-6.1/0015-v6.2-arm64-dts-qcom-hk01-use-GPIO-flags-for-tlmm.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0015-v6.2-arm64-dts-qcom-hk01-use-GPIO-flags-for-tlmm.patch rename to target/linux/qualcommax/patches-6.1/0015-v6.2-arm64-dts-qcom-hk01-use-GPIO-flags-for-tlmm.patch diff --git a/target/linux/ipq807x/patches-6.1/0016-v6.2-arm64-dts-qcom-ipq8074-Fix-up-comments.patch b/target/linux/qualcommax/patches-6.1/0016-v6.2-arm64-dts-qcom-ipq8074-Fix-up-comments.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0016-v6.2-arm64-dts-qcom-ipq8074-Fix-up-comments.patch rename to target/linux/qualcommax/patches-6.1/0016-v6.2-arm64-dts-qcom-ipq8074-Fix-up-comments.patch diff --git a/target/linux/ipq807x/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch b/target/linux/qualcommax/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch rename to target/linux/qualcommax/patches-6.1/0017-v6.2-arm64-dts-qcom-ipq8074-align-TLMM-pin-configuration-.patch diff --git a/target/linux/ipq807x/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch b/target/linux/qualcommax/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch rename to target/linux/qualcommax/patches-6.1/0019-v6.3-arm64-dts-qcom-ipq8074-set-Gen2-PCIe-pcie-max-link-s.patch diff --git a/target/linux/ipq807x/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch b/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch rename to target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch diff --git a/target/linux/ipq807x/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch b/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch rename to target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch diff --git a/target/linux/ipq807x/patches-6.1/0022-v6.5-soc-qcom-mdt_loader-Fix-unconditional-call-to-scm_pa.patch b/target/linux/qualcommax/patches-6.1/0022-v6.5-soc-qcom-mdt_loader-Fix-unconditional-call-to-scm_pa.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0022-v6.5-soc-qcom-mdt_loader-Fix-unconditional-call-to-scm_pa.patch rename to target/linux/qualcommax/patches-6.1/0022-v6.5-soc-qcom-mdt_loader-Fix-unconditional-call-to-scm_pa.patch diff --git a/target/linux/ipq807x/patches-6.1/0134-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch b/target/linux/qualcommax/patches-6.1/0023-v6.5-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch similarity index 87% rename from target/linux/ipq807x/patches-6.1/0134-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch rename to target/linux/qualcommax/patches-6.1/0023-v6.5-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch index 6231d8afb72..e720eb2b851 100644 --- a/target/linux/ipq807x/patches-6.1/0134-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch +++ b/target/linux/qualcommax/patches-6.1/0023-v6.5-arm64-dts-qcom-ipq8074-add-critical-thermal-trips.patch @@ -1,6 +1,6 @@ -From 145bbf2b88990ef3ff00ee541bb7662008683c16 Mon Sep 17 00:00:00 2001 +From 56d3067cb694ba60d654e7f5ef231b6fabc4697f Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Wed, 7 Jun 2023 20:26:26 +0200 +Date: Wed, 7 Jun 2023 20:44:48 +0200 Subject: [PATCH] arm64: dts: qcom: ipq8074: add critical thermal trips According to bindings, thermal zones must have associated trips as well. @@ -9,13 +9,15 @@ lets start by defining critical trips to protect the devices against severe overheating. Signed-off-by: Robert Marko +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20230607184448.2512179-1-robimarko@gmail.com --- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 96 +++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi -@@ -1293,6 +1293,14 @@ +@@ -896,6 +896,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 4>; @@ -30,7 +32,7 @@ Signed-off-by: Robert Marko }; nss0-thermal { -@@ -1300,6 +1308,14 @@ +@@ -903,6 +911,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 5>; @@ -45,7 +47,7 @@ Signed-off-by: Robert Marko }; nss1-thermal { -@@ -1307,6 +1323,14 @@ +@@ -910,6 +926,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 6>; @@ -60,7 +62,7 @@ Signed-off-by: Robert Marko }; wcss-phya0-thermal { -@@ -1314,6 +1338,14 @@ +@@ -917,6 +941,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 7>; @@ -75,7 +77,7 @@ Signed-off-by: Robert Marko }; wcss-phya1-thermal { -@@ -1321,6 +1353,14 @@ +@@ -924,6 +956,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 8>; @@ -90,7 +92,7 @@ Signed-off-by: Robert Marko }; cpu0_thermal: cpu0-thermal { -@@ -1328,6 +1368,14 @@ +@@ -931,6 +971,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 9>; @@ -105,7 +107,7 @@ Signed-off-by: Robert Marko }; cpu1_thermal: cpu1-thermal { -@@ -1335,6 +1383,14 @@ +@@ -938,6 +986,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 10>; @@ -120,7 +122,7 @@ Signed-off-by: Robert Marko }; cpu2_thermal: cpu2-thermal { -@@ -1342,6 +1398,14 @@ +@@ -945,6 +1001,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 11>; @@ -135,7 +137,7 @@ Signed-off-by: Robert Marko }; cpu3_thermal: cpu3-thermal { -@@ -1349,6 +1413,14 @@ +@@ -952,6 +1016,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 12>; @@ -150,7 +152,7 @@ Signed-off-by: Robert Marko }; cluster_thermal: cluster-thermal { -@@ -1356,6 +1428,14 @@ +@@ -959,6 +1031,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 13>; @@ -165,7 +167,7 @@ Signed-off-by: Robert Marko }; wcss-phyb0-thermal { -@@ -1363,6 +1443,14 @@ +@@ -966,6 +1046,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 14>; @@ -180,7 +182,7 @@ Signed-off-by: Robert Marko }; wcss-phyb1-thermal { -@@ -1370,6 +1458,14 @@ +@@ -973,6 +1061,14 @@ polling-delay = <1000>; thermal-sensors = <&tsens 15>; diff --git a/target/linux/ipq807x/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch b/target/linux/qualcommax/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch rename to target/linux/qualcommax/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch diff --git a/target/linux/ipq807x/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch b/target/linux/qualcommax/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch rename to target/linux/qualcommax/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch diff --git a/target/linux/ipq807x/patches-6.1/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch b/target/linux/qualcommax/patches-6.1/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch rename to target/linux/qualcommax/patches-6.1/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch diff --git a/target/linux/ipq807x/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch b/target/linux/qualcommax/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch rename to target/linux/qualcommax/patches-6.1/0110-arm64-dts-qcom-ipq8074-pass-QMP-PCI-PHY-PIPE-clocks-.patch diff --git a/target/linux/ipq807x/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch b/target/linux/qualcommax/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch rename to target/linux/qualcommax/patches-6.1/0111-arm64-dts-qcom-ipq8074-use-msi-parent-for-PCIe.patch diff --git a/target/linux/ipq807x/patches-6.1/0112-remoteproc-qcom-Add-PRNG-proxy-clock.patch b/target/linux/qualcommax/patches-6.1/0112-remoteproc-qcom-Add-PRNG-proxy-clock.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0112-remoteproc-qcom-Add-PRNG-proxy-clock.patch rename to target/linux/qualcommax/patches-6.1/0112-remoteproc-qcom-Add-PRNG-proxy-clock.patch diff --git a/target/linux/ipq807x/patches-6.1/0113-remoteproc-qcom-Add-secure-PIL-support.patch b/target/linux/qualcommax/patches-6.1/0113-remoteproc-qcom-Add-secure-PIL-support.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0113-remoteproc-qcom-Add-secure-PIL-support.patch rename to target/linux/qualcommax/patches-6.1/0113-remoteproc-qcom-Add-secure-PIL-support.patch diff --git a/target/linux/ipq807x/patches-6.1/0114-remoteproc-qcom-Add-support-for-split-q6-m3-wlan-fir.patch b/target/linux/qualcommax/patches-6.1/0114-remoteproc-qcom-Add-support-for-split-q6-m3-wlan-fir.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0114-remoteproc-qcom-Add-support-for-split-q6-m3-wlan-fir.patch rename to target/linux/qualcommax/patches-6.1/0114-remoteproc-qcom-Add-support-for-split-q6-m3-wlan-fir.patch diff --git a/target/linux/ipq807x/patches-6.1/0115-remoteproc-qcom-Add-ssr-subdevice-identifier.patch b/target/linux/qualcommax/patches-6.1/0115-remoteproc-qcom-Add-ssr-subdevice-identifier.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0115-remoteproc-qcom-Add-ssr-subdevice-identifier.patch rename to target/linux/qualcommax/patches-6.1/0115-remoteproc-qcom-Add-ssr-subdevice-identifier.patch diff --git a/target/linux/ipq807x/patches-6.1/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch b/target/linux/qualcommax/patches-6.1/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch rename to target/linux/qualcommax/patches-6.1/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch diff --git a/target/linux/ipq807x/patches-6.1/0117-dt-bindings-clock-qcom-Add-reset-for-WCSSAON.patch b/target/linux/qualcommax/patches-6.1/0117-dt-bindings-clock-qcom-Add-reset-for-WCSSAON.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0117-dt-bindings-clock-qcom-Add-reset-for-WCSSAON.patch rename to target/linux/qualcommax/patches-6.1/0117-dt-bindings-clock-qcom-Add-reset-for-WCSSAON.patch diff --git a/target/linux/ipq807x/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch b/target/linux/qualcommax/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch rename to target/linux/qualcommax/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch diff --git a/target/linux/ipq807x/patches-6.1/0119-remoteproc-wcss-disable-auto-boot-for-IPQ8074.patch b/target/linux/qualcommax/patches-6.1/0119-remoteproc-wcss-disable-auto-boot-for-IPQ8074.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0119-remoteproc-wcss-disable-auto-boot-for-IPQ8074.patch rename to target/linux/qualcommax/patches-6.1/0119-remoteproc-wcss-disable-auto-boot-for-IPQ8074.patch diff --git a/target/linux/ipq807x/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch b/target/linux/qualcommax/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch rename to target/linux/qualcommax/patches-6.1/0120-arm64-dts-qcom-Enable-Q6v5-WCSS-for-ipq8074-SoC.patch diff --git a/target/linux/ipq807x/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch b/target/linux/qualcommax/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch rename to target/linux/qualcommax/patches-6.1/0121-arm64-dts-ipq8074-Add-WLAN-node.patch diff --git a/target/linux/ipq807x/patches-6.1/0122-arm64-dts-ipq8074-add-CPU-clock.patch b/target/linux/qualcommax/patches-6.1/0122-arm64-dts-ipq8074-add-CPU-clock.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0122-arm64-dts-ipq8074-add-CPU-clock.patch rename to target/linux/qualcommax/patches-6.1/0122-arm64-dts-ipq8074-add-CPU-clock.patch diff --git a/target/linux/ipq807x/patches-6.1/0123-arm64-dts-ipq8074-add-cooling-cells-to-CPU-nodes.patch b/target/linux/qualcommax/patches-6.1/0123-arm64-dts-ipq8074-add-cooling-cells-to-CPU-nodes.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0123-arm64-dts-ipq8074-add-cooling-cells-to-CPU-nodes.patch rename to target/linux/qualcommax/patches-6.1/0123-arm64-dts-ipq8074-add-cooling-cells-to-CPU-nodes.patch diff --git a/target/linux/ipq807x/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch b/target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch rename to target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch diff --git a/target/linux/ipq807x/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch b/target/linux/qualcommax/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch rename to target/linux/qualcommax/patches-6.1/0129-arm64-dts-qcom-ipq8074-add-QFPROM-fuses.patch diff --git a/target/linux/ipq807x/patches-6.1/0130-arm64-dts-qcom-ipq8074-add-CPU-OPP-table.patch b/target/linux/qualcommax/patches-6.1/0130-arm64-dts-qcom-ipq8074-add-CPU-OPP-table.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0130-arm64-dts-qcom-ipq8074-add-CPU-OPP-table.patch rename to target/linux/qualcommax/patches-6.1/0130-arm64-dts-qcom-ipq8074-add-CPU-OPP-table.patch diff --git a/target/linux/ipq807x/patches-6.1/0132-mmc-core-disable-TRIM-on-Micron-MTFC4GACAJCN-1M.patch b/target/linux/qualcommax/patches-6.1/0132-mmc-core-disable-TRIM-on-Micron-MTFC4GACAJCN-1M.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0132-mmc-core-disable-TRIM-on-Micron-MTFC4GACAJCN-1M.patch rename to target/linux/qualcommax/patches-6.1/0132-mmc-core-disable-TRIM-on-Micron-MTFC4GACAJCN-1M.patch diff --git a/target/linux/ipq807x/patches-6.1/0133-mmc-core-disable-TRIM-on-Kingston-EMMC04G-M627.patch b/target/linux/qualcommax/patches-6.1/0133-mmc-core-disable-TRIM-on-Kingston-EMMC04G-M627.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0133-mmc-core-disable-TRIM-on-Kingston-EMMC04G-M627.patch rename to target/linux/qualcommax/patches-6.1/0133-mmc-core-disable-TRIM-on-Kingston-EMMC04G-M627.patch diff --git a/target/linux/ipq807x/patches-6.1/0900-power-Add-Qualcomm-APM.patch b/target/linux/qualcommax/patches-6.1/0900-power-Add-Qualcomm-APM.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0900-power-Add-Qualcomm-APM.patch rename to target/linux/qualcommax/patches-6.1/0900-power-Add-Qualcomm-APM.patch diff --git a/target/linux/ipq807x/patches-6.1/0901-regulator-add-Qualcomm-CPR-regulators.patch b/target/linux/qualcommax/patches-6.1/0901-regulator-add-Qualcomm-CPR-regulators.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0901-regulator-add-Qualcomm-CPR-regulators.patch rename to target/linux/qualcommax/patches-6.1/0901-regulator-add-Qualcomm-CPR-regulators.patch diff --git a/target/linux/ipq807x/patches-6.1/0902-arm64-dts-ipq8074-add-label-to-clocks.patch b/target/linux/qualcommax/patches-6.1/0902-arm64-dts-ipq8074-add-label-to-clocks.patch similarity index 100% rename from target/linux/ipq807x/patches-6.1/0902-arm64-dts-ipq8074-add-label-to-clocks.patch rename to target/linux/qualcommax/patches-6.1/0902-arm64-dts-ipq8074-add-label-to-clocks.patch diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts new file mode 100755 index 00000000000..b7fc063b7fb --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include +#include + +/ { + compatible = "dlink,dir-806a-b1", "ralink,mt7620a-soc"; + model = "D-Link DIR-806A B1"; + + aliases { + led-boot = &wps_led; + led-failsafe = &wps_led; + led-running = &wps_led; + led-upgrade = &wps_led; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; // #12 + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + wifi_led: 2.4g { + label = "green:wlan"; + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; // #72 + }; + + wps_led: wps { + label = "green:wps"; + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; // #39 + }; + + }; + +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <48000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ALL"; + reg = <0x0 0x800000>; + read-only; + }; + + partition@0_1 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + }; + + factory: partition@40000 { + label = "Factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uartf", "ephy"; + function = "gpio"; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; +}; + +&wmac { + pinctrl-names = "default", "pa_gpio"; + pinctrl-0 = <&pa_pins>; + pinctrl-1 = <&pa_gpio_pins>; + + ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&macaddr_factory_8004>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-3)>; + + led { + led-active-low; + }; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts new file mode 100644 index 00000000000..5f1c01b35e9 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts @@ -0,0 +1,217 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2023 Stefan Weil + */ + +#include "mt7620a.dtsi" + +#include +#include +#include +#include + +/ { + compatible = "edimax,br-6208ac-v2", "ralink,mt7620a-soc"; + model = "Edimax BR-6208AC v2"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_firmware; + }; + + keys { + compatible = "gpio-keys"; + + // Vendor firmware: /proc/RESET_BUTTON + reset_wps { + label = "reset_wps"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + // Vendor firmware: /proc/driver/led + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + // RALINK_REG_PIO3924DATA 39-24 + led_internet: internet { + label = "green:internet"; + color = ; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + + // RALINK_REG_PIO7140DATA 44-40 + led_wlan_2_4ghz: wlan_2_4ghz { + label = "green:wlan2g"; + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + // RALINK_REG_PIO7140DATA 43-40 + led_wlan_5ghz: wlan_5ghz { + label = "green:wlan5g"; + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + // RALINK_REG_PIO7140DATA 42-40 + led_firmware: firmware { + label = "green:firmware"; + color = ; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + // default-state = "keep"; + }; + + // RALINK_REG_PIO7140DATA 41-40 + led_vpn: vpn { + label = "green:vpn"; + color = ; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gdma { + status = "okay"; +}; + +// Vendor firmware: RALINK_REG_PIO7140 - gpio0: gpio@600 +// Vendor firmware: RALINK_REG_PIO3924 - gpio1: gpio@638 +// Vendor firmware: RALINK_REG_PIO7140 - gpio2: gpio@660 +// Vendor firmware: RALINK_REG_PIO72 - gpio3: gpio@688 + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + // Vendor partitions: + // 0x000000000000-0x000000030000 : "Bootloader" + // 0x000000030000-0x000000040000 : "Config" + // 0x000000040000-0x000000050000 : "Factory" + // 0x000000050000-0x000000070000 : "Cimage" + // 0x000000070000-0x000000fe0000 : "Uimage" + // 0x000000070000-0x000000190000 : "Kernel" + // 0x000000190000-0x000000fe0000 : "RootFS" + // 0x000000fe0000-0x000001000000 : "FreeSpace" + + // Bootloader + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + // Config + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + // Factory + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + // Cimage + partition@50000 { + label = "cimage"; + reg = <0x50000 0x20000>; + read-only; + }; + + partition@70000 { + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,offset = ; + openwrt,partition-magic = ; + label = "firmware"; + reg = <0x00070000 0x00f70000>; + }; + + // FreeSpace + partition@fe0000 { + label = "freespace"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + // TODO: "spi refclk"? + groups = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd"; + function = "gpio"; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_2e>; + nvmem-cell-names = "mac-address"; + + mediatek,portmap = "llllw"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts index 67a7d8d4889..bbb3e01add9 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts @@ -48,12 +48,12 @@ lan1 { label = "green:lan1"; - gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; }; lan2 { label = "green:lan2"; - gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; }; wan { diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts new file mode 100644 index 00000000000..e3e248d48f9 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621_sercomm_s1500.dtsi" + +/ { + compatible = "beeline,smartbox-pro", "mediatek,mt7621-soc"; + model = "Beeline SmartBox PRO"; + + aliases { + label-mac-device = &gmac0; + }; + + keys { + switch_bt { + label = "ROUT<->REP Switch_bt"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + debounce-interval = <60>; + }; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 &ubiconcat3 \ + &ubiconcat4 &ubiconcat5 &ubiconcat6>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0xd2e0000>; + }; + }; + }; +}; + +&led_wps { + label = "blue:wps"; + color = ; +}; + +&partitions { + partition@0_all { + label = "ALL"; + reg = <0x0 0xff80000>; + read-only; + }; + + partition@200000 { + label = "sys_data"; + reg = <0x200000 0x1400000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + ubiconcat5: partition@0 { + label = "sys_data_1"; + reg = <0x0 0x600000>; + }; + + /* + * Sercomm U-Boot saves the environment at 0x800000 from + * the start of the NAND, destroying the "sys_data" + * partition. To prevent this, we split "sys_data" into + * two parts with "u-boot-env" partition between them. + */ + partition@600000 { + label = "u-boot-env"; + reg = <0x600000 0x20000>; + }; + + ubiconcat6: partition@620000 { + label = "sys_data_2"; + reg = <0x620000 0xde0000>; + }; + }; + + ubiconcat0: partition@1f00000 { + label = "RootFS_1"; + reg = <0x1f00000 0x1e00000>; + }; + + partition@3d00000 { + label = "RootFS_2"; + reg = <0x3d00000 0x1e00000>; + read-only; + }; + + ubiconcat1: partition@5b00000 { + label = "JVM/OSGI1"; + reg = <0x5b00000 0x3200000>; + }; + + ubiconcat2: partition@8d00000 { + label = "JVM/OSGI2"; + reg = <0x8d00000 0x3200000>; + }; + + ubiconcat3: partition@bf00000 { + label = "OSGI data"; + reg = <0xbf00000 0x3c00000>; + }; + + ubiconcat4: partition@fb00000 { + label = "Ftool"; + reg = <0xfb00000 0x100000>; + }; + + /* + * 4 MiB Reserved for the Bad Blocka + * 0x10000000-0xfc00000=0x400000 + */ +}; diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts new file mode 100644 index 00000000000..80600470e77 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "comfast,cf-e390ax", "mediatek,mt7621-soc"; + model = "COMFAST CF-E390AX"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&spi0 { + status = "okay"; + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <14000000>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@50000 { + label = "factory"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@90000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x90000 0xf70000>; + }; + }; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + }; + + port@4 { + status = "okay"; + label = "lan"; + }; + }; +}; + diff --git a/target/linux/ramips/dts/mt7621_netgear_eax12.dts b/target/linux/ramips/dts/mt7621_netgear_eax12.dts new file mode 100644 index 00000000000..d5ad404be0b --- /dev/null +++ b/target/linux/ramips/dts/mt7621_netgear_eax12.dts @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "netgear,eax12", "mediatek,mt7621-soc"; + model = "Netgear EAX12"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_power_red: power_red { + label = "red:power"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + client_green { + label = "green:client"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + client_red { + label = "red:client"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + router_green { + label = "green:router"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + + router_red { + label = "red:router"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + wps_green { + label = "green:wps"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + }; + + eth_green { + label = "green:eth"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + }; + + eth_yellow { + label = "yellow:eth"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "Config"; + reg = <0x80000 0x80000>; + read-only; + }; + + factory: partition@100000 { + label = "Factory"; + reg = <0x100000 0x80000>; + read-only; + }; + + partition@180000 { + label = "firmware"; + reg = <0x180000 0x3800000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x400000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x400000 0x3400000>; + }; + }; + + partition@2780000 { + label = "firmware_backup"; + reg = <0x3980000 0x3800000>; + read-only; + }; + + partition@4d80000 { + label = "CFG"; + reg = <0x7180000 0x200000>; + read-only; + }; + + partition@5580000 { + label = "RAE"; + reg = <0x7380000 0x600000>; + read-only; + }; + + partition@5980000 { + label = "POT"; + reg = <0x7980000 0x020000>; + read-only; + }; + + partition@6780000 { + label = "LOG"; + reg = <0x79A0000 0x40000>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi new file mode 100644 index 00000000000..91053f15bc1 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi @@ -0,0 +1,281 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + aliases { + led-boot = &led_status; + led-running = &led_status; + led-upgrade = &led_wps; + led-failsafe = &led_wps; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "amber:lan4"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <0>; + linux,default-trigger = "mt7530-0:00:1Gbps"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-1 { + label = "green:lan4"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-2 { + label = "amber:lan3"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + linux,default-trigger = "mt7530-0:01:1Gbps"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + }; + + led-3 { + label = "green:lan3"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + led-4 { + label = "amber:lan2"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + linux,default-trigger = "mt7530-0:02:1Gbps"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-5 { + label = "amber:lan1"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <5>; + linux,default-trigger = "mt7530-0:03:1Gbps"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + led-6 { + label = "green:lan1"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <6>; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + led-7 { + label = "amber:wan"; + color = ; + function = LED_FUNCTION_WAN; + function-enumerator = <0>; + linux,default-trigger = "mt7530-0:04:1Gbps"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + }; + + led-8 { + label = "green:wan"; + color = ; + function = LED_FUNCTION_WAN; + function-enumerator = <1>; + gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + }; + + led-9 { + label = "green:lan2"; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <7>; + gpios = <&gpio 26 GPIO_ACTIVE_LOW>; + }; + + led-10 { + label = "white:wlan2g"; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <0>; + linux,default-trigger = "phy1radio"; + gpios = <&gpio 28 GPIO_ACTIVE_LOW>; + }; + + led_wps: led-11 { + function = LED_FUNCTION_WPS; + function-enumerator = <0>; + gpios = <&gpio 29 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_status: led-12 { + label = "white:status"; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; + gpios = <&gpio 30 GPIO_ACTIVE_LOW>; + }; + + led-13 { + label = "white:wlan5g"; + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <1>; + linux,default-trigger = "phy0radio"; + gpios = <&gpio 32 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_1000>; + nvmem-cell-names = "mac-address"; +}; + +&nand { + status = "okay"; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x100000>; + read-only; + }; + + factory: partition@100000 { + label = "Factory"; + reg = <0x100000 0x100000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_1000: macaddr@1000 { + reg = <0x1000 0x6>; + }; + }; + + partition@1600000 { + label = "boot_flag"; + reg = <0x1600000 0x100000>; + }; + + partition@1700000 { + label = "kernel"; + reg = <0x1700000 0x400000>; + }; + + partition@1b00000 { + label = "Kernel_2"; + reg = <0x1b00000 0x400000>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; + + reset-gpios = <&gpio 8 GPIO_ACTIVE_LOW>, + <&gpio 19 GPIO_ACTIVE_LOW>; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + mediatek,mtd-eeprom = <&factory 0x8000>; + + nvmem-cells = <&macaddr_factory_1000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; + }; +}; + +&pcie1 { + wlan_2g: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <2400000 2500000>; + mediatek,mtd-eeprom = <&factory 0x0>; + + nvmem-cells = <&macaddr_factory_1000>; + nvmem-cell-names = "mac-address"; + }; +}; + +&state_default { + gpio { + groups = "wdt", "uart3", "jtag", "uart2", "i2c", "rgmii2"; + function = "gpio"; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + wan: port@4 { + status = "okay"; + label = "wan"; + + nvmem-cells = <&macaddr_factory_1000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts new file mode 100644 index 00000000000..d25bf575602 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,eap613-v1", "mediatek,mt7621-soc"; + model = "TP-Link EAP613 v1"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status: status { + label = "blue:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "partition-table"; + reg = <0x80000 0x10000>; + read-only; + }; + + partition@90000 { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + label = "product-info"; + reg = <0x90000 0x10000>; + read-only; + + macaddr: macaddr@8 { + reg = <0x8 0x6>; + }; + }; + + partition@a0000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0xa0000 0xcf0000>; + }; + + partition@d90000 { + label = "user-config"; + reg = <0xd90000 0x60000>; + read-only; + }; + + partition@f30000 { + label = "mutil-log"; + reg = <0xf30000 0x80000>; + read-only; + }; + + partition@fb0000 { + label = "oops"; + reg = <0xfb0000 0x40000>; + read-only; + }; + + radio: partition@ff0000 { + label = "radio"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "uart3"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x0>; + mediatek,disable-radar-background; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts new file mode 100644 index 00000000000..6c0e2965aa0 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621_sercomm_s1500.dtsi" + +/ { + compatible = "wifire,s1500-nbn", "mediatek,mt7621-soc"; + model = "WiFire S1500.NBN"; + + aliases { + label-mac-device = &wan; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 &ubiconcat3>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x4680000>; + }; + }; + }; +}; + +&led_wps { + label = "white:wps"; + color = ; +}; + +&partitions { + partition@0_all { + label = "ALL"; + reg = <0x0 0x7f80000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x80000 0x20000>; + }; + + ubiconcat1: partition@200000 { + label = "sys_data"; + reg = <0x200000 0x1400000>; + }; + + ubiconcat0: partition@1f00000 { + label = "RootFS_1"; + reg = <0x1f00000 0x2e00000>; + }; + + partition@4d00000 { + label = "RootFS_2"; + reg = <0x4d00000 0x2e00000>; + read-only; + }; + + ubiconcat2: partition@7b00000 { + label = "Ftool"; + reg = <0x7b00000 0x100000>; + }; + + ubiconcat3: partition@7c00000 { + label = "BCT"; + reg = <0x7c00000 0x380000>; + }; + + /* + * 512 KiB reserved for the Bad Blocks + * 0x8000000-0x7f80000=0x80000 + */ +}; + +&wlan_2g { + mac-address-increment = <1>; +}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608-32m.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608-32m.dts new file mode 100644 index 00000000000..00feec2ff3d --- /dev/null +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608-32m.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_zbtlink_zbt-wg1608.dtsi" + +/ { + compatible = "zbtlink,zbt-wg1608-32m", "mediatek,mt7621-soc"; + model = "Zbtlink ZBT-WG1608 (32M)"; +}; + +&flash0 { + broken-flash-reset; +}; + +&firmware { + reg = <0x50000 0x1fb0000>; +}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi index 59fab90ed1d..303708fab0e 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi @@ -61,7 +61,7 @@ &spi0 { status = "okay"; - flash@0 { + flash0: flash@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <50000000>; diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c index a6448443c01..7e896644f8a 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c @@ -257,7 +257,7 @@ err_free_bus: err_put_node: of_node_put(mii_np); err_no_bus: - dev_err(priv->dev, "%s disabled", "mdio-bus"); + dev_info(priv->dev, "%s disabled", "mdio-bus"); priv->mii_bus = NULL; return err; } diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index c080456e7a7..265e9fb5e0c 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -7,6 +7,7 @@ include $(INCLUDE_DIR)/image.mk DEVICE_VARS += LOADER_TYPE LOADER_FLASH_OFFS LZMA_TEXT_START DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID +DEVICE_VARS += NETGEAR_ENC_MODEL NETGEAR_ENC_REGION NETGEAR_ENC_HW_ID_LIST NETGEAR_ENC_MODEL_LIST DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += SERCOMM_HWNAME SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER @@ -179,6 +180,10 @@ define Device/Default SOC := $(DEFAULT_SOC) DEVICE_DTS_DIR := ../dts DEVICE_DTS = $$(SOC)_$(1) + NETGEAR_ENC_MODEL := + NETGEAR_ENC_REGION := + NETGEAR_ENC_HW_ID_LIST := + NETGEAR_ENC_MODEL_LIST := IMAGES := sysupgrade.bin COMPILE := sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs diff --git a/target/linux/ramips/image/common-sercomm.mk b/target/linux/ramips/image/common-sercomm.mk index fbe29d70174..4060da09235 100644 --- a/target/linux/ramips/image/common-sercomm.mk +++ b/target/linux/ramips/image/common-sercomm.mk @@ -1,6 +1,12 @@ DEVICE_VARS += SERCOMM_KERNEL_OFFSET SERCOMM_ROOTFS_OFFSET DEVICE_VARS += SERCOMM_KERNEL2_OFFSET SERCOMM_ROOTFS2_OFFSET +define Build/sercomm-append-tail + printf 16 | dd seek=$$((0x90)) of=$@ bs=1 conv=notrunc 2>/dev/null + printf 11223344556677889900112233445566 | \ + sed 's/../\\x&/g' | xargs -d . printf >> $@ +endef + define Build/sercomm-crypto $(TOPDIR)/scripts/sercomm-crypto.py \ --input-file $@ \ @@ -22,18 +28,20 @@ define Build/sercomm-factory-cqr --hw-version $(SERCOMM_HWVER) \ --hw-id $(SERCOMM_HWID) \ --sw-version $(SERCOMM_SWVER) \ - --pid-file $@.fhdr + --pid-file $@.fhdr \ + --extra-padding-size 0x190 printf $$(stat -c%s $(IMAGE_KERNEL)) | \ dd seek=$$((0x70)) of=$@.fhdr bs=1 conv=notrunc 2>/dev/null printf $$(($$(stat -c%s $@)-$$(stat -c%s $(IMAGE_KERNEL))-$$((0x200)))) | \ dd seek=$$((0x80)) of=$@.fhdr bs=1 conv=notrunc 2>/dev/null - dd bs=$$((0x200)) skip=1 if=$@ conv=notrunc 2>/dev/null | \ - $(MKHASH) md5 | awk '{print $$1}' | tr -d '\n' | \ - dd seek=$$((0x1e0)) of=$@.fhdr bs=1 conv=notrunc 2>/dev/null dd if=$@ >> $@.fhdr 2>/dev/null mv $@.fhdr $@ endef +define Build/sercomm-fix-buc-pid + printf 1 | dd seek=$$((0x13)) of=$@ bs=1 conv=notrunc 2>/dev/null +endef + define Build/sercomm-kernel $(TOPDIR)/scripts/sercomm-kernel-header.py \ --kernel-image $@ \ @@ -60,6 +68,12 @@ define Build/sercomm-kernel-factory mv $@.khdr $@ endef +define Build/sercomm-mkhash + dd bs=$$((0x400)) skip=1 if=$@ conv=notrunc 2>/dev/null | \ + $(MKHASH) md5 | awk '{print $$1}' | tr -d '\n' | \ + dd seek=$$((0x1e0)) of=$@ bs=1 conv=notrunc 2>/dev/null +endef + define Build/sercomm-part-tag $(call Build/sercomm-part-tag-common,$(word 1,$(1)) $@) endef @@ -98,19 +112,28 @@ define Build/sercomm-prepend-tagged-kernel mv $(IMAGE_KERNEL).tagged $@ endef +define Build/sercomm-reset-slot1-chksum + printf "\xff\xff\xff\xff" | \ + dd of=$@ seek=$$((0x118)) bs=1 conv=notrunc 2>/dev/null +endef + define Device/sercomm $(Device/nand) LOADER_TYPE := bin + IMAGES += factory.img +endef + +define Device/sercomm_cxx_dxx + $(Device/sercomm) KERNEL_SIZE := 6144k KERNEL_LOADADDR := 0x81001000 LZMA_TEXT_START := 0x82800000 SERCOMM_KERNEL_OFFSET := 0x400100 SERCOMM_ROOTFS_OFFSET := 0x1000000 - IMAGES += factory.img endef define Device/sercomm_cxx - $(Device/sercomm) + $(Device/sercomm_cxx_dxx) SERCOMM_KERNEL2_OFFSET := 0xa00100 SERCOMM_ROOTFS2_OFFSET := 0x3000000 KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | lzma -a0 | \ @@ -118,11 +141,11 @@ define Device/sercomm_cxx IMAGE/sysupgrade.bin := append-kernel | sercomm-kernel | \ sysupgrade-tar kernel=$$$$@ | append-metadata IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \ - append-ubi | sercomm-factory-cqr + append-ubi | sercomm-factory-cqr | sercomm-mkhash endef define Device/sercomm_dxx - $(Device/sercomm) + $(Device/sercomm_cxx_dxx) KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | lzma -a0 | \ uImage lzma | sercomm-kernel KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | \ @@ -132,3 +155,17 @@ define Device/sercomm_dxx sercomm-part-tag rootfs | sercomm-prepend-tagged-kernel kernel | \ gzip | sercomm-payload | sercomm-crypto endef + +define Device/sercomm_s1500 + $(Device/sercomm) + SERCOMM_KERNEL_OFFSET := 0x1700100 + SERCOMM_ROOTFS_OFFSET := 0x1f00000 + SERCOMM_KERNEL2_OFFSET := 0x1b00100 + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | lzma -a0 | \ + uImage lzma + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | \ + lzma -a0 | uImage lzma + IMAGE/sysupgrade.bin := append-kernel | sercomm-kernel | \ + sysupgrade-tar kernel=$$$$@ | append-metadata + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 +endef diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 7c2ff740f05..f3f4873d769 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -223,6 +223,19 @@ define Device/dlink_dir-510l endef TARGET_DEVICES += dlink_dir-510l +define Device/dlink_dir-806a-b1 + SOC := mt7620a + IMAGE_SIZE := 7872k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-806A + DEVICE_VARIANT := B1 + DEVICE_PACKAGES += kmod-mt76x0e + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size | \ + sign-dlink-ru cef285a2e29e40b2baab31277d44298b +endef +TARGET_DEVICES += dlink_dir-806a-b1 + define Device/dlink_dir-810l SOC := mt7620a DEVICE_PACKAGES := kmod-mt76x0e @@ -380,6 +393,22 @@ define Device/dovado_tiny-ac endef TARGET_DEVICES += dovado_tiny-ac +define Device/edimax_br-6208ac-v2 + SOC := mt7620a + DEVICE_VENDOR := Edimax + DEVICE_MODEL := BR-6208AC + DEVICE_VARIANT := V2 + BLOCKSIZE := 64k + IMAGE_SIZE := 7744k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m RN71 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + check-size | append-metadata + DEVICE_PACKAGES := kmod-mt76x2 kmod-mt76x0e kmod-phy-realtek \ + kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ + uboot-envtools +endef +TARGET_DEVICES += edimax_br-6208ac-v2 + define Device/edimax_br-6478ac-v2 SOC := mt7620a DEVICE_VENDOR := Edimax @@ -592,6 +621,8 @@ define Device/sunvalley_filehub_common IMAGES += kernel.bin rootfs.bin IMAGE/kernel.bin := append-loader-okli $(1) | check-size 64k IMAGE/rootfs.bin := $$(sysupgrade_bin) | check-size + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ + check-size 7744k | append-metadata endef define Device/hootoo_ht-tm05 diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index b8fa0cefdb3..0d25fc1eb31 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -398,6 +398,23 @@ define Device/beeline_smartbox-giga endef TARGET_DEVICES += beeline_smartbox-giga +define Device/beeline_smartbox-pro + $(Device/sercomm_s1500) + DEVICE_VENDOR := Beeline + DEVICE_MODEL := SmartBox PRO + DEVICE_ALT0_VENDOR := Sercomm + DEVICE_ALT0_MODEL := S1500 AWI + IMAGE_SIZE := 34816k + IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \ + sercomm-reset-slot1-chksum | append-ubi | check-size | \ + sercomm-factory-cqr | sercomm-append-tail | sercomm-mkhash + SERCOMM_HWID := AWI + SERCOMM_HWVER := 10000 + SERCOMM_ROOTFS2_OFFSET := 0x3d00000 + SERCOMM_SWVER := 2020 +endef +TARGET_DEVICES += beeline_smartbox-pro + define Device/beeline_smartbox-turbo $(Device/sercomm_dxx) IMAGE_SIZE := 32768k @@ -484,6 +501,20 @@ define Device/bolt_arion endef TARGET_DEVICES += bolt_arion +define Device/comfast_cf-e390ax + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 15808k + DEVICE_VENDOR := ComFast + DEVICE_MODEL := CF-E390AX + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ + check-size | append-metadata + IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size +endef +TARGET_DEVICES += comfast_cf-e390ax + define Device/cudy_m1800 $(Device/dsa-migration) DEVICE_VENDOR := Cudy @@ -1598,6 +1629,32 @@ define Device/mts_wg430223 endef TARGET_DEVICES += mts_wg430223 +define Device/netgear_eax12 + $(Device/nand) + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := EAX12 + DEVICE_ALT0_VENDOR := NETGEAR + DEVICE_ALT0_MODEL := EAX11 + DEVICE_ALT0_VARIANT := v2 + DEVICE_ALT1_VENDOR := NETGEAR + DEVICE_ALT1_MODEL := EAX15 + DEVICE_ALT1_VARIANT := v2 + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools + NETGEAR_ENC_MODEL := EAX12 + NETGEAR_ENC_REGION := US + NETGEAR_ENC_HW_ID_LIST := 1010000004540000_NETGEAR + NETGEAR_ENC_MODEL_LIST := EAX12;EAX11v2;EAX15v2 + IMAGE_SIZE := 57344k + KERNEL_LOADADDR := 0x82000000 + KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \ + append-squashfs4-fakeroot + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$(KERNEL_SIZE) | \ + append-ubi | check-size | netgear-encrypted-factory +endef +TARGET_DEVICES += netgear_eax12 + define Device/netgear_ex6150 $(Device/dsa-migration) $(Device/uimage-lzma-loader) @@ -2115,6 +2172,19 @@ define Device/tplink_eap235-wall-v1 endef TARGET_DEVICES += tplink_eap235-wall-v1 +define Device/tplink_eap613-v1 + $(Device/dsa-migration) + $(Device/tplink-safeloader) + DEVICE_MODEL := EAP613 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools + TPLINK_BOARD_ID := EAP610-V3 + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | pad-to 64k + KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd + IMAGE_SIZE := 13248k +endef +TARGET_DEVICES += tplink_eap613-v1 + define Device/tplink_eap615-wall-v1 $(Device/dsa-migration) $(Device/tplink-safeloader) @@ -2427,6 +2497,24 @@ define Device/wevo_w2914ns-v2 endef TARGET_DEVICES += wevo_w2914ns-v2 +define Device/wifire_s1500-nbn + $(Device/sercomm_s1500) + DEVICE_VENDOR := WiFire + DEVICE_MODEL := S1500.NBN + DEVICE_ALT0_VENDOR := Sercomm + DEVICE_ALT0_MODEL := S1500 BUC + IMAGE_SIZE := 51200k + IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \ + sercomm-reset-slot1-chksum | append-ubi | check-size | \ + sercomm-factory-cqr | sercomm-fix-buc-pid | sercomm-mkhash | \ + sercomm-crypto + SERCOMM_HWID := BUC + SERCOMM_HWVER := 10000 + SERCOMM_ROOTFS2_OFFSET := 0x4d00000 + SERCOMM_SWVER := 2015 +endef +TARGET_DEVICES += wifire_s1500-nbn + define Device/winstars_ws-wn583a6 $(Device/dsa-migration) $(Device/uimage-lzma-loader) @@ -2706,6 +2794,18 @@ define Device/zbtlink_zbt-wg1608-16m endef TARGET_DEVICES += zbtlink_zbt-wg1608-16m +define Device/zbtlink_zbt-wg1608-32m + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 32448k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WG1608 + DEVICE_VARIANT := 32M + DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt7603 kmod-mt7615e \ + kmod-mt7663-firmware-ap kmod-usb3 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += zbtlink_zbt-wg1608-32m + define Device/zbtlink_zbt-wg2626 $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 2deda0861a9..22e79ca7553 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -44,6 +44,9 @@ comfast,cf-wr800n) ucidef_set_led_netdev "lan" "lan" "white:ethernet" eth0.1 ucidef_set_led_netdev "wifi_led" "wifi" "white:wifi" "wlan0" ;; +dlink,dir-806a-b1) + ucidef_set_led_netdev "wifi_led" "2.4g" "green:wlan" "phy1-ap0" + ;; dlink,dir-810l|\ trendnet,tew-810dr) ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" @@ -98,6 +101,13 @@ domywifi,dw22d) dovado,tiny-ac) ucidef_set_led_netdev "wifi_led" "wifi" "orange:wifi" "wlan0" ;; +edimax,br-6208ac-v2) + ucidef_set_led_netdev "wan" "Internet" "green:internet" "eth0.2" "tx rx" + ucidef_set_led_netdev "wifi_led" "WLAN 2.4 GHz" "green:wlan2g" "wlan1" + ucidef_set_led_netdev "wifi_led" "WLAN 5 GHz" "green:wlan5g" "wlan1" + ucidef_set_led_netdev "wifi_led" "Firmware" "green:firmware" "wlan1" + ucidef_set_led_netdev "lan" "VPN" "green:vpn" "switch0" "0x20" + ;; edimax,br-6478ac-v2|\ edimax,ew-7478apc) ucidef_set_led_netdev "wifi_led" "wifi" "blue:wlan" "wlan0" @@ -219,8 +229,8 @@ tplink,re200-v1) ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" ;; wavlink,wl-wn535k1) - ucidef_set_led_switch "lan1" "lan2" "green:lan1" "switch0" "0x04" - ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x20" + ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x20" + ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x04" ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" ;; wavlink,wl-wn579x3) diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 787e123e31b..a0174d2d1cc 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -79,6 +79,7 @@ ramips_setup_interfaces() asus,rt-ac54u|\ asus,rt-n14u|\ bdcom,wap2100-sk|\ + dlink,dir-806a-b1|\ domywifi,dm202|\ domywifi,dm203|\ domywifi,dw22d|\ @@ -142,6 +143,10 @@ ramips_setup_interfaces() "5:lan" "6@eth0" ucidef_add_switch_attr "switch1" "enable" "false" ;; + edimax,br-6208ac-v2) + ucidef_add_switch "switch0" \ + "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; edimax,br-6478ac-v2|\ lb-link,bl-w1200|\ tplink,archer-c2-v1) @@ -235,7 +240,7 @@ ramips_setup_interfaces() ;; wavlink,wl-wn535k1) ucidef_add_switch "switch0" \ - "2:lan" "5:lan" "4:wan" "6@eth0" + "2:lan:2" "5:lan:1" "4:wan" "6@eth0" ;; wavlink,wl-wn579x3) ucidef_add_switch "switch0" \ @@ -273,6 +278,7 @@ ramips_setup_macs() asus,rt-n12p|\ asus,rt-n14u|\ bdcom,wap2100-sk|\ + edimax,br-6208ac-v2|\ edimax,ew-7478apc|\ fon,fon2601|\ head-weblink,hdrm200|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 9b15da0d22b..1de35104c32 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -40,6 +40,14 @@ etisalat,s3|\ rostelecom,rt-sf-1) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; +beeline,smartbox-pro|\ +wifire,s1500-nbn) + ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1" "link tx rx" + ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2" "link tx rx" + ucidef_set_led_netdev "lan3" "lan3" "green:lan3" "lan3" "link tx rx" + ucidef_set_led_netdev "lan4" "lan4" "green:lan4" "lan4" "link tx rx" + ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx" + ;; belkin,rt1800) ucidef_set_led_netdev "wan" "wan" "white:wan" "wan" ;; @@ -138,6 +146,10 @@ mikrotik,routerboard-m11g) mtc,wr1201) ucidef_set_led_netdev "eth_link" "LAN link" "green:eth_link" "br-lan" ;; +netgear,eax12) + ucidef_set_led_netdev "eth_act" "LAN act" "yellow:eth" "lan" "tx rx" + ucidef_set_led_netdev "eth_link" "LAN link" "green:eth" "lan" "link" + ;; netgear,r6220|\ netgear,r6260|\ netgear,r6350|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index cd746e84eea..38655ef746d 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -20,10 +20,12 @@ ramips_setup_interfaces() linksys,re7000|\ mikrotik,ltap-2hnd|\ mikrotik,routerboard-m11g|\ + netgear,eax12|\ netgear,ex6150|\ sercomm,na502|\ sercomm,na502s|\ thunder,timecloud|\ + tplink,eap613-v1|\ tplink,re350-v1|\ tplink,re500-v1|\ tplink,re650-v1|\ @@ -142,6 +144,9 @@ ramips_setup_interfaces() ucidef_set_interface_lan "lan1 lan2 lan3 lan4" ucidef_set_interface "qtn" ifname "eth1" protocol "static" ipaddr "1.1.1.1" netmask "255.255.255.0" ;; + comfast,cf-e390ax) + ucidef_set_interfaces_lan_wan "lan" "wan" + ;; *) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; @@ -185,6 +190,11 @@ ramips_setup_macs() lan_mac=$wan_mac label_mac=$wan_mac ;; + comfast,cf-e390ax) + lan_mac=$(cat /sys/class/net/eth0/address) + label_mac=$lan_mac + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; dlink,dir-860l-b1) lan_mac=$(mtd_get_mac_ascii factory lanmac) wan_mac=$(mtd_get_mac_ascii factory wanmac) @@ -275,6 +285,10 @@ ramips_setup_macs() label_mac=$wan_mac lan_mac=$(macaddr_add "$wan_mac" 2) ;; + netgear,eax12) + lan_mac=$(mtd_get_mac_ascii Config mac) + label_mac=$lan_mac + ;; netgear,wax202) lan_mac=$(mtd_get_mac_ascii Config mac) wan_mac=$(macaddr_add "$lan_mac" 1) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 80c72735430..a15b4a225f2 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -27,6 +27,10 @@ case "$board" in hw_mac_addr=$(macaddr_unsetbit $hw_mac_addr 28) [ "$PHYNBR" = "1" ] && macaddr_setbit_la $hw_mac_addr > /sys${DEVPATH}/macaddress ;; + comfast,cf-e390ax) + [ "$PHYNBR" = "0" ] && echo -n "$(mtd_get_mac_binary factory 0x0004)" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && echo -n "$(mtd_get_mac_binary factory 0x8004)" > /sys${DEVPATH}/macaddress + ;; cudy,x6-v1|\ cudy,x6-v2) hw_mac_addr="$(mtd_get_mac_binary bdinfo 0xde00)" @@ -118,6 +122,11 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress ;; + netgear,eax12) + hw_mac_addr=$(mtd_get_mac_ascii Config mac) + [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress + ;; netgear,wax202) hw_mac_addr=$(mtd_get_mac_ascii Config mac) [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress @@ -158,6 +167,7 @@ case "$board" in hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress ;; + tplink,eap613-v1|\ tplink,eap615-wall-v1) hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)" macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress" diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index cef58ec3bad..3c6d02f4fa6 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -59,6 +59,7 @@ platform_do_upgrade() { asus,rt-ax54|\ beeline,smartbox-flash|\ beeline,smartbox-giga|\ + beeline,smartbox-pro|\ beeline,smartbox-turbo|\ beeline,smartbox-turbo-plus|\ belkin,rt1800|\ @@ -87,6 +88,7 @@ platform_do_upgrade() { linksys,ea8100-v1|\ linksys,ea8100-v2|\ mts,wg430223|\ + netgear,eax12|\ netgear,r6220|\ netgear,r6260|\ netgear,r6350|\ @@ -106,6 +108,7 @@ platform_do_upgrade() { sercomm,na502s|\ sim,simax1800t|\ tplink,ec330-g5u-v1|\ + wifire,s1500-nbn|\ xiaomi,mi-router-3g|\ xiaomi,mi-router-3-pro|\ xiaomi,mi-router-4|\ diff --git a/target/linux/ramips/mt7621/config-5.15 b/target/linux/ramips/mt7621/config-5.15 index 1b4330c2d16..b366dac723a 100644 --- a/target/linux/ramips/mt7621/config-5.15 +++ b/target/linux/ramips/mt7621/config-5.15 @@ -3,7 +3,6 @@ CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 -CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_AT803X_PHY=y CONFIG_BLK_MQ_PCI=y @@ -24,8 +23,6 @@ CONFIG_CPU_HAS_DIEI=y CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_RIXI=y CONFIG_CPU_HAS_SYNC=y -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_TEO=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set @@ -34,7 +31,6 @@ CONFIG_CPU_MIPSR2=y CONFIG_CPU_MIPSR2_IRQ_EI=y CONFIG_CPU_MIPSR2_IRQ_VI=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y -CONFIG_CPU_PM=y CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_RMAP=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y @@ -62,7 +58,6 @@ CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_FIND_FIRST_BIT=y @@ -136,9 +131,7 @@ CONFIG_MIPS_CM=y CONFIG_MIPS_CMDLINE_FROM_DTB=y CONFIG_MIPS_CPC=y CONFIG_MIPS_CPS=y -CONFIG_MIPS_CPS_CPUIDLE=y # CONFIG_MIPS_CPS_NS16550_BOOL is not set -CONFIG_MIPS_CPS_PM=y CONFIG_MIPS_CPU_SCACHE=y CONFIG_MIPS_EBPF_JIT=y CONFIG_MIPS_GIC=y @@ -206,12 +199,15 @@ CONFIG_OF_IRQ=y CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_PADATA=y +CONFIG_PAGE_POOL=y +CONFIG_PAGE_POOL_STATS=y CONFIG_PCI=y CONFIG_PCIE_MT7621=y CONFIG_PCI_DISABLE_COMMON_QUIRKS=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS_GENERIC=y CONFIG_PCI_DRIVERS_GENERIC=y +CONFIG_PCS_MTK_LYNXI=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y diff --git a/target/linux/ramips/patches-5.15/010-v6.5-01-mips-pci-mt7620-do-not-print-NFTS-register-value-as-.patch b/target/linux/ramips/patches-5.15/010-v6.5-01-mips-pci-mt7620-do-not-print-NFTS-register-value-as-.patch new file mode 100644 index 00000000000..704e861b821 --- /dev/null +++ b/target/linux/ramips/patches-5.15/010-v6.5-01-mips-pci-mt7620-do-not-print-NFTS-register-value-as-.patch @@ -0,0 +1,32 @@ +From 9f9a035e6156a57d9da062b26d2a48d031744a1e Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Tue, 20 Jun 2023 18:43:22 +0800 +Subject: [PATCH 1/2] mips: pci-mt7620: do not print NFTS register value as + error log + +These codes are used to read NFTS_TIMEOUT_DELAY register value and +write it into kernel log after writing the register. they are only +used for debugging during driver development, so there is no need +to keep them now. + +Tested on MT7628AN router Motorola MWR03. + +Signed-off-by: Shiji Yang +Reviewed-by: Sergio Paracuellos +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/pci/pci-mt7620.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/arch/mips/pci/pci-mt7620.c ++++ b/arch/mips/pci/pci-mt7620.c +@@ -274,9 +274,6 @@ static int mt7628_pci_hw_init(struct pla + val |= 0x50 << 8; + pci_config_write(NULL, 0, 0x70c, 4, val); + +- pci_config_read(NULL, 0, 0x70c, 4, &val); +- dev_err(&pdev->dev, "Port 0 N_FTS = %x\n", (unsigned int) val); +- + return 0; + } + diff --git a/target/linux/ramips/patches-5.15/010-v6.5-02-mips-pci-mt7620-use-dev_info-to-log-PCIe-device-dete.patch b/target/linux/ramips/patches-5.15/010-v6.5-02-mips-pci-mt7620-use-dev_info-to-log-PCIe-device-dete.patch new file mode 100644 index 00000000000..5898a110ea9 --- /dev/null +++ b/target/linux/ramips/patches-5.15/010-v6.5-02-mips-pci-mt7620-use-dev_info-to-log-PCIe-device-dete.patch @@ -0,0 +1,39 @@ +From 89ec9bbe60b61cc6ae3eddd6d4f43e128f8a88de Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Tue, 20 Jun 2023 18:43:23 +0800 +Subject: [PATCH 2/2] mips: pci-mt7620: use dev_info() to log PCIe device + detection result + +Usually, We only need to print the error log when there is a PCIe card but +initialization fails. Whether the driver finds the PCIe card or not is the +expected behavior. So it's better to log these information with dev_info(). + +Tested on MT7628AN router Motorola MWR03. + +Signed-off-by: Shiji Yang +Reviewed-by: Sergio Paracuellos +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/pci/pci-mt7620.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/pci/pci-mt7620.c ++++ b/arch/mips/pci/pci-mt7620.c +@@ -331,7 +331,7 @@ static int mt7620_pci_probe(struct platf + rt_sysc_m32(RALINK_PCIE0_CLK_EN, 0, RALINK_CLKCFG1); + if (ralink_soc == MT762X_SOC_MT7620A) + rt_sysc_m32(LC_CKDRVPD, PDRV_SW_SET, PPLL_DRV); +- dev_err(&pdev->dev, "PCIE0 no card, disable it(RST&CLK)\n"); ++ dev_info(&pdev->dev, "PCIE0 no card, disable it(RST&CLK)\n"); + return -1; + } + +@@ -374,7 +374,7 @@ int pcibios_map_irq(const struct pci_dev + dev->bus->number, slot); + return 0; + } +- dev_err(&dev->dev, "card - bus=0x%x, slot = 0x%x irq=%d\n", ++ dev_info(&dev->dev, "card - bus=0x%x, slot = 0x%x irq=%d\n", + dev->bus->number, slot, irq); + + /* configure the cache line size to 0x14 */ diff --git a/target/linux/ramips/patches-5.15/110-v6.4-PCI-mt7621-Use-dev_info-to-log-PCIe-card-detection.patch b/target/linux/ramips/patches-5.15/110-v6.4-PCI-mt7621-Use-dev_info-to-log-PCIe-card-detection.patch new file mode 100644 index 00000000000..94519b9c01a --- /dev/null +++ b/target/linux/ramips/patches-5.15/110-v6.4-PCI-mt7621-Use-dev_info-to-log-PCIe-card-detection.patch @@ -0,0 +1,31 @@ +From 50233e105a0332ec0f3bc83180c416e6b200471e Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Fri, 24 Mar 2023 08:37:33 +0100 +Subject: PCI: mt7621: Use dev_info() to log PCIe card detection + +When there is no card plugged on a PCIe port a log reporting that +the port will be disabled is flagged as an error (dev_err()). + +Since this is not an error at all, change the log level by using +dev_info() instead. + +Link: https://lore.kernel.org/r/20230324073733.1596231-1-sergio.paracuellos@gmail.com +Signed-off-by: Sergio Paracuellos +Signed-off-by: Lorenzo Pieralisi +--- + drivers/pci/controller/pcie-mt7621.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/pci/controller/pcie-mt7621.c ++++ b/drivers/pci/controller/pcie-mt7621.c +@@ -383,8 +383,8 @@ static int mt7621_pcie_init_ports(struct + u32 slot = port->slot; + + if (!mt7621_pcie_port_is_linkup(port)) { +- dev_err(dev, "pcie%d no card, disable it (RST & CLK)\n", +- slot); ++ dev_info(dev, "pcie%d no card, disable it (RST & CLK)\n", ++ slot); + mt7621_control_assert(port); + port->enabled = false; + num_disabled++; diff --git a/target/linux/ramips/patches-5.15/314-MIPS-add-bootargs-override-property.patch b/target/linux/ramips/patches-5.15/314-MIPS-add-bootargs-override-property.patch index 07635a9d86a..ef45aac61bd 100644 --- a/target/linux/ramips/patches-5.15/314-MIPS-add-bootargs-override-property.patch +++ b/target/linux/ramips/patches-5.15/314-MIPS-add-bootargs-override-property.patch @@ -17,7 +17,7 @@ Signed-off-by: David Bauer --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -544,8 +544,28 @@ static int __init bootcmdline_scan_chose +@@ -545,8 +545,28 @@ static int __init bootcmdline_scan_chose #endif /* CONFIG_OF_EARLY_FLATTREE */ @@ -46,7 +46,7 @@ Signed-off-by: David Bauer bool dt_bootargs = false; /* -@@ -559,6 +579,14 @@ static void __init bootcmdline_init(void +@@ -560,6 +580,14 @@ static void __init bootcmdline_init(void } /* diff --git a/target/linux/ramips/patches-5.15/315-owrt-hack-fix-mt7688-cache-issue.patch b/target/linux/ramips/patches-5.15/315-owrt-hack-fix-mt7688-cache-issue.patch index f36f028cab3..d49429f7a3b 100644 --- a/target/linux/ramips/patches-5.15/315-owrt-hack-fix-mt7688-cache-issue.patch +++ b/target/linux/ramips/patches-5.15/315-owrt-hack-fix-mt7688-cache-issue.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -686,7 +686,6 @@ static void __init arch_mem_init(char ** +@@ -687,7 +687,6 @@ static void __init arch_mem_init(char ** mips_reserve_vmcore(); mips_parse_crashkernel(); @@ -18,7 +18,7 @@ Signed-off-by: John Crispin /* * In order to reduce the possibility of kernel panic when failed to -@@ -803,6 +802,7 @@ void __init setup_arch(char **cmdline_p) +@@ -804,6 +803,7 @@ void __init setup_arch(char **cmdline_p) cpu_cache_init(); paging_init(); diff --git a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c index d47ba3e013a..c69a5af4bde 100644 --- a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c +++ b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include "rtl83xx-phy.h" @@ -19,9 +21,6 @@ extern struct rtl83xx_soc_info soc_info; extern struct mutex smi_lock; -#define PHY_CTRL_REG 0 -#define PHY_POWER_BIT 11 - #define PHY_PAGE_2 2 #define PHY_PAGE_4 4 @@ -124,23 +123,23 @@ static int resume_polling(u64 saved_state) static void rtl8380_int_phy_on_off(struct phy_device *phydev, bool on) { - phy_modify(phydev, 0, BIT(11), on?0:BIT(11)); + phy_modify(phydev, 0, BMCR_PDOWN, on ? 0 : BMCR_PDOWN); } static void rtl8380_rtl8214fc_on_off(struct phy_device *phydev, bool on) { /* fiber ports */ phy_write_paged(phydev, RTL83XX_PAGE_RAW, RTL821XEXT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_FIBRE); - phy_modify(phydev, 0x10, BIT(11), on?0:BIT(11)); + phy_modify(phydev, 0x10, BMCR_PDOWN, on ? 0 : BMCR_PDOWN); /* copper ports */ phy_write_paged(phydev, RTL83XX_PAGE_RAW, RTL821XEXT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_COPPER); - phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, BIT(11), on?0:BIT(11)); + phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, BMCR_PDOWN, on ? 0 : BMCR_PDOWN); } static void rtl8380_phy_reset(struct phy_device *phydev) { - phy_modify(phydev, 0, BIT(15), BIT(15)); + phy_modify(phydev, 0, BMCR_RESET, BMCR_RESET); } /* The access registers for SDS_MODE_SEL and the LSB for each SDS within */ @@ -223,9 +222,9 @@ int rtl839x_read_sds_phy(int phy_addr, int phy_reg) * which would otherwise read as 0. */ if (soc_info.id == 0x8393) { - if (phy_reg == 2) + if (phy_reg == MII_PHYSID1) return 0x1c; - if (phy_reg == 3) + if (phy_reg == MII_PHYSID2) return 0x8393; } @@ -445,20 +444,20 @@ static int rtl8226_read_status(struct phy_device *phydev) /* Link status must be read twice */ for (int i = 0; i < 2; i++) - val = phy_read_mmd(phydev, MMD_VEND2, 0xA402); + val = phy_read_mmd(phydev, MDIO_MMD_VEND2, 0xA402); phydev->link = val & BIT(2) ? 1 : 0; if (!phydev->link) goto out; /* Read duplex status */ - val = phy_read_mmd(phydev, MMD_VEND2, 0xA434); + val = phy_read_mmd(phydev, MDIO_MMD_VEND2, 0xA434); if (val < 0) goto out; phydev->duplex = !!(val & BIT(3)); /* Read speed */ - val = phy_read_mmd(phydev, MMD_VEND2, 0xA434); + val = phy_read_mmd(phydev, MDIO_MMD_VEND2, 0xA434); switch (val & 0x0630) { case 0x0000: phydev->speed = SPEED_10; @@ -493,34 +492,34 @@ static int rtl8226_advertise_aneg(struct phy_device *phydev) pr_info("In %s\n", __func__); - v = phy_read_mmd(phydev, MMD_AN, 16); + v = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE); if (v < 0) goto out; - v |= BIT(5); /* HD 10M */ - v |= BIT(6); /* FD 10M */ - v |= BIT(7); /* HD 100M */ - v |= BIT(8); /* FD 100M */ + v |= ADVERTISE_10HALF; + v |= ADVERTISE_10FULL; + v |= ADVERTISE_100HALF; + v |= ADVERTISE_100FULL; - ret = phy_write_mmd(phydev, MMD_AN, 16, v); + ret = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_ADVERTISE, v); /* Allow 1GBit */ - v = phy_read_mmd(phydev, MMD_VEND2, 0xA412); + v = phy_read_mmd(phydev, MDIO_MMD_VEND2, 0xA412); if (v < 0) goto out; - v |= BIT(9); /* FD 1000M */ + v |= ADVERTISE_1000FULL; - ret = phy_write_mmd(phydev, MMD_VEND2, 0xA412, v); + ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, 0xA412, v); if (ret < 0) goto out; /* Allow 2.5G */ - v = phy_read_mmd(phydev, MMD_AN, 32); + v = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL); if (v < 0) goto out; - v |= BIT(7); - ret = phy_write_mmd(phydev, MMD_AN, 32, v); + v |= MDIO_AN_10GBT_CTRL_ADV2_5G; + ret = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL, v); out: return ret; @@ -537,22 +536,22 @@ static int rtl8226_config_aneg(struct phy_device *phydev) if (ret) goto out; /* AutoNegotiationEnable */ - v = phy_read_mmd(phydev, MMD_AN, 0); + v = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1); if (v < 0) goto out; - v |= BIT(12); /* Enable AN */ - ret = phy_write_mmd(phydev, MMD_AN, 0, v); + v |= MDIO_AN_CTRL1_ENABLE; /* Enable AN */ + ret = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1, v); if (ret < 0) goto out; /* RestartAutoNegotiation */ - v = phy_read_mmd(phydev, MMD_VEND2, 0xA400); + v = phy_read_mmd(phydev, MDIO_MMD_VEND2, 0xA400); if (v < 0) goto out; - v |= BIT(9); + v |= MDIO_AN_CTRL1_RESTART; - ret = phy_write_mmd(phydev, MMD_VEND2, 0xA400, v); + ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, 0xA400, v); } /* TODO: ret = __genphy_config_aneg(phydev, ret); */ @@ -569,12 +568,12 @@ static int rtl8226_get_eee(struct phy_device *phydev, pr_debug("In %s, port %d, was enabled: %d\n", __func__, addr, e->eee_enabled); - val = phy_read_mmd(phydev, MMD_AN, 60); + val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV); if (e->eee_enabled) { - e->eee_enabled = !!(val & BIT(1)); + e->eee_enabled = !!(val & MDIO_EEE_100TX); if (!e->eee_enabled) { - val = phy_read_mmd(phydev, MMD_AN, 62); - e->eee_enabled = !!(val & BIT(0)); + val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV2); + e->eee_enabled = !!(val & MDIO_EEE_2_5GT); } } pr_debug("%s: enabled: %d\n", __func__, e->eee_enabled); @@ -594,29 +593,29 @@ static int rtl8226_set_eee(struct phy_device *phydev, struct ethtool_eee *e) poll_state = disable_polling(port); /* Remember aneg state */ - val = phy_read_mmd(phydev, MMD_AN, 0); - an_enabled = !!(val & BIT(12)); + val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1); + an_enabled = !!(val & MDIO_AN_CTRL1_ENABLE); /* Setup 100/1000MBit */ - val = phy_read_mmd(phydev, MMD_AN, 60); + val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV); if (e->eee_enabled) - val |= 0x6; + val |= (MDIO_EEE_100TX | MDIO_EEE_1000T); else - val &= 0x6; - phy_write_mmd(phydev, MMD_AN, 60, val); + val &= (MDIO_EEE_100TX | MDIO_EEE_1000T); + phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val); /* Setup 2.5GBit */ - val = phy_read_mmd(phydev, MMD_AN, 62); + val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV2); if (e->eee_enabled) - val |= 0x1; + val |= MDIO_EEE_2_5GT; else - val &= 0x1; - phy_write_mmd(phydev, MMD_AN, 62, val); + val &= MDIO_EEE_2_5GT; + phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV2, val); /* RestartAutoNegotiation */ - val = phy_read_mmd(phydev, MMD_VEND2, 0xA400); - val |= BIT(9); - phy_write_mmd(phydev, MMD_VEND2, 0xA400, val); + val = phy_read_mmd(phydev, MDIO_MMD_VEND2, 0xA400); + val |= MDIO_AN_CTRL1_RESTART; + phy_write_mmd(phydev, MDIO_MMD_VEND2, 0xA400, val); resume_polling(poll_state); @@ -748,8 +747,8 @@ static int rtl8380_configure_int_rtl8218b(struct phy_device *phydev) // int ipd_flag = 1; // } - val = phy_read(phydev, 0); - if (val & BIT(11)) + val = phy_read(phydev, MII_BMCR); + if (val & BMCR_PDOWN) rtl8380_int_phy_on_off(phydev, true); else rtl8380_phy_reset(phydev); @@ -839,8 +838,8 @@ static int rtl8380_configure_ext_rtl8218b(struct phy_device *phydev) rtl8218B_6276B_rtl8380_perport = (void *)h + sizeof(struct fw_header) + h->parts[1].start; rtl8380_rtl8218b_perport = (void *)h + sizeof(struct fw_header) + h->parts[2].start; - val = phy_read(phydev, 0); - if (val & (1 << 11)) + val = phy_read(phydev, MII_BMCR); + if (val & BMCR_PDOWN) rtl8380_int_phy_on_off(phydev, true); else rtl8380_phy_reset(phydev); @@ -939,7 +938,7 @@ static bool rtl8214fc_media_is_fibre(struct phy_device *phydev) val = phy_package_read_paged(phydev, RTL821X_PAGE_PORT, reg[mac % 4]); phy_package_write_paged(phydev, RTL83XX_PAGE_RAW, RTL821XINT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_AUTO); - if (val & BIT(11)) + if (val & BMCR_PDOWN) return false; return true; @@ -958,9 +957,9 @@ static void rtl8214fc_power_set(struct phy_device *phydev, int port, bool on) } if (on) { - phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, BIT(11), 0); + phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, BMCR_PDOWN, 0); } else { - phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, 0, BIT(11)); + phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, 0, BMCR_PDOWN); } phy_write_paged(phydev, RTL83XX_PAGE_RAW, RTL821XINT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_AUTO); @@ -1000,9 +999,9 @@ static void rtl8214fc_media_set(struct phy_device *phydev, bool set_fibre) val |= BIT(10); if (set_fibre) { - val &= ~BIT(11); + val &= ~BMCR_PDOWN; } else { - val |= BIT(11); + val |= BMCR_PDOWN; } phy_package_write_paged(phydev, RTL83XX_PAGE_RAW, RTL821XINT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_INTERNAL); @@ -1057,13 +1056,12 @@ void rtl8218d_eee_set(struct phy_device *phydev, bool enable) /* Set GPHY page to copper */ phy_write_paged(phydev, RTL821X_PAGE_GPHY, RTL821XEXT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_COPPER); - val = phy_read(phydev, 0); - an_enabled = val & BIT(12); + val = phy_read(phydev, MII_BMCR); + an_enabled = val & BMCR_ANENABLE; - /* Enable 100M (bit 1) / 1000M (bit 2) EEE */ - val = phy_read_mmd(phydev, 7, 60); - val |= BIT(2) | BIT(1); - phy_write_mmd(phydev, 7, 60, enable ? 0x6 : 0); + val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV); + val |= MDIO_EEE_1000T | MDIO_EEE_100TX; + phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, enable ? (MDIO_EEE_100TX | MDIO_EEE_1000T) : 0); /* 500M EEE ability */ val = phy_read_paged(phydev, RTL821X_PAGE_GPHY, 20); @@ -1075,9 +1073,9 @@ void rtl8218d_eee_set(struct phy_device *phydev, bool enable) /* Restart AN if enabled */ if (an_enabled) { - val = phy_read(phydev, 0); - val |= BIT(9); - phy_write(phydev, 0, val); + val = phy_read(phydev, MII_BMCR); + val |= BMCR_ANRESTART; + phy_write(phydev, MII_BMCR, val); } /* GPHY page back to auto */ @@ -1095,7 +1093,7 @@ static int rtl8218b_get_eee(struct phy_device *phydev, /* Set GPHY page to copper */ phy_write_paged(phydev, RTL821X_PAGE_GPHY, RTL821XINT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_COPPER); - val = phy_read_paged(phydev, 7, 60); + val = phy_read_paged(phydev, 7, MDIO_AN_EEE_ADV); if (e->eee_enabled) { /* Verify vs MAC-based EEE */ e->eee_enabled = !!(val & BIT(7)); @@ -1123,7 +1121,7 @@ static int rtl8218d_get_eee(struct phy_device *phydev, /* Set GPHY page to copper */ phy_write_paged(phydev, RTL821X_PAGE_GPHY, RTL821XEXT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_COPPER); - val = phy_read_paged(phydev, 7, 60); + val = phy_read_paged(phydev, 7, MDIO_AN_EEE_ADV); if (e->eee_enabled) e->eee_enabled = !!(val & BIT(7)); pr_debug("%s: enabled: %d\n", __func__, e->eee_enabled); @@ -1155,8 +1153,8 @@ static int rtl8214fc_set_eee(struct phy_device *phydev, phy_write_paged(phydev, RTL821X_PAGE_GPHY, RTL821XINT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_COPPER); /* Get auto-negotiation status */ - val = phy_read(phydev, 0); - an_enabled = val & BIT(12); + val = phy_read(phydev, MII_BMCR); + an_enabled = val & BMCR_ANENABLE; pr_info("%s: aneg: %d\n", __func__, an_enabled); val = phy_read_paged(phydev, RTL821X_PAGE_MAC, 25); @@ -1164,7 +1162,7 @@ static int rtl8214fc_set_eee(struct phy_device *phydev, phy_write_paged(phydev, RTL821X_PAGE_MAC, 25, val); /* Enable 100M (bit 1) / 1000M (bit 2) EEE */ - phy_write_paged(phydev, 7, 60, e->eee_enabled ? 0x6 : 0); + phy_write_paged(phydev, 7, MDIO_AN_EEE_ADV, e->eee_enabled ? (MDIO_EEE_100TX | MDIO_EEE_1000T) : 0); /* 500M EEE ability */ val = phy_read_paged(phydev, RTL821X_PAGE_GPHY, 20); @@ -1178,9 +1176,9 @@ static int rtl8214fc_set_eee(struct phy_device *phydev, /* Restart AN if enabled */ if (an_enabled) { pr_info("%s: doing aneg\n", __func__); - val = phy_read(phydev, 0); - val |= BIT(9); - phy_write(phydev, 0, val); + val = phy_read(phydev, MII_BMCR); + val |= BMCR_ANRESTART; + phy_write(phydev, MII_BMCR, val); } /* GPHY page back to auto */ @@ -1218,8 +1216,8 @@ static int rtl8218b_set_eee(struct phy_device *phydev, struct ethtool_eee *e) /* Set GPHY page to copper */ phy_write(phydev, RTL821XEXT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_COPPER); - val = phy_read(phydev, 0); - an_enabled = val & BIT(12); + val = phy_read(phydev, MII_BMCR); + an_enabled = val & BMCR_ANENABLE; if (e->eee_enabled) { /* 100/1000M EEE Capability */ @@ -1245,9 +1243,9 @@ static int rtl8218b_set_eee(struct phy_device *phydev, struct ethtool_eee *e) /* Restart AN if enabled */ if (an_enabled) { - val = phy_read(phydev, 0); - val |= BIT(9); - phy_write(phydev, 0, val); + val = phy_read(phydev, MII_BMCR); + val |= BMCR_ANRESTART; + phy_write(phydev, MII_BMCR, val); } /* GPHY page back to auto */ @@ -1342,7 +1340,7 @@ static int rtl8380_configure_rtl8214fc(struct phy_device *phydev) val = phy_read_paged(phydev, RTL83XX_PAGE_RAW, 28); val = phy_read(phydev, 16); - if (val & (1 << 11)) + if (val & BMCR_PDOWN) rtl8380_rtl8214fc_on_off(phydev, true); else rtl8380_phy_reset(phydev); @@ -2750,17 +2748,17 @@ void rtl9300_phy_enable_10g_1g(int sds_num) u32 v; /* Enable 1GBit PHY */ - v = rtl930x_read_sds_phy(sds_num, PHY_PAGE_2, PHY_CTRL_REG); + v = rtl930x_read_sds_phy(sds_num, PHY_PAGE_2, MII_BMCR); pr_info("%s 1gbit phy: %08x\n", __func__, v); - v &= ~BIT(PHY_POWER_BIT); - rtl930x_write_sds_phy(sds_num, PHY_PAGE_2, PHY_CTRL_REG, v); + v &= ~BMCR_PDOWN; + rtl930x_write_sds_phy(sds_num, PHY_PAGE_2, MII_BMCR, v); pr_info("%s 1gbit phy enabled: %08x\n", __func__, v); /* Enable 10GBit PHY */ - v = rtl930x_read_sds_phy(sds_num, PHY_PAGE_4, PHY_CTRL_REG); + v = rtl930x_read_sds_phy(sds_num, PHY_PAGE_4, MII_BMCR); pr_info("%s 10gbit phy: %08x\n", __func__, v); - v &= ~BIT(PHY_POWER_BIT); - rtl930x_write_sds_phy(sds_num, PHY_PAGE_4, PHY_CTRL_REG, v); + v &= ~BMCR_PDOWN; + rtl930x_write_sds_phy(sds_num, PHY_PAGE_4, MII_BMCR, v); pr_info("%s 10gbit phy after: %08x\n", __func__, v); /* dal_longan_construct_mac_default_10gmedia_fiber */ diff --git a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.h b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.h index 3b912318291..fb79560e6b6 100644 --- a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.h +++ b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.h @@ -35,10 +35,6 @@ struct __attribute__ ((__packed__)) fw_header { #define PHY_ID_RTL8393_I 0x001c8393 #define PHY_ID_RTL9300_I 0x70d03106 -/* PHY MMD devices */ -#define MMD_AN 7 -#define MMD_VEND2 31 - /* Registers of the internal Serdes of the 8380 */ #define RTL838X_SDS_MODE_SEL (0x0028) #define RTL838X_SDS_CFG_REG (0x0034) diff --git a/target/linux/realtek/patches-5.15/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch b/target/linux/realtek/patches-5.15/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch index 17ff729f525..dfe7ab28d73 100644 --- a/target/linux/realtek/patches-5.15/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch +++ b/target/linux/realtek/patches-5.15/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch @@ -32,7 +32,7 @@ Signed-off-by: Guenter Roeck --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -15902,6 +15902,13 @@ S: Maintained +@@ -15895,6 +15895,13 @@ S: Maintained F: include/sound/rt*.h F: sound/soc/codecs/rt* diff --git a/target/linux/realtek/patches-5.15/300-mips-add-rtl838x-platform.patch b/target/linux/realtek/patches-5.15/300-mips-add-rtl838x-platform.patch index 6407a49fb6b..f853ef4feef 100644 --- a/target/linux/realtek/patches-5.15/300-mips-add-rtl838x-platform.patch +++ b/target/linux/realtek/patches-5.15/300-mips-add-rtl838x-platform.patch @@ -25,7 +25,7 @@ Submitted-by: Birger Koblitz platform-$(CONFIG_SGI_IP28) += sgi-ip22/ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1053,8 +1053,58 @@ config NLM_XLP_BOARD +@@ -1054,8 +1054,58 @@ config NLM_XLP_BOARD This board is based on Netlogic XLP Processor. Say Y here if you have a XLP based board. diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index c10e0cbcc9d..7ac5148275a 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -7,6 +7,7 @@ rockchip_setup_interfaces() local board="$1" case "$board" in + friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2s|\ friendlyarm,nanopi-r4s|\ xunlong,orangepi-r1-plus|\ diff --git a/target/linux/rockchip/armv8/config-6.1 b/target/linux/rockchip/armv8/config-6.1 index 4d747537e23..e21de9a3484 100644 --- a/target/linux/rockchip/armv8/config-6.1 +++ b/target/linux/rockchip/armv8/config-6.1 @@ -2,7 +2,6 @@ CONFIG_64BIT=y CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=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_MHP_MEMMAP_ON_MEMORY_ENABLE=y diff --git a/target/linux/sifiveu/patches-5.15/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch b/target/linux/sifiveu/patches-5.15/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch index b5779e09cb0..c6b997dbbed 100644 --- a/target/linux/sifiveu/patches-5.15/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch +++ b/target/linux/sifiveu/patches-5.15/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch @@ -14,7 +14,7 @@ Signed-off-by: David Abdurachmanov --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig -@@ -565,6 +565,14 @@ config BUILTIN_DTB +@@ -566,6 +566,14 @@ config BUILTIN_DTB depends on OF default y if XIP_KERNEL diff --git a/target/linux/x86/64/config-5.15 b/target/linux/x86/64/config-5.15 index d972668e543..d80706338bc 100644 --- a/target/linux/x86/64/config-5.15 +++ b/target/linux/x86/64/config-5.15 @@ -334,7 +334,7 @@ CONFIG_NR_CPUS_DEFAULT=64 CONFIG_NR_CPUS_RANGE_BEGIN=2 CONFIG_NR_CPUS_RANGE_END=512 CONFIG_NVME_CORE=y -# CONFIG_NVME_HWMON is not set +CONFIG_NVME_HWMON=y CONFIG_NVME_MULTIPATH=y CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_PADATA=y @@ -478,7 +478,7 @@ CONFIG_X86_64_SMP=y CONFIG_X86_ACPI_CPUFREQ=y # CONFIG_X86_ACPI_CPUFREQ_CPB is not set CONFIG_X86_AMD_FREQ_SENSITIVITY=y -# CONFIG_X86_AMD_PLATFORM_DEVICE is not set +CONFIG_X86_AMD_PLATFORM_DEVICE=y CONFIG_X86_CPUID=y CONFIG_X86_DIRECT_GBPAGES=y CONFIG_X86_HV_CALLBACK_VECTOR=y diff --git a/target/linux/x86/generic/config-5.15 b/target/linux/x86/generic/config-5.15 index 1da6ad555da..5fda82dd296 100644 --- a/target/linux/x86/generic/config-5.15 +++ b/target/linux/x86/generic/config-5.15 @@ -415,7 +415,7 @@ CONFIG_X86_32_SMP=y CONFIG_X86_ACPI_CPUFREQ=y # CONFIG_X86_ACPI_CPUFREQ_CPB is not set CONFIG_X86_AMD_FREQ_SENSITIVITY=y -# CONFIG_X86_AMD_PLATFORM_DEVICE is not set +CONFIG_X86_AMD_PLATFORM_DEVICE=y # CONFIG_X86_BIGSMP is not set CONFIG_X86_CPUID=y # CONFIG_X86_E_POWERSAVER is not set diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 0ef79f4c76e..72103411677 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2023-05-18 -PKG_SOURCE_VERSION:=02cdbc6a4d61605c008efef09162f772f553fcde -PKG_MIRROR_HASH:=f5188fc38bb03ddbcc34763ff049597e2d8af98c0854910dc87f10e5927096e2 +PKG_SOURCE_DATE:=2023-06-29 +PKG_SOURCE_VERSION:=9e2de8515be15e2b61ae518ce592e5b446ef2d48 +PKG_MIRROR_HASH:=e43d1796dd482ec364e5196f224bb1563dbb0494f0f28fb4e206ef7ef31260fb include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk