forked from Ivasoft/openwrt
Compare commits
69 Commits
master
...
v23.05.0-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f29f876bfa | ||
|
|
e2701e0f33 | ||
|
|
f949dd5c90 | ||
|
|
d4d94a1ff3 | ||
|
|
dd97954772 | ||
|
|
f2a13cf10e | ||
|
|
c734a399cc | ||
|
|
65b5b72cb7 | ||
|
|
14cbf041ea | ||
|
|
20295c071a | ||
|
|
9c45c58c7c | ||
|
|
478a3e609f | ||
|
|
e2e7dd4450 | ||
|
|
e8231a43e0 | ||
|
|
570618b844 | ||
|
|
3d05d54679 | ||
|
|
6fc6ea4d3a | ||
|
|
94884f3904 | ||
|
|
cd36c6f52b | ||
|
|
e018afcfc6 | ||
|
|
99c94c6696 | ||
|
|
f588da89a3 | ||
|
|
c55bcf7772 | ||
|
|
5d0d04e238 | ||
|
|
7f0e1373f4 | ||
|
|
dc2841045d | ||
|
|
912974cc15 | ||
|
|
afe2722f6d | ||
|
|
3a1cb63336 | ||
|
|
4174768d9f | ||
|
|
ec6bbc5255 | ||
|
|
962334bc82 | ||
|
|
7666503f68 | ||
|
|
8f2dcd0c3d | ||
|
|
f54bea12b6 | ||
|
|
e996c6eb19 | ||
|
|
e458cfc214 | ||
|
|
670dedbbd7 | ||
|
|
fd17917951 | ||
|
|
84e3d27355 | ||
|
|
98e6233202 | ||
|
|
f7d0a4797f | ||
|
|
5970f5d027 | ||
|
|
d5dc84f44e | ||
|
|
d74c3d8895 | ||
|
|
918c0e5f41 | ||
|
|
3ff5e9e8de | ||
|
|
5df84814bb | ||
|
|
34b19a8520 | ||
|
|
d4b4926320 | ||
|
|
ea9a7f1250 | ||
|
|
f1fbf61fcf | ||
|
|
60b6220028 | ||
|
|
22d7148689 | ||
|
|
b79ed14dd1 | ||
|
|
bf82648bf7 | ||
|
|
635d5488c9 | ||
|
|
f0b2fdb82e | ||
|
|
84a4601ca6 | ||
|
|
7613efde8e | ||
|
|
e22fba1694 | ||
|
|
6b9f405324 | ||
|
|
4a6847ce4e | ||
|
|
7df43979d1 | ||
|
|
7d226e13e2 | ||
|
|
56ffc5a866 | ||
|
|
7f0db09513 | ||
|
|
fdfb848402 | ||
|
|
8192380288 |
76
.github/workflows/build.yml
vendored
76
.github/workflows/build.yml
vendored
@@ -8,6 +8,9 @@ on:
|
||||
target:
|
||||
required: true
|
||||
type: string
|
||||
subtarget:
|
||||
required: true
|
||||
type: string
|
||||
testing:
|
||||
type: boolean
|
||||
build_toolchain:
|
||||
@@ -50,7 +53,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
setup_build:
|
||||
name: Setup build ${{ inputs.target }}
|
||||
name: Setup build ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
owner_lc: ${{ steps.lower_owner.outputs.owner_lc }}
|
||||
@@ -109,7 +112,7 @@ jobs:
|
||||
echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build ${{ inputs.target }}
|
||||
name: Build ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
needs: setup_build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -153,35 +156,6 @@ jobs:
|
||||
repository: openwrt/telephony
|
||||
path: openwrt/feeds/telephony
|
||||
|
||||
- name: Fix permission
|
||||
run: |
|
||||
chown -R buildbot:buildbot openwrt
|
||||
|
||||
- name: Initialization environment
|
||||
run: |
|
||||
TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1)
|
||||
SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2)
|
||||
echo "TARGET=$TARGET" >> "$GITHUB_ENV"
|
||||
echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
|
||||
|
||||
- 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: Parse toolchain file
|
||||
if: inputs.build_toolchain == false
|
||||
id: parse-toolchain
|
||||
@@ -213,7 +187,7 @@ jobs:
|
||||
fi
|
||||
fi
|
||||
|
||||
SUMS_FILE="https://downloads.cdn.openwrt.org/$TOOLCHAIN_PATH/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums"
|
||||
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')
|
||||
@@ -231,20 +205,42 @@ jobs:
|
||||
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
|
||||
echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Fix permission
|
||||
run: |
|
||||
chown -R buildbot:buildbot openwrt
|
||||
|
||||
- name: Prepare prebuilt tools
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
mkdir -p staging_dir build_dir
|
||||
ln -s /prebuilt_tools/staging_dir/host staging_dir/host
|
||||
ln -s /prebuilt_tools/build_dir/host build_dir/host
|
||||
|
||||
./scripts/ext-tools.sh --refresh
|
||||
|
||||
- name: Update & Install feeds
|
||||
if: inputs.include_feeds == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
|
||||
- name: Cache ccache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: openwrt/.ccache
|
||||
key: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-${{ needs.setup_build.outputs.ccache_hash }}
|
||||
key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ needs.setup_build.outputs.ccache_hash }}
|
||||
restore-keys: |
|
||||
ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-
|
||||
ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-
|
||||
|
||||
- name: Download external toolchain/sdk
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \
|
||||
wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \
|
||||
| tar --xz -xf -
|
||||
|
||||
- name: Configure testing kernel
|
||||
@@ -289,7 +285,7 @@ jobs:
|
||||
./scripts/ext-toolchain.sh \
|
||||
--toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \
|
||||
--overwrite-config \
|
||||
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
|
||||
--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'
|
||||
@@ -331,7 +327,7 @@ jobs:
|
||||
./scripts/ext-toolchain.sh \
|
||||
--toolchain ${{ env.TOOLCHAIN_FILE }}/staging_dir/toolchain-* \
|
||||
--overwrite-config \
|
||||
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
|
||||
--config ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
|
||||
- name: Configure internal toolchain
|
||||
if: inputs.build_toolchain == true || steps.parse-toolchain.outputs.toolchain-type == 'internal'
|
||||
@@ -342,8 +338,8 @@ jobs:
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}_${{ inputs.subtarget }}=y" >> .config
|
||||
|
||||
make defconfig
|
||||
|
||||
@@ -435,5 +431,5 @@ jobs:
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs
|
||||
name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs
|
||||
path: "openwrt/logs"
|
||||
|
||||
31
.github/workflows/check-kernel-patches.yml
vendored
31
.github/workflows/check-kernel-patches.yml
vendored
@@ -6,6 +6,9 @@ on:
|
||||
target:
|
||||
required: true
|
||||
type: string
|
||||
subtarget:
|
||||
required: true
|
||||
type: string
|
||||
testing:
|
||||
type: boolean
|
||||
use_openwrt_container:
|
||||
@@ -85,17 +88,6 @@ jobs:
|
||||
run: |
|
||||
chown -R buildbot:buildbot openwrt
|
||||
|
||||
- name: Opt-out from Git stricter repository ownership checks
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
- name: Initialization environment
|
||||
run: |
|
||||
TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1)
|
||||
SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2)
|
||||
echo "TARGET=$TARGET" >> "$GITHUB_ENV"
|
||||
echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Prepare prebuilt tools
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
@@ -122,8 +114,8 @@ jobs:
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}_${{ inputs.subtarget }}=y" >> .config
|
||||
|
||||
make defconfig
|
||||
|
||||
@@ -138,18 +130,19 @@ jobs:
|
||||
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 ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok"
|
||||
success "Kernel patches for ${{ inputs.target }}/${{ inputs.subtarget }} seems ok"
|
||||
else
|
||||
err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)"
|
||||
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 ${{ env.TARGET }}-${{ env.SUBTARGET }}-refreshed
|
||||
mkdir ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed
|
||||
for f in $(git diff --name-only); do
|
||||
cp --parents $f ${{ env.TARGET }}-${{ env.SUBTARGET }}-refreshed/
|
||||
cp --parents $f ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed/
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
@@ -158,5 +151,5 @@ jobs:
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-refreshed
|
||||
path: openwrt/${{ env.TARGET }}-${{ env.SUBTARGET }}-refreshed
|
||||
name: ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed
|
||||
path: openwrt/${{ inputs.target }}-${{ inputs.subtarget }}-refreshed
|
||||
|
||||
3
.github/workflows/coverity.yml
vendored
3
.github/workflows/coverity.yml
vendored
@@ -17,7 +17,8 @@ jobs:
|
||||
packages: read
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: x86/64
|
||||
target: x86
|
||||
subtarget: 64
|
||||
build_full: true
|
||||
include_feeds: true
|
||||
coverity_compiler_template_list: >-
|
||||
|
||||
12
.github/workflows/kernel.yml
vendored
12
.github/workflows/kernel.yml
vendored
@@ -64,8 +64,9 @@ jobs:
|
||||
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"'"'"${TARGET}"'"'
|
||||
JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE"
|
||||
FIRST=0
|
||||
fi
|
||||
done
|
||||
@@ -77,8 +78,9 @@ jobs:
|
||||
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"'"'"${TARGET}"'"'
|
||||
JSON_TARGETS="$JSON_TARGETS""$TUPLE"
|
||||
FIRST=0
|
||||
fi
|
||||
done
|
||||
@@ -104,10 +106,11 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
target: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
|
||||
include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
|
||||
@@ -120,8 +123,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
target: ${{fromJson(needs.determine_targets.outputs.targets)}}
|
||||
include: ${{fromJson(needs.determine_targets.outputs.targets)}}
|
||||
uses: ./.github/workflows/check-kernel-patches.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
|
||||
|
||||
7
.github/workflows/label-kernel.yml
vendored
7
.github/workflows/label-kernel.yml
vendored
@@ -13,6 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
target: ${{ steps.set_target.outputs.target }}
|
||||
subtarget: ${{ steps.set_target.outputs.subtarget }}
|
||||
|
||||
steps:
|
||||
- name: Set target
|
||||
@@ -20,7 +21,8 @@ jobs:
|
||||
env:
|
||||
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
||||
run: |
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target="\1\/\2"/p' | tee --append $GITHUB_OUTPUT
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT
|
||||
|
||||
build_kernel:
|
||||
name: Build Kernel with external toolchain
|
||||
@@ -30,7 +32,9 @@ jobs:
|
||||
packages: read
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: ${{ needs.set_target.outputs.target }}
|
||||
subtarget: ${{ needs.set_target.outputs.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
|
||||
@@ -43,3 +47,4 @@ jobs:
|
||||
uses: ./.github/workflows/check-kernel-patches.yml
|
||||
with:
|
||||
target: ${{ needs.set_target.outputs.target }}
|
||||
subtarget: ${{ needs.set_target.outputs.subtarget }}
|
||||
|
||||
6
.github/workflows/label-target.yml
vendored
6
.github/workflows/label-target.yml
vendored
@@ -13,6 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
target: ${{ steps.set_target.outputs.target }}
|
||||
subtarget: ${{ steps.set_target.outputs.subtarget }}
|
||||
|
||||
steps:
|
||||
- name: Set target
|
||||
@@ -20,7 +21,8 @@ jobs:
|
||||
env:
|
||||
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
||||
run: |
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target="\1\/\2"/p' | tee --append $GITHUB_OUTPUT
|
||||
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
|
||||
@@ -30,7 +32,9 @@ jobs:
|
||||
packages: read
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: ${{ needs.set_target.outputs.target }}
|
||||
subtarget: ${{ needs.set_target.outputs.subtarget }}
|
||||
build_full: true
|
||||
build_all_kmods: true
|
||||
build_all_boards: true
|
||||
|
||||
7
.github/workflows/packages.yml
vendored
7
.github/workflows/packages.yml
vendored
@@ -37,11 +37,14 @@ jobs:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include:
|
||||
- target: malta/be
|
||||
- target: x86/64
|
||||
- target: malta
|
||||
subtarget: be
|
||||
- target: x86
|
||||
subtarget: 64
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
build_all_modules: true
|
||||
|
||||
1
.github/workflows/push-containers.yml
vendored
1
.github/workflows/push-containers.yml
vendored
@@ -3,6 +3,7 @@ name: Build and Push prebuilt tools container
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'include/version.mk'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/build-tools.yml'
|
||||
- '.github/workflows/push-containers.yml'
|
||||
|
||||
6
.github/workflows/toolchain.yml
vendored
6
.github/workflows/toolchain.yml
vendored
@@ -40,8 +40,9 @@ jobs:
|
||||
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"'"'"${TARGET}"'"'
|
||||
JSON="$JSON""$TUPLE"
|
||||
FIRST=0
|
||||
done
|
||||
JSON="$JSON"']'
|
||||
@@ -61,8 +62,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
target: ${{fromJson(needs.determine_targets.outputs.target)}}
|
||||
include: ${{fromJson(needs.determine_targets.outputs.target)}}
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_toolchain: true
|
||||
|
||||
2
.github/workflows/tools.yml
vendored
2
.github/workflows/tools.yml
vendored
@@ -3,11 +3,13 @@ name: Build host tools
|
||||
on:
|
||||
pull_request:
|
||||
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'
|
||||
|
||||
@@ -373,16 +373,6 @@ config KERNEL_DEBUG_INFO_BTF
|
||||
|
||||
Required to run BPF CO-RE applications.
|
||||
|
||||
config KERNEL_MODULE_ALLOW_BTF_MISMATCH
|
||||
bool "Allow loading modules with non-matching BTF type info"
|
||||
depends on KERNEL_DEBUG_INFO_BTF
|
||||
help
|
||||
For modules whose split BTF does not match vmlinux, load without
|
||||
BTF rather than refusing to load. The default behavior with
|
||||
module BTF enabled is to reject modules with such mismatches;
|
||||
this option will still load module BTF where possible but ignore
|
||||
it when a mismatch is found.
|
||||
|
||||
config KERNEL_DEBUG_INFO_REDUCED
|
||||
bool "Reduce debugging information"
|
||||
default y
|
||||
@@ -397,6 +387,17 @@ config KERNEL_DEBUG_INFO_REDUCED
|
||||
DEBUG_INFO build and compile times are reduced too.
|
||||
Only works with newer gcc versions.
|
||||
|
||||
config KERNEL_FRAME_WARN
|
||||
int
|
||||
range 0 8192
|
||||
default 1280 if KERNEL_KASAN && !ARCH_64BIT
|
||||
default 1024 if !ARCH_64BIT
|
||||
default 2048 if ARCH_64BIT
|
||||
help
|
||||
Tell the compiler to warn at build time for stack frames larger than this.
|
||||
Setting this too low will cause a lot of warnings.
|
||||
Setting it to 0 disables the warning.
|
||||
|
||||
# KERNEL_DEBUG_LL symbols must have the default value set as otherwise
|
||||
# KConfig wont evaluate them unless KERNEL_EARLY_PRINTK is selected
|
||||
# which means that buildroot wont override the DEBUG_LL symbols in target
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
src-git-full packages https://git.openwrt.org/feed/packages.git
|
||||
src-git-full luci https://git.openwrt.org/project/luci.git
|
||||
src-git-full routing https://git.openwrt.org/feed/routing.git
|
||||
src-git-full telephony https://git.openwrt.org/feed/telephony.git
|
||||
#src-git-full video https://github.com/openwrt/video.git
|
||||
#src-git-full targets https://github.com/openwrt/targets.git
|
||||
#src-git-full oldpackages http://git.openwrt.org/packages.git
|
||||
#src-link custom /usr/src/openwrt/custom-feed
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^002cea57c04dc8cc606b49d2f3d6902cfbac75d8
|
||||
src-git luci https://git.openwrt.org/project/luci.git^39e312a9b2ab44d19703df7a23287445da488784
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^593a514ab53c4590bd0efc37ab82ae90460434bb
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^129c8e0a9d68a39ad2dd550cf79dc8fc678f4a38
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.15 = .112
|
||||
LINUX_KERNEL_HASH-5.15.112 = b0e8ebdba38e0c369f64ec4dc2a69ec59ffe87a64b82f940dbdf8e752b6ad651
|
||||
LINUX_VERSION-5.15 = .114
|
||||
LINUX_KERNEL_HASH-5.15.114 = e981ea5d219f77735bf5a3f7e84a8af578df8ac3e1c4ff1b0649e2b0795277d2
|
||||
|
||||
@@ -175,8 +175,6 @@ $(eval $(call SetupHostCommand,install,Please install GNU 'install', \
|
||||
$(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
|
||||
perl --version | grep "perl.*v5"))
|
||||
|
||||
$(eval $(call CleanupPython2))
|
||||
|
||||
$(eval $(call SetupHostCommand,python,Please install Python >= 3.6, \
|
||||
python3.11 -V 2>&1 | grep 'Python 3', \
|
||||
python3.10 -V 2>&1 | grep 'Python 3', \
|
||||
|
||||
@@ -30,6 +30,8 @@ define Require
|
||||
printf "Checking '$(1)'... "
|
||||
if $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \
|
||||
echo 'ok.'; \
|
||||
elif $(NO_TRACE_MAKE) -f $(firstword $(MAKEFILE_LIST)) check-$(1) >/dev/null 2>/dev/null; then \
|
||||
echo 'updated.'; \
|
||||
else \
|
||||
echo 'failed.'; \
|
||||
echo "$(PKG_NAME): $(strip $(2))" >> $(TMP_DIR)/.prereq-error; \
|
||||
@@ -75,18 +77,6 @@ define RequireCHeader
|
||||
$$(eval $$(call Require,$(1),$(2)))
|
||||
endef
|
||||
|
||||
define CleanupPython2
|
||||
define Require/python2-cleanup
|
||||
if [ -f "$(STAGING_DIR_HOST)/bin/python" ] && \
|
||||
$(STAGING_DIR_HOST)/bin/python -V 2>&1 | \
|
||||
grep -q 'Python 2'; then \
|
||||
rm $(STAGING_DIR_HOST)/bin/python; \
|
||||
fi
|
||||
endef
|
||||
|
||||
$$(eval $$(call Require,python2-cleanup))
|
||||
endef
|
||||
|
||||
define QuoteHostCommand
|
||||
'$(subst ','"'"',$(strip $(1)))'
|
||||
endef
|
||||
@@ -107,7 +97,7 @@ endef
|
||||
# 3+: candidates
|
||||
define SetupHostCommand
|
||||
define Require/$(1)
|
||||
[ -f "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0; \
|
||||
mkdir -p "$(STAGING_DIR_HOST)/bin"; \
|
||||
for cmd in $(call QuoteHostCommand,$(3)) $(call QuoteHostCommand,$(4)) \
|
||||
$(call QuoteHostCommand,$(5)) $(call QuoteHostCommand,$(6)) \
|
||||
$(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \
|
||||
@@ -117,7 +107,11 @@ define SetupHostCommand
|
||||
bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
|
||||
command -v "$$$$$$$${cmd%% *}")"; \
|
||||
if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \
|
||||
mkdir -p "$(STAGING_DIR_HOST)/bin"; \
|
||||
case "$$$$$$$$(ls -dl -- $(STAGING_DIR_HOST)/bin/$(strip $(1)))" in \
|
||||
*" -> $$$$$$$$bin"*) \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
esac; \
|
||||
ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
|
||||
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.0-rc1)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r23069-e2701e0f33)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/snapshots)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05.0-rc1)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
|
||||
@@ -190,7 +190,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "https://downloads.openwrt.org/snapshots"
|
||||
default "https://downloads.openwrt.org/releases/23.05.0-rc1"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
@@ -266,7 +266,7 @@ if VERSIONOPT
|
||||
config VERSION_CODE_FILENAMES
|
||||
bool
|
||||
prompt "Revision code in filenames"
|
||||
default y
|
||||
default n
|
||||
help
|
||||
Enable this to include the revision identifier or the configured
|
||||
version code into the firmware image, SDK- and Image Builder archive
|
||||
|
||||
@@ -30,6 +30,7 @@ define Trusted-Firmware-A/Default
|
||||
DDR3_FLYBY:=
|
||||
DDR_TYPE:=
|
||||
NAND_TYPE:=
|
||||
BOARD_QFN:=
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7622-nor-1ddr
|
||||
@@ -92,6 +93,46 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr
|
||||
DDR3_FLYBY:=1
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-nor-ddr3
|
||||
NAME:=MediaTek MT7981 (SPI-NOR, DDR3)
|
||||
BOOT_DEVICE:=nor
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr3
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-emmc-ddr3
|
||||
NAME:=MediaTek MT7981 (eMMC, DDR3)
|
||||
BOOT_DEVICE:=emmc
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr3
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-sdmmc-ddr3
|
||||
NAME:=MediaTek MT7981 (SD card, DDR3)
|
||||
BOOT_DEVICE:=sdmmc
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr3
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7986-snand-ddr3
|
||||
NAME:=MediaTek MT7981 (SPI-NAND via SNFI, DDR3)
|
||||
BOOT_DEVICE:=snand
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr3
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-spim-nand-ddr3
|
||||
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR3)
|
||||
BOOT_DEVICE:=spim-nand
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr3
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7986-nor-ddr4
|
||||
NAME:=MediaTek MT7986 (SPI-NOR, DDR4)
|
||||
BOOT_DEVICE:=nor
|
||||
@@ -182,6 +223,11 @@ TFA_TARGETS:= \
|
||||
mt7622-emmc-2ddr \
|
||||
mt7622-sdmmc-1ddr \
|
||||
mt7622-sdmmc-2ddr \
|
||||
mt7981-emmc-ddr3 \
|
||||
mt7981-nor-ddr3 \
|
||||
mt7981-sdmmc-ddr3 \
|
||||
mt7986-snand-ddr3 \
|
||||
mt7981-spim-nand-ddr3 \
|
||||
mt7986-emmc-ddr3 \
|
||||
mt7986-nor-ddr3 \
|
||||
mt7986-sdmmc-ddr3 \
|
||||
@@ -197,6 +243,7 @@ TFA_MAKE_FLAGS += \
|
||||
BOOT_DEVICE=$(BOOT_DEVICE) \
|
||||
USE_MKIMAGE=1 MKIMAGE=$(STAGING_DIR_HOST)/bin/mkimage \
|
||||
$(if $(findstring ddr4,$(DDR_TYPE)),DRAM_USE_DDR4=1) \
|
||||
$(if $(BOARD_QFN),BOARD_QFN=1,BOARD_BGA=1) \
|
||||
$(if $(NAND_TYPE),NAND_TYPE=$(NAND_TYPE)) \
|
||||
HAVE_DRAM_OBJ_FILE=yes \
|
||||
$(if $(DDR3_FLYBY),DDR3_FLYBY=1) \
|
||||
|
||||
@@ -27,6 +27,9 @@ araknis,an-700-ap-i-ac|\
|
||||
arduino,yun|\
|
||||
buffalo,bhr-4grv2|\
|
||||
devolo,magic-2-wifi|\
|
||||
dlink,dir-859-a1|\
|
||||
dlink,dir-859-a3|\
|
||||
dlink,dir-869-a1|\
|
||||
engenius,eap1200h|\
|
||||
engenius,eap1750h|\
|
||||
engenius,eap300-v2|\
|
||||
|
||||
@@ -41,6 +41,7 @@ xiaomi,redmi-router-ax6000-stock)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
qihoo,360t7|\
|
||||
tplink,tl-xdr4288|\
|
||||
tplink,tl-xdr6086|\
|
||||
tplink,tl-xdr6088|\
|
||||
@@ -52,6 +53,10 @@ xiaomi,redmi-router-ax6000-ubootmod)
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1"
|
||||
ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1"
|
||||
;;
|
||||
zyxel,ex5601-t0)
|
||||
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0x8fffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
sd_boot=ext4load mmc 0:1 $loadaddr fitImage;bootm $loadaddr
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs),49m@0xf00000(firmware)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0x8fffffff
|
||||
initrd_high=0xffffffff
|
||||
sd_boot=ext4load mmc 0:1 ${loadaddr} fitImage;bootm ${loadaddr}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0x8fffffff
|
||||
initrd_high=0xffffffff
|
||||
sd_boot=ext4load mmc 0:1 $loadaddr fitImage;bootm $loadaddr
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
|
||||
bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs),49m@0xf00000(firmware) cma=64M@0x0-0xb0000000
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0x8fffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
sd_boot=ext4load mmc 0:1 ${loadaddr} fitImage;bootm ${loadaddr}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0x8fffffff
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0xa0000000
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0xa0000000
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
fdt_high=0xa0000000
|
||||
initrd_high=0xffffffffffffffff
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
mc_init=mmc read 80000000 5000 1800;mmc read 80300000 7000 800;fsl_mc start mc 80000000 80300000;mmc read 80400000 6800 800;fsl_mc apply dpl 80400000
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fdtaddr=0x8f000000
|
||||
loadaddr=0x81000000
|
||||
loadaddr=0x88000000
|
||||
bootm_size=0x10000000
|
||||
hwconfig=fsl_ddr:bank_intlv=auto
|
||||
mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000
|
||||
|
||||
@@ -176,6 +176,18 @@ define U-Boot/mt7629_rfb
|
||||
UBOOT_CONFIG:=mt7629_rfb
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_qihoo_360t7
|
||||
NAME:=Qihoo 360T7
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=qihoo_360t7
|
||||
UBOOT_CONFIG:=mt7981_qihoo-360t7
|
||||
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/mt7986_rfb
|
||||
NAME:=MT7986 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@@ -301,6 +313,7 @@ UBOOT_TARGETS := \
|
||||
mt7628_rfb \
|
||||
ravpower_rp-wd009 \
|
||||
mt7629_rfb \
|
||||
mt7981_qihoo_360t7 \
|
||||
mt7986_bananapi_bpi-r3-emmc \
|
||||
mt7986_bananapi_bpi-r3-sdmmc \
|
||||
mt7986_bananapi_bpi-r3-snand \
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/arch/arm/dts/mt7981.dtsi
|
||||
+++ b/arch/arm/dts/mt7981.dtsi
|
||||
@@ -32,6 +32,35 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ psci {
|
||||
+ compatible = "arm,psci-0.2";
|
||||
+ method = "smc";
|
||||
+ };
|
||||
+
|
||||
+ reserved-memory {
|
||||
+ #address-cells = <2>;
|
||||
+ #size-cells = <2>;
|
||||
+ ranges;
|
||||
+
|
||||
+ /* 64 KiB reserved for ramoops/pstore */
|
||||
+ ramoops@42ff0000 {
|
||||
+ compatible = "ramoops";
|
||||
+ reg = <0 0x42ff0000 0 0x10000>;
|
||||
+ record-size = <0x1000>;
|
||||
+ };
|
||||
+
|
||||
+ /* 192 KiB reserved for ARM Trusted Firmware (BL31) */
|
||||
+ secmon_reserved: secmon@43000000 {
|
||||
+ reg = <0 0x43000000 0 0x30000>;
|
||||
+ no-map;
|
||||
+ };
|
||||
+
|
||||
+ wmcpu_emi: wmcpu-reserved@4fc00000 {
|
||||
+ no-map;
|
||||
+ reg = <0 0x4fc00000 0 0x00100000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
gpt_clk: gpt_dummy20m {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <13000000>;
|
||||
@@ -0,0 +1,43 @@
|
||||
--- a/board/mediatek/mt7981/mt7981_rfb.c
|
||||
+++ b/board/mediatek/mt7981/mt7981_rfb.c
|
||||
@@ -6,9 +6,16 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <config.h>
|
||||
+#include <dm.h>
|
||||
+#include <button.h>
|
||||
#include <env.h>
|
||||
#include <init.h>
|
||||
#include <asm/global_data.h>
|
||||
+#include <linux/delay.h>
|
||||
+
|
||||
+#ifndef CONFIG_RESET_BUTTON_LABEL
|
||||
+#define CONFIG_RESET_BUTTON_LABEL "reset"
|
||||
+#endif
|
||||
|
||||
#include <mtd.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
@@ -24,7 +31,22 @@ int board_init(void)
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
- gd->env_valid = 1; //to load environment variable from persistent store
|
||||
+ struct udevice *dev;
|
||||
+
|
||||
+ gd->env_valid = ENV_VALID;
|
||||
+ if (!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev)) {
|
||||
+ puts("reset button found\n");
|
||||
+#ifdef CONFIG_RESET_BUTTON_SETTLE_DELAY
|
||||
+ if (CONFIG_RESET_BUTTON_SETTLE_DELAY > 0) {
|
||||
+ button_get_state(dev);
|
||||
+ mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY);
|
||||
+ }
|
||||
+#endif
|
||||
+ if (button_get_state(dev) == BUTTON_ON) {
|
||||
+ puts("button pushed, resetting environment\n");
|
||||
+ gd->env_valid = ENV_INVALID;
|
||||
+ }
|
||||
+ }
|
||||
env_relocate();
|
||||
return 0;
|
||||
}
|
||||
420
package/boot/uboot-mediatek/patches/433-add-qihoo_360t7.patch
Normal file
420
package/boot/uboot-mediatek/patches/433-add-qihoo_360t7.patch
Normal file
@@ -0,0 +1,420 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_qihoo-360t7_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_qihoo-360t7"
|
||||
+CONFIG_DEFAULT_ENV_FILE="qihoo-360t7_env"
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981_qihoo-360t7.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_qihoo-360t7.dts
|
||||
@@ -0,0 +1,180 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2022 MediaTek Inc.
|
||||
+ * Author: Sam Shih <sam.shih@mediatek.com>
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "Qihoo 360T7";
|
||||
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ factory {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wps {
|
||||
+ label = "wps";
|
||||
+ linux,code = <KEY_WPS_BUTTON>;
|
||||
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ status_red {
|
||||
+ label = "red:status";
|
||||
+ gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ status_green {
|
||||
+ label = "green:status";
|
||||
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ mediatek,force-highspeed;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart1_pins>;
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "sgmii";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <1000>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ spic_pins: spi1-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "spi";
|
||||
+ groups = "spi1_1";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ uart1_pins: spi1-pins-func-3 {
|
||||
+ mux {
|
||||
+ function = "uart";
|
||||
+ groups = "uart1_2";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pwm_pins: pwm0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "pwm";
|
||||
+ groups = "pwm0_1", "pwm1_0";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pwm {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&pwm_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ must_tx;
|
||||
+ enhance_timing;
|
||||
+ dma_ext;
|
||||
+ ipm_design;
|
||||
+ support_quad;
|
||||
+ tick_dly = <2>;
|
||||
+ sample_sel = <0>;
|
||||
+
|
||||
+ spi_nand@0 {
|
||||
+ compatible = "spi-nand";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "bl2";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "orig-env";
|
||||
+ reg = <0x100000 0x80000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@160000 {
|
||||
+ label = "factory";
|
||||
+ reg = <0x180000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "fip";
|
||||
+ reg = <0x380000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x6c00000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/qihoo-360t7_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-qihoo_360t7-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-qihoo_360t7-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-qihoo_360t7-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-qihoo_360t7-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=green:status
|
||||
+bootled_rec=red:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
|
||||
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
|
||||
+part_default=production
|
||||
+part_recovery=recovery
|
||||
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
|
||||
+mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
|
||||
+mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
|
||||
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 || run ubi_format
|
||||
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
|
||||
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
|
||||
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
|
||||
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
|
||||
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
|
||||
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize
|
||||
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize
|
||||
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
@@ -897,10 +897,12 @@ define KernelPackage/crypto-sha1/mpc85xx
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha1-ppc-spe)
|
||||
endef
|
||||
|
||||
ifndef CONFIG_TARGET_uml
|
||||
define KernelPackage/crypto-sha1/x86_64
|
||||
FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifdef KernelPackage/crypto-sha1/$(ARCH)
|
||||
KernelPackage/crypto-sha1/$(CRYPTO_TARGET)=\
|
||||
@@ -935,10 +937,12 @@ define KernelPackage/crypto-sha256/mpc85xx
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha256-ppc-spe)
|
||||
endef
|
||||
|
||||
ifndef CONFIG_TARGET_uml
|
||||
define KernelPackage/crypto-sha256/x86_64
|
||||
FILES+=$(LINUX_DIR)/arch/x86/crypto/sha256-ssse3.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha256-ssse3)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifdef KernelPackage/crypto-sha256/$(ARCH)
|
||||
KernelPackage/crypto-sha256/$(CRYPTO_TARGET)=\
|
||||
@@ -977,10 +981,12 @@ endef
|
||||
|
||||
KernelPackage/crypto-sha512/tegra=$(KernelPackage/crypto-sha512/arm)
|
||||
|
||||
ifndef CONFIG_TARGET_uml
|
||||
define KernelPackage/crypto-sha512/x86_64
|
||||
FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko
|
||||
AUTOLOAD+=$(call AutoLoad,09,sha512-ssse3)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifdef KernelPackage/crypto-sha512/$(ARCH)
|
||||
KernelPackage/crypto-sha512/$(CRYPTO_TARGET)=\
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
# Copyright (C) 2006-2023 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -1147,6 +1147,26 @@ endef
|
||||
$(eval $(call KernelPackage,nft-bridge))
|
||||
|
||||
|
||||
define KernelPackage/nft-dup-inet
|
||||
SUBMENU:=$(NF_MENU)
|
||||
TITLE:=Netfilter nf_tables dup in ip/ip6/inet familly support
|
||||
DEPENDS:=+kmod-nft-core +kmod-nf-conntrack +IPV6:kmod-nf-conntrack6
|
||||
KCONFIG:= \
|
||||
CONFIG_NF_DUP_IPV4 \
|
||||
CONFIG_NF_DUP_IPV6 \
|
||||
CONFIG_NFT_DUP_IPV4 \
|
||||
CONFIG_NFT_DUP_IPV6
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/net/ipv4/netfilter/nf_dup_ipv4.ko \
|
||||
$(LINUX_DIR)/net/ipv6/netfilter/nf_dup_ipv6.ko \
|
||||
$(LINUX_DIR)/net/ipv4/netfilter/nft_dup_ipv4.ko \
|
||||
$(LINUX_DIR)/net/ipv6/netfilter/nft_dup_ipv6.ko
|
||||
AUTOLOAD:=$(call AutoProbe,nf_dup_ipv4 nf_dup_ipv6 nft_dup_ipv4 nft_dup_ipv6)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,nft-dup-inet))
|
||||
|
||||
|
||||
define KernelPackage/nft-nat
|
||||
SUBMENU:=$(NF_MENU)
|
||||
TITLE:=Netfilter nf_tables NAT support
|
||||
|
||||
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=6.1.24
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
# PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||
PKG_HASH:=5d39aca7e34c33cb9b3e366117b2e86841b7bdd37933679d6b1e61be6b150648
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
|
||||
Date: Mon, 8 Jun 2015 16:11:40 +0200
|
||||
Subject: [PATCH] brcmfmac: register wiphy(s) during module_init
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is needed by OpenWrt which expects all PHYs to be created after
|
||||
module loads successfully.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
@@ -459,6 +459,7 @@ struct brcmf_fw {
|
||||
u32 curpos;
|
||||
unsigned int board_index;
|
||||
void (*done)(struct device *dev, int err, struct brcmf_fw_request *req);
|
||||
+ struct completion *completion;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_EFI
|
||||
@@ -686,6 +687,8 @@ static void brcmf_fw_request_done(const
|
||||
fwctx->req = NULL;
|
||||
}
|
||||
fwctx->done(fwctx->dev, ret, fwctx->req);
|
||||
+ if (fwctx->completion)
|
||||
+ complete(fwctx->completion);
|
||||
kfree(fwctx);
|
||||
}
|
||||
|
||||
@@ -751,6 +754,8 @@ int brcmf_fw_get_firmwares(struct device
|
||||
{
|
||||
struct brcmf_fw_item *first = &req->items[0];
|
||||
struct brcmf_fw *fwctx;
|
||||
+ struct completion completion;
|
||||
+ unsigned long time_left;
|
||||
char *alt_path = NULL;
|
||||
int ret;
|
||||
|
||||
@@ -768,6 +773,9 @@ int brcmf_fw_get_firmwares(struct device
|
||||
fwctx->dev = dev;
|
||||
fwctx->req = req;
|
||||
fwctx->done = fw_cb;
|
||||
+
|
||||
+ init_completion(&completion);
|
||||
+ fwctx->completion = &completion;
|
||||
|
||||
/* First try alternative board-specific path if any */
|
||||
if (fwctx->req->board_types[0])
|
||||
@@ -787,6 +795,12 @@ int brcmf_fw_get_firmwares(struct device
|
||||
if (ret < 0)
|
||||
brcmf_fw_request_done(NULL, fwctx);
|
||||
|
||||
+
|
||||
+ time_left = wait_for_completion_timeout(&completion,
|
||||
+ msecs_to_jiffies(5000));
|
||||
+ if (!time_left && fwctx)
|
||||
+ fwctx->completion = NULL;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qca-ssdk
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
@@ -37,6 +37,8 @@ else
|
||||
TOOLCHAIN_BIN_PATH=$(TOOLCHAIN_DIR)/bin
|
||||
endif
|
||||
|
||||
LNX_CONFIG_OPTS = LNX_MAKEOPTS='$(KERNEL_MAKEOPTS)' MODULE_TYPE=KSLIB modules
|
||||
|
||||
MAKE_FLAGS+= \
|
||||
TARGET_NAME=$(CONFIG_TARGET_NAME) \
|
||||
TOOL_PATH=$(TOOLCHAIN_BIN_PATH) \
|
||||
@@ -47,7 +49,7 @@ MAKE_FLAGS+= \
|
||||
TARGET_SUFFIX=$(CONFIG_TARGET_SUFFIX) \
|
||||
GCC_VERSION=$(GCC_VERSION) \
|
||||
EXTRA_CFLAGS=-fno-stack-protector -I$(STAGING_DIR)/usr/include \
|
||||
$(KERNEL_MAKE_FLAGS)
|
||||
$(LNX_CONFIG_OPTS)
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
|
||||
MAKE_FLAGS+= CHIP_TYPE=HPPE PTP_FEATURE=disable SWCONFIG_FEATURE=disable
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
From edd3d4347cc73a99c7cf59aceeb1e8ad4d4dd303 Mon Sep 17 00:00:00 2001
|
||||
From: crao <quic_crao@quicinc.com>
|
||||
Date: Tue, 15 Nov 2022 18:50:01 +0800
|
||||
Subject: [PATCH] [qca-ssdk]: Support Linux-Style Makefile for SSDK
|
||||
|
||||
Change-Id: I8c4399433b6422ef6192f70bf08b0d3023cc94b6
|
||||
Signed-off-by: crao <quic_crao@quicinc.com>
|
||||
---
|
||||
Makefile | 15 +++++++++++++
|
||||
Makefile.modules | 16 ++++++++++++++
|
||||
make/defs.mk | 1 +
|
||||
make/linux_opt.mk | 54 ++++++++++++++++++++++++++++-------------------
|
||||
make/target.mk | 12 +++++++++++
|
||||
src/api/Makefile | 2 +-
|
||||
6 files changed, 77 insertions(+), 23 deletions(-)
|
||||
mode change 100755 => 100644 Makefile
|
||||
create mode 100644 Makefile.modules
|
||||
mode change 100755 => 100644 make/defs.mk
|
||||
mode change 100755 => 100644 make/linux_opt.mk
|
||||
mode change 100755 => 100644 make/target.mk
|
||||
mode change 100755 => 100644 src/api/Makefile
|
||||
|
||||
--- 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
|
||||
@@ -0,0 +1,27 @@
|
||||
From 3026f89b06049df01d5fe19c5fccc972637aa344 Mon Sep 17 00:00:00 2001
|
||||
From: crao <quic_crao@quicinc.com>
|
||||
Date: Tue, 7 Mar 2023 17:15:07 +0800
|
||||
Subject: [PATCH] [qca-ssdk]: fix compilation issue in Linux-Style Makefile
|
||||
|
||||
Change-Id: If38251fc0a2bf4abc666d30f4812c0d9507310dc
|
||||
Signed-off-by: crao <quic_crao@quicinc.com>
|
||||
---
|
||||
Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
mode change 100644 => 100755 Makefile
|
||||
|
||||
--- 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:
|
||||
@@ -0,0 +1,23 @@
|
||||
From 6e4efd68e6e560a1994bc273fe6f7a72139f3957 Mon Sep 17 00:00:00 2001
|
||||
From: crao <quic_crao@quicinc.com>
|
||||
Date: Wed, 15 Mar 2023 11:19:39 +0800
|
||||
Subject: [PATCH] [qca-ssdk]: fix compilation issue in Miami yocto
|
||||
|
||||
Change-Id: I8526b9e43667d72ae9afa4ef8a13167088d194ba
|
||||
Signed-off-by: crao <quic_crao@quicinc.com>
|
||||
---
|
||||
Makefile | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -29,7 +29,9 @@ all: $(BIN_DIR) kslib
|
||||
modules: $(BIN_DIR) kslib_c
|
||||
mkdir -p ./temp/;cp * ./temp -a;cd ./temp;cp ../Makefile.modules ./Makefile;
|
||||
make -C $(SYS_PATH) M=$(PRJ_PATH)/temp $(LNX_MAKEOPTS) modules
|
||||
+ cp $(PRJ_PATH)/temp/Module.symvers $(PRJ_PATH)/Module.symvers;
|
||||
cp temp/*.ko build/bin;
|
||||
+ rm -Rf ./temp/*.o ./temp/*.ko ./temp/*.a
|
||||
@echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished."
|
||||
|
||||
kslib_c:
|
||||
75
package/libs/libbpf/Makefile
Normal file
75
package/libs/libbpf/Makefile
Normal file
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbpf
|
||||
PKG_VERSION:=1.2.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fbd60dbff51c870f5e80a17c4f2fd639eb80af90
|
||||
PKG_MIRROR_HASH:=80a80dfba71576e017b596fb28068e2a92de629e426f063e4b37314c8d576336
|
||||
PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
|
||||
|
||||
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
||||
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/libbpf
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libbpf - eBPF helper library
|
||||
LICENSE:=LGPL-2.1 OR BSD-2-Clause
|
||||
ABI_VERSION:=$(PKG_ABI_VERSION)
|
||||
URL:=http://www.kernel.org
|
||||
DEPENDS:=+libelf
|
||||
endef
|
||||
|
||||
define Package/libbpf/description
|
||||
libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
|
||||
endef
|
||||
|
||||
MAKE_VARS = \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
MAKE_FLAGS += \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
|
||||
LIBSUBDIR=lib
|
||||
|
||||
MAKE_PATH = src
|
||||
|
||||
define Build/InstallDev/libbpf
|
||||
$(INSTALL_DIR) $(1)/usr/include/bpf
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.{a,so*} \
|
||||
$(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbpf.pc \
|
||||
$(1)/usr/lib/pkgconfig/
|
||||
$(SED) 's,/usr/include,$$$${prefix}/include,g' \
|
||||
$(1)/usr/lib/pkgconfig/libbpf.pc
|
||||
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' \
|
||||
$(1)/usr/lib/pkgconfig/libbpf.pc
|
||||
endef
|
||||
|
||||
Build/InstallDev=$(Build/InstallDev/libbpf)
|
||||
|
||||
define Package/libbpf/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbpf))
|
||||
10
package/libs/libbpf/patches/001-cflags.patch
Normal file
10
package/libs/libbpf/patches/001-cflags.patch
Normal file
@@ -0,0 +1,10 @@
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -34,6 +34,7 @@ ALL_CFLAGS := $(INCLUDES)
|
||||
|
||||
SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED
|
||||
|
||||
+CFLAGS = $(EXTRA_CFLAGS)
|
||||
CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89
|
||||
ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS)
|
||||
ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS)
|
||||
@@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcap
|
||||
PKG_VERSION:=2.68
|
||||
PKG_VERSION:=2.69
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
|
||||
PKG_HASH:=90be3b6d41be5f81ae4b03ec76012b0d27c829293684f6c05b65d5f9cce724b2
|
||||
PKG_HASH:=f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb
|
||||
|
||||
PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
@@ -103,7 +103,7 @@ endef
|
||||
$(foreach a,$(LIBSELINUX_UTILS),$(eval $(call GenUtilPkg,libselinux-$(a),$(a))))
|
||||
|
||||
# Needed to link libselinux utilities, which link against
|
||||
# libselinux.so, which indirectly depends on libpcre.so, installed in
|
||||
# libselinux.so, which indirectly depends on libpcre2.so, installed in
|
||||
# $(STAGING_DIR_HOSTPKG).
|
||||
HOST_LDFLAGS += -Wl,-rpath="$(STAGING_DIR_HOSTPKG)/lib"
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libxml2
|
||||
PKG_VERSION:=2.11.3
|
||||
PKG_VERSION:=2.11.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION))
|
||||
PKG_HASH:=f1acae1664bda006cd81bfc238238217043d586d06659d5c0e3d1bcebe040870
|
||||
PKG_HASH:=737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
@@ -66,7 +66,8 @@ CMAKE_HOST_OPTIONS += \
|
||||
-DPCRE2_SUPPORT_JIT=OFF \
|
||||
-DPCRE2_SHOW_REPORT=OFF \
|
||||
-DPCRE2_BUILD_PCRE2GREP=OFF \
|
||||
-DPCRE2_BUILD_TESTS=OFF
|
||||
-DPCRE2_BUILD_TESTS=OFF \
|
||||
-DPCRE2_STATIC_PIC=ON
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=lldpd
|
||||
PKG_VERSION:=1.0.16
|
||||
PKG_VERSION:=1.0.17
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/
|
||||
PKG_HASH:=7753c6e31e938923185f4e10c4ab328929729e22ee4a9687d08881fb82c092ee
|
||||
PKG_HASH:=89ae691a4917ac9e0ec3b8b2c1e634cc402d43b804f98850c73bd1c7df380882
|
||||
|
||||
PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 Tony Ambardar <itugrok@yahoo.com>
|
||||
# Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,14 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bpftools
|
||||
PKG_VERSION:=7.2.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/libbpf/bpftool
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=7.1.0
|
||||
PKG_SOURCE_VERSION:=b01941c8f7890489f09713348a7d89567538504b
|
||||
PKG_MIRROR_HASH:=641fb337342e25ae784a3efe72c71d8c88600a326300d8d5834e26be21547015
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
PKG_SOURCE_VERSION:=19ff0564980a7429e730f6987a0b0bf418b3c676
|
||||
PKG_MIRROR_HASH:=f9b9871f64986dd2e5dab7060bb919398256ba93964da49c62efaf0e6bc9bbc4
|
||||
|
||||
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
||||
|
||||
@@ -63,27 +62,8 @@ define Package/bpftool-full/description
|
||||
eBPF programs and jited code.
|
||||
endef
|
||||
|
||||
define Package/libbpf
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libbpf - eBPF helper library
|
||||
VARIANT:=lib
|
||||
LICENSE:=LGPL-2.1 OR BSD-2-Clause
|
||||
ABI_VERSION:=$(PKG_ABI_VERSION)
|
||||
URL:=http://www.kernel.org
|
||||
DEPENDS:=+libelf
|
||||
endef
|
||||
|
||||
define Package/libbpf/description
|
||||
libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
|
||||
endef
|
||||
|
||||
|
||||
# LTO not compatible with DSO using PIC
|
||||
ifneq ($(BUILD_VARIANT),lib)
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -flto
|
||||
endif
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -flto
|
||||
|
||||
ifeq ($(BUILD_VARIANT),full)
|
||||
full:=1
|
||||
@@ -99,7 +79,6 @@ MAKE_FLAGS += \
|
||||
OUTPUT="$(PKG_BUILD_DIR)/" \
|
||||
prefix="/usr" \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
|
||||
LIBSUBDIR=lib \
|
||||
check_feat=0 \
|
||||
feature-clang-bpf-co-re=0 \
|
||||
feature-libbfd=$(full) \
|
||||
@@ -108,30 +87,7 @@ MAKE_FLAGS += \
|
||||
feature-disassembler-four-args=1 \
|
||||
feature-disassembler-init-styled=1
|
||||
|
||||
ifeq ($(BUILD_VARIANT),lib)
|
||||
MAKE_PATH = libbpf/src
|
||||
else
|
||||
MAKE_PATH = src
|
||||
endif
|
||||
|
||||
define Build/InstallDev/libbpf
|
||||
$(INSTALL_DIR) $(1)/usr/include/bpf
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.{a,so*} \
|
||||
$(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbpf.pc \
|
||||
$(1)/usr/lib/pkgconfig/
|
||||
$(SED) 's,/usr/include,$$$${prefix}/include,g' \
|
||||
$(1)/usr/lib/pkgconfig/libbpf.pc
|
||||
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' \
|
||||
$(1)/usr/lib/pkgconfig/libbpf.pc
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),lib)
|
||||
Build/InstallDev=$(Build/InstallDev/libbpf)
|
||||
endif
|
||||
MAKE_PATH = src
|
||||
|
||||
define Package/bpftool-$(BUILD_VARIANT)/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
@@ -139,11 +95,5 @@ define Package/bpftool-$(BUILD_VARIANT)/install
|
||||
$(1)/usr/libexec/bpftool-$(BUILD_VARIANT)
|
||||
endef
|
||||
|
||||
define Package/libbpf/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbpf))
|
||||
$(eval $(call BuildPackage,bpftool-full))
|
||||
$(eval $(call BuildPackage,bpftool-minimal))
|
||||
@@ -7,17 +7,20 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ca-certificates
|
||||
PKG_VERSION:=20211016
|
||||
PKG_VERSION:=20230311
|
||||
PKG_RELEASE:=1
|
||||
PKG_MAINTAINER:=
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@DEBIAN/pool/main/c/ca-certificates
|
||||
PKG_HASH:=2ae9b6dc5f40c25d6d7fe55e07b54f12a8967d1955d3b7b2f42ee46266eeef88
|
||||
PKG_HASH:=83de934afa186e279d1ed08ea0d73f5cf43a6fbfb5f00874b6db3711c64576f3
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
TAR_OPTIONS+= --strip-components 1
|
||||
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||
|
||||
define Package/ca-certificates
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
@@ -34,13 +37,6 @@ define Package/ca-bundle
|
||||
PROVIDES:=ca-certs
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(DECOMPRESS_CMD) $(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
|
||||
$(Build/Patch)
|
||||
endef
|
||||
|
||||
MAKE_PATH := work
|
||||
|
||||
define Build/Install
|
||||
mkdir -p \
|
||||
$(PKG_INSTALL_DIR)/usr/sbin \
|
||||
|
||||
@@ -18,8 +18,8 @@ Reported-by: Chen Minqiang <ptpt52@gmail.com>
|
||||
Reported-by: Shane Synan <digitalcircuit36939@gmail.com>
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
---
|
||||
--- a/work/mozilla/certdata2pem.py
|
||||
+++ b/work/mozilla/certdata2pem.py
|
||||
--- a/mozilla/certdata2pem.py
|
||||
+++ b/mozilla/certdata2pem.py
|
||||
@@ -21,16 +21,12 @@
|
||||
# USA.
|
||||
|
||||
@@ -42,8 +42,8 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
if not obj['CKA_LABEL'] in trust or not trust[obj['CKA_LABEL']]:
|
||||
continue
|
||||
-
|
||||
- cert = x509.load_der_x509_certificate(obj['CKA_VALUE'])
|
||||
- if cert.not_valid_after < datetime.datetime.now():
|
||||
- cert = x509.load_der_x509_certificate(bytes(obj['CKA_VALUE']))
|
||||
- if cert.not_valid_after < datetime.datetime.utcnow():
|
||||
- print('!'*74)
|
||||
- print('Trusted but expired certificate found: %s' % obj['CKA_LABEL'])
|
||||
- print('!'*74)
|
||||
|
||||
@@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=selinux-policy
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_MIRROR_HASH:=ff1ddca168a6631aeac34352657f424bc4acf5d50b8aa7ff8dfa8c9663ba8538
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_MIRROR_HASH:=81ac6e31d2f1febddbe594f3578a9c40444fc0e349075ab6abd3d3ee014a988e
|
||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=busybox
|
||||
PKG_VERSION:=1.36.0
|
||||
PKG_VERSION:=1.36.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_FLAGS:=essential
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://www.busybox.net/downloads \
|
||||
http://sources.buildroot.net
|
||||
PKG_HASH:=542750c8af7cb2630e201780b4f99f3dcceeb06f505b479ec68241c1e6af61a5
|
||||
PKG_HASH:=b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314
|
||||
|
||||
PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
obj-$(CONFIG_SPI_FSL_CPM) += spi-fsl-cpm.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/spi/spi-en7523.c
|
||||
@@ -0,0 +1,311 @@
|
||||
@@ -0,0 +1,313 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
@@ -166,6 +166,7 @@
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#if 0
|
||||
+static void set_spi_clock_speed(int freq_mhz)
|
||||
+{
|
||||
+ u32 tmp, val;
|
||||
@@ -178,6 +179,7 @@
|
||||
+ tmp |= (val << 8) | 1;
|
||||
+ writel(tmp, ENSPI_CLOCK_DIVIDER);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static void init_hw(void)
|
||||
+{
|
||||
|
||||
@@ -23,7 +23,6 @@ CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca9563_dlink_dir-8x9-a1.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
/ {
|
||||
model = "D-Link DIR-859 A1";
|
||||
|
||||
64
target/linux/ath79/dts/qca9563_dlink_dir-859-a3.dts
Normal file
64
target/linux/ath79/dts/qca9563_dlink_dir-859-a3.dts
Normal file
@@ -0,0 +1,64 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca9563_dlink_dir-8x9-a1.dtsi"
|
||||
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
compatible = "dlink,dir-859-a3", "qca,qca9563";
|
||||
model = "D-Link DIR-859 A3";
|
||||
|
||||
aliases {
|
||||
label-mac-device = &wmac;
|
||||
led-boot = &led_power;
|
||||
led-failsafe = &led_power;
|
||||
led-running = &led_power;
|
||||
led-upgrade = &led_power;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_power: power {
|
||||
label = "green:power";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_POWER;
|
||||
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wan {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wlan {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
wps {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WPS;
|
||||
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ath10k {
|
||||
nvmem-cells = <&calibration_ath10k>, <&macaddr_bdcfg_ethaddr 2>;
|
||||
nvmem-cell-names = "calibration", "mac-address";
|
||||
};
|
||||
|
||||
&bdcfg {
|
||||
macaddr_bdcfg_ethaddr: ethaddr {
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&wmac {
|
||||
nvmem-cells = <&calibration_ath9k>, <&macaddr_bdcfg_ethaddr 0>;
|
||||
nvmem-cell-names = "calibration", "mac-address";
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "qca9563_dlink_dir-8x9-a1.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
/ {
|
||||
model = "D-Link DIR-869 A1";
|
||||
@@ -28,4 +27,3 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -6,17 +6,18 @@
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
debounce-interval = <60>;
|
||||
@@ -27,7 +28,7 @@
|
||||
&pcie {
|
||||
status = "okay";
|
||||
|
||||
wifi@0,0 {
|
||||
ath10k: wifi@0,0 {
|
||||
compatible = "qcom,ath10k";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
|
||||
@@ -42,7 +43,7 @@
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
@@ -51,19 +52,19 @@
|
||||
|
||||
partition@0 {
|
||||
label = "bootloader";
|
||||
reg = <0x000000 0x40000>;
|
||||
reg = <0x000000 0x040000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
bdcfg: partition@40000 {
|
||||
compatible = "u-boot,env";
|
||||
label = "bdcfg";
|
||||
reg = <0x040000 0x10000>;
|
||||
read-only;
|
||||
reg = <0x040000 0x010000>;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
label = "devdata";
|
||||
reg = <0x050000 0x10000>;
|
||||
reg = <0x050000 0x010000>;
|
||||
read-only;
|
||||
|
||||
compatible = "nvmem-cells";
|
||||
@@ -81,7 +82,7 @@
|
||||
|
||||
partition@60000 {
|
||||
label = "devconf";
|
||||
reg = <0x060000 0x10000>;
|
||||
reg = <0x060000 0x010000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
|
||||
@@ -234,6 +234,9 @@ dlink,dap-1365-a1)
|
||||
dlink,dir-859-a1)
|
||||
ucidef_set_led_switch "internet" "WAN" "green:internet" "switch0" "0x20"
|
||||
;;
|
||||
dlink,dir-859-a3)
|
||||
ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x20"
|
||||
;;
|
||||
engenius,ens202ext-v1|\
|
||||
engenius,enstationac-v1)
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
|
||||
@@ -291,6 +291,7 @@ ath79_setup_interfaces()
|
||||
dlink,dir-842-c2|\
|
||||
dlink,dir-842-c3|\
|
||||
dlink,dir-859-a1|\
|
||||
dlink,dir-859-a3|\
|
||||
dlink,dir-869-a1|\
|
||||
engenius,epg5000|\
|
||||
engenius,esr1200|\
|
||||
@@ -661,6 +662,10 @@ ath79_setup_macs()
|
||||
lan_mac=$(mtd_get_mac_text "devdata" 0xc9)
|
||||
wan_mac=$(mtd_get_mac_text "devdata" 0x79)
|
||||
;;
|
||||
dlink,dir-859-a3)
|
||||
lan_mac=$(get_mac_label)
|
||||
wan_mac=$(macaddr_add "$lan_mac" 3)
|
||||
;;
|
||||
qihoo,c301|\
|
||||
wd,mynet-n600|\
|
||||
wd,mynet-n750)
|
||||
|
||||
@@ -22,6 +22,8 @@ dlink,dap-3662-a1)
|
||||
fixwrgg
|
||||
;;
|
||||
dlink,dir-629-a1|\
|
||||
dlink,dir-859-a1|\
|
||||
dlink,dir-859-a3|\
|
||||
dlink,dir-869-a1|\
|
||||
qihoo,c301)
|
||||
fix_seama_header
|
||||
|
||||
@@ -15,6 +15,8 @@ CONFIG_MARVELL_PHY=y
|
||||
CONFIG_MICREL_PHY=y
|
||||
CONFIG_MTD_REDBOOT_PARTS=y
|
||||
CONFIG_MTD_SPLIT_EVA_FW=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_NVMEM_U_BOOT_ENV=y
|
||||
CONFIG_PHY_AR7100_USB=y
|
||||
CONFIG_PHY_AR7200_USB=y
|
||||
CONFIG_REALTEK_PHY=y
|
||||
|
||||
@@ -1143,18 +1143,28 @@ define Device/dlink_dir-842-c3
|
||||
endef
|
||||
TARGET_DEVICES += dlink_dir-842-c3
|
||||
|
||||
define Device/dlink_dir-859-a1
|
||||
define Device/dlink_dir-859-ax
|
||||
$(Device/seama)
|
||||
SOC := qca9563
|
||||
DEVICE_VENDOR := D-Link
|
||||
DEVICE_MODEL := DIR-859
|
||||
DEVICE_VARIANT := A1
|
||||
IMAGE_SIZE := 15872k
|
||||
DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
|
||||
SEAMA_SIGNATURE := wrgac37_dlink.2013gui_dir859
|
||||
endef
|
||||
|
||||
define Device/dlink_dir-859-a1
|
||||
$(Device/dlink_dir-859-ax)
|
||||
DEVICE_VARIANT := A1
|
||||
endef
|
||||
TARGET_DEVICES += dlink_dir-859-a1
|
||||
|
||||
define Device/dlink_dir-859-a3
|
||||
$(Device/dlink_dir-859-ax)
|
||||
DEVICE_VARIANT := A3
|
||||
endef
|
||||
TARGET_DEVICES += dlink_dir-859-a3
|
||||
|
||||
define Device/dlink_dir-869-a1
|
||||
$(Device/seama)
|
||||
SOC := qca9563
|
||||
|
||||
@@ -27,7 +27,6 @@ CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
|
||||
@@ -27,7 +27,6 @@ CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
|
||||
@@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
/* Disable rate control for now */
|
||||
bcmgenet_tdma_ring_writel(priv, index, flow_period_val,
|
||||
TDMA_FLOW_PERIOD);
|
||||
@@ -4083,9 +4083,12 @@ static int bcmgenet_probe(struct platfor
|
||||
@@ -4084,9 +4084,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 */
|
||||
|
||||
@@ -70,7 +70,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
* @dev: the device whose endpoint is being disabled
|
||||
--- a/include/linux/usb.h
|
||||
+++ b/include/linux/usb.h
|
||||
@@ -1845,6 +1845,8 @@ extern int usb_clear_halt(struct usb_dev
|
||||
@@ -1850,6 +1850,8 @@ extern int usb_clear_halt(struct usb_dev
|
||||
extern int usb_reset_configuration(struct usb_device *dev);
|
||||
extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate);
|
||||
extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr);
|
||||
|
||||
@@ -25,7 +25,7 @@ Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
|
||||
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -17538,6 +17538,14 @@ T: git git://linuxtv.org/media_tree.git
|
||||
@@ -17541,6 +17541,14 @@ T: git git://linuxtv.org/media_tree.git
|
||||
F: Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
|
||||
F: drivers/media/i2c/imx412.c
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
/* Reinitialize TDMA and RDMA and SW housekeeping */
|
||||
ret = bcmgenet_init_dma(priv);
|
||||
@@ -4212,7 +4220,7 @@ static int bcmgenet_resume(struct device
|
||||
@@ -4213,7 +4221,7 @@ static int bcmgenet_resume(struct device
|
||||
bcmgenet_hfb_create_rxnfc_filter(priv, rule);
|
||||
|
||||
/* Disable RX/TX DMA and flush TX queues */
|
||||
|
||||
@@ -132,7 +132,7 @@ Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
|
||||
+...
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -17552,6 +17552,7 @@ M: Raspberry Pi Kernel Maintenance <kern
|
||||
@@ -17555,6 +17555,7 @@ M: Raspberry Pi Kernel Maintenance <kern
|
||||
L: linux-media@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://linuxtv.org/media_tree.git
|
||||
|
||||
@@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci-ring.c
|
||||
+++ b/drivers/usb/host/xhci-ring.c
|
||||
@@ -677,9 +677,9 @@ deq_found:
|
||||
@@ -697,9 +697,9 @@ deq_found:
|
||||
}
|
||||
|
||||
if ((ep->ep_state & SET_DEQ_PENDING)) {
|
||||
|
||||
@@ -132,7 +132,7 @@ Signed-off-by: Lee Jackson <info@arducam.com>
|
||||
+...
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -17556,6 +17556,14 @@ F: Documentation/devicetree/bindings/med
|
||||
@@ -17559,6 +17559,14 @@ F: Documentation/devicetree/bindings/med
|
||||
F: Documentation/devicetree/bindings/media/i2c/imx477.yaml
|
||||
F: drivers/media/i2c/imx477.c
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci-pci.c
|
||||
+++ b/drivers/usb/host/xhci-pci.c
|
||||
@@ -296,6 +296,7 @@ static void xhci_pci_quirks(struct devic
|
||||
@@ -297,6 +297,7 @@ static void xhci_pci_quirks(struct devic
|
||||
if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) {
|
||||
xhci->quirks |= XHCI_LPM_SUPPORT;
|
||||
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
|
||||
@@ -32,7 +32,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
|
||||
--- a/drivers/usb/host/xhci-ring.c
|
||||
+++ b/drivers/usb/host/xhci-ring.c
|
||||
@@ -667,6 +667,15 @@ static int xhci_move_dequeue_past_td(str
|
||||
@@ -687,6 +687,15 @@ static int xhci_move_dequeue_past_td(str
|
||||
} while (!cycle_found || !td_last_trb_found);
|
||||
|
||||
deq_found:
|
||||
|
||||
@@ -14,7 +14,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci-ring.c
|
||||
+++ b/drivers/usb/host/xhci-ring.c
|
||||
@@ -289,6 +289,12 @@ static inline int room_on_ring(struct xh
|
||||
@@ -309,6 +309,12 @@ static inline int room_on_ring(struct xh
|
||||
return 0;
|
||||
|
||||
if (ring->type != TYPE_COMMAND && ring->type != TYPE_EVENT) {
|
||||
|
||||
@@ -205,7 +205,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
xhci_err(xhci, "Tried to move enqueue past ring segment\n");
|
||||
return;
|
||||
}
|
||||
@@ -3162,7 +3165,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd
|
||||
@@ -3189,7 +3192,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd
|
||||
* that clears the EHB.
|
||||
*/
|
||||
while (xhci_handle_event(xhci) > 0) {
|
||||
@@ -214,7 +214,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
continue;
|
||||
xhci_update_erst_dequeue(xhci, event_ring_deq);
|
||||
event_ring_deq = xhci->event_ring->dequeue;
|
||||
@@ -3304,7 +3307,8 @@ static int prepare_ring(struct xhci_hcd
|
||||
@@ -3331,7 +3334,8 @@ static int prepare_ring(struct xhci_hcd
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
cycle_state, type, max_packet, flags);
|
||||
--- a/drivers/usb/host/xhci-pci.c
|
||||
+++ b/drivers/usb/host/xhci-pci.c
|
||||
@@ -297,6 +297,7 @@ static void xhci_pci_quirks(struct devic
|
||||
@@ -298,6 +298,7 @@ static void xhci_pci_quirks(struct devic
|
||||
xhci->quirks |= XHCI_LPM_SUPPORT;
|
||||
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
|
||||
xhci->quirks |= XHCI_AVOID_DQ_ON_LINK;
|
||||
|
||||
@@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci-pci.c
|
||||
+++ b/drivers/usb/host/xhci-pci.c
|
||||
@@ -298,6 +298,7 @@ static void xhci_pci_quirks(struct devic
|
||||
@@ -299,6 +299,7 @@ static void xhci_pci_quirks(struct devic
|
||||
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
|
||||
xhci->quirks |= XHCI_AVOID_DQ_ON_LINK;
|
||||
xhci->quirks |= XHCI_VLI_TRB_CACHE_BUG;
|
||||
@@ -36,7 +36,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
|
||||
--- a/drivers/usb/host/xhci-ring.c
|
||||
+++ b/drivers/usb/host/xhci-ring.c
|
||||
@@ -3617,14 +3617,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
@@ -3644,14 +3644,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
unsigned int num_trbs;
|
||||
unsigned int start_cycle, num_sgs = 0;
|
||||
unsigned int enqd_len, block_len, trb_buff_len, full_len;
|
||||
@@ -54,7 +54,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
full_len = urb->transfer_buffer_length;
|
||||
/* If we have scatter/gather list, we use it. */
|
||||
if (urb->num_sgs && !(urb->transfer_flags & URB_DMA_MAP_SINGLE)) {
|
||||
@@ -3661,6 +3662,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
@@ -3688,6 +3689,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
start_cycle = ring->cycle_state;
|
||||
send_addr = addr;
|
||||
|
||||
@@ -72,7 +72,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
/* Queue the TRBs, even if they are zero-length */
|
||||
for (enqd_len = 0; first_trb || enqd_len < full_len;
|
||||
enqd_len += trb_buff_len) {
|
||||
@@ -3673,6 +3685,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
@@ -3700,6 +3712,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
if (enqd_len + trb_buff_len > full_len)
|
||||
trb_buff_len = full_len - enqd_len;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
|
||||
--- a/drivers/usb/host/xhci-ring.c
|
||||
+++ b/drivers/usb/host/xhci-ring.c
|
||||
@@ -3617,7 +3617,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
@@ -3644,7 +3644,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
unsigned int num_trbs;
|
||||
unsigned int start_cycle, num_sgs = 0;
|
||||
unsigned int enqd_len, block_len, trb_buff_len, full_len;
|
||||
@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
u32 field, length_field, remainder, maxpacket;
|
||||
u64 addr, send_addr;
|
||||
|
||||
@@ -3663,14 +3663,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
@@ -3690,14 +3690,9 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
send_addr = addr;
|
||||
|
||||
if (xhci->quirks & XHCI_VLI_SS_BULK_OUT_BUG &&
|
||||
@@ -40,7 +40,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
}
|
||||
|
||||
/* Queue the TRBs, even if they are zero-length */
|
||||
@@ -3685,7 +3680,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
@@ -3712,7 +3707,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
|
||||
if (enqd_len + trb_buff_len > full_len)
|
||||
trb_buff_len = full_len - enqd_len;
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From b6f56cddb5f57a0b8da0ce582232a2f1933558c6 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:17:19 +0100
|
||||
Subject: [PATCH 04/16] net: dsa: mt7530: make some noise if register read
|
||||
fails
|
||||
|
||||
Simply returning the negative error value instead of the read value
|
||||
doesn't seem like a good idea. Return 0 instead and add WARN_ON_ONCE(1)
|
||||
so this kind of error will not go unnoticed.
|
||||
|
||||
Suggested-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -224,9 +224,10 @@ mt7530_mii_read(struct mt7530_priv *priv
|
||||
/* MT7530 uses 31 as the pseudo port */
|
||||
ret = bus->write(bus, 0x1f, 0x1f, page);
|
||||
if (ret < 0) {
|
||||
+ WARN_ON_ONCE(1);
|
||||
dev_err(&bus->dev,
|
||||
"failed to read mt7530 register\n");
|
||||
- return ret;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
lo = bus->read(bus, 0x1f, r);
|
||||
@@ -0,0 +1,111 @@
|
||||
From 9ecc00164dc2300dfcd40afe549a8ee951dfea9f Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:17:30 +0100
|
||||
Subject: [PATCH 05/16] net: dsa: mt7530: refactor SGMII PCS creation
|
||||
|
||||
Instead of macro templates use a dedidated function and allocated
|
||||
regmap_config when creating the regmaps for the pcs-mtk-lynxi
|
||||
instances.
|
||||
This is in preparation to switching to use unlocked regmap accessors
|
||||
and have regmap's locking API handle locking for us.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 74 +++++++++++++++++++++++++++-------------
|
||||
1 file changed, 50 insertions(+), 24 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -2926,26 +2926,56 @@ static const struct regmap_bus mt7531_re
|
||||
.reg_update_bits = mt7530_regmap_update_bits,
|
||||
};
|
||||
|
||||
-#define MT7531_PCS_REGMAP_CONFIG(_name, _reg_base) \
|
||||
- { \
|
||||
- .name = _name, \
|
||||
- .reg_bits = 16, \
|
||||
- .val_bits = 32, \
|
||||
- .reg_stride = 4, \
|
||||
- .reg_base = _reg_base, \
|
||||
- .max_register = 0x17c, \
|
||||
+static int
|
||||
+mt7531_create_sgmii(struct mt7530_priv *priv)
|
||||
+{
|
||||
+ struct regmap_config *mt7531_pcs_config[2];
|
||||
+ struct phylink_pcs *pcs;
|
||||
+ struct regmap *regmap;
|
||||
+ int i, ret = 0;
|
||||
+
|
||||
+ for (i = 0; i < 2; i++) {
|
||||
+ mt7531_pcs_config[i] = devm_kzalloc(priv->dev,
|
||||
+ sizeof(struct regmap_config),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!mt7531_pcs_config[i]) {
|
||||
+ ret = -ENOMEM;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ mt7531_pcs_config[i]->name = i ? "port6" : "port5";
|
||||
+ mt7531_pcs_config[i]->reg_bits = 16;
|
||||
+ mt7531_pcs_config[i]->val_bits = 32;
|
||||
+ 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;
|
||||
+
|
||||
+ regmap = devm_regmap_init(priv->dev,
|
||||
+ &mt7531_regmap_bus, priv,
|
||||
+ mt7531_pcs_config[i]);
|
||||
+ if (IS_ERR(regmap)) {
|
||||
+ ret = PTR_ERR(regmap);
|
||||
+ break;
|
||||
+ }
|
||||
+ pcs = mtk_pcs_lynxi_create(priv->dev, regmap,
|
||||
+ MT7531_PHYA_CTRL_SIGNAL3, 0);
|
||||
+ if (!pcs) {
|
||||
+ ret = -ENXIO;
|
||||
+ break;
|
||||
+ }
|
||||
+ priv->ports[5 + i].sgmii_pcs = pcs;
|
||||
}
|
||||
|
||||
-static const struct regmap_config mt7531_pcs_config[] = {
|
||||
- MT7531_PCS_REGMAP_CONFIG("port5", MT7531_SGMII_REG_BASE(5)),
|
||||
- MT7531_PCS_REGMAP_CONFIG("port6", MT7531_SGMII_REG_BASE(6)),
|
||||
-};
|
||||
+ if (ret && i)
|
||||
+ mtk_pcs_lynxi_destroy(priv->ports[5].sgmii_pcs);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
|
||||
static int
|
||||
mt753x_setup(struct dsa_switch *ds)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
- struct regmap *regmap;
|
||||
int i, ret;
|
||||
|
||||
/* Initialise the PCS devices */
|
||||
@@ -2967,15 +2997,11 @@ mt753x_setup(struct dsa_switch *ds)
|
||||
if (ret && priv->irq)
|
||||
mt7530_free_irq_common(priv);
|
||||
|
||||
- if (priv->id == ID_MT7531)
|
||||
- for (i = 0; i < 2; i++) {
|
||||
- regmap = devm_regmap_init(ds->dev,
|
||||
- &mt7531_regmap_bus, priv,
|
||||
- &mt7531_pcs_config[i]);
|
||||
- priv->ports[5 + i].sgmii_pcs =
|
||||
- mtk_pcs_lynxi_create(ds->dev, regmap,
|
||||
- MT7531_PHYA_CTRL_SIGNAL3, 0);
|
||||
- }
|
||||
+ if (priv->id == ID_MT7531) {
|
||||
+ ret = mt7531_create_sgmii(priv);
|
||||
+ if (ret && priv->irq)
|
||||
+ mt7530_free_irq_common(priv);
|
||||
+ }
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
From 1bd099c49f65ed923b9f19b8c4b3cd1ff0024091 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:17:40 +0100
|
||||
Subject: [PATCH 06/16] net: dsa: mt7530: use unlocked regmap accessors
|
||||
|
||||
Instead of wrapping the locked register accessor functions, use the
|
||||
unlocked variants and add locking wrapper functions to let regmap
|
||||
handle the locking.
|
||||
|
||||
This is a preparation towards being able to always use regmap to
|
||||
access switch registers instead of open-coded accessor functions.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 23 ++++++++++++++---------
|
||||
1 file changed, 14 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -2899,7 +2899,7 @@ static int mt7530_regmap_read(void *cont
|
||||
{
|
||||
struct mt7530_priv *priv = context;
|
||||
|
||||
- *val = mt7530_read(priv, reg);
|
||||
+ *val = mt7530_mii_read(priv, reg);
|
||||
return 0;
|
||||
};
|
||||
|
||||
@@ -2907,23 +2907,25 @@ static int mt7530_regmap_write(void *con
|
||||
{
|
||||
struct mt7530_priv *priv = context;
|
||||
|
||||
- mt7530_write(priv, reg, val);
|
||||
+ mt7530_mii_write(priv, reg, val);
|
||||
return 0;
|
||||
};
|
||||
|
||||
-static int mt7530_regmap_update_bits(void *context, unsigned int reg,
|
||||
- unsigned int mask, unsigned int val)
|
||||
+static void
|
||||
+mt7530_mdio_regmap_lock(void *mdio_lock)
|
||||
{
|
||||
- struct mt7530_priv *priv = context;
|
||||
+ mutex_lock_nested(mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+}
|
||||
|
||||
- mt7530_rmw(priv, reg, mask, val);
|
||||
- return 0;
|
||||
-};
|
||||
+static void
|
||||
+mt7530_mdio_regmap_unlock(void *mdio_lock)
|
||||
+{
|
||||
+ mutex_unlock(mdio_lock);
|
||||
+}
|
||||
|
||||
static const struct regmap_bus mt7531_regmap_bus = {
|
||||
.reg_write = mt7530_regmap_write,
|
||||
.reg_read = mt7530_regmap_read,
|
||||
- .reg_update_bits = mt7530_regmap_update_bits,
|
||||
};
|
||||
|
||||
static int
|
||||
@@ -2949,6 +2951,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;
|
||||
+ mt7531_pcs_config[i]->lock = mt7530_mdio_regmap_lock;
|
||||
+ mt7531_pcs_config[i]->unlock = mt7530_mdio_regmap_unlock;
|
||||
+ mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
|
||||
|
||||
regmap = devm_regmap_init(priv->dev,
|
||||
&mt7531_regmap_bus, priv,
|
||||
@@ -0,0 +1,224 @@
|
||||
From a08c045580e060a6886bbb656c50ae20b0c780b5 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:17:52 +0100
|
||||
Subject: [PATCH 07/16] net: dsa: mt7530: use regmap to access switch register
|
||||
space
|
||||
|
||||
Use regmap API to access the switch register space.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 99 ++++++++++++++++++++++++----------------
|
||||
drivers/net/dsa/mt7530.h | 2 +
|
||||
2 files changed, 62 insertions(+), 39 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -183,9 +183,9 @@ core_clear(struct mt7530_priv *priv, u32
|
||||
}
|
||||
|
||||
static int
|
||||
-mt7530_mii_write(struct mt7530_priv *priv, u32 reg, u32 val)
|
||||
+mt7530_regmap_write(void *context, unsigned int reg, unsigned int val)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
+ struct mii_bus *bus = context;
|
||||
u16 page, r, lo, hi;
|
||||
int ret;
|
||||
|
||||
@@ -197,24 +197,34 @@ mt7530_mii_write(struct mt7530_priv *pri
|
||||
/* MT7530 uses 31 as the pseudo port */
|
||||
ret = bus->write(bus, 0x1f, 0x1f, page);
|
||||
if (ret < 0)
|
||||
- goto err;
|
||||
+ return ret;
|
||||
|
||||
ret = bus->write(bus, 0x1f, r, lo);
|
||||
if (ret < 0)
|
||||
- goto err;
|
||||
+ return ret;
|
||||
|
||||
ret = bus->write(bus, 0x1f, 0x10, hi);
|
||||
-err:
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mt7530_mii_write(struct mt7530_priv *priv, u32 reg, u32 val)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = regmap_write(priv->regmap, reg, val);
|
||||
+
|
||||
if (ret < 0)
|
||||
- dev_err(&bus->dev,
|
||||
+ dev_err(priv->dev,
|
||||
"failed to write mt7530 register\n");
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static u32
|
||||
-mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
|
||||
+static int
|
||||
+mt7530_regmap_read(void *context, unsigned int reg, unsigned int *val)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
+ struct mii_bus *bus = context;
|
||||
u16 page, r, lo, hi;
|
||||
int ret;
|
||||
|
||||
@@ -223,17 +233,32 @@ mt7530_mii_read(struct mt7530_priv *priv
|
||||
|
||||
/* MT7530 uses 31 as the pseudo port */
|
||||
ret = bus->write(bus, 0x1f, 0x1f, page);
|
||||
- if (ret < 0) {
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ lo = bus->read(bus, 0x1f, r);
|
||||
+ hi = bus->read(bus, 0x1f, 0x10);
|
||||
+
|
||||
+ *val = (hi << 16) | (lo & 0xffff);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static u32
|
||||
+mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
|
||||
+{
|
||||
+ int ret;
|
||||
+ u32 val;
|
||||
+
|
||||
+ ret = regmap_read(priv->regmap, reg, &val);
|
||||
+ if (ret) {
|
||||
WARN_ON_ONCE(1);
|
||||
- dev_err(&bus->dev,
|
||||
+ dev_err(priv->dev,
|
||||
"failed to read mt7530 register\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
- lo = bus->read(bus, 0x1f, r);
|
||||
- hi = bus->read(bus, 0x1f, 0x10);
|
||||
-
|
||||
- return (hi << 16) | (lo & 0xffff);
|
||||
+ return val;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -283,14 +308,10 @@ mt7530_rmw(struct mt7530_priv *priv, u32
|
||||
u32 mask, u32 set)
|
||||
{
|
||||
struct mii_bus *bus = priv->bus;
|
||||
- u32 val;
|
||||
|
||||
mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
|
||||
- val = mt7530_mii_read(priv, reg);
|
||||
- val &= ~mask;
|
||||
- val |= set;
|
||||
- mt7530_mii_write(priv, reg, val);
|
||||
+ regmap_update_bits(priv->regmap, reg, mask, set);
|
||||
|
||||
mutex_unlock(&bus->mdio_lock);
|
||||
}
|
||||
@@ -298,7 +319,7 @@ mt7530_rmw(struct mt7530_priv *priv, u32
|
||||
static void
|
||||
mt7530_set(struct mt7530_priv *priv, u32 reg, u32 val)
|
||||
{
|
||||
- mt7530_rmw(priv, reg, 0, val);
|
||||
+ mt7530_rmw(priv, reg, val, val);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2895,22 +2916,6 @@ static const struct phylink_pcs_ops mt75
|
||||
.pcs_an_restart = mt7530_pcs_an_restart,
|
||||
};
|
||||
|
||||
-static int mt7530_regmap_read(void *context, unsigned int reg, unsigned int *val)
|
||||
-{
|
||||
- struct mt7530_priv *priv = context;
|
||||
-
|
||||
- *val = mt7530_mii_read(priv, reg);
|
||||
- return 0;
|
||||
-};
|
||||
-
|
||||
-static int mt7530_regmap_write(void *context, unsigned int reg, unsigned int val)
|
||||
-{
|
||||
- struct mt7530_priv *priv = context;
|
||||
-
|
||||
- mt7530_mii_write(priv, reg, val);
|
||||
- return 0;
|
||||
-};
|
||||
-
|
||||
static void
|
||||
mt7530_mdio_regmap_lock(void *mdio_lock)
|
||||
{
|
||||
@@ -2923,7 +2928,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc
|
||||
mutex_unlock(mdio_lock);
|
||||
}
|
||||
|
||||
-static const struct regmap_bus mt7531_regmap_bus = {
|
||||
+static const struct regmap_bus mt7530_regmap_bus = {
|
||||
.reg_write = mt7530_regmap_write,
|
||||
.reg_read = mt7530_regmap_read,
|
||||
};
|
||||
@@ -2956,7 +2961,7 @@ mt7531_create_sgmii(struct mt7530_priv *
|
||||
mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
|
||||
|
||||
regmap = devm_regmap_init(priv->dev,
|
||||
- &mt7531_regmap_bus, priv,
|
||||
+ &mt7530_regmap_bus, priv->bus,
|
||||
mt7531_pcs_config[i]);
|
||||
if (IS_ERR(regmap)) {
|
||||
ret = PTR_ERR(regmap);
|
||||
@@ -3121,6 +3126,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match)
|
||||
static int
|
||||
mt7530_probe(struct mdio_device *mdiodev)
|
||||
{
|
||||
+ static struct regmap_config *regmap_config;
|
||||
struct mt7530_priv *priv;
|
||||
struct device_node *dn;
|
||||
|
||||
@@ -3200,6 +3206,21 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||
mutex_init(&priv->reg_mutex);
|
||||
dev_set_drvdata(&mdiodev->dev, priv);
|
||||
|
||||
+ regmap_config = devm_kzalloc(&mdiodev->dev, sizeof(*regmap_config),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!regmap_config)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ regmap_config->reg_bits = 16;
|
||||
+ regmap_config->val_bits = 32;
|
||||
+ regmap_config->reg_stride = 4;
|
||||
+ regmap_config->max_register = MT7530_CREV;
|
||||
+ regmap_config->disable_locking = true;
|
||||
+ priv->regmap = devm_regmap_init(priv->dev, &mt7530_regmap_bus,
|
||||
+ priv->bus, regmap_config);
|
||||
+ if (IS_ERR(priv->regmap))
|
||||
+ return PTR_ERR(priv->regmap);
|
||||
+
|
||||
return dsa_register_switch(priv->ds);
|
||||
}
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.h
|
||||
+++ b/drivers/net/dsa/mt7530.h
|
||||
@@ -747,6 +747,7 @@ struct mt753x_info {
|
||||
* @dev: The device pointer
|
||||
* @ds: The pointer to the dsa core structure
|
||||
* @bus: The bus used for the device and built-in PHY
|
||||
+ * @regmap: The regmap instance representing all switch registers
|
||||
* @rstc: The pointer to reset control used by MCM
|
||||
* @core_pwr: The power supplied into the core
|
||||
* @io_pwr: The power supplied into the I/O
|
||||
@@ -767,6 +768,7 @@ struct mt7530_priv {
|
||||
struct device *dev;
|
||||
struct dsa_switch *ds;
|
||||
struct mii_bus *bus;
|
||||
+ struct regmap *regmap;
|
||||
struct reset_control *rstc;
|
||||
struct regulator *core_pwr;
|
||||
struct regulator *io_pwr;
|
||||
@@ -0,0 +1,54 @@
|
||||
From 6de2852297737171ba96b91e89bf302ca1fda869 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:18:04 +0100
|
||||
Subject: [PATCH 08/16] net: dsa: mt7530: move SGMII PCS creation to
|
||||
mt7530_probe function
|
||||
|
||||
Move creating the SGMII PCS from mt753x_setup() to the more appropriate
|
||||
mt7530_probe() function.
|
||||
This is done also in preparation of moving all functions related to
|
||||
MDIO-connected MT753x switches to a separate module.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -3007,12 +3007,6 @@ mt753x_setup(struct dsa_switch *ds)
|
||||
if (ret && priv->irq)
|
||||
mt7530_free_irq_common(priv);
|
||||
|
||||
- if (priv->id == ID_MT7531) {
|
||||
- ret = mt7531_create_sgmii(priv);
|
||||
- if (ret && priv->irq)
|
||||
- mt7530_free_irq_common(priv);
|
||||
- }
|
||||
-
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -3129,6 +3123,7 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||
static struct regmap_config *regmap_config;
|
||||
struct mt7530_priv *priv;
|
||||
struct device_node *dn;
|
||||
+ int ret;
|
||||
|
||||
dn = mdiodev->dev.of_node;
|
||||
|
||||
@@ -3221,6 +3216,12 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||
if (IS_ERR(priv->regmap))
|
||||
return PTR_ERR(priv->regmap);
|
||||
|
||||
+ if (priv->id == ID_MT7531) {
|
||||
+ ret = mt7531_create_sgmii(priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
return dsa_register_switch(priv->ds);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
From 1557c679f71c82a994eae0baadbaeb62b71e15bf Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:18:16 +0100
|
||||
Subject: [PATCH 09/16] net: dsa: mt7530: introduce mutex helpers
|
||||
|
||||
As the MDIO bus lock only needs to be involved if actually operating
|
||||
on an MDIO-connected switch we will need to skip locking for built-in
|
||||
switches which are accessed via MMIO.
|
||||
Create helper functions which simplify that upcoming change.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 73 ++++++++++++++++++++--------------------
|
||||
1 file changed, 36 insertions(+), 37 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -143,31 +143,40 @@ err:
|
||||
}
|
||||
|
||||
static void
|
||||
-core_write(struct mt7530_priv *priv, u32 reg, u32 val)
|
||||
+mt7530_mutex_lock(struct mt7530_priv *priv)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
+ mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+}
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+static void
|
||||
+mt7530_mutex_unlock(struct mt7530_priv *priv)
|
||||
+{
|
||||
+ mutex_unlock(&priv->bus->mdio_lock);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+core_write(struct mt7530_priv *priv, u32 reg, u32 val)
|
||||
+{
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
core_write_mmd_indirect(priv, reg, MDIO_MMD_VEND2, val);
|
||||
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
}
|
||||
|
||||
static void
|
||||
core_rmw(struct mt7530_priv *priv, u32 reg, u32 mask, u32 set)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
u32 val;
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
val = core_read_mmd_indirect(priv, reg, MDIO_MMD_VEND2);
|
||||
val &= ~mask;
|
||||
val |= set;
|
||||
core_write_mmd_indirect(priv, reg, MDIO_MMD_VEND2, val);
|
||||
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -264,13 +273,11 @@ mt7530_mii_read(struct mt7530_priv *priv
|
||||
static void
|
||||
mt7530_write(struct mt7530_priv *priv, u32 reg, u32 val)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
-
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
mt7530_mii_write(priv, reg, val);
|
||||
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
}
|
||||
|
||||
static u32
|
||||
@@ -282,14 +289,13 @@ _mt7530_unlocked_read(struct mt7530_dumm
|
||||
static u32
|
||||
_mt7530_read(struct mt7530_dummy_poll *p)
|
||||
{
|
||||
- struct mii_bus *bus = p->priv->bus;
|
||||
u32 val;
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(p->priv);
|
||||
|
||||
val = mt7530_mii_read(p->priv, p->reg);
|
||||
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(p->priv);
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -307,13 +313,11 @@ static void
|
||||
mt7530_rmw(struct mt7530_priv *priv, u32 reg,
|
||||
u32 mask, u32 set)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
-
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
regmap_update_bits(priv->regmap, reg, mask, set);
|
||||
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -645,14 +649,13 @@ static int
|
||||
mt7531_ind_c45_phy_read(struct mt7530_priv *priv, int port, int devad,
|
||||
int regnum)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
struct mt7530_dummy_poll p;
|
||||
u32 reg, val;
|
||||
int ret;
|
||||
|
||||
INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC);
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
|
||||
!(val & MT7531_PHY_ACS_ST), 20, 100000);
|
||||
@@ -685,7 +688,7 @@ mt7531_ind_c45_phy_read(struct mt7530_pr
|
||||
|
||||
ret = val & MT7531_MDIO_RW_DATA_MASK;
|
||||
out:
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -694,14 +697,13 @@ static int
|
||||
mt7531_ind_c45_phy_write(struct mt7530_priv *priv, int port, int devad,
|
||||
int regnum, u32 data)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
struct mt7530_dummy_poll p;
|
||||
u32 val, reg;
|
||||
int ret;
|
||||
|
||||
INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC);
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
|
||||
!(val & MT7531_PHY_ACS_ST), 20, 100000);
|
||||
@@ -733,7 +735,7 @@ mt7531_ind_c45_phy_write(struct mt7530_p
|
||||
}
|
||||
|
||||
out:
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -741,14 +743,13 @@ out:
|
||||
static int
|
||||
mt7531_ind_c22_phy_read(struct mt7530_priv *priv, int port, int regnum)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
struct mt7530_dummy_poll p;
|
||||
int ret;
|
||||
u32 val;
|
||||
|
||||
INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC);
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
|
||||
!(val & MT7531_PHY_ACS_ST), 20, 100000);
|
||||
@@ -771,7 +772,7 @@ mt7531_ind_c22_phy_read(struct mt7530_pr
|
||||
|
||||
ret = val & MT7531_MDIO_RW_DATA_MASK;
|
||||
out:
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -780,14 +781,13 @@ static int
|
||||
mt7531_ind_c22_phy_write(struct mt7530_priv *priv, int port, int regnum,
|
||||
u16 data)
|
||||
{
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
struct mt7530_dummy_poll p;
|
||||
int ret;
|
||||
u32 reg;
|
||||
|
||||
INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC);
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg,
|
||||
!(reg & MT7531_PHY_ACS_ST), 20, 100000);
|
||||
@@ -809,7 +809,7 @@ mt7531_ind_c22_phy_write(struct mt7530_p
|
||||
}
|
||||
|
||||
out:
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1109,7 +1109,6 @@ static int
|
||||
mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
- struct mii_bus *bus = priv->bus;
|
||||
int length;
|
||||
u32 val;
|
||||
|
||||
@@ -1120,7 +1119,7 @@ mt7530_port_change_mtu(struct dsa_switch
|
||||
if (!dsa_is_cpu_port(ds, port))
|
||||
return 0;
|
||||
|
||||
- mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
|
||||
val = mt7530_mii_read(priv, MT7530_GMACCR);
|
||||
val &= ~MAX_RX_PKT_LEN_MASK;
|
||||
@@ -1141,7 +1140,7 @@ mt7530_port_change_mtu(struct dsa_switch
|
||||
|
||||
mt7530_mii_write(priv, MT7530_GMACCR, val);
|
||||
|
||||
- mutex_unlock(&bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1937,10 +1936,10 @@ mt7530_irq_thread_fn(int irq, void *dev_
|
||||
u32 val;
|
||||
int p;
|
||||
|
||||
- mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
val = mt7530_mii_read(priv, MT7530_SYS_INT_STS);
|
||||
mt7530_mii_write(priv, MT7530_SYS_INT_STS, val);
|
||||
- mutex_unlock(&priv->bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
|
||||
for (p = 0; p < MT7530_NUM_PHYS; p++) {
|
||||
if (BIT(p) & val) {
|
||||
@@ -1976,7 +1975,7 @@ mt7530_irq_bus_lock(struct irq_data *d)
|
||||
{
|
||||
struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
|
||||
|
||||
- mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ mt7530_mutex_lock(priv);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1985,7 +1984,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);
|
||||
- mutex_unlock(&priv->bus->mdio_lock);
|
||||
+ mt7530_mutex_unlock(priv);
|
||||
}
|
||||
|
||||
static struct irq_chip mt7530_irq_chip = {
|
||||
@@ -0,0 +1,75 @@
|
||||
From 25d15dee34a1a40d5fd71636a205e3211f09fd1d Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:18:28 +0100
|
||||
Subject: [PATCH 10/16] net: dsa: mt7530: move p5_intf_modes() function to
|
||||
mt7530.c
|
||||
|
||||
In preparation of splitting mt7530.c into a driver for MDIO-connected
|
||||
as well as MDIO-accessed built-in switches on one hand and MMIO-accessed
|
||||
built-in switches move the p5_inft_modes() function from mt7530.h to
|
||||
mt7530.c. The function is only needed there and will trigger a compiler
|
||||
warning about a defined but unused function otherwise when including
|
||||
mt7530.h in the to-be-introduced bus-specific drivers.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 18 ++++++++++++++++++
|
||||
drivers/net/dsa/mt7530.h | 18 ------------------
|
||||
2 files changed, 18 insertions(+), 18 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -950,6 +950,24 @@ mt7530_set_ageing_time(struct dsa_switch
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static const char *p5_intf_modes(unsigned int p5_interface)
|
||||
+{
|
||||
+ switch (p5_interface) {
|
||||
+ case P5_DISABLED:
|
||||
+ return "DISABLED";
|
||||
+ case P5_INTF_SEL_PHY_P0:
|
||||
+ return "PHY P0";
|
||||
+ case P5_INTF_SEL_PHY_P4:
|
||||
+ return "PHY P4";
|
||||
+ case P5_INTF_SEL_GMAC5:
|
||||
+ return "GMAC5";
|
||||
+ case P5_INTF_SEL_GMAC5_SGMII:
|
||||
+ return "GMAC5_SGMII";
|
||||
+ default:
|
||||
+ return "unknown";
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
--- a/drivers/net/dsa/mt7530.h
|
||||
+++ b/drivers/net/dsa/mt7530.h
|
||||
@@ -682,24 +682,6 @@ enum p5_interface_select {
|
||||
P5_INTF_SEL_GMAC5_SGMII,
|
||||
};
|
||||
|
||||
-static const char *p5_intf_modes(unsigned int p5_interface)
|
||||
-{
|
||||
- switch (p5_interface) {
|
||||
- case P5_DISABLED:
|
||||
- return "DISABLED";
|
||||
- case P5_INTF_SEL_PHY_P0:
|
||||
- return "PHY P0";
|
||||
- case P5_INTF_SEL_PHY_P4:
|
||||
- return "PHY P4";
|
||||
- case P5_INTF_SEL_GMAC5:
|
||||
- return "GMAC5";
|
||||
- case P5_INTF_SEL_GMAC5_SGMII:
|
||||
- return "GMAC5_SGMII";
|
||||
- default:
|
||||
- return "unknown";
|
||||
- }
|
||||
-}
|
||||
-
|
||||
struct mt7530_priv;
|
||||
|
||||
struct mt753x_pcs {
|
||||
@@ -0,0 +1,155 @@
|
||||
From 37c9c0d8d0b2e24f8c9af72ecd4edd31537284d3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:18:39 +0100
|
||||
Subject: [PATCH 11/16] net: dsa: mt7530: introduce mt7530_probe_common helper
|
||||
function
|
||||
|
||||
Move commonly used parts from mt7530_probe into new mt7530_probe_common
|
||||
helper function which will be used by both, mt7530_probe and the
|
||||
to-be-introduced mt7988_probe.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 98 ++++++++++++++++++++++------------------
|
||||
1 file changed, 54 insertions(+), 44 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -3135,44 +3135,21 @@ static const struct of_device_id mt7530_
|
||||
MODULE_DEVICE_TABLE(of, mt7530_of_match);
|
||||
|
||||
static int
|
||||
-mt7530_probe(struct mdio_device *mdiodev)
|
||||
+mt7530_probe_common(struct mt7530_priv *priv)
|
||||
{
|
||||
- static struct regmap_config *regmap_config;
|
||||
- struct mt7530_priv *priv;
|
||||
- struct device_node *dn;
|
||||
- int ret;
|
||||
+ struct device *dev = priv->dev;
|
||||
|
||||
- dn = mdiodev->dev.of_node;
|
||||
-
|
||||
- priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
- if (!priv)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- priv->ds = devm_kzalloc(&mdiodev->dev, sizeof(*priv->ds), GFP_KERNEL);
|
||||
+ priv->ds = devm_kzalloc(dev, sizeof(*priv->ds), GFP_KERNEL);
|
||||
if (!priv->ds)
|
||||
return -ENOMEM;
|
||||
|
||||
- priv->ds->dev = &mdiodev->dev;
|
||||
+ priv->ds->dev = dev;
|
||||
priv->ds->num_ports = MT7530_NUM_PORTS;
|
||||
|
||||
- /* Use medatek,mcm property to distinguish hardware type that would
|
||||
- * casues a little bit differences on power-on sequence.
|
||||
- */
|
||||
- priv->mcm = of_property_read_bool(dn, "mediatek,mcm");
|
||||
- if (priv->mcm) {
|
||||
- dev_info(&mdiodev->dev, "MT7530 adapts as multi-chip module\n");
|
||||
-
|
||||
- priv->rstc = devm_reset_control_get(&mdiodev->dev, "mcm");
|
||||
- if (IS_ERR(priv->rstc)) {
|
||||
- dev_err(&mdiodev->dev, "Couldn't get our reset line\n");
|
||||
- return PTR_ERR(priv->rstc);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/* Get the hardware identifier from the devicetree node.
|
||||
* We will need it for some of the clock and regulator setup.
|
||||
*/
|
||||
- priv->info = of_device_get_match_data(&mdiodev->dev);
|
||||
+ priv->info = of_device_get_match_data(dev);
|
||||
if (!priv->info)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -3186,23 +3163,53 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||
return -EINVAL;
|
||||
|
||||
priv->id = priv->info->id;
|
||||
+ priv->dev = dev;
|
||||
+ priv->ds->priv = priv;
|
||||
+ priv->ds->ops = &mt7530_switch_ops;
|
||||
+ mutex_init(&priv->reg_mutex);
|
||||
+ dev_set_drvdata(dev, priv);
|
||||
|
||||
- if (priv->id == ID_MT7530) {
|
||||
- priv->core_pwr = devm_regulator_get(&mdiodev->dev, "core");
|
||||
- if (IS_ERR(priv->core_pwr))
|
||||
- return PTR_ERR(priv->core_pwr);
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
- priv->io_pwr = devm_regulator_get(&mdiodev->dev, "io");
|
||||
- if (IS_ERR(priv->io_pwr))
|
||||
- return PTR_ERR(priv->io_pwr);
|
||||
- }
|
||||
+static int
|
||||
+mt7530_probe(struct mdio_device *mdiodev)
|
||||
+{
|
||||
+ static struct regmap_config *regmap_config;
|
||||
+ struct mt7530_priv *priv;
|
||||
+ struct device_node *dn;
|
||||
+ int ret;
|
||||
+
|
||||
+ dn = mdiodev->dev.of_node;
|
||||
+
|
||||
+ priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
|
||||
- /* Not MCM that indicates switch works as the remote standalone
|
||||
+ priv->bus = mdiodev->bus;
|
||||
+ priv->dev = &mdiodev->dev;
|
||||
+
|
||||
+ ret = mt7530_probe_common(priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Use medatek,mcm property to distinguish hardware type that would
|
||||
+ * cause a little bit differences on power-on sequence.
|
||||
+ * Not MCM that indicates switch works as the remote standalone
|
||||
* integrated circuit so the GPIO pin would be used to complete
|
||||
* the reset, otherwise memory-mapped register accessing used
|
||||
* through syscon provides in the case of MCM.
|
||||
*/
|
||||
- if (!priv->mcm) {
|
||||
+ priv->mcm = of_property_read_bool(dn, "mediatek,mcm");
|
||||
+ if (priv->mcm) {
|
||||
+ dev_info(&mdiodev->dev, "MT7530 adapts as multi-chip module\n");
|
||||
+
|
||||
+ priv->rstc = devm_reset_control_get(&mdiodev->dev, "mcm");
|
||||
+ if (IS_ERR(priv->rstc)) {
|
||||
+ dev_err(&mdiodev->dev, "Couldn't get our reset line\n");
|
||||
+ return PTR_ERR(priv->rstc);
|
||||
+ }
|
||||
+ } else {
|
||||
priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset",
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(priv->reset)) {
|
||||
@@ -3211,12 +3218,15 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||
}
|
||||
}
|
||||
|
||||
- priv->bus = mdiodev->bus;
|
||||
- priv->dev = &mdiodev->dev;
|
||||
- priv->ds->priv = priv;
|
||||
- priv->ds->ops = &mt7530_switch_ops;
|
||||
- mutex_init(&priv->reg_mutex);
|
||||
- dev_set_drvdata(&mdiodev->dev, priv);
|
||||
+ if (priv->id == ID_MT7530) {
|
||||
+ priv->core_pwr = devm_regulator_get(&mdiodev->dev, "core");
|
||||
+ if (IS_ERR(priv->core_pwr))
|
||||
+ return PTR_ERR(priv->core_pwr);
|
||||
+
|
||||
+ priv->io_pwr = devm_regulator_get(&mdiodev->dev, "io");
|
||||
+ if (IS_ERR(priv->io_pwr))
|
||||
+ return PTR_ERR(priv->io_pwr);
|
||||
+ }
|
||||
|
||||
regmap_config = devm_kzalloc(&mdiodev->dev, sizeof(*regmap_config),
|
||||
GFP_KERNEL);
|
||||
@@ -0,0 +1,55 @@
|
||||
From 720d736351761574af02ed093658ab60de60576c Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:18:50 +0100
|
||||
Subject: [PATCH 12/16] net: dsa: mt7530: introduce mt7530_remove_common helper
|
||||
function
|
||||
|
||||
Move commonly used parts from mt7530_remove into new
|
||||
mt7530_remove_common helper function which will be used by both,
|
||||
mt7530_remove and the to-be-introduced mt7988_remove.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 18 ++++++++++++------
|
||||
1 file changed, 12 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -3253,6 +3253,17 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||
}
|
||||
|
||||
static void
|
||||
+mt7530_remove_common(struct mt7530_priv *priv)
|
||||
+{
|
||||
+ if (priv->irq)
|
||||
+ mt7530_free_irq(priv);
|
||||
+
|
||||
+ dsa_unregister_switch(priv->ds);
|
||||
+
|
||||
+ mutex_destroy(&priv->reg_mutex);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
mt7530_remove(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||
@@ -3271,16 +3282,11 @@ mt7530_remove(struct mdio_device *mdiode
|
||||
dev_err(priv->dev, "Failed to disable io pwr: %d\n",
|
||||
ret);
|
||||
|
||||
- if (priv->irq)
|
||||
- mt7530_free_irq(priv);
|
||||
-
|
||||
- dsa_unregister_switch(priv->ds);
|
||||
+ mt7530_remove_common(priv);
|
||||
|
||||
for (i = 0; i < 2; ++i)
|
||||
mtk_pcs_lynxi_destroy(priv->ports[5 + i].sgmii_pcs);
|
||||
|
||||
- mutex_destroy(&priv->reg_mutex);
|
||||
-
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
From 7f54cc9772ced2d76ac11832f0ada43798443ac9 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:19:02 +0100
|
||||
Subject: [PATCH 13/16] net: dsa: mt7530: split-off common parts from
|
||||
mt7531_setup
|
||||
|
||||
MT7988 shares a significant part of the setup function with MT7531.
|
||||
Split-off those parts into a shared function which is going to be used
|
||||
also by mt7988_setup.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 99 ++++++++++++++++++++++------------------
|
||||
1 file changed, 55 insertions(+), 44 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -2348,11 +2348,64 @@ mt7530_setup(struct dsa_switch *ds)
|
||||
}
|
||||
|
||||
static int
|
||||
+mt7531_setup_common(struct dsa_switch *ds)
|
||||
+{
|
||||
+ struct mt7530_priv *priv = ds->priv;
|
||||
+ struct dsa_port *cpu_dp;
|
||||
+ int ret, i;
|
||||
+
|
||||
+ /* BPDU to CPU port */
|
||||
+ dsa_switch_for_each_cpu_port(cpu_dp, ds) {
|
||||
+ mt7530_rmw(priv, MT7531_CFC, MT7531_CPU_PMAP_MASK,
|
||||
+ BIT(cpu_dp->index));
|
||||
+ break;
|
||||
+ }
|
||||
+ mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
|
||||
+ MT753X_BPDU_CPU_ONLY);
|
||||
+
|
||||
+ /* Enable and reset MIB counters */
|
||||
+ mt7530_mib_reset(ds);
|
||||
+
|
||||
+ for (i = 0; i < MT7530_NUM_PORTS; i++) {
|
||||
+ /* Disable forwarding by default on all ports */
|
||||
+ mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK,
|
||||
+ PCR_MATRIX_CLR);
|
||||
+
|
||||
+ /* Disable learning by default on all ports */
|
||||
+ mt7530_set(priv, MT7530_PSC_P(i), SA_DIS);
|
||||
+
|
||||
+ mt7530_set(priv, MT7531_DBG_CNT(i), MT7531_DIS_CLR);
|
||||
+
|
||||
+ if (dsa_is_cpu_port(ds, i)) {
|
||||
+ ret = mt753x_cpu_port_enable(ds, i);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ } else {
|
||||
+ mt7530_port_disable(ds, i);
|
||||
+
|
||||
+ /* Set default PVID to 0 on all user ports */
|
||||
+ mt7530_rmw(priv, MT7530_PPBV1_P(i), G0_PORT_VID_MASK,
|
||||
+ G0_PORT_VID_DEF);
|
||||
+ }
|
||||
+
|
||||
+ /* Enable consistent egress tag */
|
||||
+ mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK,
|
||||
+ PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
|
||||
+ }
|
||||
+
|
||||
+ /* Flush the FDB table */
|
||||
+ ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
mt7531_setup(struct dsa_switch *ds)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
struct mt7530_dummy_poll p;
|
||||
- struct dsa_port *cpu_dp;
|
||||
u32 val, id;
|
||||
int ret, i;
|
||||
|
||||
@@ -2426,44 +2479,7 @@ mt7531_setup(struct dsa_switch *ds)
|
||||
mt7531_ind_c45_phy_write(priv, MT753X_CTRL_PHY_ADDR, MDIO_MMD_VEND2,
|
||||
CORE_PLL_GROUP4, val);
|
||||
|
||||
- /* BPDU to CPU port */
|
||||
- dsa_switch_for_each_cpu_port(cpu_dp, ds) {
|
||||
- mt7530_rmw(priv, MT7531_CFC, MT7531_CPU_PMAP_MASK,
|
||||
- BIT(cpu_dp->index));
|
||||
- break;
|
||||
- }
|
||||
- mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK,
|
||||
- MT753X_BPDU_CPU_ONLY);
|
||||
-
|
||||
- /* Enable and reset MIB counters */
|
||||
- mt7530_mib_reset(ds);
|
||||
-
|
||||
- for (i = 0; i < MT7530_NUM_PORTS; i++) {
|
||||
- /* Disable forwarding by default on all ports */
|
||||
- mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK,
|
||||
- PCR_MATRIX_CLR);
|
||||
-
|
||||
- /* Disable learning by default on all ports */
|
||||
- mt7530_set(priv, MT7530_PSC_P(i), SA_DIS);
|
||||
-
|
||||
- mt7530_set(priv, MT7531_DBG_CNT(i), MT7531_DIS_CLR);
|
||||
-
|
||||
- if (dsa_is_cpu_port(ds, i)) {
|
||||
- ret = mt753x_cpu_port_enable(ds, i);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
- } else {
|
||||
- mt7530_port_disable(ds, i);
|
||||
-
|
||||
- /* Set default PVID to 0 on all user ports */
|
||||
- mt7530_rmw(priv, MT7530_PPBV1_P(i), G0_PORT_VID_MASK,
|
||||
- G0_PORT_VID_DEF);
|
||||
- }
|
||||
-
|
||||
- /* Enable consistent egress tag */
|
||||
- mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK,
|
||||
- PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
|
||||
- }
|
||||
+ mt7531_setup_common(ds);
|
||||
|
||||
/* Setup VLAN ID 0 for VLAN-unaware bridges */
|
||||
ret = mt7530_setup_vlan0(priv);
|
||||
@@ -2473,11 +2489,6 @@ mt7531_setup(struct dsa_switch *ds)
|
||||
ds->assisted_learning_on_cpu_port = true;
|
||||
ds->mtu_enforcement_ingress = true;
|
||||
|
||||
- /* Flush the FDB table */
|
||||
- ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,692 @@
|
||||
From cb675afcddbbeb2bfa6596e3bc236bc026cd425f Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:19:13 +0100
|
||||
Subject: [PATCH 14/16] net: dsa: mt7530: introduce separate MDIO driver
|
||||
|
||||
Split MT7530 switch driver into a common part and a part specific
|
||||
for MDIO connected switches and multi-chip modules.
|
||||
Move MDIO-specific functions to newly introduced mt7530-mdio.c while
|
||||
keeping the common parts in mt7530.c.
|
||||
Introduce new Kconfig symbol CONFIG_NET_DSA_MT7530_MDIO which is
|
||||
implied by CONFIG_NET_DSA_MT7530.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
MAINTAINERS | 1 +
|
||||
drivers/net/dsa/Kconfig | 15 +-
|
||||
drivers/net/dsa/Makefile | 1 +
|
||||
drivers/net/dsa/mt7530-mdio.c | 271 ++++++++++++++++++++++++++++++++++
|
||||
drivers/net/dsa/mt7530.c | 264 +--------------------------------
|
||||
drivers/net/dsa/mt7530.h | 6 +
|
||||
6 files changed, 300 insertions(+), 258 deletions(-)
|
||||
create mode 100644 drivers/net/dsa/mt7530-mdio.c
|
||||
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -11901,6 +11901,7 @@ M: Landen Chao <Landen.Chao@mediatek.com
|
||||
M: DENG Qingfang <dqfext@gmail.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
+F: drivers/net/dsa/mt7530-mdio.c
|
||||
F: drivers/net/dsa/mt7530.*
|
||||
F: net/dsa/tag_mtk.c
|
||||
|
||||
--- a/drivers/net/dsa/Kconfig
|
||||
+++ b/drivers/net/dsa/Kconfig
|
||||
@@ -37,10 +37,22 @@ config NET_DSA_MT7530
|
||||
tristate "MediaTek MT753x and MT7621 Ethernet switch support"
|
||||
select NET_DSA_TAG_MTK
|
||||
select MEDIATEK_GE_PHY
|
||||
+ imply NET_DSA_MT7530_MDIO
|
||||
+ help
|
||||
+ This enables support for the MediaTek MT7530 and MT7531 Ethernet
|
||||
+ switch chips. Multi-chip module MT7530 in MT7621AT, MT7621DAT,
|
||||
+ MT7621ST and MT7623AI SoCs, and built-in switch in MT7988 SoC are
|
||||
+ supported as well.
|
||||
+
|
||||
+config NET_DSA_MT7530_MDIO
|
||||
+ tristate "MediaTek MT7530 MDIO interface driver"
|
||||
+ depends on NET_DSA_MT7530
|
||||
select PCS_MTK_LYNXI
|
||||
help
|
||||
- This enables support for the MediaTek MT7530, MT7531, and MT7621
|
||||
- Ethernet switch chips.
|
||||
+ This enables support for the MediaTek MT7530 and MT7531 switch
|
||||
+ chips which are connected via MDIO, as well as multi-chip
|
||||
+ module MT7530 which can be found in the MT7621AT, MT7621DAT,
|
||||
+ MT7621ST and MT7623AI SoCs.
|
||||
|
||||
config NET_DSA_MV88E6060
|
||||
tristate "Marvell 88E6060 ethernet switch chip support"
|
||||
--- a/drivers/net/dsa/Makefile
|
||||
+++ b/drivers/net/dsa/Makefile
|
||||
@@ -7,6 +7,7 @@ obj-$(CONFIG_FIXED_PHY) += dsa_loop_bdi
|
||||
endif
|
||||
obj-$(CONFIG_NET_DSA_LANTIQ_GSWIP) += lantiq_gswip.o
|
||||
obj-$(CONFIG_NET_DSA_MT7530) += mt7530.o
|
||||
+obj-$(CONFIG_NET_DSA_MT7530_MDIO) += mt7530-mdio.o
|
||||
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
|
||||
obj-$(CONFIG_NET_DSA_REALTEK_SMI) += realtek-smi.o
|
||||
realtek-smi-objs := realtek-smi-core.o rtl8366.o rtl8366rb.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/dsa/mt7530-mdio.c
|
||||
@@ -0,0 +1,271 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+
|
||||
+#include <linux/gpio/consumer.h>
|
||||
+#include <linux/mdio.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/pcs/pcs-mtk-lynxi.h>
|
||||
+#include <linux/of_irq.h>
|
||||
+#include <linux/of_mdio.h>
|
||||
+#include <linux/of_net.h>
|
||||
+#include <linux/of_platform.h>
|
||||
+#include <linux/regmap.h>
|
||||
+#include <linux/reset.h>
|
||||
+#include <linux/regulator/consumer.h>
|
||||
+#include <net/dsa.h>
|
||||
+
|
||||
+#include "mt7530.h"
|
||||
+
|
||||
+static int
|
||||
+mt7530_regmap_write(void *context, unsigned int reg, unsigned int val)
|
||||
+{
|
||||
+ struct mii_bus *bus = context;
|
||||
+ u16 page, r, lo, hi;
|
||||
+ int ret;
|
||||
+
|
||||
+ page = (reg >> 6) & 0x3ff;
|
||||
+ r = (reg >> 2) & 0xf;
|
||||
+ lo = val & 0xffff;
|
||||
+ hi = val >> 16;
|
||||
+
|
||||
+ /* MT7530 uses 31 as the pseudo port */
|
||||
+ ret = bus->write(bus, 0x1f, 0x1f, page);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = bus->write(bus, 0x1f, r, lo);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = bus->write(bus, 0x1f, 0x10, hi);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mt7530_regmap_read(void *context, unsigned int reg, unsigned int *val)
|
||||
+{
|
||||
+ struct mii_bus *bus = context;
|
||||
+ u16 page, r, lo, hi;
|
||||
+ int ret;
|
||||
+
|
||||
+ page = (reg >> 6) & 0x3ff;
|
||||
+ r = (reg >> 2) & 0xf;
|
||||
+
|
||||
+ /* MT7530 uses 31 as the pseudo port */
|
||||
+ ret = bus->write(bus, 0x1f, 0x1f, page);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ lo = bus->read(bus, 0x1f, r);
|
||||
+ hi = bus->read(bus, 0x1f, 0x10);
|
||||
+
|
||||
+ *val = (hi << 16) | (lo & 0xffff);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+mt7530_mdio_regmap_lock(void *mdio_lock)
|
||||
+{
|
||||
+ mutex_lock_nested(mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+mt7530_mdio_regmap_unlock(void *mdio_lock)
|
||||
+{
|
||||
+ mutex_unlock(mdio_lock);
|
||||
+}
|
||||
+
|
||||
+static const struct regmap_bus mt7530_regmap_bus = {
|
||||
+ .reg_write = mt7530_regmap_write,
|
||||
+ .reg_read = mt7530_regmap_read,
|
||||
+};
|
||||
+
|
||||
+static int
|
||||
+mt7531_create_sgmii(struct mt7530_priv *priv)
|
||||
+{
|
||||
+ struct regmap_config *mt7531_pcs_config[2];
|
||||
+ struct phylink_pcs *pcs;
|
||||
+ struct regmap *regmap;
|
||||
+ int i, ret = 0;
|
||||
+
|
||||
+ for (i = 0; i < 2; i++) {
|
||||
+ mt7531_pcs_config[i] = devm_kzalloc(priv->dev,
|
||||
+ sizeof(struct regmap_config),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!mt7531_pcs_config[i]) {
|
||||
+ ret = -ENOMEM;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ mt7531_pcs_config[i]->name = i ? "port6" : "port5";
|
||||
+ mt7531_pcs_config[i]->reg_bits = 16;
|
||||
+ mt7531_pcs_config[i]->val_bits = 32;
|
||||
+ 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;
|
||||
+ mt7531_pcs_config[i]->lock = mt7530_mdio_regmap_lock;
|
||||
+ mt7531_pcs_config[i]->unlock = mt7530_mdio_regmap_unlock;
|
||||
+ mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
|
||||
+
|
||||
+ regmap = devm_regmap_init(priv->dev,
|
||||
+ &mt7530_regmap_bus, priv->bus,
|
||||
+ mt7531_pcs_config[i]);
|
||||
+ if (IS_ERR(regmap)) {
|
||||
+ ret = PTR_ERR(regmap);
|
||||
+ break;
|
||||
+ }
|
||||
+ pcs = mtk_pcs_lynxi_create(priv->dev, regmap,
|
||||
+ MT7531_PHYA_CTRL_SIGNAL3, 0);
|
||||
+ if (!pcs) {
|
||||
+ ret = -ENXIO;
|
||||
+ break;
|
||||
+ }
|
||||
+ priv->ports[5 + i].sgmii_pcs = pcs;
|
||||
+ }
|
||||
+
|
||||
+ if (ret && i)
|
||||
+ mtk_pcs_lynxi_destroy(priv->ports[5].sgmii_pcs);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id mt7530_of_match[] = {
|
||||
+ { .compatible = "mediatek,mt7621", .data = &mt753x_table[ID_MT7621], },
|
||||
+ { .compatible = "mediatek,mt7530", .data = &mt753x_table[ID_MT7530], },
|
||||
+ { .compatible = "mediatek,mt7531", .data = &mt753x_table[ID_MT7531], },
|
||||
+ { /* sentinel */ },
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, mt7530_of_match);
|
||||
+
|
||||
+static int
|
||||
+mt7530_probe(struct mdio_device *mdiodev)
|
||||
+{
|
||||
+ static struct regmap_config *regmap_config;
|
||||
+ struct mt7530_priv *priv;
|
||||
+ struct device_node *dn;
|
||||
+ int ret;
|
||||
+
|
||||
+ dn = mdiodev->dev.of_node;
|
||||
+
|
||||
+ priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ priv->bus = mdiodev->bus;
|
||||
+ priv->dev = &mdiodev->dev;
|
||||
+
|
||||
+ ret = mt7530_probe_common(priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Use medatek,mcm property to distinguish hardware type that would
|
||||
+ * cause a little bit differences on power-on sequence.
|
||||
+ * Not MCM that indicates switch works as the remote standalone
|
||||
+ * integrated circuit so the GPIO pin would be used to complete
|
||||
+ * the reset, otherwise memory-mapped register accessing used
|
||||
+ * through syscon provides in the case of MCM.
|
||||
+ */
|
||||
+ priv->mcm = of_property_read_bool(dn, "mediatek,mcm");
|
||||
+ if (priv->mcm) {
|
||||
+ dev_info(&mdiodev->dev, "MT7530 adapts as multi-chip module\n");
|
||||
+
|
||||
+ priv->rstc = devm_reset_control_get(&mdiodev->dev, "mcm");
|
||||
+ if (IS_ERR(priv->rstc)) {
|
||||
+ dev_err(&mdiodev->dev, "Couldn't get our reset line\n");
|
||||
+ return PTR_ERR(priv->rstc);
|
||||
+ }
|
||||
+ } else {
|
||||
+ priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset",
|
||||
+ GPIOD_OUT_LOW);
|
||||
+ if (IS_ERR(priv->reset)) {
|
||||
+ dev_err(&mdiodev->dev, "Couldn't get our reset line\n");
|
||||
+ return PTR_ERR(priv->reset);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (priv->id == ID_MT7530) {
|
||||
+ priv->core_pwr = devm_regulator_get(&mdiodev->dev, "core");
|
||||
+ if (IS_ERR(priv->core_pwr))
|
||||
+ return PTR_ERR(priv->core_pwr);
|
||||
+
|
||||
+ priv->io_pwr = devm_regulator_get(&mdiodev->dev, "io");
|
||||
+ if (IS_ERR(priv->io_pwr))
|
||||
+ return PTR_ERR(priv->io_pwr);
|
||||
+ }
|
||||
+
|
||||
+ regmap_config = devm_kzalloc(&mdiodev->dev, sizeof(*regmap_config),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!regmap_config)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ regmap_config->reg_bits = 16;
|
||||
+ regmap_config->val_bits = 32;
|
||||
+ regmap_config->reg_stride = 4;
|
||||
+ regmap_config->max_register = MT7530_CREV;
|
||||
+ regmap_config->disable_locking = true;
|
||||
+ priv->regmap = devm_regmap_init(priv->dev, &mt7530_regmap_bus,
|
||||
+ priv->bus, regmap_config);
|
||||
+ if (IS_ERR(priv->regmap))
|
||||
+ return PTR_ERR(priv->regmap);
|
||||
+
|
||||
+ if (priv->id == ID_MT7531) {
|
||||
+ ret = mt7531_create_sgmii(priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return dsa_register_switch(priv->ds);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+mt7530_remove(struct mdio_device *mdiodev)
|
||||
+{
|
||||
+ struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||
+ int ret = 0, i;
|
||||
+
|
||||
+ if (!priv)
|
||||
+ return;
|
||||
+
|
||||
+ ret = regulator_disable(priv->core_pwr);
|
||||
+ if (ret < 0)
|
||||
+ dev_err(priv->dev,
|
||||
+ "Failed to disable core power: %d\n", ret);
|
||||
+
|
||||
+ ret = regulator_disable(priv->io_pwr);
|
||||
+ if (ret < 0)
|
||||
+ dev_err(priv->dev, "Failed to disable io pwr: %d\n",
|
||||
+ ret);
|
||||
+
|
||||
+ mt7530_remove_common(priv);
|
||||
+
|
||||
+ for (i = 0; i < 2; ++i)
|
||||
+ mtk_pcs_lynxi_destroy(priv->ports[5 + i].sgmii_pcs);
|
||||
+}
|
||||
+
|
||||
+static void mt7530_shutdown(struct mdio_device *mdiodev)
|
||||
+{
|
||||
+ struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||
+
|
||||
+ if (!priv)
|
||||
+ return;
|
||||
+
|
||||
+ dsa_switch_shutdown(priv->ds);
|
||||
+
|
||||
+ dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
+}
|
||||
+
|
||||
+static struct mdio_driver mt7530_mdio_driver = {
|
||||
+ .probe = mt7530_probe,
|
||||
+ .remove = mt7530_remove,
|
||||
+ .shutdown = mt7530_shutdown,
|
||||
+ .mdiodrv.driver = {
|
||||
+ .name = "mt7530-mdio",
|
||||
+ .of_match_table = mt7530_of_match,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+mdio_module_driver(mt7530_mdio_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");
|
||||
+MODULE_DESCRIPTION("Driver for Mediatek MT7530 Switch (MDIO)");
|
||||
+MODULE_LICENSE("GPL");
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <linux/of_mdio.h>
|
||||
#include <linux/of_net.h>
|
||||
#include <linux/of_platform.h>
|
||||
-#include <linux/pcs/pcs-mtk-lynxi.h>
|
||||
#include <linux/phylink.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
@@ -192,31 +191,6 @@ core_clear(struct mt7530_priv *priv, u32
|
||||
}
|
||||
|
||||
static int
|
||||
-mt7530_regmap_write(void *context, unsigned int reg, unsigned int val)
|
||||
-{
|
||||
- struct mii_bus *bus = context;
|
||||
- u16 page, r, lo, hi;
|
||||
- int ret;
|
||||
-
|
||||
- page = (reg >> 6) & 0x3ff;
|
||||
- r = (reg >> 2) & 0xf;
|
||||
- lo = val & 0xffff;
|
||||
- hi = val >> 16;
|
||||
-
|
||||
- /* MT7530 uses 31 as the pseudo port */
|
||||
- ret = bus->write(bus, 0x1f, 0x1f, page);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
-
|
||||
- ret = bus->write(bus, 0x1f, r, lo);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
-
|
||||
- ret = bus->write(bus, 0x1f, 0x10, hi);
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-static int
|
||||
mt7530_mii_write(struct mt7530_priv *priv, u32 reg, u32 val)
|
||||
{
|
||||
int ret;
|
||||
@@ -230,29 +204,6 @@ mt7530_mii_write(struct mt7530_priv *pri
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-mt7530_regmap_read(void *context, unsigned int reg, unsigned int *val)
|
||||
-{
|
||||
- struct mii_bus *bus = context;
|
||||
- u16 page, r, lo, hi;
|
||||
- int ret;
|
||||
-
|
||||
- page = (reg >> 6) & 0x3ff;
|
||||
- r = (reg >> 2) & 0xf;
|
||||
-
|
||||
- /* MT7530 uses 31 as the pseudo port */
|
||||
- ret = bus->write(bus, 0x1f, 0x1f, page);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
-
|
||||
- lo = bus->read(bus, 0x1f, r);
|
||||
- hi = bus->read(bus, 0x1f, 0x10);
|
||||
-
|
||||
- *val = (hi << 16) | (lo & 0xffff);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static u32
|
||||
mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
|
||||
{
|
||||
@@ -2944,72 +2895,6 @@ static const struct phylink_pcs_ops mt75
|
||||
.pcs_an_restart = mt7530_pcs_an_restart,
|
||||
};
|
||||
|
||||
-static void
|
||||
-mt7530_mdio_regmap_lock(void *mdio_lock)
|
||||
-{
|
||||
- mutex_lock_nested(mdio_lock, MDIO_MUTEX_NESTED);
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-mt7530_mdio_regmap_unlock(void *mdio_lock)
|
||||
-{
|
||||
- mutex_unlock(mdio_lock);
|
||||
-}
|
||||
-
|
||||
-static const struct regmap_bus mt7530_regmap_bus = {
|
||||
- .reg_write = mt7530_regmap_write,
|
||||
- .reg_read = mt7530_regmap_read,
|
||||
-};
|
||||
-
|
||||
-static int
|
||||
-mt7531_create_sgmii(struct mt7530_priv *priv)
|
||||
-{
|
||||
- struct regmap_config *mt7531_pcs_config[2];
|
||||
- struct phylink_pcs *pcs;
|
||||
- struct regmap *regmap;
|
||||
- int i, ret = 0;
|
||||
-
|
||||
- for (i = 0; i < 2; i++) {
|
||||
- mt7531_pcs_config[i] = devm_kzalloc(priv->dev,
|
||||
- sizeof(struct regmap_config),
|
||||
- GFP_KERNEL);
|
||||
- if (!mt7531_pcs_config[i]) {
|
||||
- ret = -ENOMEM;
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- mt7531_pcs_config[i]->name = i ? "port6" : "port5";
|
||||
- mt7531_pcs_config[i]->reg_bits = 16;
|
||||
- mt7531_pcs_config[i]->val_bits = 32;
|
||||
- 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;
|
||||
- mt7531_pcs_config[i]->lock = mt7530_mdio_regmap_lock;
|
||||
- mt7531_pcs_config[i]->unlock = mt7530_mdio_regmap_unlock;
|
||||
- mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
|
||||
-
|
||||
- regmap = devm_regmap_init(priv->dev,
|
||||
- &mt7530_regmap_bus, priv->bus,
|
||||
- mt7531_pcs_config[i]);
|
||||
- if (IS_ERR(regmap)) {
|
||||
- ret = PTR_ERR(regmap);
|
||||
- break;
|
||||
- }
|
||||
- pcs = mtk_pcs_lynxi_create(priv->dev, regmap,
|
||||
- MT7531_PHYA_CTRL_SIGNAL3, 0);
|
||||
- if (!pcs) {
|
||||
- ret = -ENXIO;
|
||||
- break;
|
||||
- }
|
||||
- priv->ports[5 + i].sgmii_pcs = pcs;
|
||||
- }
|
||||
-
|
||||
- if (ret && i)
|
||||
- mtk_pcs_lynxi_destroy(priv->ports[5].sgmii_pcs);
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
mt753x_setup(struct dsa_switch *ds)
|
||||
{
|
||||
@@ -3068,7 +2953,7 @@ static int mt753x_set_mac_eee(struct dsa
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static const struct dsa_switch_ops mt7530_switch_ops = {
|
||||
+const struct dsa_switch_ops mt7530_switch_ops = {
|
||||
.get_tag_protocol = mtk_get_tag_protocol,
|
||||
.setup = mt753x_setup,
|
||||
.get_strings = mt7530_get_strings,
|
||||
@@ -3102,8 +2987,9 @@ static const struct dsa_switch_ops mt753
|
||||
.get_mac_eee = mt753x_get_mac_eee,
|
||||
.set_mac_eee = mt753x_set_mac_eee,
|
||||
};
|
||||
+EXPORT_SYMBOL_GPL(mt7530_switch_ops);
|
||||
|
||||
-static const struct mt753x_info mt753x_table[] = {
|
||||
+const struct mt753x_info mt753x_table[] = {
|
||||
[ID_MT7621] = {
|
||||
.id = ID_MT7621,
|
||||
.pcs_ops = &mt7530_pcs_ops,
|
||||
@@ -3136,16 +3022,9 @@ static const struct mt753x_info mt753x_t
|
||||
.mac_port_config = mt7531_mac_config,
|
||||
},
|
||||
};
|
||||
+EXPORT_SYMBOL_GPL(mt753x_table);
|
||||
|
||||
-static const struct of_device_id mt7530_of_match[] = {
|
||||
- { .compatible = "mediatek,mt7621", .data = &mt753x_table[ID_MT7621], },
|
||||
- { .compatible = "mediatek,mt7530", .data = &mt753x_table[ID_MT7530], },
|
||||
- { .compatible = "mediatek,mt7531", .data = &mt753x_table[ID_MT7531], },
|
||||
- { /* sentinel */ },
|
||||
-};
|
||||
-MODULE_DEVICE_TABLE(of, mt7530_of_match);
|
||||
-
|
||||
-static int
|
||||
+int
|
||||
mt7530_probe_common(struct mt7530_priv *priv)
|
||||
{
|
||||
struct device *dev = priv->dev;
|
||||
@@ -3182,88 +3061,9 @@ mt7530_probe_common(struct mt7530_priv *
|
||||
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(mt7530_probe_common);
|
||||
|
||||
-static int
|
||||
-mt7530_probe(struct mdio_device *mdiodev)
|
||||
-{
|
||||
- static struct regmap_config *regmap_config;
|
||||
- struct mt7530_priv *priv;
|
||||
- struct device_node *dn;
|
||||
- int ret;
|
||||
-
|
||||
- dn = mdiodev->dev.of_node;
|
||||
-
|
||||
- priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
- if (!priv)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- priv->bus = mdiodev->bus;
|
||||
- priv->dev = &mdiodev->dev;
|
||||
-
|
||||
- ret = mt7530_probe_common(priv);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- /* Use medatek,mcm property to distinguish hardware type that would
|
||||
- * cause a little bit differences on power-on sequence.
|
||||
- * Not MCM that indicates switch works as the remote standalone
|
||||
- * integrated circuit so the GPIO pin would be used to complete
|
||||
- * the reset, otherwise memory-mapped register accessing used
|
||||
- * through syscon provides in the case of MCM.
|
||||
- */
|
||||
- priv->mcm = of_property_read_bool(dn, "mediatek,mcm");
|
||||
- if (priv->mcm) {
|
||||
- dev_info(&mdiodev->dev, "MT7530 adapts as multi-chip module\n");
|
||||
-
|
||||
- priv->rstc = devm_reset_control_get(&mdiodev->dev, "mcm");
|
||||
- if (IS_ERR(priv->rstc)) {
|
||||
- dev_err(&mdiodev->dev, "Couldn't get our reset line\n");
|
||||
- return PTR_ERR(priv->rstc);
|
||||
- }
|
||||
- } else {
|
||||
- priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset",
|
||||
- GPIOD_OUT_LOW);
|
||||
- if (IS_ERR(priv->reset)) {
|
||||
- dev_err(&mdiodev->dev, "Couldn't get our reset line\n");
|
||||
- return PTR_ERR(priv->reset);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (priv->id == ID_MT7530) {
|
||||
- priv->core_pwr = devm_regulator_get(&mdiodev->dev, "core");
|
||||
- if (IS_ERR(priv->core_pwr))
|
||||
- return PTR_ERR(priv->core_pwr);
|
||||
-
|
||||
- priv->io_pwr = devm_regulator_get(&mdiodev->dev, "io");
|
||||
- if (IS_ERR(priv->io_pwr))
|
||||
- return PTR_ERR(priv->io_pwr);
|
||||
- }
|
||||
-
|
||||
- regmap_config = devm_kzalloc(&mdiodev->dev, sizeof(*regmap_config),
|
||||
- GFP_KERNEL);
|
||||
- if (!regmap_config)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- regmap_config->reg_bits = 16;
|
||||
- regmap_config->val_bits = 32;
|
||||
- regmap_config->reg_stride = 4;
|
||||
- regmap_config->max_register = MT7530_CREV;
|
||||
- regmap_config->disable_locking = true;
|
||||
- priv->regmap = devm_regmap_init(priv->dev, &mt7530_regmap_bus,
|
||||
- priv->bus, regmap_config);
|
||||
- if (IS_ERR(priv->regmap))
|
||||
- return PTR_ERR(priv->regmap);
|
||||
-
|
||||
- if (priv->id == ID_MT7531) {
|
||||
- ret = mt7531_create_sgmii(priv);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- return dsa_register_switch(priv->ds);
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
+void
|
||||
mt7530_remove_common(struct mt7530_priv *priv)
|
||||
{
|
||||
if (priv->irq)
|
||||
@@ -3274,57 +3074,6 @@ mt7530_remove_common(struct mt7530_priv
|
||||
mutex_destroy(&priv->reg_mutex);
|
||||
}
|
||||
|
||||
-static void
|
||||
-mt7530_remove(struct mdio_device *mdiodev)
|
||||
-{
|
||||
- struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||
- int ret = 0, i;
|
||||
-
|
||||
- if (!priv)
|
||||
- return;
|
||||
-
|
||||
- ret = regulator_disable(priv->core_pwr);
|
||||
- if (ret < 0)
|
||||
- dev_err(priv->dev,
|
||||
- "Failed to disable core power: %d\n", ret);
|
||||
-
|
||||
- ret = regulator_disable(priv->io_pwr);
|
||||
- if (ret < 0)
|
||||
- dev_err(priv->dev, "Failed to disable io pwr: %d\n",
|
||||
- ret);
|
||||
-
|
||||
- mt7530_remove_common(priv);
|
||||
-
|
||||
- for (i = 0; i < 2; ++i)
|
||||
- mtk_pcs_lynxi_destroy(priv->ports[5 + i].sgmii_pcs);
|
||||
-
|
||||
- dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
-}
|
||||
-
|
||||
-static void mt7530_shutdown(struct mdio_device *mdiodev)
|
||||
-{
|
||||
- struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||
-
|
||||
- if (!priv)
|
||||
- return;
|
||||
-
|
||||
- dsa_switch_shutdown(priv->ds);
|
||||
-
|
||||
- dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
-}
|
||||
-
|
||||
-static struct mdio_driver mt7530_mdio_driver = {
|
||||
- .probe = mt7530_probe,
|
||||
- .remove = mt7530_remove,
|
||||
- .shutdown = mt7530_shutdown,
|
||||
- .mdiodrv.driver = {
|
||||
- .name = "mt7530",
|
||||
- .of_match_table = mt7530_of_match,
|
||||
- },
|
||||
-};
|
||||
-
|
||||
-mdio_module_driver(mt7530_mdio_driver);
|
||||
-
|
||||
MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");
|
||||
MODULE_DESCRIPTION("Driver for Mediatek MT7530 Switch");
|
||||
MODULE_LICENSE("GPL");
|
||||
--- a/drivers/net/dsa/mt7530.h
|
||||
+++ b/drivers/net/dsa/mt7530.h
|
||||
@@ -807,4 +807,10 @@ static inline void INIT_MT7530_DUMMY_POL
|
||||
p->reg = reg;
|
||||
}
|
||||
|
||||
+int mt7530_probe_common(struct mt7530_priv *priv);
|
||||
+void mt7530_remove_common(struct mt7530_priv *priv);
|
||||
+
|
||||
+extern const struct dsa_switch_ops mt7530_switch_ops;
|
||||
+extern const struct mt753x_info mt753x_table[];
|
||||
+
|
||||
#endif /* __MT7530_H */
|
||||
@@ -0,0 +1,47 @@
|
||||
From 54d4147a121cec5004a673a58572da346e4458f8 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 3 Apr 2023 02:19:28 +0100
|
||||
Subject: [PATCH 15/16] net: dsa: mt7530: skip locking if MDIO bus isn't
|
||||
present
|
||||
|
||||
As MT7530 and MT7531 internally use 32-bit wide registers, each access
|
||||
to any register of the switch requires several operations on the MDIO
|
||||
bus. Hence if there is congruent access, e.g. due to PCS or PHY
|
||||
polling, this can mess up and interfere with another ongoing register
|
||||
access sequence.
|
||||
|
||||
However, the MDIO bus mutex is only relevant for MDIO-connected
|
||||
switches. Prepare switches which have there registers directly mapped
|
||||
into the SoCs register space via MMIO which do not require such
|
||||
locking. There we can simply use regmap's default locking mechanism.
|
||||
|
||||
Hence guard mutex operations to only be performed in case of MDIO
|
||||
connected switches.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -144,13 +144,15 @@ err:
|
||||
static void
|
||||
mt7530_mutex_lock(struct mt7530_priv *priv)
|
||||
{
|
||||
- mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
+ if (priv->bus)
|
||||
+ mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
}
|
||||
|
||||
static void
|
||||
mt7530_mutex_unlock(struct mt7530_priv *priv)
|
||||
{
|
||||
- mutex_unlock(&priv->bus->mdio_lock);
|
||||
+ if (priv->bus)
|
||||
+ mutex_unlock(&priv->bus->mdio_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user