diff --git a/.clang-format b/.clang-format index 940f22994b8f7..11054457bc365 100644 --- a/.clang-format +++ b/.clang-format @@ -99,6 +99,7 @@ IndentCaseLabels: false IndentGotoLabels: false IndentWidth: 8 InsertBraces: true +InsertNewlineAtEOF: true SpaceBeforeInheritanceColon: False SpaceBeforeParens: ControlStatementsExceptControlMacros SortIncludes: Never diff --git a/.github/ISSUE_TEMPLATE/007_ext-source.md b/.github/ISSUE_TEMPLATE/007_ext-source.md index 835450cd507e0..2b6eb4cebb9f5 100644 --- a/.github/ISSUE_TEMPLATE/007_ext-source.md +++ b/.github/ISSUE_TEMPLATE/007_ext-source.md @@ -49,6 +49,15 @@ required to maintain ...) Why is this the right component to solve it (e.g., SQLite is small, easy to use, and has a very liberal license.) +## Security + +Does this component include any cryptographic functionality? +If so, please describe the cryptographic algorithms and protocols used. + +How does this component handle security vulnerabilities and updates? +Are there any known vulnerabilities in this component? If so, please +provide details and references to any CVEs or security advisories. + ## Dependencies What other components does this package depend on? diff --git a/.github/SECURITY.md b/.github/SECURITY.md index ba2dedb99e499..ffbaf1a6b622b 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -11,9 +11,9 @@ updates: At this time, with the latest release of v4.0, the supported versions are: - - v4.0: Current release - - v3.7: Prior release and Current LTS - - v2.7: Prior LTS + - v4.1: Current release + - v4.0: Prior release + - v3.7: Current LTS ## Reporting process diff --git a/.github/codeql/codeql-actions-config.yml b/.github/codeql/codeql-actions-config.yml new file mode 100644 index 0000000000000..4076bfd99c5aa --- /dev/null +++ b/.github/codeql/codeql-actions-config.yml @@ -0,0 +1,2 @@ +paths: + - .github diff --git a/.github/codeql/codeql-js-config.yml b/.github/codeql/codeql-js-config.yml new file mode 100644 index 0000000000000..6503a1fa80c91 --- /dev/null +++ b/.github/codeql/codeql-js-config.yml @@ -0,0 +1,2 @@ +paths: + - doc diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a880296ea6d58..fc85287baa7a0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,5 @@ version: 2 +enable-beta-ecosystems: true updates: - package-ecosystem: "github-actions" directory: "/" @@ -11,3 +12,15 @@ updates: actions-deps: patterns: - "*" + + - package-ecosystem: "uv" + directory: "/doc" + schedule: + interval: "weekly" + commit-message: + prefix: "ci: doc: " + labels: [] + groups: + doc-deps: + patterns: + - "*" diff --git a/.github/workflows/assigner.yml b/.github/workflows/assigner.yml index be3696c4d3055..3e5988fc698cf 100644 --- a/.github/workflows/assigner.yml +++ b/.github/workflows/assigner.yml @@ -15,23 +15,36 @@ on: types: - labeled +permissions: + contents: read + jobs: assignment: name: Pull Request Assignment if: github.event.pull_request.draft == false - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + permissions: + pull-requests: write # to add assignees to pull requests + issues: write # to add assignees to issues steps: - - name: Install Python dependencies - run: | - pip install -U PyGithub>=1.55 west - - name: Check out source code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes - name: Run assignment script env: - GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | FLAGS="-v" FLAGS+=" -o ${{ github.event.repository.owner.login }}" diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 5e28332c2a2d2..3ecf66b17da9c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -7,10 +7,17 @@ on: branches: - main +permissions: + contents: read + jobs: backport: name: Backport - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + permissions: + contents: write # to create/push backport branches + pull-requests: write # to create backport PRs + issues: write # to add labels to issue created if backport fails # Only react to merged PRs for security reasons. # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. if: > @@ -24,8 +31,8 @@ jobs: ) steps: - name: Backport - uses: zephyrproject-rtos/action-backport@v2.0.3-3 + uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3 with: - github_token: ${{ secrets.ZB_GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} issue_labels: Backport labels_template: '["Backport"]' diff --git a/.github/workflows/backport_issue_check.yml b/.github/workflows/backport_issue_check.yml index 2d2c4fda6a8b8..a285113aad209 100644 --- a/.github/workflows/backport_issue_check.yml +++ b/.github/workflows/backport_issue_check.yml @@ -10,29 +10,41 @@ on: branches: - v*-branch +permissions: + contents: read + jobs: backport: name: Backport Issue Check concurrency: group: backport-issue-check-${{ github.ref }} cancel-in-progress: true - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.repository == 'zephyrproject-rtos/zephyr' + permissions: + issues: read # to check if associated issue exists for backport steps: - name: Check out source code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt - - name: Install Python dependencies + - name: Install Python packages run: | - pip install -U pygithub + pip install -r scripts/requirements-actions.txt --require-hashes - name: Run backport issue checker env: - GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ./scripts/release/list_backports.py \ - -o ${{ github.event.repository.owner.login }} \ - -r ${{ github.event.repository.name }} \ - -b ${{ github.event.pull_request.base.ref }} \ - -p ${{ github.event.pull_request.number }} + -o ${{ github.event.repository.owner.login }} \ + -r ${{ github.event.repository.name }} \ + -b ${{ github.event.pull_request.base.ref }} \ + -p ${{ github.event.pull_request.number }} diff --git a/.github/workflows/bsim-tests-publish.yaml b/.github/workflows/bsim-tests-publish.yaml index 5a4fbc0b39fff..1cb30f2cfa9ed 100644 --- a/.github/workflows/bsim-tests-publish.yaml +++ b/.github/workflows/bsim-tests-publish.yaml @@ -5,20 +5,26 @@ on: workflows: ["BabbleSim Tests"] types: - completed + +permissions: + contents: read + jobs: bsim-test-results: name: "Publish BabbleSim Test Results" - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.event.workflow_run.conclusion != 'skipped' + permissions: + checks: write # to create the check run entry with test results steps: - name: Download artifacts - uses: dawidd6/action-download-artifact@v8 + uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9 with: run_id: ${{ github.event.workflow_run.id }} - name: Publish BabbleSim Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 + uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0 with: check_name: BabbleSim Test Results comment_mode: off diff --git a/.github/workflows/bsim-tests.yaml b/.github/workflows/bsim-tests.yaml index 66d47c68a1c24..ed6ca0c766137 100644 --- a/.github/workflows/bsim-tests.yaml +++ b/.github/workflows/bsim-tests.yaml @@ -27,6 +27,10 @@ on: - "include/zephyr/net/ieee802154*" - "drivers/serial/*nrfx*" - "tests/drivers/uart/**" + - '!**.rst' + +permissions: + contents: read concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} @@ -45,6 +49,9 @@ jobs: BSIM_OUT_PATH: /opt/bsim/ BSIM_COMPONENTS_PATH: /opt/bsim/components EDTT_PATH: ../tools/edtt + permissions: + checks: write # to create the check run entry with test results + steps: - name: Apply container owner mismatch workaround run: | @@ -67,7 +74,7 @@ jobs: git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 @@ -91,7 +98,7 @@ jobs: echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV - name: Check common triggering files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3 id: check-common-files with: files: | @@ -110,7 +117,7 @@ jobs: modules/hal_nordic/** - name: Check if Bluethooth files changed - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3 id: check-bluetooth-files with: files: | @@ -119,7 +126,7 @@ jobs: subsys/bluetooth/ - name: Check if Networking files changed - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3 id: check-networking-files with: files: | @@ -132,7 +139,7 @@ jobs: include/zephyr/net/ieee802154* - name: Check if UART files changed - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3 id: check-uart-files with: files: | @@ -172,13 +179,12 @@ jobs: - name: Merge Test Results run: | - pip install junitparser junit2html junitparser merge --glob "./bsim_*/*bsim_results.*.xml" "./twister-out/twister.xml" junit.xml junit2html junit.xml junit.html - name: Upload Unit Test Results in HTML if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: HTML Unit Test Results if-no-files-found: ignore @@ -186,7 +192,7 @@ jobs: junit.html - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 + uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0 with: check_name: Bsim Test Results files: "junit.xml" @@ -194,7 +200,7 @@ jobs: - name: Upload Event Details if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: event path: | diff --git a/.github/workflows/bug_snapshot.yaml b/.github/workflows/bug_snapshot.yaml index f10dc718b6eb2..e4cc5b7fddabd 100644 --- a/.github/workflows/bug_snapshot.yaml +++ b/.github/workflows/bug_snapshot.yaml @@ -13,19 +13,30 @@ on: # Run daily at 14:05 - cron: '5 14 * * *' +permissions: + contents: read + jobs: make_bugs_pickle: name: Make bugs pickle - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.repository_owner == 'zephyrproject-rtos' steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt - - name: Install Python dependencies + - name: Install Python packages run: | - pip install -U pygithub + pip install -r scripts/requirements-actions.txt --require-hashes + - name: Snapshot bugs env: @@ -41,7 +52,7 @@ jobs: echo "BUGS_PICKLE_PATH=${BUGS_PICKLE_PATH}" >> ${GITHUB_ENV} - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 with: aws-access-key-id: ${{ vars.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml new file mode 100644 index 0000000000000..2e085c2bb3602 --- /dev/null +++ b/.github/workflows/clang.yaml @@ -0,0 +1,180 @@ +name: Build with Clang/LLVM +on: + push: + branches: + - main + - v*-branch + - collab-* +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + clang-build: + if: github.repository_owner == 'zephyrproject-rtos' + runs-on: + group: zephyr-runner-v2-linux-x64-4xlarge + container: + image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026 + options: '--entrypoint /bin/bash' + strategy: + fail-fast: false + matrix: + subset: [1, 2] + env: + CCACHE_DIR: /node-cache/ccache-zephyr + CCACHE_REMOTE_STORAGE: "redis://cache-*.keydb-cache.svc.cluster.local|shards=1,2,3" + CCACHE_REMOTE_ONLY: "true" + CCACHE_IGNOREOPTIONS: '-specs=* --specs=*' + LLVM_TOOLCHAIN_PATH: /usr/lib/llvm-16 + BASE_REF: ${{ github.base_ref }} + steps: + - name: Apply container owner mismatch workaround + run: | + # FIXME: The owner UID of the GITHUB_WORKSPACE directory may not + # match the container user UID because of the way GitHub + # Actions runner is implemented. Remove this workaround when + # GitHub comes up with a fundamental fix for this problem. + git config --global --add safe.directory ${GITHUB_WORKSPACE} + + - name: Print cloud service information + run: | + echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}" + echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}" + echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}" + + - name: Clone cached Zephyr repository + continue-on-error: true + run: | + git clone --shared /repo-cache/zephyrproject/zephyr . + git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} + + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Environment Setup + run: | + echo "$HOME/.local/bin" >> $GITHUB_PATH + git config --global user.email "bot@zephyrproject.org" + git config --global user.name "Zephyr Bot" + rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" + git clean -f -d + git log --pretty=oneline | head -n 10 + west init -l . || true + west config --global update.narrow true + west config manifest.group-filter -- +ci,+optional + # In some cases modules are left in a state where they can't be + # updated (i.e. when we cancel a job and the builder is killed), + # So first retry to update, if that does not work, remove all modules + # and start over. (Workaround until we implement more robust module + # west caching). + west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.log || west update --path-cache /repo-cache/zephyrproject 2>&1 1> west2.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /repo-cache/zephyrproject) + + echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV + + - name: Check Environment + run: | + cmake --version + ${LLVM_TOOLCHAIN_PATH}/bin/clang --version + gcc --version + ls -la + + - name: Set up ccache + run: | + mkdir -p ${CCACHE_DIR} + ccache -M 10G + ccache -p + ccache -z -s -vv + + - name: Update BabbleSim to manifest revision + run: | + export BSIM_VERSION=$( west list bsim -f {revision} ) + echo "Manifest points to bsim sha $BSIM_VERSION" + cd /opt/bsim_west/bsim + git fetch -n origin ${BSIM_VERSION} + git -c advice.detachedHead=false checkout ${BSIM_VERSION} + west update + make everything -s -j 8 + + - name: Run Tests with Twister + id: twister + run: | + export ZEPHYR_BASE=${PWD} + export ZEPHYR_TOOLCHAIN_VARIANT=llvm + + ./scripts/twister -p native_sim --no-detailed-test-id --force-color --inline-logs -M -N -v --retry-failed 2 \ + -T tests --subset ${{matrix.subset}}/2 -j 16 + + - name: Print ccache stats + if: always() + run: | + ccache -s -vv + + - name: Upload Unit Test Results + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: Unit Test Results (Subset ${{ matrix.subset }}) + path: | + twister-out/twister.xml + twister-out/twister.json + if-no-files-found: ignore + + clang-build-results: + name: "Publish Unit Tests Results" + needs: clang-build + runs-on: ubuntu-24.04 + permissions: + checks: write # to create GitHub annotations + if: (success() || failure()) + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Download Artifacts + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + with: + path: artifacts + + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + + - name: Merge Test Results + run: | + junitparser merge artifacts/*/twister.xml junit.xml + junit2html junit.xml junit-clang.html + + - name: Upload Unit Test Results in HTML + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: HTML Unit Test Results + if-no-files-found: ignore + path: | + junit-clang.html + + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0 + if: always() + with: + check_name: Unit Test Results + files: "**/twister.xml" + comment_mode: off diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 5707610ae87b9..74ca259c91fa2 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -4,6 +4,9 @@ on: schedule: - cron: '25 06,18 * * *' +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} cancel-in-progress: true @@ -61,10 +64,21 @@ jobs: git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + - name: west setup run: | west init -l . || true @@ -85,24 +99,13 @@ jobs: ccache -p ccache -z -s -vv - - name: Update BabbleSim to manifest revision - run: | - export BSIM_VERSION=$( west list bsim -f {revision} ) - echo "Manifest points to bsim sha $BSIM_VERSION" - cd /opt/bsim_west/bsim - git fetch -n origin ${BSIM_VERSION} - git -c advice.detachedHead=false checkout ${BSIM_VERSION} - west update - make everything -s -j 8 - - name: Run Tests with Twister (Push) continue-on-error: true run: | export ZEPHYR_BASE=${PWD} export ZEPHYR_TOOLCHAIN_VARIANT=zephyr mkdir -p coverage/reports - pip install gcovr==6.0 - ./scripts/twister -E ${{matrix.normalized}}-testplan.json + ./scripts/twister --save-tests ${{matrix.normalized}}-testplan.json ls -la ./scripts/twister \ -i --force-color -N -v --filter runnable -p ${{ matrix.platform }} --coverage \ @@ -121,7 +124,7 @@ jobs: - name: Upload Coverage Results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: Coverage Data (Subset ${{ matrix.normalized }}) path: | @@ -131,18 +134,29 @@ jobs: codecov-results: name: "Publish Coverage Results" needs: codecov - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # the codecov job might be skipped, we don't need to run this job then if: success() || failure() steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + - name: Download Artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: path: coverage/reports @@ -182,7 +196,6 @@ jobs: - name: Merge coverage files run: | pushd ./coverage/reports - pip install gcovr==6.0 gcovr ${{ steps.get-coverage-files.outputs.mergefiles }} --merge-mode-functions=separate --json merged.json gcovr ${{ steps.get-coverage-files.outputs.mergefiles }} --merge-mode-functions=separate --cobertura merged.xml popd @@ -198,7 +211,6 @@ jobs: - name: Generate Coverage Report if: always() run: | - pip install xlsxwriter ijson python3 ./scripts/ci/coverage/coverage_analysis.py \ -t native_sim-testplan.json \ -m MAINTAINERS.yml \ @@ -209,7 +221,7 @@ jobs: - name: Upload Merged Coverage Results and Report if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: Coverage Data and report path: | @@ -220,7 +232,7 @@ jobs: - name: Upload coverage to Codecov if: always() - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 with: env_vars: OS,PYTHON fail_ci_if_error: false diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000000..f9295f68cd719 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,58 @@ +name: "CodeQL" + +on: + push: + branches: + - main + - v*-branch + - collab-* + schedule: + - cron: '34 16 * * 3' + pull_request: + branches: + - main + - v*-branch + - collab-* + +permissions: + contents: read +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-24.04 + permissions: + security-events: write + strategy: + fail-fast: false + matrix: + include: + - language: python + build-mode: none + - language: actions + build-mode: none + config: ./.github/codeql/codeql-actions-config.yml + - language: javascript-typescript + build-mode: none + config: ./.github/codeql/codeql-js-config.yml + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + queries: security-extended + config-file: ${{ matrix.config }} + + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo "nothing yet" + exit 0 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/coding_guidelines.yml b/.github/workflows/coding_guidelines.yml index 81c20b372d9a7..cf3d7182f18f5 100644 --- a/.github/workflows/coding_guidelines.yml +++ b/.github/workflows/coding_guidelines.yml @@ -2,27 +2,30 @@ name: Coding Guidelines on: pull_request +permissions: + contents: read + jobs: compliance_job: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 name: Run coding guidelines checks on patch series (PR) steps: - name: Checkout the code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - - name: cache-pip - uses: actions/cache@v4 + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/coding_guidelines.yml') }} + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt - - name: Install python dependencies + - name: Install Python packages run: | - pip install unidiff - pip install sh + pip install -r scripts/requirements-actions.txt --require-hashes - name: Install Packages run: | diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 1875de7cb7e8e..12f2601c01642 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -8,9 +8,12 @@ on: - reopened - synchronize +permissions: + contents: read + jobs: check_compliance: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 name: Run compliance checks on patch series (PR) steps: - name: Update PATH for west @@ -18,7 +21,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Checkout the code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 @@ -41,20 +44,15 @@ jobs: git log --pretty=oneline | head -n 10 - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: cache-pip - uses: actions/cache@v4 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/compliance.yml') }} + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt - - name: Install python dependencies + - name: Install Python packages run: | - pip install -r scripts/requirements-compliance.txt - pip install west + pip install -r scripts/requirements-actions.txt --require-hashes - name: west setup run: | @@ -62,14 +60,6 @@ jobs: west config manifest.group-filter -- +ci,-optional west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log - - name: Check for PR description - if: ${{ github.event.pull_request.body == '' }} - continue-on-error: true - id: pr_description - run: | - echo "Pull request description cannot be empty." - exit 1 - - name: Run Compliance Tests continue-on-error: true id: compliance @@ -82,11 +72,15 @@ jobs: git log --pretty=oneline | head -n 10 # Increase rename limit to allow for large PRs git config diff.renameLimit 10000 - ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat \ - -c origin/${BASE_REF}.. + excludes="-e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat" + # The signed-off-by check for dependabot should be skipped + if [ "${{ github.actor }}" == "dependabot[bot]" ]; then + excludes="$excludes -e Identity" + fi + ./scripts/ci/check_compliance.py --annotate $excludes -c origin/${BASE_REF}.. - name: upload-results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 continue-on-error: true with: name: compliance.xml diff --git a/.github/workflows/daily_test_version.yml b/.github/workflows/daily_test_version.yml index 3a43ac643008d..02eef3c776f6f 100644 --- a/.github/workflows/daily_test_version.yml +++ b/.github/workflows/daily_test_version.yml @@ -10,28 +10,38 @@ on: branches: - refs/tags/* +permissions: + contents: read + jobs: get_version: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.repository == 'zephyrproject-rtos/zephyr' steps: - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 with: aws-access-key-id: ${{ vars.AWS_TESTING_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_TESTING_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - name: install-pip - run: | - pip install gitpython - - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + - name: Upload to AWS S3 run: | python3 scripts/ci/version_mgr.py --update . diff --git a/.github/workflows/devicetree_checks.yml b/.github/workflows/devicetree_checks.yml index 345eb5b7db08e..00a498bbc4594 100644 --- a/.github/workflows/devicetree_checks.yml +++ b/.github/workflows/devicetree_checks.yml @@ -20,6 +20,9 @@ on: - 'scripts/dts/**' - '.github/workflows/devicetree_checks.yml' +permissions: + contents: read + jobs: devicetree-checks: name: Devicetree script tests @@ -30,39 +33,19 @@ jobs: os: [ubuntu-22.04, macos-14, windows-2022] steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: ${{ matrix.python-version }} - - name: cache-pip-linux - if: startsWith(runner.os, 'Linux') - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }} - - name: cache-pip-mac - if: startsWith(runner.os, 'macOS') - uses: actions/cache@v4 - with: - path: ~/Library/Caches/pip - # Trailing '-' was just to get a different cache name - key: ${{ runner.os }}-pip-${{ matrix.python-version }}- - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- - - name: cache-pip-win - if: startsWith(runner.os, 'Windows') - uses: actions/cache@v4 - with: - path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }} - - name: install python dependencies + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages run: | - pip install pytest pyyaml tox + pip install -r scripts/requirements-actions.txt --require-hashes + - name: run tox working-directory: scripts/dts/python-devicetree run: | diff --git a/.github/workflows/do_not_merge.yml b/.github/workflows/do_not_merge.yml deleted file mode 100644 index 8d90efa981de0..0000000000000 --- a/.github/workflows/do_not_merge.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Do Not Merge - -on: - pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] - -jobs: - do-not-merge: - name: Prevent Merging - runs-on: ubuntu-22.04 - steps: - - name: Check for label - if: ${{ contains(github.event.*.labels.*.name, 'DNM') || - contains(github.event.*.labels.*.name, 'DNM (manifest)') || - contains(github.event.*.labels.*.name, 'TSC') || - contains(github.event.*.labels.*.name, 'Architecture Review') || - contains(github.event.*.labels.*.name, 'dev-review') }} - run: | - echo "Pull request is labeled as 'DNM', 'TSC', 'Architecture Review' or 'dev-review'." - echo "This workflow fails so that the pull request cannot be merged." - exit 1 diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index d263c1c80b6e2..144f872e5f588 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -11,33 +11,28 @@ on: - v* pull_request: +permissions: + contents: read + env: - # NOTE: west docstrings will be extracted from the version listed here - WEST_VERSION: 1.2.0 - # The latest CMake available directly with apt is 3.18, but we need >=3.20 - # so we fetch that through pip. - CMAKE_VERSION: 3.20.5 DOXYGEN_VERSION: 1.12.0 - # Job count is set to 2 less than the vCPU count of 16 because the total available RAM is 32GiB - # and each sphinx-build process may use more than 2GiB of RAM. - JOB_COUNT: 14 + DOXYGEN_MD5SUM: fd96a5defa535dfe2e987b46540844a4 + JOB_COUNT: 4 jobs: doc-file-check: name: Check for doc changes - runs-on: ubuntu-22.04 - if: > - github.repository_owner == 'zephyrproject-rtos' + runs-on: ubuntu-24.04 outputs: file_check: ${{ steps.check-doc-files.outputs.any_modified }} steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Check if Documentation related files changed - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3 id: check-doc-files with: files: | @@ -48,7 +43,6 @@ jobs: kernel/include/kernel_arch_interface.h lib/libc/** subsys/testsuite/ztest/include/** - tests/ **/Kconfig* west.yml scripts/dts/ @@ -61,9 +55,8 @@ jobs: name: "Documentation Build (HTML)" needs: [doc-file-check] if: > - github.repository_owner == 'zephyrproject-rtos' && - ( needs.doc-file-check.outputs.file_check == 'true' || github.event_name != 'pull_request' ) - runs-on: ubuntu-22.04 + needs.doc-file-check.outputs.file_check == 'true' || github.event_name != 'pull_request' + runs-on: ubuntu-24.04 timeout-minutes: 90 concurrency: group: doc-build-html-${{ github.ref }} @@ -75,15 +68,21 @@ jobs: sudo apt-get update sudo apt-get install -y wget python3-pip git ninja-build graphviz lcov wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" + echo "${DOXYGEN_MD5SUM} doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" | md5sum -c + if [ $? -ne 0 ]; then + echo "Failed to verify doxygen tarball" + exit 1 + fi sudo tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt echo "/opt/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH echo "${HOME}/.local/bin" >> $GITHUB_PATH - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 + path: zephyr - name: Rebase if: github.event_name == 'pull_request' @@ -91,6 +90,7 @@ jobs: env: BASE_REF: ${{ github.base_ref }} PR_HEAD: ${{ github.event.pull_request.head.sha }} + working-directory: zephyr run: | git config --global user.email "actions@zephyrproject.org" git config --global user.name "Github Actions" @@ -100,25 +100,27 @@ jobs: git clean -f -d git log --graph --oneline HEAD...${PR_HEAD} - - name: cache-pip - uses: actions/cache@v4 + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: - path: ~/.cache/pip - key: pip-${{ hashFiles('doc/requirements.txt') }} + python-version: 3.12 + cache: pip + cache-dependency-path: doc/requirements.txt - - name: install-pip - run: | - pip install -r doc/requirements.txt - pip install west==${WEST_VERSION} - pip install cmake==${CMAKE_VERSION} - pip install coverxygen + - name: Setup Zephyr project + uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6 + with: + app-path: zephyr + toolchains: 'all' - - name: west setup + - name: install-pip + working-directory: zephyr run: | - west init -l . + pip install -r doc/requirements.txt --require-hashes - name: build-docs shell: bash + working-directory: zephyr run: | if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then DOC_TAG="release" @@ -144,22 +146,23 @@ jobs: genhtml --no-function-coverage --no-branch-coverage new.info -o coverage-report - name: compress-docs + working-directory: zephyr run: | tar --use-compress-program="xz -T0" -cf html-output.tar.xz --exclude html/_sources --exclude html/doxygen/xml --directory=doc/_build html tar --use-compress-program="xz -T0" -cf api-output.tar.xz --directory=doc/_build html/doxygen/html tar --use-compress-program="xz -T0" -cf api-coverage.tar.xz coverage-report - name: upload-build - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: html-output - path: html-output.tar.xz + path: zephyr/html-output.tar.xz - name: upload-api-coverage - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: api-coverage - path: api-coverage.tar.xz + path: zephyr/api-coverage.tar.xz - name: process-pr if: github.event_name == 'pull_request' @@ -176,7 +179,7 @@ jobs: echo "API Coverage Report will be available shortly at: ${API_COVERAGE_URL}" >> $GITHUB_STEP_SUMMARY - name: upload-pr-number - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: github.event_name == 'pull_request' with: name: pr_num @@ -186,52 +189,56 @@ jobs: name: "Documentation Build (PDF)" needs: [doc-file-check] if: | - github.event_name != 'pull_request' && - github.repository_owner == 'zephyrproject-rtos' - runs-on: ubuntu-22.04 - container: texlive/texlive:latest + github.event_name != 'pull_request' + runs-on: ubuntu-24.04 timeout-minutes: 120 concurrency: group: doc-build-pdf-${{ github.ref }} cancel-in-progress: true steps: - - name: Apply container owner mismatch workaround - run: | - git config --global --add safe.directory ${GITHUB_WORKSPACE} - - name: checkout - uses: actions/checkout@v4 - - - name: install-pkgs - run: | - apt-get update - apt-get install -y python3-pip python3-venv ninja-build doxygen graphviz librsvg2-bin imagemagick + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: zephyr - - name: cache-pip - uses: actions/cache@v4 + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: - path: ~/.cache/pip - key: pip-${{ hashFiles('doc/requirements.txt') }} + python-version: 3.12 + cache: pip + cache-dependency-path: doc/requirements.txt - - name: setup-venv + - name: install-pkgs run: | - python3 -m venv .venv - . .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV + sudo apt-get update + sudo apt-get install --no-install-recommends graphviz librsvg2-bin \ + texlive-latex-base texlive-latex-extra latexmk \ + texlive-fonts-recommended texlive-fonts-extra texlive-xetex \ + imagemagick fonts-noto xindy + wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" + echo "${DOXYGEN_MD5SUM} doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" | md5sum -c + if [ $? -ne 0 ]; then + echo "Failed to verify doxygen tarball" + exit 1 + fi + sudo tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt + echo "/opt/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH - - name: install-pip - run: | - pip install -r doc/requirements.txt - pip install west==${WEST_VERSION} - pip install cmake==${CMAKE_VERSION} + - name: Setup Zephyr project + uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6 + with: + app-path: zephyr + toolchains: 'arm-zephyr-eabi' - - name: west setup + - name: install-pip-pkgs + working-directory: zephyr run: | - west init -l . + pip install -r doc/requirements.txt --require-hashes - name: build-docs shell: bash + working-directory: zephyr continue-on-error: true run: | if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then @@ -247,13 +254,13 @@ jobs: - name: upload-build if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: pdf-output if-no-files-found: ignore path: | - doc/_build/latex/zephyr.pdf - doc/_build/latex/zephyr.log + zephyr/doc/_build/latex/zephyr.pdf + zephyr/doc/_build/latex/zephyr.log doc-build-status-check: if: always() diff --git a/.github/workflows/doc-publish-pr.yml b/.github/workflows/doc-publish-pr.yml index d75bcad785616..54ac20d6ad46a 100644 --- a/.github/workflows/doc-publish-pr.yml +++ b/.github/workflows/doc-publish-pr.yml @@ -10,10 +10,13 @@ on: types: - completed +permissions: + contents: read + jobs: doc-publish: name: Publish Documentation - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: | github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' && @@ -22,7 +25,7 @@ jobs: steps: - name: Download artifacts id: download-artifacts - uses: dawidd6/action-download-artifact@v8 + uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9 with: workflow: doc-build.yml run_id: ${{ github.event.workflow_run.id }} @@ -30,7 +33,7 @@ jobs: - name: Load PR number if: steps.download-artifacts.outputs.found_artifact == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | let fs = require("fs"); @@ -40,7 +43,7 @@ jobs: - name: Check PR number if: steps.download-artifacts.outputs.found_artifact == 'true' id: check-pr - uses: carpentries/actions/check-valid-pr@v0.14.0 + uses: carpentries/actions/check-valid-pr@e27aa6c531dadd357d2aa4c9a21e90849e23e963 # v0.14.0 with: pr: ${{ env.PR_NUM }} sha: ${{ github.event.workflow_run.head_sha }} @@ -63,7 +66,7 @@ jobs: - name: Configure AWS Credentials if: steps.download-artifacts.outputs.found_artifact == 'true' - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 with: aws-access-key-id: ${{ vars.AWS_BUILDS_ZEPHYR_PR_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_PR_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/doc-publish.yml b/.github/workflows/doc-publish.yml index 89349ed669730..89afeb4ed1b90 100644 --- a/.github/workflows/doc-publish.yml +++ b/.github/workflows/doc-publish.yml @@ -13,10 +13,13 @@ on: types: - completed +permissions: + contents: read + jobs: doc-publish: name: Publish Documentation - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: | github.event.workflow_run.event != 'pull_request' && github.event.workflow_run.conclusion == 'success' && @@ -24,7 +27,7 @@ jobs: steps: - name: Download artifacts - uses: dawidd6/action-download-artifact@v8 + uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9 with: workflow: doc-build.yml run_id: ${{ github.event.workflow_run.id }} @@ -37,7 +40,7 @@ jobs: fi - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 with: aws-access-key-id: ${{ vars.AWS_DOCS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_DOCS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/errno.yml b/.github/workflows/errno.yml index d3fe1b0dcae40..a035936216f58 100644 --- a/.github/workflows/errno.yml +++ b/.github/workflows/errno.yml @@ -6,9 +6,12 @@ on: - 'lib/libc/minimal/include/errno.h' - 'scripts/ci/errno.py' +permissions: + contents: read + jobs: check-errno: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: image: ghcr.io/zephyrproject-rtos/ci:v0.27.4 @@ -22,7 +25,7 @@ jobs: git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Environment Setup run: | diff --git a/.github/workflows/footprint-tracking.yml b/.github/workflows/footprint-tracking.yml index 78f761cb545c4..c974b0ded252b 100644 --- a/.github/workflows/footprint-tracking.yml +++ b/.github/workflows/footprint-tracking.yml @@ -16,6 +16,9 @@ on: # same commit - 'v*' +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} cancel-in-progress: true @@ -58,14 +61,24 @@ jobs: run: | sudo apt-get update sudo apt-get install -y python3-venv - pip install -U gitpython - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + - name: Environment Setup run: | echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV @@ -77,7 +90,7 @@ jobs: west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 with: aws-access-key-id: ${{ vars.AWS_TESTING_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_TESTING_SECRET_ACCESS_KEY }} @@ -94,7 +107,6 @@ jobs: run: | python3 -m venv .venv . .venv/bin/activate - pip install awscli aws s3 sync --quiet footprint_data/ s3://testing.zephyrproject.org/footprint_data/ - name: Transform Footprint data to Twister JSON reports @@ -113,7 +125,6 @@ jobs: ELASTICSEARCH_INDEX: ${{ vars.FOOTPRINT_TRACKING_INDEX }} run: | shopt -s globstar - pip install -U elasticsearch run_date=`date --iso-8601=minutes` python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \ --flatten footprint \ diff --git a/.github/workflows/greet_first_time_contributor.yml b/.github/workflows/greet_first_time_contributor.yml index 5f62c03d6def9..ae69fd5cc012a 100644 --- a/.github/workflows/greet_first_time_contributor.yml +++ b/.github/workflows/greet_first_time_contributor.yml @@ -6,14 +6,20 @@ on: pull_request_target: types: [opened, closed] +permissions: + contents: read + jobs: check_for_first_interaction: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.repository == 'zephyrproject-rtos/zephyr' + permissions: + pull-requests: write # to comment on pull requests + issues: write # to comment on issues steps: - - uses: actions/checkout@v4 - - uses: zephyrproject-rtos/action-first-interaction@v1.1.1-zephyr-5 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: zephyrproject-rtos/action-first-interaction@58853996b1ac504b8e0f6964301f369d2bb22e5c # v1.1.1+zephyr.6 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index f267688b1f0a5..8fb8b11597b04 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -16,6 +16,9 @@ on: - '.github/workflows/hello_world_multiplatform.yaml' - 'SDK_VERSION' +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} cancel-in-progress: true @@ -29,7 +32,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: zephyr fetch-depth: 0 @@ -51,12 +54,12 @@ jobs: git log --graph --oneline HEAD...${PR_HEAD} - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: 3.11 - name: Setup Zephyr project - uses: zephyrproject-rtos/action-zephyr-setup@v1 + uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6 with: app-path: zephyr toolchains: all @@ -74,7 +77,7 @@ jobs: - name: Upload artifacts if: failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: if-no-files-found: ignore path: diff --git a/.github/workflows/issue_count.yml b/.github/workflows/issue_count.yml index 7d6ed6dfc3e28..0ab24ef5f6471 100644 --- a/.github/workflows/issue_count.yml +++ b/.github/workflows/issue_count.yml @@ -4,6 +4,9 @@ on: schedule: - cron: '*/10 * * * *' +permissions: + contents: read + env: OUTPUT_FILE_NAME: IssuesReport.md COMMITTER_EMAIL: actions@github.com @@ -14,7 +17,7 @@ env: jobs: track-issues: name: "Collect Issue Stats" - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.repository == 'zephyrproject-rtos/zephyr' steps: @@ -27,7 +30,7 @@ jobs: sudo apt-get update sudo apt-get install discount - - uses: brcrista/summarize-issues@v4 + - uses: brcrista/summarize-issues@54c549b7d38b7db39e5c6e06fd9617e12e5c3491 # v4 with: title: 'Issues Report for ${{ github.repository }}' configPath: 'issues-report-config.json' @@ -35,14 +38,14 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: upload-stats - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 continue-on-error: true with: name: ${{ env.OUTPUT_FILE_NAME }} path: ${{ env.OUTPUT_FILE_NAME }} - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 with: aws-access-key-id: ${{ vars.AWS_TESTING_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_TESTING_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index 7d2d083faae0e..212c76366598d 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -2,22 +2,25 @@ name: Scancode on: [pull_request] +permissions: + contents: read + jobs: scancode_job: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 name: Scan code for licenses steps: - name: Checkout the code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - name: Scan the code id: scancode - uses: zephyrproject-rtos/action_scancode@v4 + uses: zephyrproject-rtos/action_scancode@23ef91ce31cd4b954366a7b71eea47520da9b380 # v4 with: directory-to-scan: 'scan/' - name: Artifact Upload - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: scancode path: ./artifacts diff --git a/.github/workflows/manifest.yml b/.github/workflows/manifest.yml index 8cfd17695afc5..fdd6f75e38cfd 100644 --- a/.github/workflows/manifest.yml +++ b/.github/workflows/manifest.yml @@ -2,33 +2,49 @@ name: Manifest on: pull_request_target: +permissions: + contents: read + jobs: contribs: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + permissions: + pull-requests: write # to create/update pull request comments name: Manifest steps: - name: Checkout the code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: zephyrproject/zephyr ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 persist-credentials: false + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + cd zephyrproject/zephyr + pip install -r scripts/requirements-actions.txt --require-hashes + - name: west setup env: BASE_REF: ${{ github.base_ref }} working-directory: zephyrproject/zephyr run: | - pip install west git config --global user.email "you@example.com" git config --global user.name "Your Name" west init -l . || true - name: Manifest - uses: zephyrproject-rtos/action-manifest@v1.7.0 + uses: zephyrproject-rtos/action-manifest@cb8f6fba6f20b5f8649bd573e80a7583a239894c # v1.7.0 with: - github-token: ${{ secrets.ZB_GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} manifest-path: 'west.yml' checkout-path: 'zephyrproject/zephyr' use-tree-checkout: 'true' diff --git a/.github/workflows/pinned-gh-actions.yml b/.github/workflows/pinned-gh-actions.yml new file mode 100644 index 0000000000000..12ca596322190 --- /dev/null +++ b/.github/workflows/pinned-gh-actions.yml @@ -0,0 +1,19 @@ +name: Check SHA-pinned GitHub Actions + +on: + pull_request: + paths: + - '.github/workflows/**' + +permissions: + contents: read + +jobs: + check-sha-pinned-actions: + name: Verify GitHub Actions + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Ensure SHA pinned actions + uses: zgosalvez/github-actions-ensure-sha-pinned-actions@4830be28ce81da52ec70d65c552a7403821d98d4 # v3.0.23 diff --git a/.github/workflows/pr_metadata_check.yml b/.github/workflows/pr_metadata_check.yml new file mode 100644 index 0000000000000..3564c6352c8fe --- /dev/null +++ b/.github/workflows/pr_metadata_check.yml @@ -0,0 +1,40 @@ +name: PR Metadata Check + +on: + pull_request: + types: + - synchronize + - opened + - reopened + - labeled + - unlabeled + - edited + +permissions: + contents: read + +jobs: + do-not-merge: + name: Prevent Merging + runs-on: ubuntu-24.04 + steps: + - name: Check for label + if: ${{ contains(github.event.*.labels.*.name, 'DNM') || + contains(github.event.*.labels.*.name, 'DNM (manifest)') || + contains(github.event.*.labels.*.name, 'TSC') || + contains(github.event.*.labels.*.name, 'Architecture Review') || + contains(github.event.*.labels.*.name, 'dev-review') }} + run: | + echo "Pull request is labeled as 'DNM', 'TSC', 'Architecture Review' or 'dev-review'." + echo "This workflow fails so that the pull request cannot be merged." + exit 1 + + empty_pr_description: + if: ${{ github.event.pull_request.body == '' }} + name: PR Description + runs-on: ubuntu-24.04 + steps: + - name: Check for PR description + run: | + echo "Pull request description cannot be empty." + exit 1 diff --git a/.github/workflows/pylib_tests.yml b/.github/workflows/pylib_tests.yml index bf9d828921224..29cfd1a52730f 100644 --- a/.github/workflows/pylib_tests.yml +++ b/.github/workflows/pylib_tests.yml @@ -19,6 +19,9 @@ on: - 'scripts/pylib/build_helpers/**' - '.github/workflows/pylib_tests.yml' +permissions: + contents: read + jobs: pylib-tests: name: Misc. Pylib Unit Tests @@ -26,25 +29,21 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13'] - os: [ubuntu-22.04] + os: [ubuntu-24.04] steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: ${{ matrix.python-version }} - - name: cache-pip-linux - if: startsWith(runner.os, 'Linux') - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }} - - name: install-packages + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages run: | - pip install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt + pip install -r scripts/requirements-actions.txt --require-hashes - name: Run pytest for build_helpers env: ZEPHYR_BASE: ./ diff --git a/.github/workflows/ready-to-merge.yml b/.github/workflows/ready-to-merge.yml index 897a604452217..01f08e8a4b671 100644 --- a/.github/workflows/ready-to-merge.yml +++ b/.github/workflows/ready-to-merge.yml @@ -7,6 +7,9 @@ on: type: string required: true +permissions: + contents: read + jobs: all_jobs_passed: name: all jobs passed diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c7e71324c1d25..91f4037a2e2cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,11 +6,16 @@ on: - 'v*' - '!v*rc*' +permissions: + contents: read + jobs: release: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + permissions: + contents: write # to create GitHub release entry steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 @@ -21,12 +26,12 @@ jobs: echo "TRIMMED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - name: REUSE Compliance Check - uses: fsfe/reuse-action@v5 + uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0 with: args: spdx -o zephyr-${{ steps.get_version.outputs.VERSION }}.spdx - name: upload-results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 continue-on-error: true with: name: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx @@ -38,7 +43,7 @@ jobs: - name: Create Release id: create_release - uses: actions/create-release@v1 + uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -50,7 +55,7 @@ jobs: - name: Upload Release Assets id: upload-release-asset - uses: actions/upload-release-asset@v1 + uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index e2325da0a4ac6..d54e76cdcb8c5 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -29,12 +29,12 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 + uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 with: results_file: results.sarif results_format: sarif @@ -47,7 +47,7 @@ jobs: # uploads of run results in SARIF format to the repository Actions tab. # https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts - name: "Upload artifact" - uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: SARIF file path: results.sarif @@ -56,6 +56,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 + uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 with: sarif_file: results.sarif diff --git a/.github/workflows/scripts_tests.yml b/.github/workflows/scripts_tests.yml index 06e12ada528cb..0664dbcebc569 100644 --- a/.github/workflows/scripts_tests.yml +++ b/.github/workflows/scripts_tests.yml @@ -19,6 +19,9 @@ on: - 'scripts/build/**' - '.github/workflows/scripts_tests.yml' +permissions: + contents: read + jobs: scripts-tests: name: Scripts tests @@ -26,10 +29,10 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13'] - os: [ubuntu-20.04] + os: [ubuntu-24.04] steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 @@ -49,22 +52,15 @@ jobs: git log --graph --oneline HEAD...${PR_HEAD} - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: scripts/requirements-actions.txt - - name: cache-pip-linux - if: startsWith(runner.os, 'Linux') - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }} - - - name: install-packages + - name: Install Python packages run: | - pip install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt + pip install -r scripts/requirements-actions.txt --require-hashes - name: Run pytest env: diff --git a/.github/workflows/stale-workflow-queue-cleanup.yml b/.github/workflows/stale-workflow-queue-cleanup.yml index ec1a4cc716fbb..f40d5b928da8a 100644 --- a/.github/workflows/stale-workflow-queue-cleanup.yml +++ b/.github/workflows/stale-workflow-queue-cleanup.yml @@ -7,6 +7,9 @@ on: # everyday at 15:00 - cron: '0 15 * * *' +permissions: + contents: read + concurrency: group: stale-workflow-queue-cleanup cancel-in-progress: true @@ -14,11 +17,13 @@ concurrency: jobs: cleanup: name: Cleanup - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + permissions: + actions: write # to delete stale workflow runs steps: - name: Delete stale queued workflow runs - uses: MajorScruffy/delete-old-workflow-runs@v0.3.0 + uses: MajorScruffy/delete-old-workflow-runs@78b5af714fefaefdf74862181c467b061782719e # v0.3.0 with: repository: ${{ github.repository }} # Remove any workflow runs in "queued" state for more than 1 day diff --git a/.github/workflows/stale_issue.yml b/.github/workflows/stale_issue.yml index f71e485ff8eea..ec59d2641d90e 100644 --- a/.github/workflows/stale_issue.yml +++ b/.github/workflows/stale_issue.yml @@ -3,13 +3,20 @@ on: schedule: - cron: "16 00 * * *" +permissions: + contents: read + jobs: stale: name: Find Stale issues and PRs - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 if: github.repository == 'zephyrproject-rtos/zephyr' + permissions: + pull-requests: write # to comment on stale pull requests + issues: write # to comment on stale issues + steps: - - uses: actions/stale@v9 + - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0 with: stale-pr-message: 'This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you diff --git a/.github/workflows/stats_merged_prs.yml b/.github/workflows/stats_merged_prs.yml index 0f86958e47b7b..bb79f77280177 100644 --- a/.github/workflows/stats_merged_prs.yml +++ b/.github/workflows/stats_merged_prs.yml @@ -6,13 +6,28 @@ on: - main - v*-branch types: [closed] + +permissions: + contents: read + jobs: record_merged: if: github.event.pull_request.merged == true && github.repository == 'zephyrproject-rtos/zephyr' - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + - name: PR event env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -20,5 +35,4 @@ jobs: ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443" PR_STAT_ES_INDEX: ${{ vars.PR_STAT_ES_INDEX }} run: | - pip install pygithub elasticsearch python3 ./scripts/ci/stats/merged_prs.py --pull-request ${{ github.event.pull_request.number }} --repo ${{ github.repository }} diff --git a/.github/workflows/twister-prep.yaml b/.github/workflows/twister-prep.yaml deleted file mode 100644 index 51bc771059d69..0000000000000 --- a/.github/workflows/twister-prep.yaml +++ /dev/null @@ -1,147 +0,0 @@ -name: Prepare For a Twister Run - -on: - workflow_call: - outputs: - subset: - description: subset - value: ${{ jobs.prep_push.outputs.subset != '' && jobs.prep_push.outputs.subset || jobs.prep_pr.outputs.subset }} - size: - description: size - value: ${{ jobs.prep_push.outputs.size != '' && jobs.prep_push.outputs.size || jobs.prep_pr.outputs.size }} - fullrun: - description: fullrun - value: ${{ jobs.prep_push.outputs.fullrun != '' && jobs.prep_push.outputs.fullrun || jobs.prep_pr.outputs.size }} - -jobs: - prep_pr: - if: github.repository_owner == 'zephyrproject-rtos' && github.event_name == 'pull_request_target' - runs-on: - group: zephyr-runner-v2-linux-x64-4xlarge - container: - image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.27.4.20241026 - options: '--entrypoint /bin/bash' - outputs: - subset: ${{ steps.output-services.outputs.subset }} - size: ${{ steps.output-services.outputs.size }} - fullrun: ${{ steps.output-services.outputs.fullrun }} - env: - MATRIX_SIZE: 10 - PUSH_MATRIX_SIZE: 20 - DAILY_MATRIX_SIZE: 80 - BSIM_OUT_PATH: /opt/bsim/ - BSIM_COMPONENTS_PATH: /opt/bsim/components - TESTS_PER_BUILDER: 700 - COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} - BASE_REF: ${{ github.base_ref }} - steps: - - name: Apply container owner mismatch workaround - run: | - # FIXME: The owner UID of the GITHUB_WORKSPACE directory may not - # match the container user UID because of the way GitHub - # Actions runner is implemented. Remove this workaround when - # GitHub comes up with a fundamental fix for this problem. - git config --global --add safe.directory ${GITHUB_WORKSPACE} - - - name: Print cloud service information - run: | - echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}" - echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}" - echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}" - - - name: Clone cached Zephyr repository - continue-on-error: true - run: | - git clone --shared /repo-cache/zephyrproject/zephyr . - git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} - - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - persist-credentials: false - - - name: Environment Setup - run: | - git config --global user.email "bot@zephyrproject.org" - git config --global user.name "Zephyr Bot" - rm -fr ".git/rebase-apply" - rm -fr ".git/rebase-merge" - git rebase origin/${BASE_REF} - git clean -f -d - git log --pretty=oneline | head -n 10 - west init -l . || true - west config manifest.group-filter -- +ci,+optional - west config --global update.narrow true - west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /repo-cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /repo-cache/zephyrproject) - west forall -c 'git reset --hard HEAD' - - echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV - - - name: Generate Test Plan with Twister - id: test-plan - run: | - export ZEPHYR_BASE=${PWD} - export ZEPHYR_TOOLCHAIN_VARIANT=zephyr - python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --no-detailed-test-id --pull-request -t $TESTS_PER_BUILDER - if [ -s .testplan ]; then - cat .testplan >> $GITHUB_ENV - else - echo "TWISTER_NODES=${MATRIX_SIZE}" >> $GITHUB_ENV - fi - rm -f testplan.json .testplan - - - name: Determine matrix size - id: output-services - run: | - if [ -n "${TWISTER_NODES}" ]; then - subset="[$(seq -s',' 1 ${TWISTER_NODES})]" - else - subset="[$(seq -s',' 1 ${MATRIX_SIZE})]" - fi - size=${TWISTER_NODES} - - echo "subset=${subset}" >> $GITHUB_OUTPUT - echo "size=${size}" >> $GITHUB_OUTPUT - echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT - - prep_push: - if: github.repository_owner == 'zephyrproject-rtos' && (github.event_name == 'push' || github.event_name == 'schedule') - runs-on: ubuntu-22.04 - outputs: - subset: ${{ steps.output-services.outputs.subset }} - size: ${{ steps.output-services.outputs.size }} - fullrun: ${{ steps.output-services.outputs.fullrun }} - env: - MATRIX_SIZE: 10 - PUSH_MATRIX_SIZE: 20 - DAILY_MATRIX_SIZE: 80 - BSIM_OUT_PATH: /opt/bsim/ - BSIM_COMPONENTS_PATH: /opt/bsim/components - TESTS_PER_BUILDER: 700 - COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} - BASE_REF: ${{ github.base_ref }} - steps: - - name: Print cloud service information - run: | - echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}" - echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}" - echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}" - - - name: Determine matrix size - id: output-services - run: | - if [ "${{github.event_name}}" = "push" ]; then - subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]" - size=${MATRIX_SIZE} - elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then - subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]" - size=${DAILY_MATRIX_SIZE} - else - size=0 - fi - - echo "subset=${subset}" >> $GITHUB_OUTPUT - echo "size=${size}" >> $GITHUB_OUTPUT - echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/twister-publish.yaml b/.github/workflows/twister-publish.yaml index 77078f8fdbcb3..ceac5a7736bfa 100644 --- a/.github/workflows/twister-publish.yaml +++ b/.github/workflows/twister-publish.yaml @@ -8,26 +8,38 @@ on: types: - completed +permissions: + contents: read + jobs: upload-to-elasticsearch: if: | github.repository == 'zephyrproject-rtos/zephyr' && - github.event.workflow_run.event != 'pull_request_target' + github.event.workflow_run.event != 'pull_request' env: ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }} ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443" - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: # Needed for elasticearch and upload script - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 persist-credentials: false + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes - name: Download Artifacts id: download-artifacts - uses: dawidd6/action-download-artifact@v8 + uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9 with: path: artifacts workflow: twister.yml @@ -37,7 +49,6 @@ jobs: - name: Upload to elasticsearch if: steps.download-artifacts.outputs.found_artifact == 'true' run: | - pip install elasticsearch # set run date on upload to get consistent and unified data across the matrix. run_date=`date --iso-8601=minutes` if [ "${{github.event.workflow_run.event}}" = "push" ]; then diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 668813b5c5199..946cfff778e4f 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -6,14 +6,17 @@ on: - main - v*-branch - collab-* - pull_request_target: + pull_request: branches: - main - v*-branch - collab-* schedule: - # Run at 03:00 UTC on every Sunday - - cron: '0 3 * * 0' + # Run at 17:00 UTC on every Saturday + - cron: '0 17 * * 6' + +permissions: + contents: read concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} @@ -21,7 +24,102 @@ concurrency: jobs: twister-build-prep: - uses: ./.github/workflows/twister-prep.yaml + if: github.repository_owner == 'zephyrproject-rtos' + runs-on: ubuntu-24.04 + outputs: + subset: ${{ steps.output-services.outputs.subset }} + size: ${{ steps.output-services.outputs.size }} + fullrun: ${{ steps.output-services.outputs.fullrun }} + env: + MATRIX_SIZE: 10 + PUSH_MATRIX_SIZE: 20 + WEEKLY_MATRIX_SIZE: 200 + BSIM_OUT_PATH: /opt/bsim/ + BSIM_COMPONENTS_PATH: /opt/bsim/components + TESTS_PER_BUILDER: 900 + COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} + BASE_REF: ${{ github.base_ref }} + steps: + - name: Checkout + if: github.event_name == 'pull_request' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + path: zephyr + persist-credentials: false + + - name: Set up Python + if: github.event_name == 'pull_request' + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: install-packages + working-directory: zephyr + if: github.event_name == 'pull_request' + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + + - name: Setup Zephyr project + if: github.event_name == 'pull_request' + uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6 + with: + app-path: zephyr + toolchains: all + + - name: Environment Setup + working-directory: zephyr + if: github.event_name == 'pull_request' + run: | + git config --global user.email "bot@zephyrproject.org" + git config --global user.name "Zephyr Bot" + rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" + git rebase origin/${BASE_REF} + git clean -f -d + git log --pretty=oneline | head -n 10 + + - name: Generate Test Plan with Twister + working-directory: zephyr + if: github.event_name == 'pull_request' + id: test-plan + run: | + export ZEPHYR_BASE=${PWD} + export ZEPHYR_TOOLCHAIN_VARIANT=zephyr + python3 ./scripts/ci/test_plan.py -c origin/${BASE_REF}.. --no-detailed-test-id --pull-request -t $TESTS_PER_BUILDER + if [ -s .testplan ]; then + cat .testplan >> $GITHUB_ENV + else + echo "TWISTER_NODES=${MATRIX_SIZE}" >> $GITHUB_ENV + fi + rm -f testplan.json .testplan + + - name: Determine matrix size + id: output-services + run: | + if [ "${{github.event_name}}" = "push" ]; then + subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]" + size=${MATRIX_SIZE} + elif [ "${{github.event_name}}" = "pull_request" ]; then + if [ -n "${TWISTER_NODES}" ]; then + subset="[$(seq -s',' 1 ${TWISTER_NODES})]" + else + subset="[$(seq -s',' 1 ${MATRIX_SIZE})]" + fi + size=${TWISTER_NODES} + elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then + subset="[$(seq -s',' 1 ${WEEKLY_MATRIX_SIZE})]" + size=${WEEKLY_MATRIX_SIZE} + else + size=0 + fi + + echo "subset=${subset}" >> $GITHUB_OUTPUT + echo "size=${size}" >> $GITHUB_OUTPUT + echo "fullrun=${TWISTER_FULL}" >> $GITHUB_OUTPUT twister-build: runs-on: @@ -44,10 +142,10 @@ jobs: CCACHE_IGNOREOPTIONS: '-specs=* --specs=*' BSIM_OUT_PATH: /opt/bsim/ BSIM_COMPONENTS_PATH: /opt/bsim/components - TWISTER_COMMON: '--no-detailed-test-id --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 ' - WEEKLY_OPTIONS: ' -M --build-only --all --show-footprint --report-filtered' - PR_OPTIONS: ' --clobber-output --integration' - PUSH_OPTIONS: ' --clobber-output -M --show-footprint --report-filtered' + TWISTER_COMMON: ' --test-config tests/test_config_ci.yaml --no-detailed-test-id --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 ' + WEEKLY_OPTIONS: ' -M --build-only --all --show-footprint --report-filtered -j 32' + PR_OPTIONS: ' --clobber-output --integration -j 16' + PUSH_OPTIONS: ' --clobber-output -M --show-footprint --report-filtered -j 16' COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} LLVM_TOOLCHAIN_PATH: /usr/lib/llvm-16 @@ -73,7 +171,7 @@ jobs: git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 @@ -81,7 +179,7 @@ jobs: - name: Environment Setup run: | - if [ "${{github.event_name}}" = "pull_request_target" ]; then + if [ "${{github.event_name}}" = "pull_request" ]; then git config --global user.email "bot@zephyrproject.org" git config --global user.name "Zephyr Builder" rm -fr ".git/rebase-apply" @@ -143,7 +241,7 @@ jobs: fi fi - - if: github.event_name == 'pull_request_target' + - if: github.event_name == 'pull_request' name: Run Tests with Twister (Pull Request) id: run_twister_pr run: | @@ -180,7 +278,7 @@ jobs: - name: Upload Unit Test Results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: Unit Test Results (Subset ${{ matrix.subset }}) if-no-files-found: ignore @@ -202,7 +300,7 @@ jobs: - if: matrix.subset == 1 && github.event_name == 'push' name: Upload the list of Python packages - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: Frozen PIP package set path: | @@ -212,41 +310,53 @@ jobs: name: "Publish Unit Tests Results" needs: - twister-build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + permissions: + checks: write # to create the check run entry with Twister test results # the build-and-test job might be skipped, we don't need to run this job then if: success() || failure() steps: - name: Check out source code - if: needs.twister-build.result == 'failure' - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 persist-credentials: false + - name: Set up Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: 3.12 + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages + run: | + pip install -r scripts/requirements-actions.txt --require-hashes + - name: Download Artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: path: artifacts - name: Merge Test Results run: | - pip install junitparser junit2html junitparser merge artifacts/*/*/twister.xml junit.xml junit2html junit.xml junit.html - - name: Upload Unit Test Results in HTML + - name: Upload Unit Test Results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: HTML Unit Test Results + name: Unit Test Results if-no-files-found: ignore path: | junit.html + junit.xml - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 + uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0 with: check_name: Unit Test Results files: "**/twister.xml" @@ -263,7 +373,7 @@ jobs: - name: Upload Twister Analysis Results if: needs.twister-build.result == 'failure' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: Twister Analysis Results if-no-files-found: ignore diff --git a/.github/workflows/twister_tests.yml b/.github/workflows/twister_tests.yml index 66409bce8763c..394936a29aa3e 100644 --- a/.github/workflows/twister_tests.yml +++ b/.github/workflows/twister_tests.yml @@ -26,6 +26,9 @@ on: - '.github/workflows/twister_tests.yml' - 'scripts/schemas/twister/' +permissions: + contents: read + jobs: twister-tests: name: Twister Unit Tests @@ -33,25 +36,22 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13'] - os: [ubuntu-22.04] + os: [ubuntu-24.04] steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: ${{ matrix.python-version }} - - name: cache-pip-linux - if: startsWith(runner.os, 'Linux') - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }} - - name: install-packages + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages run: | - pip install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt + pip install -r scripts/requirements-actions.txt --require-hashes + - name: Run pytest for twisterlib env: ZEPHYR_BASE: ./ diff --git a/.github/workflows/twister_tests_blackbox.yml b/.github/workflows/twister_tests_blackbox.yml index cd24a2a39aea6..1e9303e24dd3c 100644 --- a/.github/workflows/twister_tests_blackbox.yml +++ b/.github/workflows/twister_tests_blackbox.yml @@ -15,66 +15,51 @@ on: - 'scripts/tests/twister_blackbox/**' - '.github/workflows/twister_tests_blackbox.yml' +permissions: + contents: read + jobs: twister-tests: name: Twister Black Box Tests - runs-on: ${{ matrix.os }} + runs-on: ubuntu-24.04 strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13'] - os: [ubuntu-22.04] - container: - image: ghcr.io/zephyrproject-rtos/ci:v0.27.4 - steps: - - name: Apply Container Owner Mismatch Workaround - run: | - # FIXME: The owner UID of the GITHUB_WORKSPACE directory may not - # match the container user UID because of the way GitHub - # Actions runner is implemented. Remove this workaround when - # GitHub comes up with a fundamental fix for this problem. - git config --global --add safe.directory ${GITHUB_WORKSPACE} - - name: Checkout - uses: actions/checkout@v4 - - - name: Environment Setup - run: | - echo "$HOME/.local/bin" >> $GITHUB_PATH - - west init -l . || true - # we do not depend on any hals, tools or bootloader, save some time and space... - west config manifest.group-filter -- -hal,-tools,-bootloader,-babblesim - west config manifest.project-filter -- -nrf_hw_models - west config --global update.narrow true - west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject) - west forall -c 'git reset --hard HEAD' - - echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: zephyr + fetch-depth: 0 - name: Set Up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: scripts/requirements-actions.txt - - name: Go Into Venv - shell: bash + - name: install-packages + working-directory: zephyr run: | - python3 -m pip install --user virtualenv - python3 -m venv env - source env/bin/activate - echo "$(which python)" + pip install -r scripts/requirements-actions.txt --require-hashes + sudo apt-get update -y + sudo apt-get install -y lcov - - name: Install Packages - run: | - python3 -m pip install -U -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt + - name: Setup Zephyr project + uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6 + with: + app-path: zephyr + toolchains: all - name: Run Pytest For Twister Black Box Tests + working-directory: zephyr shell: bash env: ZEPHYR_BASE: ./ ZEPHYR_TOOLCHAIN_VARIANT: zephyr run: | + export ZEPHYR_SDK_INSTALL_DIR=${{ github.workspace }}/zephyr-sdk echo "Run twister tests" source zephyr-env.sh - PYTHONPATH="./scripts/tests" pytest ./scripts/tests/twister_blackbox + PYTHONPATH="./scripts/tests" pytest ./scripts/tests/twister_blackbox/ diff --git a/.github/workflows/west_cmds.yml b/.github/workflows/west_cmds.yml index dc75c7578cc64..1756664303d8d 100644 --- a/.github/workflows/west_cmds.yml +++ b/.github/workflows/west_cmds.yml @@ -23,8 +23,11 @@ on: - 'scripts/west_commands/**' - '.github/workflows/west_cmds.yml' +permissions: + contents: read + jobs: - west-commnads: + west-commands: name: West Command Tests runs-on: ${{ matrix.os }} strategy: @@ -33,43 +36,24 @@ jobs: os: [ubuntu-22.04, macos-14, windows-2022] steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 with: python-version: ${{ matrix.python-version }} - - name: cache-pip-linux - if: startsWith(runner.os, 'Linux') - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }} - - name: cache-pip-mac - if: startsWith(runner.os, 'macOS') - uses: actions/cache@v4 - with: - path: ~/Library/Caches/pip - # Trailing '-' was just to get a different cache name - key: ${{ runner.os }}-pip-${{ matrix.python-version }}- - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- - - name: cache-pip-win - if: startsWith(runner.os, 'Windows') - uses: actions/cache@v4 - with: - path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }} - - name: install pytest + cache: pip + cache-dependency-path: scripts/requirements-actions.txt + + - name: Install Python packages run: | - pip install pytest west pyelftools canopen natsort progress mypy intelhex psutil ply pyserial anytree junitparser + pip install -r scripts/requirements-actions.txt --require-hashes + - name: run pytest-win if: runner.os == 'Windows' run: | python ./scripts/west_commands/run_tests.py + - name: run pytest-mac-linux if: runner.os != 'Windows' run: | diff --git a/.gitlint b/.gitlint index e83edce6b6e65..16e9bdca9aaae 100644 --- a/.gitlint +++ b/.gitlint @@ -59,3 +59,7 @@ ignore-merge-commits=false # By specifying this rule, developers can only change the file when they explicitly reference # it in the commit message. #files=gitlint/rules.py,README.md + +[ignore-by-author-name] +regex=^dependabot\[bot\]$ +ignore=all diff --git a/.ruff-excludes.toml b/.ruff-excludes.toml index 269a0c9fcf171..276bdcdd546ce 100644 --- a/.ruff-excludes.toml +++ b/.ruff-excludes.toml @@ -436,24 +436,10 @@ "UP035", # https://docs.astral.sh/ruff/rules/deprecated-import ] "./scripts/dts/python-devicetree/src/devicetree/dtlib.py" = [ - "E701", # https://docs.astral.sh/ruff/rules/multiple-statements-on-one-line-colon - "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports - "SIM201", # https://docs.astral.sh/ruff/rules/negate-equal-op "UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation - "UP035", # https://docs.astral.sh/ruff/rules/deprecated-import - "UP037", # https://docs.astral.sh/ruff/rules/quoted-annotation ] "./scripts/dts/python-devicetree/src/devicetree/edtlib.py" = [ - "B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except - "B905", # https://docs.astral.sh/ruff/rules/zip-without-explicit-strict - "E713", # https://docs.astral.sh/ruff/rules/not-in-test - "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports - "SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if - "SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys "UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation - "UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes - "UP035", # https://docs.astral.sh/ruff/rules/deprecated-import - "UP037", # https://docs.astral.sh/ruff/rules/quoted-annotation ] "./scripts/dts/python-devicetree/src/devicetree/grutils.py" = [ "E501", # https://docs.astral.sh/ruff/rules/line-too-long @@ -828,14 +814,6 @@ "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports "UP026", # https://docs.astral.sh/ruff/rules/deprecated-mock-import ] -"./scripts/tests/twister/test_config_parser.py" = [ - "B017", # https://docs.astral.sh/ruff/rules/assert-raises-exception - "B033", # https://docs.astral.sh/ruff/rules/duplicate-value - "E501", # https://docs.astral.sh/ruff/rules/line-too-long - "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports - "SIM117", # https://docs.astral.sh/ruff/rules/multiple-with-statements - "UP026", # https://docs.astral.sh/ruff/rules/deprecated-mock-import -] "./scripts/tests/twister/test_data/mixins/test_to_ignore.py" = [ "B011", # https://docs.astral.sh/ruff/rules/assert-false ] diff --git a/CMakeLists.txt b/CMakeLists.txt index 16a471ae6ee64..779c533a809ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,15 @@ set(ZEPHYR_CURRENT_LINKER_PASS 0) set(ZEPHYR_CURRENT_LINKER_CMD linker_zephyr_pre${ZEPHYR_CURRENT_LINKER_PASS}.cmd) set(ZEPHYR_LINK_STAGE_EXECUTABLE zephyr_pre${ZEPHYR_CURRENT_LINKER_PASS}) +# Make kconfig variables available to the linker script generator +zephyr_linker_include_generated(KCONFIG ${CMAKE_CURRENT_BINARY_DIR}/.config) + +# The linker generator also needs sections.h to be able to access e.g. _APP_SMEM_SECTION_NAME +# for linkerscripts that do not support c-preprocessing. +zephyr_linker_include_generated(HEADER ${ZEPHYR_BASE}/include/zephyr/linker/sections.h) + +zephyr_linker_include_var(VAR CMAKE_VERBOSE_MAKEFILE VALUE ${CMAKE_VERBOSE_MAKEFILE}) + # ZEPHYR_PREBUILT_EXECUTABLE is used outside of this file, therefore keep the # existing variable to allow slowly cleanup of linking stage handling. # Three stage linking active: pre0 -> pre1 -> final, this will correspond to `pre1` @@ -174,13 +183,17 @@ endif() # @Intent: Set compiler flags to detect general stack overflows across all functions if(CONFIG_STACK_CANARIES) - zephyr_compile_options($) + zephyr_compile_options("$<$:$>") + zephyr_compile_options("$<$:$>") elseif(CONFIG_STACK_CANARIES_STRONG) - zephyr_compile_options($) + zephyr_compile_options("$<$:$>") + zephyr_compile_options("$<$:$>") elseif(CONFIG_STACK_CANARIES_ALL) - zephyr_compile_options($) + zephyr_compile_options("$<$:$>") + zephyr_compile_options("$<$:$>") elseif(CONFIG_STACK_CANARIES_EXPLICIT) - zephyr_compile_options($) + zephyr_compile_options("$<$:$>") + zephyr_compile_options("$<$:$>") endif() # @Intent: Obtain compiler optimizations flags and store in variables @@ -227,7 +240,8 @@ SOC_* symbol.") endif() # Apply the final optimization flag(s) -zephyr_compile_options(${OPTIMIZATION_FLAG}) +zephyr_compile_options($<$:${OPTIMIZATION_FLAG}>) +zephyr_compile_options($<$:${OPTIMIZATION_FLAG}>) if(CONFIG_LTO) zephyr_compile_options($) @@ -315,7 +329,9 @@ if(CONFIG_CODING_GUIDELINE_CHECK) endif() # @Intent: Set compiler specific macro inclusion of AUTOCONF_H -zephyr_compile_options("SHELL: $ ${AUTOCONF_H}") +zephyr_compile_options("SHELL: $<$:$ ${AUTOCONF_H}>") +zephyr_compile_options("SHELL: $<$:$ ${AUTOCONF_H}>") +zephyr_compile_options("SHELL: $<$:$ ${AUTOCONF_H}>") if(CONFIG_COMPILER_FREESTANDING) # @Intent: Set compiler specific flag for bare metal freestanding option @@ -360,7 +376,9 @@ zephyr_compile_options($<$:$ # @Intent: Enforce standard integer type correspondence to match Zephyr usage. # (must be after compiler specific flags) if(CONFIG_ENFORCE_ZEPHYR_STDINT) - zephyr_compile_options("SHELL: $ ${ZEPHYR_BASE}/include/zephyr/toolchain/zephyr_stdint.h") + zephyr_compile_options("SHELL:$<$:$ ${ZEPHYR_BASE}/include/zephyr/toolchain/zephyr_stdint.h>") + zephyr_compile_options("SHELL:$<$:$ ${ZEPHYR_BASE}/include/zephyr/toolchain/zephyr_stdint.h>") + zephyr_compile_options("SHELL:$<$:$ ${ZEPHYR_BASE}/include/zephyr/toolchain/zephyr_stdint.h>") endif() # Common toolchain-agnostic assembly flags @@ -926,6 +944,8 @@ add_custom_target(${DEVICE_API_LD_TARGET} ${DEVICE_API_LINKER_SECTIONS_CMAKE} ) +zephyr_linker_include_generated(CMAKE ${DEVICE_API_LINKER_SECTIONS_CMAKE}) + # Add a pseudo-target that is up-to-date when all generated headers # are up-to-date. @@ -1118,8 +1138,6 @@ elseif(DEFINED BOARD_LINKER_SCRIPT) set(LINKER_SCRIPT ${BOARD_LINKER_SCRIPT}) elseif(DEFINED SOC_LINKER_SCRIPT) set(LINKER_SCRIPT ${SOC_LINKER_SCRIPT}) -else() - find_package(Deprecated COMPONENTS SEARCHED_LINKER_SCRIPT) endif() if(NOT EXISTS ${LINKER_SCRIPT}) @@ -1127,14 +1145,20 @@ if(NOT EXISTS ${LINKER_SCRIPT}) endif() if(CONFIG_USERSPACE) - set(APP_SMEM_ALIGNED_LD "${PROJECT_BINARY_DIR}/include/generated/app_smem_aligned.ld") - set(APP_SMEM_UNALIGNED_LD "${PROJECT_BINARY_DIR}/include/generated/app_smem_unaligned.ld") + if(CONFIG_CMAKE_LINKER_GENERATOR) + set(APP_SMEM_LD_EXT "cmake") + else() + set(APP_SMEM_LD_EXT "ld") + endif() + + set(APP_SMEM_ALIGNED_LD "${PROJECT_BINARY_DIR}/include/generated/app_smem_aligned.${APP_SMEM_LD_EXT}") + set(APP_SMEM_UNALIGNED_LD "${PROJECT_BINARY_DIR}/include/generated/app_smem_unaligned.${APP_SMEM_LD_EXT}") if(CONFIG_LINKER_USE_PINNED_SECTION) set(APP_SMEM_PINNED_ALIGNED_LD - "${PROJECT_BINARY_DIR}/include/generated/app_smem_pinned_aligned.ld") + "${PROJECT_BINARY_DIR}/include/generated/app_smem_pinned_aligned.${APP_SMEM_LD_EXT}") set(APP_SMEM_PINNED_UNALIGNED_LD - "${PROJECT_BINARY_DIR}/include/generated/app_smem_pinned_unaligned.ld") + "${PROJECT_BINARY_DIR}/include/generated/app_smem_pinned_unaligned.${APP_SMEM_LD_EXT}") if(NOT CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT) # The libc partition may hold symbols that are required during boot process, @@ -1199,9 +1223,11 @@ if(CONFIG_USERSPACE) set(APP_SMEM_UNALIGNED_LIB app_smem_unaligned_output_obj_renamed_lib) list(APPEND LINKER_PASS_${ZEPHYR_CURRENT_LINKER_PASS}_DEFINE "LINKER_APP_SMEM_UNALIGNED") -endif() -if (CONFIG_USERSPACE) + foreach(dep ${APP_SMEM_UNALIGNED_LD} ${APP_SMEM_PINNED_UNALIGNED_LD}) + zephyr_linker_include_generated(CMAKE ${dep} PASS LINKER_APP_SMEM_UNALIGNED) + endforeach() + add_custom_command( OUTPUT ${APP_SMEM_ALIGNED_LD} ${APP_SMEM_PINNED_ALIGNED_LD} COMMAND ${PYTHON_EXECUTABLE} @@ -1221,6 +1247,9 @@ if (CONFIG_USERSPACE) COMMAND_EXPAND_LISTS COMMENT "Generating app_smem_aligned linker section" ) + foreach(dep ${APP_SMEM_ALIGNED_LD} ${APP_SMEM_PINNED_ALIGNED_LD}) + zephyr_linker_include_generated(CMAKE ${dep} PASS NOT LINKER_APP_SMEM_UNALIGNED) + endforeach() endif() if(CONFIG_USERSPACE) @@ -1328,6 +1357,13 @@ if(CONFIG_USERSPACE) DEPENDS ${KOBJECT_LINKER_HEADER_DATA} ) + + # gen_kobject_placeholders.py generates linker-kobject-prebuild-data.h, + # linker-kobject-prebuild-priv-stacks.h and linker-kobject-prebuild-rodata.h + foreach(ext "-data.h" "-priv-stacks.h" "-rodata.h") + string(REGEX REPLACE "-data.h$" ${ext} file ${KOBJECT_LINKER_HEADER_DATA}) + zephyr_linker_include_generated(HEADER ${file} PASS LINKER_ZEPHYR_PREBUILT LINKER_ZEPHYR_FINAL) + endforeach() endif() if(CONFIG_USERSPACE OR CONFIG_DEVICE_DEPS) @@ -2220,46 +2256,57 @@ if((CMAKE_BUILD_TYPE IN_LIST build_types) AND (NOT NO_BUILD_TYPE_WARNING)) endif() # Extension Development Kit (EDK) generation. -set(llext_edk_file ${PROJECT_BINARY_DIR}/${CONFIG_LLEXT_EDK_NAME}.tar.xz) +if(CONFIG_LLEXT_EDK) + if(CONFIG_LLEXT_EDK_FORMAT_TAR_XZ) + set(llext_edk_extension "tar.xz") + elseif(CONFIG_LLEXT_EDK_FORMAT_TAR_ZSTD) + set(llext_edk_extension "tar.Z") + elseif(CONFIG_LLEXT_EDK_FORMAT_ZIP) + set(llext_edk_extension "zip") + else() + message(FATAL_ERROR "Unsupported LLEXT_EDK_FORMAT choice") + endif() + set(llext_edk_file ${PROJECT_BINARY_DIR}/${CONFIG_LLEXT_EDK_NAME}.${llext_edk_extension}) -# TODO maybe generate flags for C CXX ASM -zephyr_get_compile_definitions_for_lang(C zephyr_defs) -zephyr_get_compile_options_for_lang(C zephyr_flags) + # TODO maybe generate flags for C CXX ASM + zephyr_get_compile_definitions_for_lang(C zephyr_defs) + zephyr_get_compile_options_for_lang(C zephyr_flags) -# Filter out non LLEXT and LLEXT_EDK flags - and add required ones -llext_filter_zephyr_flags(LLEXT_REMOVE_FLAGS ${zephyr_flags} llext_filt_flags) -llext_filter_zephyr_flags(LLEXT_EDK_REMOVE_FLAGS ${llext_filt_flags} llext_filt_flags) + # Filter out non LLEXT and LLEXT_EDK flags - and add required ones + llext_filter_zephyr_flags(LLEXT_REMOVE_FLAGS ${zephyr_flags} llext_filt_flags) + llext_filter_zephyr_flags(LLEXT_EDK_REMOVE_FLAGS ${llext_filt_flags} llext_filt_flags) -set(llext_edk_cflags ${zephyr_defs} -DLL_EXTENSION_BUILD) -list(APPEND llext_edk_cflags ${llext_filt_flags}) -list(APPEND llext_edk_cflags ${LLEXT_APPEND_FLAGS}) -list(APPEND llext_edk_cflags ${LLEXT_EDK_APPEND_FLAGS}) + set(llext_edk_cflags ${zephyr_defs} -DLL_EXTENSION_BUILD) + list(APPEND llext_edk_cflags ${llext_filt_flags}) + list(APPEND llext_edk_cflags ${LLEXT_APPEND_FLAGS}) + list(APPEND llext_edk_cflags ${LLEXT_EDK_APPEND_FLAGS}) -build_info(llext-edk file PATH ${llext_edk_file}) -build_info(llext-edk cflags VALUE ${llext_edk_cflags}) -build_info(llext-edk include-dirs VALUE "$") + build_info(llext-edk file PATH ${llext_edk_file}) + build_info(llext-edk cflags VALUE ${llext_edk_cflags}) + build_info(llext-edk include-dirs VALUE "$") -add_custom_command( + add_custom_command( OUTPUT ${llext_edk_file} # Regenerate syscalls in case CONFIG_LLEXT_EDK_USERSPACE_ONLY COMMAND ${CMAKE_COMMAND} - -E make_directory edk/include/generated/zephyr + -E make_directory edk/include/generated/zephyr COMMAND - ${PYTHON_EXECUTABLE} - ${ZEPHYR_BASE}/scripts/build/gen_syscalls.py - --json-file ${syscalls_json} # Read this file - --base-output edk/include/generated/zephyr/syscalls # Write to this dir - --syscall-dispatch edk/include/generated/zephyr/syscall_dispatch.c # Write this file - --syscall-list ${edk_syscall_list_h} - $<$:--userspace-only> - ${SYSCALL_LONG_REGISTERS_ARG} - ${SYSCALL_SPLIT_TIMEOUT_ARG} + ${PYTHON_EXECUTABLE} + ${ZEPHYR_BASE}/scripts/build/gen_syscalls.py + --json-file ${syscalls_json} # Read this file + --base-output edk/include/generated/zephyr/syscalls # Write to this dir + --syscall-dispatch edk/include/generated/zephyr/syscall_dispatch.c # Write this file + --syscall-list ${edk_syscall_list_h} + $<$:--userspace-only> + ${SYSCALL_LONG_REGISTERS_ARG} + ${SYSCALL_SPLIT_TIMEOUT_ARG} COMMAND ${CMAKE_COMMAND} -P ${ZEPHYR_BASE}/cmake/llext-edk.cmake DEPENDS ${logical_target_for_zephyr_elf} build_info_yaml_saved COMMAND_EXPAND_LISTS -) -add_custom_target(llext-edk DEPENDS ${llext_edk_file}) + ) + add_custom_target(llext-edk DEPENDS ${llext_edk_file}) +endif() # @Intent: Set compiler specific flags for standard C/C++ includes # Done at the very end, so any other system includes which may diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000000000..54110c3f9a546 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,4 @@ +# Instead of the CODEOWNERS file, The Zephyr Project uses a custom format. +# See MAINTAINERS.yml for details. +# +# DO NOT EDIT THIS FILE. diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 2d8031260ced6..6791e2d90420c 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -621,6 +621,13 @@ config MISRA_SANE standard for safety reasons. Specifically variable length arrays are not permitted (and gcc will enforce this). +config TOOLCHAIN_SUPPORTS_VLA_IN_STATEMENTS + bool + default y + help + Hidden symbol to state if the toolchain can handle vla in + statements. + endmenu choice diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 251006cbafb45..3731470db07e5 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -182,6 +182,7 @@ ARM arch: - MaureenHelm - stephanosio - bbolen + - ithinuel files: - arch/arm/ - arch/arm/core/offsets/ @@ -202,6 +203,9 @@ ARM64 arch: - npitre - povergoing - sgrrzhf + - wearyzen + - ithinuel + - JiafeiPan files: - arch/arm64/ - include/zephyr/arch/arm64/ @@ -218,6 +222,8 @@ ARM Platforms: status: maintained maintainers: - wearyzen + collaborators: + - ithinuel files: - boards/arm/mps*/ - boards/arm/v2m_*/ @@ -293,6 +299,7 @@ BeagleBoard Platforms: - ayush1325 - con-pax - vaishnavachath + - glneo files: - boards/beagle/ labels: @@ -358,9 +365,9 @@ Bluetooth Controller: - carlescufi - thoh-ot - ppryga - - mtpr-ot - wopu-ot - erbr-ot + - Tronil files: - doc/connectivity/bluetooth/bluetooth-ctlr-arch.rst - doc/connectivity/bluetooth/img/ctlr* @@ -432,6 +439,7 @@ Bluetooth Host: - subsys/bluetooth/host/iso_internal.h - subsys/bluetooth/host/shell/iso.c - tests/bluetooth/audio/ + - tests/bluetooth/classic/ - tests/bluetooth/controller/ - tests/bluetooth/mesh*/ - tests/bluetooth/qualification/ @@ -520,11 +528,15 @@ Bluetooth Classic: - lylezhu2012 collaborators: - jhedberg + - MarkWangChinese + - gzh-terry + - makeshi files: - doc/connectivity/bluetooth/shell/classic/a2dp.rst - subsys/bluetooth/common/ - subsys/bluetooth/host/classic/ - include/zephyr/bluetooth/classic/ + - tests/bluetooth/classic/ labels: - "area: Bluetooth Classic" - "area: Bluetooth" @@ -874,7 +886,6 @@ Demand Paging: Device Driver Model: status: maintained maintainers: - - gmarull - tbursztyka collaborators: - dcpleung @@ -966,6 +977,7 @@ Display drivers: collaborators: - jfischer-no - danieldegrasse + - VynDragon files: - drivers/display/ - dts/bindings/display/ @@ -1021,9 +1033,9 @@ Documentation: Documentation Infrastructure: status: maintained maintainers: - - gmarull - kartben collaborators: + - gmarull - carlescufi - nashif files: @@ -1408,12 +1420,13 @@ Release Notes: - drivers.espi "Drivers: Ethernet": - status: odd fixes + status: maintained + maintainers: + - maass-hamburg collaborators: - decsny - lmajewski - pdgendt - - maass-hamburg files: - drivers/ethernet/ - include/zephyr/dt-bindings/ethernet/ @@ -1642,6 +1655,9 @@ Release Notes: status: maintained maintainers: - carlocaione + collaborators: + - wearyzen + - ithinuel files: - include/zephyr/drivers/mbox.h - drivers/mbox/ @@ -1764,24 +1780,6 @@ Release Notes: tests: - drivers.ipm -"Drivers: kscan": - status: maintained - maintainers: - - albertofloyd - collaborators: - - VenkatKotakonda - files: - - drivers/kscan/ - - include/zephyr/drivers/kscan.h - - samples/drivers/kscan/ - - tests/drivers/kscan/ - - dts/bindings/kscan/ - - doc/hardware/peripherals/kscan.rst - labels: - - "area: Kscan" - tests: - - drivers.kscan - "Drivers: LED": status: maintained maintainers: @@ -1823,7 +1821,6 @@ Release Notes: "Drivers: MFD": status: odd fixes collaborators: - - gmarull - aasinclair files: - drivers/mfd/ @@ -1934,8 +1931,8 @@ Release Notes: - samples.drivers.peci "Drivers: Pin Control": - status: maintained - maintainers: + status: odd fixes + collaborators: - gmarull files: - doc/hardware/pinctrl/ @@ -2071,7 +2068,7 @@ Release Notes: labels: - "area: Sensors" tests: - - drivers.sensors + - drivers.sensor "Drivers: SMBus": status: maintained @@ -2116,12 +2113,15 @@ Release Notes: - dipakgmx - fabiobaltieri - faxe1008 + - jbehrensnx files: - drivers/stepper/ - include/zephyr/drivers/stepper.h - dts/bindings/stepper/ - doc/hardware/peripherals/stepper.rst + - samples/drivers/stepper/ - tests/drivers/build_all/stepper/ + - tests/drivers/stepper/ labels: - "area: Stepper" tests: @@ -2307,11 +2307,9 @@ EC Host Commands: Xen Platform: status: maintained maintainers: - - povergoing + - firscity collaborators: - - SgrrZhf - lorc - - firscity - luca-fancellu files: - include/zephyr/xen/ @@ -2392,8 +2390,6 @@ Input: status: maintained maintainers: - fabiobaltieri - collaborators: - - gmarull files: - doc/services/input/ - drivers/input/ @@ -2751,6 +2747,21 @@ Modem: tests: - modem +NEORV32 platform: + status: maintained + maintainers: + - henrikbrixandersen + files: + - boards/others/neorv32/ + - drivers/*/*neorv32* + - dts/bindings/*/*neorv32* + - soc/neorv32/ + - tests/boards/neorv32/ + labels: + - "platform: NEORV32" + tests: + - boards.neorv32 + OSDP: status: maintained maintainers: @@ -2796,7 +2807,7 @@ hawkBit: tests: - sample.net.updatehub -Native POSIX/Sim and POSIX arch: +Native_sim and POSIX arch: status: maintained maintainers: - aescolar @@ -2819,7 +2830,7 @@ Native POSIX/Sim and POSIX arch: labels: - "area: native port" description: >- - POSIX architecture and SOC, native_posix & native_sim boards, and related drivers + POSIX architecture and SOC, native_sim boards, and related drivers tests: - boards.native_sim @@ -2851,7 +2862,6 @@ Networking: - include/zephyr/net/ieee802154*.h - include/zephyr/net/ptp.h - include/zephyr/net/wifi*.h - - include/zephyr/net/buf.h - include/zephyr/net/dhcpv4*.h - include/zephyr/net/http/ - samples/net/gptp/ @@ -2904,7 +2914,6 @@ Networking: - jukkar files: - doc/services/net_buf/ - - include/zephyr/net/buf.h - include/zephyr/net_buf.h - lib/net_buf/ - tests/lib/net_buf/ @@ -3243,6 +3252,7 @@ RISCV arch: - carlocaione - npitre - ycsin + - VynDragon files: - arch/riscv/ - boards/enjoydigital/litex_vexriscv/ @@ -3352,7 +3362,7 @@ Settings: - subsys/settings/ - tests/subsys/settings/ - samples/subsys/settings/ - - doc/services/settings/ + - doc/services/storage/settings/ labels: - "area: Settings" tests: @@ -3445,19 +3455,23 @@ ADI Platforms: - microbuilder files: - boards/adi/ + - boards/shields/eval*ardz/ - boards/shields/pmod_acl/ - drivers/*/*max* - drivers/*/*max*/ - drivers/dac/dac_ltc* - drivers/ethernet/eth_adin* + - drivers/ethernet/phy/phy_adin* - drivers/mdio/mdio_adin* - - drivers/regulator/regulator_adp5360* - drivers/sensor/adi/ + - drivers/stepper/adi_tmc/ - dts/arm/adi/ - dts/bindings/*/adi,* - dts/bindings/*/lltc,* - dts/bindings/*/maxim,* - soc/adi/ + files-regex: + - ^drivers/(adc|dac|gpio|mfd|regulator)/.*adp?\d+ labels: - "platform: ADI" @@ -3473,7 +3487,6 @@ GD32 Platforms: maintainers: - nandojve collaborators: - - gmarull - soburi - cameled files: @@ -3573,9 +3586,15 @@ Raspberry Pi Pico Platforms: - threeeights - ajf58 files: - - boards/raspberrypi/ + - boards/raspberrypi/rpi_pico*/ - boards/adafruit/kb2040/ + - boards/adafruit/macropad_rp2040/ + - boards/adafruit/qt_py_rp2040/ + - boards/pimoroni/pico_plus2/ + - boards/seeed/xiao_rp2040/ - boards/sparkfun/pro_micro_rp2040/ + - boards/waveshare/rp2040_zero/ + - boards/wiznet/w5500_evb_pico*/ - dts/arm/raspberrypi/rpi_pico/ - dts/bindings/*/raspberrypi,pico* - drivers/*/*rpi_pico @@ -3599,8 +3618,11 @@ Silabs Platforms: - dts/arm/silabs/ - dts/bindings/*/silabs* - drivers/*/*gecko* - - drivers/bluetooth/hci/hci_silabs_* - drivers/*/*silabs* + - drivers/*/*siwx91x* + - drivers/*/*/*silabs* + - drivers/*/*/*siwx91x* + - tests/boards/silabs/ labels: - "platform: Silabs" @@ -3888,7 +3910,7 @@ NXP Platforms (Robotics Products): - boards/nxp/rddrone_fmuk66/ - boards/nxp/mr_canhubk3/ labels: - - "platform: NXP" + - "platform: NXP Robotics" description: NXP Robotics Module Platform Products Microchip MEC Platforms: @@ -3965,6 +3987,19 @@ nRF Platforms: labels: - "platform: nRF" +Octavo Systems Platforms: + status: maintained + maintainers: + - fkokosinski + - tgorochowik + collaborators: + - kgugala + files: + - boards/oct/ + - soc/oct/ + labels: + - "platform: Octavo Systems" + OpenTitan Platforms: status: maintained maintainers: @@ -4022,6 +4057,7 @@ Renesas RA Platforms: collaborators: - duynguyenxa - thaoluonguw + - thenguyenyf files: - boards/arduino/uno_r4/ - boards/renesas/*ra*/ @@ -4030,6 +4066,7 @@ Renesas RA Platforms: - dts/arm/renesas/ra/ - dts/bindings/*/*renesas,ra* - soc/renesas/ra/ + - samples/boards/renesas/ labels: - "platform: Renesas RA" description: >- @@ -4040,8 +4077,8 @@ Renesas RZ Platforms: status: maintained maintainers: - tgorochowik - collaborators: - binhnguyen2434 + collaborators: - nhutnguyenkc files: - boards/renesas/rz*/ @@ -4051,7 +4088,6 @@ Renesas RZ Platforms: - dts/arm/renesas/rz/ - dts/bindings/*/*rzt2m* - dts/bindings/*/*renesas,rz* - - soc/renesas/rzt2m/ - soc/renesas/rz/ labels: - "platforms: Renesas RZ" @@ -4219,6 +4255,7 @@ TI K3 Platforms: collaborators: - gramsay0 - dnltz + - glneo files: - boards/ti/*am62*/ - drivers/*/*davinci* @@ -4332,14 +4369,26 @@ Secure storage: - tomi-font files: - subsys/secure_storage/ + - include/zephyr/psa/ - samples/psa/ - - doc/services/secure_storage.rst + - doc/services/storage/secure_storage/index.rst - tests/subsys/secure_storage/ labels: - "area: Secure storage" tests: - psa.secure_storage +Sensry Platforms: + status: maintained + maintainers: + - tswaehn + files: + - boards/sensry/ + files-regex: + - .*sy1xx.* + labels: + - "platform: sensry" + Storage: status: odd fixes files: @@ -4407,8 +4456,13 @@ Task Watchdog: TDK Sensors: status: maintained maintainers: + - afontaine-invn + - rbuisson-invn + collaborators: - teburd - MaureenHelm + - sriccardi-invn + - gjabouley-invn files: - drivers/sensor/tdk/ labels: @@ -4471,6 +4525,18 @@ TDK Sensors: labels: - "area: Toolchains" +"Toolchain IAR": + status: maintained + maintainers: + - RobinKastberg + files: + - cmake/*/iar/ + - include/zephyr/toolchain/iar.h + - include/zephyr/toolchain/iar/* + - lib/libc/iar/* + labels: + - "area: Toolchains" + "Toolchain oneApi": status: maintained maintainers: @@ -4772,6 +4838,7 @@ West: - wearyzen collaborators: - tomi-font + - ithinuel files: [] labels: - "area: CMSIS_6" @@ -4868,6 +4935,8 @@ West: maintainers: - kristofer-jonsson-arm - wearyzen + collaborators: + - ithinuel files: - drivers/misc/ethos_u/ - modules/hal_ethos_u/ @@ -4879,7 +4948,6 @@ West: maintainers: - nandojve collaborators: - - gmarull - soburi files: - modules/hal_gigadevice/ @@ -4946,9 +5014,6 @@ West: - bperseghetti files: - modules/hal_nxp/ - - modules/Kconfig.imx - - modules/Kconfig.mcux - - modules/Kconfig.nxp_s32 labels: - "platform: NXP" @@ -5073,6 +5138,8 @@ West: maintainers: - nzmichaelh - kholia + collaborators: + - VynDragon files: - modules/hal_wch/ @@ -5200,6 +5267,7 @@ West: - wearyzen - valeriosetti - tomi-font + - ithinuel files: - modules/mbedtls/ - tests/crypto/mbedtls/ @@ -5351,7 +5419,9 @@ West: - "area: Audio" "West project: tflite-micro": - status: odd fixes + status: maintained + maintainers: + - XenuIsWatching collaborators: - laurenmurphyx64 files: @@ -5390,6 +5460,7 @@ West: - wearyzen - valeriosetti - tomi-font + - ithinuel files: - modules/trusted-firmware-m/ - samples/tfm_integration/ @@ -5407,6 +5478,7 @@ West: collaborators: - Vge0rge - wearyzen + - ithinuel files: [] labels: - "area: TF-M" @@ -5419,6 +5491,7 @@ West: collaborators: - carlocaione - wearyzen + - ithinuel files: - modules/trusted-firmware-a/ labels: @@ -5431,6 +5504,7 @@ West: collaborators: - Vge0rge - wearyzen + - ithinuel files: [] labels: - "area: TF-M" @@ -5602,6 +5676,22 @@ Peregrine Platforms: labels: - "platform: Peregrine" +WCH Platforms: + status: maintained + maintainers: + - nzmichaelh + - kholia + collaborators: + - VynDragon + files: + - boards/wch/ + - dts/riscv/wch/ + - soc/wch/ + - drivers/*/*wch* + - dts/bindings/*/wch,* + labels: + - "platform: WinChipHead" + # This area is to be converted to a subarea Testing with Renode: status: odd fixes @@ -5612,8 +5702,8 @@ Testing with Renode: - cmake/emu/renode.cmake - soc/renode/ - boards/renode/ - - boards/**/*/support/*.repl - - boards/**/*/support/*.resc + - boards/*/*/support/*.repl + - boards/*/*/support/*.resc labels: - "area: Renode" diff --git a/VERSION b/VERSION index b170abf44be15..9749142466ba2 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 4 -VERSION_MINOR = 0 +VERSION_MINOR = 1 PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/arch/Kconfig b/arch/Kconfig index 94e9a540a08e2..d8b44324819bd 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -8,7 +8,7 @@ # Include these first so that any properties (e.g. defaults) below can be # overridden (by defining symbols in multiple locations) -source "$(ARCH_DIR)/Kconfig.$(HWM_SCHEME)" +source "$(KCONFIG_BINARY_DIR)/arch/Kconfig" # ToDo: Generate a Kconfig.arch for loading of additional arch in HWMv2. osource "$(KCONFIG_BINARY_DIR)/Kconfig.arch" @@ -317,7 +317,7 @@ config PRIVILEGED_STACK_SIZE int "Size of privileged stack" default 2048 if EMUL default 1024 - depends on ARCH_HAS_USERSPACE + depends on USERSPACE help This option sets the privileged stack region size that will be used in addition to the user mode thread stack. During normal execution, @@ -331,14 +331,14 @@ config KOBJECT_TEXT_AREA default 512 if NO_OPTIMIZATIONS default 512 if STACK_CANARIES && RISCV default 256 - depends on ARCH_HAS_USERSPACE + depends on USERSPACE help Size of kernel object text area. Used in linker script. config KOBJECT_DATA_AREA_RESERVE_EXTRA_PERCENT int "Reserve extra kobject data area (in percentage)" default 100 - depends on ARCH_HAS_USERSPACE + depends on USERSPACE help Multiplication factor used to calculate the size of placeholder to reserve space for kobject metadata hash table. The hash table is @@ -352,7 +352,7 @@ config KOBJECT_DATA_AREA_RESERVE_EXTRA_PERCENT config KOBJECT_RODATA_AREA_EXTRA_BYTES int "Reserve extra bytes for kobject rodata area" default 16 - depends on ARCH_HAS_USERSPACE + depends on USERSPACE help Reserve a few more bytes for the RODATA region for kobject metadata. This is to account for the uncertainty of tables generated by gperf. @@ -1134,9 +1134,9 @@ config ARCH_HAS_CUSTOM_CPU_ATOMIC_IDLE config ARCH_HAS_CUSTOM_SWAP_TO_MAIN bool help - It's possible that an architecture port cannot use _Swap() to swap to - the _main() thread, but instead must do something custom. It must - enable this option in that case. + It's possible that an architecture port cannot use z_swap_unlocked() + to swap to the main thread (bg_thread_main), but instead must do + something custom. It must enable this option in that case. config ARCH_HAS_CUSTOM_BUSY_WAIT bool diff --git a/arch/Kconfig.v1 b/arch/Kconfig.v1 deleted file mode 100644 index d76acba59a3e1..0000000000000 --- a/arch/Kconfig.v1 +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Note: $ARCH might be a glob pattern -source "$(ARCH_DIR)/$(ARCH)/Kconfig" diff --git a/arch/Kconfig.v2 b/arch/Kconfig.v2 deleted file mode 100644 index 19db8d4624657..0000000000000 --- a/arch/Kconfig.v2 +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA - -# SPDX-License-Identifier: Apache-2.0 - -source "$(KCONFIG_BINARY_DIR)/arch/Kconfig" diff --git a/arch/arc/arcmwdt/arcmwdt-dtr-stubs.c b/arch/arc/arcmwdt/arcmwdt-dtr-stubs.c index 6ba748b34558b..f33bd638d7704 100644 --- a/arch/arc/arcmwdt/arcmwdt-dtr-stubs.c +++ b/arch/arc/arcmwdt/arcmwdt-dtr-stubs.c @@ -8,14 +8,6 @@ __weak void *__dso_handle; -int __cxa_atexit(void (*destructor)(void *), void *objptr, void *dso) -{ - ARG_UNUSED(destructor); - ARG_UNUSED(objptr); - ARG_UNUSED(dso); - return 0; -} - int atexit(void (*function)(void)) { return 0; diff --git a/arch/arc/core/elf.c b/arch/arc/core/elf.c index 9f9f1073431a0..db2a74e164ef3 100644 --- a/arch/arc/core/elf.c +++ b/arch/arc/core/elf.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -31,12 +32,32 @@ LOG_MODULE_REGISTER(elf, CONFIG_LLEXT_LOG_LEVEL); * https://github.com/foss-for-synopsys-dwc-arc-processors/arc-ABI-manual/blob/master/ARCv2_ABI.pdf * https://github.com/zephyrproject-rtos/binutils-gdb */ -int arch_elf_relocate(elf_rela_t *rel, uintptr_t loc, uintptr_t sym_base_addr, const char *sym_name, - uintptr_t load_bias) +int arch_elf_relocate(struct llext_loader *ldr, struct llext *ext, elf_rela_t *rel, + const elf_shdr_t *shdr) { int ret = 0; - uint32_t insn = UNALIGNED_GET((uint32_t *)loc); uint32_t value; + const uintptr_t loc = llext_get_reloc_instruction_location(ldr, ext, shdr->sh_info, rel); + uint32_t insn = UNALIGNED_GET((uint32_t *)loc); + elf_sym_t sym; + uintptr_t sym_base_addr; + const char *sym_name; + + ret = llext_read_symbol(ldr, ext, rel, &sym); + + if (ret != 0) { + LOG_ERR("Could not read symbol from binary!"); + return ret; + } + + sym_name = llext_symbol_name(ldr, ext, &sym); + + ret = llext_lookup_symbol(ldr, ext, &sym_base_addr, rel, &sym, sym_name, shdr); + + if (ret != 0) { + LOG_ERR("Could not find symbol %s!", sym_name); + return ret; + } sym_base_addr += rel->r_addend; diff --git a/arch/arm/core/cortex_a_r/Kconfig b/arch/arm/core/cortex_a_r/Kconfig index 409968ca6c7cf..a6176bbe5c094 100644 --- a/arch/arm/core/cortex_a_r/Kconfig +++ b/arch/arm/core/cortex_a_r/Kconfig @@ -13,6 +13,15 @@ # CPU_AARCH32_CORTEX_A / if CPU_AARCH32_CORTEX_R blocks so they are not # exposed if one selects a different ARM Cortex Family (Cortex-M). +config CPU_CORTEX_A7 + bool + select CPU_AARCH32_CORTEX_A + select ARMV7_A + select CPU_HAS_ICACHE + select CPU_HAS_DCACHE + help + This option signifies the use of a Cortex-A7 CPU. + config CPU_CORTEX_A9 bool select CPU_AARCH32_CORTEX_A @@ -82,6 +91,8 @@ config CPU_CORTEX_R5 select CPU_AARCH32_CORTEX_R select ARMV7_R select ARMV7_R_FP if CPU_HAS_FPU + select CPU_HAS_ICACHE + select CPU_HAS_DCACHE help This option signifies the use of a Cortex-R5 CPU diff --git a/arch/arm/core/cortex_a_r/cache.c b/arch/arm/core/cortex_a_r/cache.c index 31cf27a08e645..07c5b32bf327e 100644 --- a/arch/arm/core/cortex_a_r/cache.c +++ b/arch/arm/core/cortex_a_r/cache.c @@ -208,7 +208,13 @@ int arch_icache_flush_range(void *start_addr, size_t size) int arch_icache_invd_range(void *start_addr, size_t size) { - return -ENOTSUP; + /* Cortex A/R do have the ICIMVAU operation to selectively invalidate + * the instruction cache, but not currently supported by CMSIS. + * For now, invalidate the entire cache. + */ + L1C_InvalidateICacheAll(); + + return 0; } int arch_icache_flush_and_invd_range(void *start_addr, size_t size) diff --git a/arch/arm/core/cortex_a_r/exc.S b/arch/arm/core/cortex_a_r/exc.S index 78414fcd0a193..ecf7bab57f091 100644 --- a/arch/arm/core/cortex_a_r/exc.S +++ b/arch/arm/core/cortex_a_r/exc.S @@ -237,6 +237,28 @@ SECTION_SUBSEC_FUNC(TEXT, __exc, z_arm_data_abort) b z_arm_exc_exit #else + +GTEXT(z_arm_cortex_ar_exit_exc) +SECTION_SUBSEC_FUNC(TEXT, _HandlerModeExit, z_arm_cortex_ar_exit_exc) + + /* Note: + * This function is expected to be *always* called with + * processor mode set to MODE_SYS. + */ + + /* decrement exception depth */ + get_cpu r2 + ldrb r1, [r2, #_cpu_offset_to_exc_depth] + sub r1, r1, #1 + strb r1, [r2, #_cpu_offset_to_exc_depth] + + /* + * Restore r0-r3, r12, lr, lr_und and spsr_und from the exception stack + * and return to the current thread. + */ + pop {r0-r3, r12, lr} + rfeia sp! + /** * @brief Undefined instruction exception handler * diff --git a/arch/arm/core/cortex_a_r/fault.c b/arch/arm/core/cortex_a_r/fault.c index daf1d2345ca06..eac07cbf9b25b 100644 --- a/arch/arm/core/cortex_a_r/fault.c +++ b/arch/arm/core/cortex_a_r/fault.c @@ -100,6 +100,59 @@ static uint32_t dump_fault(uint32_t status, uint32_t addr) reason = K_ERR_ARM_UNSUPPORTED_EXCLUSIVE_ACCESS_FAULT; LOG_ERR("Unsupported Exclusive Access Fault @ 0x%08x", addr); break; +#elif defined(CONFIG_ARMV7_A) + case FSR_FS_PERMISSION_FAULT_2ND_LEVEL: + reason = K_ERR_ARM_PERMISSION_FAULT_2ND_LEVEL; + LOG_ERR("2nd Level Permission Fault @ 0x%08x", addr); + break; + case FSR_FS_ACCESS_FLAG_FAULT_1ST_LEVEL: + reason = K_ERR_ARM_ACCESS_FLAG_FAULT_1ST_LEVEL; + LOG_ERR("1st Level Access Flag Fault @ 0x%08x", addr); + break; + case FSR_FS_ACCESS_FLAG_FAULT_2ND_LEVEL: + reason = K_ERR_ARM_ACCESS_FLAG_FAULT_2ND_LEVEL; + LOG_ERR("2nd Level Access Flag Fault @ 0x%08x", addr); + break; + case FSR_FS_CACHE_MAINTENANCE_INSTRUCTION_FAULT: + reason = K_ERR_ARM_CACHE_MAINTENANCE_INSTRUCTION_FAULT; + LOG_ERR("Cache Maintenance Instruction Fault @ 0x%08x", addr); + break; + case FSR_FS_TRANSLATION_FAULT: + reason = K_ERR_ARM_TRANSLATION_FAULT; + LOG_ERR("1st Level Translation Fault @ 0x%08x", addr); + break; + case FSR_FS_TRANSLATION_FAULT_2ND_LEVEL: + reason = K_ERR_ARM_TRANSLATION_FAULT_2ND_LEVEL; + LOG_ERR("2nd Level Translation Fault @ 0x%08x", addr); + break; + case FSR_FS_DOMAIN_FAULT_1ST_LEVEL: + reason = K_ERR_ARM_DOMAIN_FAULT_1ST_LEVEL; + LOG_ERR("1st Level Domain Fault @ 0x%08x", addr); + break; + case FSR_FS_DOMAIN_FAULT_2ND_LEVEL: + reason = K_ERR_ARM_DOMAIN_FAULT_2ND_LEVEL; + LOG_ERR("2nd Level Domain Fault @ 0x%08x", addr); + break; + case FSR_FS_SYNC_EXTERNAL_ABORT_TRANSLATION_TABLE_1ST_LEVEL: + reason = K_ERR_ARM_SYNC_EXTERNAL_ABORT_TRANSLATION_TABLE_1ST_LEVEL; + LOG_ERR("1st Level Synchronous External Abort Translation Table @ 0x%08x", addr); + break; + case FSR_FS_SYNC_EXTERNAL_ABORT_TRANSLATION_TABLE_2ND_LEVEL: + reason = K_ERR_ARM_SYNC_EXTERNAL_ABORT_TRANSLATION_TABLE_2ND_LEVEL; + LOG_ERR("2nd Level Synchronous External Abort Translation Table @ 0x%08x", addr); + break; + case FSR_FS_TLB_CONFLICT_FAULT: + reason = K_ERR_ARM_TLB_CONFLICT_FAULT; + LOG_ERR("Table Conflict Fault @ 0x%08x", addr); + break; + case FSR_FS_SYNC_PARITY_ERROR_TRANSLATION_TABLE_1ST_LEVEL: + reason = K_ERR_ARM_SYNC_PARITY_ERROR_TRANSLATION_TABLE_1ST_LEVEL; + LOG_ERR("1st Level Synchronous Parity Error Translation Table @ 0x%08x", addr); + break; + case FSR_FS_SYNC_PARITY_ERROR_TRANSLATION_TABLE_2ND_LEVEL: + reason = K_ERR_ARM_SYNC_PARITY_ERROR_TRANSLATION_TABLE_2ND_LEVEL; + LOG_ERR("2nd Level Synchronous Parity Error Translation Table @ 0x%08x", addr); + break; #else case FSR_FS_BACKGROUND_FAULT: reason = K_ERR_ARM_BACKGROUND_FAULT; diff --git a/arch/arm/core/cortex_a_r/irq_manage.c b/arch/arm/core/cortex_a_r/irq_manage.c index 48c9ede3327bb..5303d1d71785e 100644 --- a/arch/arm/core/cortex_a_r/irq_manage.c +++ b/arch/arm/core/cortex_a_r/irq_manage.c @@ -33,6 +33,14 @@ extern void z_arm_reserved(void); * Generic Interrupt Controller (GIC) and therefore the architecture interrupt * control functions are mapped to the GIC driver interface. * + * When GIC is used together with other interrupt controller for + * multi-level interrupts support (i.e. CONFIG_MULTI_LEVEL_INTERRUPTS + * is enabled), the architecture interrupt control functions are mapped + * to the SoC layer in `include/arch/arm/irq.h`. + * The exported arm interrupt control functions which are wrappers of + * GIC control could be used for SoC to do level 1 irq control to implement SoC + * layer interrupt control functions. + * * When a custom interrupt controller is used (i.e. * CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER is enabled), the architecture * interrupt control functions are mapped to the SoC layer in @@ -40,17 +48,17 @@ extern void z_arm_reserved(void); */ #if !defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER) -void arch_irq_enable(unsigned int irq) +void arm_irq_enable(unsigned int irq) { arm_gic_irq_enable(irq); } -void arch_irq_disable(unsigned int irq) +void arm_irq_disable(unsigned int irq) { arm_gic_irq_disable(irq); } -int arch_irq_is_enabled(unsigned int irq) +int arm_irq_is_enabled(unsigned int irq) { return arm_gic_irq_is_enabled(irq); } @@ -65,10 +73,11 @@ int arch_irq_is_enabled(unsigned int irq) * priority levels which are reserved: three for various types of exceptions, * and possibly one additional to support zero latency interrupts. */ -void z_arm_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) +void arm_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) { arm_gic_irq_set_priority(irq, prio, flags); } + #endif /* !CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER */ void z_arm_fatal_error(unsigned int reason, const struct arch_esf *esf); diff --git a/arch/arm/core/cortex_a_r/reboot.c b/arch/arm/core/cortex_a_r/reboot.c index b5cea619f0932..d721baceda23c 100644 --- a/arch/arm/core/cortex_a_r/reboot.c +++ b/arch/arm/core/cortex_a_r/reboot.c @@ -28,16 +28,13 @@ static inline void relocate_vector_table(void) #else -#if defined(__GNUC__) /* * GCC can detect if memcpy is passed a NULL argument, however one of * the cases of relocate_vector_table() it is valid to pass NULL, so we * suppress the warning for this case. We need to do this before * string.h is included to get the declaration of memcpy. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnonnull" -#endif /* __GNUC__ */ +TOOLCHAIN_DISABLE_WARNING(TOOLCHAIN_WARNING_NONNULL) #include @@ -53,9 +50,7 @@ void __weak relocate_vector_table(void) #endif } -#if defined(__GNUC__) -#pragma GCC diagnostic pop -#endif +TOOLCHAIN_ENABLE_WARNING(TOOLCHAIN_WARNING_NONNULL) #endif /* !CONFIG_AARCH32_ARMV8_R */ diff --git a/arch/arm/core/cortex_a_r/semihost.c b/arch/arm/core/cortex_a_r/semihost.c index ff5e443759ba9..1467dbca3a4b2 100644 --- a/arch/arm/core/cortex_a_r/semihost.c +++ b/arch/arm/core/cortex_a_r/semihost.c @@ -19,10 +19,10 @@ long semihost_exec(enum semihost_instr instr, void *args) register long ret __asm__ ("r0"); if (IS_ENABLED(CONFIG_ISA_THUMB2)) { - __asm__ __volatile__ ("svc 0xab" + __asm__ volatile ("svc 0xab" : "=r" (ret) : "r" (r0), "r" (r1) : "memory"); } else { - __asm__ __volatile__ ("svc 0x123456" + __asm__ volatile ("svc 0x123456" : "=r" (ret) : "r" (r0), "r" (r1) : "memory"); } return ret; diff --git a/arch/arm/core/cortex_a_r/swap_helper.S b/arch/arm/core/cortex_a_r/swap_helper.S index a41e1ab5942fe..04b19f0b046b2 100644 --- a/arch/arm/core/cortex_a_r/swap_helper.S +++ b/arch/arm/core/cortex_a_r/swap_helper.S @@ -423,5 +423,9 @@ valid_syscall_id: GTEXT(z_arm_cortex_r_svc) SECTION_FUNC(TEXT, z_arm_cortex_r_svc) + .cfi_sections .debug_frame + .cfi_startproc simple + .cfi_def_cfa 13, 0x0 svc #_SVC_CALL_CONTEXT_SWITCH bx lr + .cfi_endproc diff --git a/arch/arm/core/cortex_a_r/vector_table.S b/arch/arm/core/cortex_a_r/vector_table.S index e74b6a41c8d6b..d5d95272548fd 100644 --- a/arch/arm/core/cortex_a_r/vector_table.S +++ b/arch/arm/core/cortex_a_r/vector_table.S @@ -35,27 +35,3 @@ SECTION_SUBSEC_FUNC(exc_vector_table,_vector_table_section,_vector_table) #else ldr pc,=z_irq_spurious #endif - - -#ifdef CONFIG_USE_SWITCH -GTEXT(z_arm_cortex_ar_exit_exc) -SECTION_SUBSEC_FUNC(TEXT, _HandlerModeExit, z_arm_cortex_ar_exit_exc) - - /* Note: - * This function is expected to be *always* called with - * processor mode set to MODE_SYS. - */ - - /* decrement exception depth */ - get_cpu r2 - ldrb r1, [r2, #_cpu_offset_to_exc_depth] - sub r1, r1, #1 - strb r1, [r2, #_cpu_offset_to_exc_depth] - - /* - * Restore r0-r3, r12, lr, lr_und and spsr_und from the exception stack - * and return to the current thread. - */ - pop {r0-r3, r12, lr} - rfeia sp! -#endif diff --git a/arch/arm/core/cortex_m/cmse/arm_core_cmse.c b/arch/arm/core/cortex_m/cmse/arm_core_cmse.c index aac96472ecf4f..163a9d0cdd205 100644 --- a/arch/arm/core/cortex_m/cmse/arm_core_cmse.c +++ b/arch/arm/core/cortex_m/cmse/arm_core_cmse.c @@ -9,7 +9,7 @@ int arm_cmse_mpu_region_get(uint32_t addr) { - cmse_address_info_t addr_info = cmse_TT((void *)addr); + cmse_address_info_t addr_info = cmse_TT((void *)addr); if (addr_info.flags.mpu_region_valid) { return addr_info.flags.mpu_region; @@ -40,8 +40,7 @@ int arm_cmse_addr_readwrite_ok(uint32_t addr, int force_npriv) return arm_cmse_addr_read_write_ok(addr, force_npriv, 1); } -static int arm_cmse_addr_range_read_write_ok(uint32_t addr, uint32_t size, - int force_npriv, int rw) +static int arm_cmse_addr_range_read_write_ok(uint32_t addr, uint32_t size, int force_npriv, int rw) { int flags = 0; @@ -74,10 +73,10 @@ int arm_cmse_addr_range_readwrite_ok(uint32_t addr, uint32_t size, int force_npr int arm_cmse_mpu_nonsecure_region_get(uint32_t addr) { - cmse_address_info_t addr_info = cmse_TTA((void *)addr); + cmse_address_info_t addr_info = cmse_TTA((void *)addr); if (addr_info.flags.mpu_region_valid) { - return addr_info.flags.mpu_region; + return addr_info.flags.mpu_region; } return -EINVAL; @@ -85,7 +84,7 @@ int arm_cmse_mpu_nonsecure_region_get(uint32_t addr) int arm_cmse_sau_region_get(uint32_t addr) { - cmse_address_info_t addr_info = cmse_TT((void *)addr); + cmse_address_info_t addr_info = cmse_TT((void *)addr); if (addr_info.flags.sau_region_valid) { return addr_info.flags.sau_region; @@ -96,7 +95,7 @@ int arm_cmse_sau_region_get(uint32_t addr) int arm_cmse_idau_region_get(uint32_t addr) { - cmse_address_info_t addr_info = cmse_TT((void *)addr); + cmse_address_info_t addr_info = cmse_TT((void *)addr); if (addr_info.flags.idau_region_valid) { return addr_info.flags.idau_region; @@ -107,13 +106,12 @@ int arm_cmse_idau_region_get(uint32_t addr) int arm_cmse_addr_is_secure(uint32_t addr) { - cmse_address_info_t addr_info = cmse_TT((void *)addr); + cmse_address_info_t addr_info = cmse_TT((void *)addr); return addr_info.flags.secure; } -static int arm_cmse_addr_nonsecure_read_write_ok(uint32_t addr, - int force_npriv, int rw) +static int arm_cmse_addr_nonsecure_read_write_ok(uint32_t addr, int force_npriv, int rw) { cmse_address_info_t addr_info; if (force_npriv) { @@ -122,8 +120,7 @@ static int arm_cmse_addr_nonsecure_read_write_ok(uint32_t addr, addr_info = cmse_TTA((void *)addr); } - return rw ? addr_info.flags.nonsecure_readwrite_ok : - addr_info.flags.nonsecure_read_ok; + return rw ? addr_info.flags.nonsecure_readwrite_ok : addr_info.flags.nonsecure_read_ok; } int arm_cmse_addr_nonsecure_read_ok(uint32_t addr, int force_npriv) @@ -137,7 +134,7 @@ int arm_cmse_addr_nonsecure_readwrite_ok(uint32_t addr, int force_npriv) } static int arm_cmse_addr_range_nonsecure_read_write_ok(uint32_t addr, uint32_t size, - int force_npriv, int rw) + int force_npriv, int rw) { int flags = CMSE_NONSECURE; @@ -156,18 +153,14 @@ static int arm_cmse_addr_range_nonsecure_read_write_ok(uint32_t addr, uint32_t s } } -int arm_cmse_addr_range_nonsecure_read_ok(uint32_t addr, uint32_t size, - int force_npriv) +int arm_cmse_addr_range_nonsecure_read_ok(uint32_t addr, uint32_t size, int force_npriv) { - return arm_cmse_addr_range_nonsecure_read_write_ok(addr, size, - force_npriv, 0); + return arm_cmse_addr_range_nonsecure_read_write_ok(addr, size, force_npriv, 0); } -int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, - int force_npriv) +int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, int force_npriv) { - return arm_cmse_addr_range_nonsecure_read_write_ok(addr, size, - force_npriv, 1); + return arm_cmse_addr_range_nonsecure_read_write_ok(addr, size, force_npriv, 1); } #endif /* CONFIG_ARM_SECURE_FIRMWARE */ diff --git a/arch/arm/core/cortex_m/coredump.c b/arch/arm/core/cortex_m/coredump.c index c688c91d9819d..ddb539c4e34ef 100644 --- a/arch/arm/core/cortex_m/coredump.c +++ b/arch/arm/core/cortex_m/coredump.c @@ -7,31 +7,31 @@ #include #include -#define ARCH_HDR_VER 2 +#define ARCH_HDR_VER 2 uint32_t z_arm_coredump_fault_sp; struct arm_arch_block { struct { - uint32_t r0; - uint32_t r1; - uint32_t r2; - uint32_t r3; - uint32_t r12; - uint32_t lr; - uint32_t pc; - uint32_t xpsr; - uint32_t sp; + uint32_t r0; + uint32_t r1; + uint32_t r2; + uint32_t r3; + uint32_t r12; + uint32_t lr; + uint32_t pc; + uint32_t xpsr; + uint32_t sp; /* callee registers - optionally collected in V2 */ - uint32_t r4; - uint32_t r5; - uint32_t r6; - uint32_t r7; - uint32_t r8; - uint32_t r9; - uint32_t r10; - uint32_t r11; + uint32_t r4; + uint32_t r5; + uint32_t r6; + uint32_t r7; + uint32_t r8; + uint32_t r9; + uint32_t r10; + uint32_t r11; } r; } __packed; @@ -76,12 +76,12 @@ void arch_coredump_info_dump(const struct arch_esf *esf) #if defined(CONFIG_EXTRA_EXCEPTION_INFO) if (esf->extra_info.callee) { - arch_blk.r.r4 = esf->extra_info.callee->v1; - arch_blk.r.r5 = esf->extra_info.callee->v2; - arch_blk.r.r6 = esf->extra_info.callee->v3; - arch_blk.r.r7 = esf->extra_info.callee->v4; - arch_blk.r.r8 = esf->extra_info.callee->v5; - arch_blk.r.r9 = esf->extra_info.callee->v6; + arch_blk.r.r4 = esf->extra_info.callee->v1; + arch_blk.r.r5 = esf->extra_info.callee->v2; + arch_blk.r.r6 = esf->extra_info.callee->v3; + arch_blk.r.r7 = esf->extra_info.callee->v4; + arch_blk.r.r8 = esf->extra_info.callee->v5; + arch_blk.r.r9 = esf->extra_info.callee->v6; arch_blk.r.r10 = esf->extra_info.callee->v7; arch_blk.r.r11 = esf->extra_info.callee->v8; } diff --git a/arch/arm/core/cortex_m/cpu_idle.c b/arch/arm/core/cortex_m/cpu_idle.c index 5f373a88c9d55..47eff95090a8d 100644 --- a/arch/arm/core/cortex_m/cpu_idle.c +++ b/arch/arm/core/cortex_m/cpu_idle.c @@ -30,27 +30,31 @@ void z_arm_cpu_idle_init(void) #if defined(CONFIG_ARM_ON_EXIT_CPU_IDLE) #define ON_EXIT_IDLE_HOOK SOC_ON_EXIT_CPU_IDLE #else -#define ON_EXIT_IDLE_HOOK do {} while (false) +#define ON_EXIT_IDLE_HOOK \ + do { \ + } while (false) #endif #if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK) -#define SLEEP_IF_ALLOWED(wait_instr) do { \ - /* Skip the wait instr if on_enter_cpu_idle returns false */ \ - if (z_arm_on_enter_cpu_idle()) { \ - /* Wait for all memory transaction to complete */ \ - /* before entering low power state. */ \ - __DSB(); \ - wait_instr(); \ - /* Inline the macro provided by SoC-specific code */ \ - ON_EXIT_IDLE_HOOK; \ - } \ -} while (false) +#define SLEEP_IF_ALLOWED(wait_instr) \ + do { \ + /* Skip the wait instr if on_enter_cpu_idle returns false */ \ + if (z_arm_on_enter_cpu_idle()) { \ + /* Wait for all memory transaction to complete */ \ + /* before entering low power state. */ \ + __DSB(); \ + wait_instr(); \ + /* Inline the macro provided by SoC-specific code */ \ + ON_EXIT_IDLE_HOOK; \ + } \ + } while (false) #else -#define SLEEP_IF_ALLOWED(wait_instr) do { \ - __DSB(); \ - wait_instr(); \ - ON_EXIT_IDLE_HOOK; \ -} while (false) +#define SLEEP_IF_ALLOWED(wait_instr) \ + do { \ + __DSB(); \ + wait_instr(); \ + ON_EXIT_IDLE_HOOK; \ + } while (false) #endif #ifndef CONFIG_ARCH_HAS_CUSTOM_CPU_IDLE @@ -94,6 +98,9 @@ void arch_cpu_idle(void) SLEEP_IF_ALLOWED(__WFI); +#if defined(CONFIG_TRACING) + sys_trace_idle_exit(); +#endif __enable_irq(); __ISB(); } @@ -133,6 +140,10 @@ void arch_cpu_atomic_idle(unsigned int key) SLEEP_IF_ALLOWED(__WFE); +#if defined(CONFIG_TRACING) + sys_trace_idle_exit(); +#endif + arch_irq_unlock(key); #if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) __enable_irq(); diff --git a/arch/arm/core/cortex_m/debug.c b/arch/arm/core/cortex_m/debug.c index 61fb681453507..47141d913dd14 100644 --- a/arch/arm/core/cortex_m/debug.c +++ b/arch/arm/core/cortex_m/debug.c @@ -35,7 +35,7 @@ bool z_arm_debug_monitor_event_error_check(void) printk("Null-pointer exception?\n"); } __ASSERT((DWT->FUNCTION0 & DWT_FUNCTION_MATCHED_Msk) == 0, - "MATCHED flag should have been cleared on read."); + "MATCHED flag should have been cleared on read."); return true; } @@ -55,8 +55,8 @@ bool z_arm_debug_monitor_event_error_check(void) * so we add a build assert that catches it. */ BUILD_ASSERT(!(CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE & - (CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE - 1)), - "the size of the partition must be power of 2"); + (CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE - 1)), + "the size of the partition must be power of 2"); int z_arm_debug_enable_null_pointer_detection(void) { @@ -81,20 +81,12 @@ int z_arm_debug_enable_null_pointer_detection(void) DWT->COMP0 = 0; DWT->COMP1 = CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE - 1; - DWT->FUNCTION0 = - ((0x4 << DWT_FUNCTION_MATCH_Pos) & DWT_FUNCTION_MATCH_Msk) - | - ((0x1 << DWT_FUNCTION_ACTION_Pos) & DWT_FUNCTION_ACTION_Msk) - | - ((0x0 << DWT_FUNCTION_DATAVSIZE_Pos) & DWT_FUNCTION_DATAVSIZE_Msk) - ; - DWT->FUNCTION1 = - ((0x7 << DWT_FUNCTION_MATCH_Pos) & DWT_FUNCTION_MATCH_Msk) - | - ((0x1 << DWT_FUNCTION_ACTION_Pos) & DWT_FUNCTION_ACTION_Msk) - | - ((0x0 << DWT_FUNCTION_DATAVSIZE_Pos) & DWT_FUNCTION_DATAVSIZE_Msk) - ; + DWT->FUNCTION0 = ((0x4 << DWT_FUNCTION_MATCH_Pos) & DWT_FUNCTION_MATCH_Msk) | + ((0x1 << DWT_FUNCTION_ACTION_Pos) & DWT_FUNCTION_ACTION_Msk) | + ((0x0 << DWT_FUNCTION_DATAVSIZE_Pos) & DWT_FUNCTION_DATAVSIZE_Msk); + DWT->FUNCTION1 = ((0x7 << DWT_FUNCTION_MATCH_Pos) & DWT_FUNCTION_MATCH_Msk) | + ((0x1 << DWT_FUNCTION_ACTION_Pos) & DWT_FUNCTION_ACTION_Msk) | + ((0x0 << DWT_FUNCTION_DATAVSIZE_Pos) & DWT_FUNCTION_DATAVSIZE_Msk); #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) /* ASSERT that we have the comparator needed for the implementation */ @@ -106,13 +98,10 @@ int z_arm_debug_enable_null_pointer_detection(void) /* Use comparator 0, R/W access check */ DWT->COMP0 = 0; - DWT->FUNCTION0 = (0x7 << DWT_FUNCTION_FUNCTION_Pos) & - DWT_FUNCTION_FUNCTION_Msk; - + DWT->FUNCTION0 = (0x7 << DWT_FUNCTION_FUNCTION_Pos) & DWT_FUNCTION_FUNCTION_Msk; /* Set mask according to the desired size */ - DWT->MASK0 = 32 - __builtin_clzl( - CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE - 1); + DWT->MASK0 = 32 - __builtin_clzl(CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE - 1); #endif return 0; diff --git a/arch/arm/core/cortex_m/fault.c b/arch/arm/core/cortex_m/fault.c index 56d5be60f4cc0..27ce260dad535 100644 --- a/arch/arm/core/cortex_m/fault.c +++ b/arch/arm/core/cortex_m/fault.c @@ -22,7 +22,7 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); #if defined(CONFIG_PRINTK) || defined(CONFIG_LOG) -#define PR_EXC(...) LOG_ERR(__VA_ARGS__) +#define PR_EXC(...) LOG_ERR(__VA_ARGS__) #define STORE_xFAR(reg_var, reg) uint32_t reg_var = (uint32_t)reg #else #define PR_EXC(...) @@ -36,8 +36,8 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); #endif #if defined(CONFIG_ARM_MPU) && defined(CONFIG_CPU_HAS_NXP_SYSMPU) -#define EMN(edr) (((edr) & SYSMPU_EDR_EMN_MASK) >> SYSMPU_EDR_EMN_SHIFT) -#define EACD(edr) (((edr) & SYSMPU_EDR_EACD_MASK) >> SYSMPU_EDR_EACD_SHIFT) +#define EMN(edr) (((edr) & SYSMPU_EDR_EMN_MASK) >> SYSMPU_EDR_EMN_SHIFT) +#define EACD(edr) (((edr) & SYSMPU_EDR_EACD_MASK) >> SYSMPU_EDR_EACD_SHIFT) #endif /* Integrity signature for an ARMv8-M implementation */ @@ -54,15 +54,12 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL); #if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) /* helpers to access memory/bus/usage faults */ -#define SCB_CFSR_MEMFAULTSR \ - (uint32_t)((SCB->CFSR & SCB_CFSR_MEMFAULTSR_Msk) \ - >> SCB_CFSR_MEMFAULTSR_Pos) -#define SCB_CFSR_BUSFAULTSR \ - (uint32_t)((SCB->CFSR & SCB_CFSR_BUSFAULTSR_Msk) \ - >> SCB_CFSR_BUSFAULTSR_Pos) -#define SCB_CFSR_USGFAULTSR \ - (uint32_t)((SCB->CFSR & SCB_CFSR_USGFAULTSR_Msk) \ - >> SCB_CFSR_USGFAULTSR_Pos) +#define SCB_CFSR_MEMFAULTSR \ + (uint32_t)((SCB->CFSR & SCB_CFSR_MEMFAULTSR_Msk) >> SCB_CFSR_MEMFAULTSR_Pos) +#define SCB_CFSR_BUSFAULTSR \ + (uint32_t)((SCB->CFSR & SCB_CFSR_BUSFAULTSR_Msk) >> SCB_CFSR_BUSFAULTSR_Pos) +#define SCB_CFSR_USGFAULTSR \ + (uint32_t)((SCB->CFSR & SCB_CFSR_USGFAULTSR_Msk) >> SCB_CFSR_USGFAULTSR_Pos) #endif /* CONFIG_ARMV7_M_ARMV8_M_MAINLINE */ /** @@ -103,8 +100,8 @@ static void fault_show(const struct arch_esf *esf, int fault) PR_EXC("Fault! EXC #%d", fault); #if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) - PR_EXC("MMFSR: 0x%x, BFSR: 0x%x, UFSR: 0x%x", SCB_CFSR_MEMFAULTSR, - SCB_CFSR_BUSFAULTSR, SCB_CFSR_USGFAULTSR); + PR_EXC("MMFSR: 0x%x, BFSR: 0x%x, UFSR: 0x%x", SCB_CFSR_MEMFAULTSR, SCB_CFSR_BUSFAULTSR, + SCB_CFSR_USGFAULTSR); #if defined(CONFIG_ARM_SECURE_FIRMWARE) PR_EXC("SFSR: 0x%x", SAU->SFSR); #endif /* CONFIG_ARM_SECURE_FIRMWARE */ @@ -127,9 +124,7 @@ static void fault_show(const struct arch_esf *esf, int fault) #ifdef CONFIG_USERSPACE Z_EXC_DECLARE(z_arm_user_string_nlen); -static const struct z_exc_handle exceptions[] = { - Z_EXC_HANDLE(z_arm_user_string_nlen) -}; +static const struct z_exc_handle exceptions[] = {Z_EXC_HANDLE(z_arm_user_string_nlen)}; #endif /* Perform an assessment whether an MPU fault shall be @@ -146,12 +141,12 @@ static bool memory_fault_recoverable(struct arch_esf *esf, bool synchronous) uint32_t end = (uint32_t)exceptions[i].end & ~0x1U; #if defined(CONFIG_NULL_POINTER_EXCEPTION_DETECTION_DWT) - /* Non-synchronous exceptions (e.g. DebugMonitor) may have - * allowed PC to continue to the next instruction. - */ - end += (synchronous) ? 0x0 : 0x4; + /* Non-synchronous exceptions (e.g. DebugMonitor) may have + * allowed PC to continue to the next instruction. + */ + end += (synchronous) ? 0x0 : 0x4; #else - ARG_UNUSED(synchronous); + ARG_UNUSED(synchronous); #endif if (esf->basic.pc >= start && esf->basic.pc < end) { esf->basic.pc = (uint32_t)(exceptions[i].fixup); @@ -168,8 +163,7 @@ static bool memory_fault_recoverable(struct arch_esf *esf, bool synchronous) #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) #if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE) -uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, - const uint32_t psp); +uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp); #endif /* CONFIG_MPU_STACK_GUARD || defined(CONFIG_USERSPACE) */ /** @@ -180,8 +174,7 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, * * @return error code to identify the fatal error reason */ -static uint32_t mem_manage_fault(struct arch_esf *esf, int from_hard_fault, - bool *recoverable) +static uint32_t mem_manage_fault(struct arch_esf *esf, int from_hard_fault, bool *recoverable) { uint32_t reason = K_ERR_ARM_MEM_GENERIC; uint32_t mmfar = -EINVAL; @@ -191,7 +184,7 @@ static uint32_t mem_manage_fault(struct arch_esf *esf, int from_hard_fault, if ((SCB->CFSR & SCB_CFSR_MSTKERR_Msk) != 0) { reason = K_ERR_ARM_MEM_STACKING; PR_FAULT_INFO(" Stacking error (context area might be" - " not valid)"); + " not valid)"); } if ((SCB->CFSR & SCB_CFSR_MUNSTKERR_Msk) != 0) { reason = K_ERR_ARM_MEM_UNSTACKING; @@ -226,8 +219,7 @@ static uint32_t mem_manage_fault(struct arch_esf *esf, int from_hard_fault, #if defined(CONFIG_ARMV7_M_ARMV8_M_FP) if ((SCB->CFSR & SCB_CFSR_MLSPERR_Msk) != 0) { reason = K_ERR_ARM_MEM_FP_LAZY_STATE_PRESERVATION; - PR_FAULT_INFO( - " Floating-point lazy state preservation error"); + PR_FAULT_INFO(" Floating-point lazy state preservation error"); } #endif /* CONFIG_ARMV7_M_ARMV8_M_FP */ @@ -244,8 +236,7 @@ static uint32_t mem_manage_fault(struct arch_esf *esf, int from_hard_fault, * Data Access Violation errors may or may not be caused by * thread stack overflows. */ - if ((SCB->CFSR & SCB_CFSR_MSTKERR_Msk) || - (SCB->CFSR & SCB_CFSR_DACCVIOL_Msk)) { + if ((SCB->CFSR & SCB_CFSR_MSTKERR_Msk) || (SCB->CFSR & SCB_CFSR_DACCVIOL_Msk)) { #if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE) /* MemManage Faults are always banked between security * states. Therefore, we can safely assume the fault @@ -265,8 +256,8 @@ static uint32_t mem_manage_fault(struct arch_esf *esf, int from_hard_fault, * handle the case of 'mmfar' holding the -EINVAL value. */ if (SCB->ICSR & SCB_ICSR_RETTOBASE_Msk) { - uint32_t min_stack_ptr = z_check_thread_stack_fail(mmfar, - ((uint32_t) &esf[0])); + uint32_t min_stack_ptr = + z_check_thread_stack_fail(mmfar, ((uint32_t)&esf[0])); if (min_stack_ptr) { /* When MemManage Stacking Error has occurred, @@ -299,14 +290,14 @@ static uint32_t mem_manage_fault(struct arch_esf *esf, int from_hard_fault, reason = K_ERR_STACK_CHK_FAIL; } else { __ASSERT(!(SCB->CFSR & SCB_CFSR_MSTKERR_Msk), - "Stacking error not a stack fail\n"); + "Stacking error not a stack fail\n"); } } #else - (void)mmfar; - __ASSERT(!(SCB->CFSR & SCB_CFSR_MSTKERR_Msk), - "Stacking or Data Access Violation error " - "without stack guard, user-mode or null-pointer detection\n"); + (void)mmfar; + __ASSERT(!(SCB->CFSR & SCB_CFSR_MSTKERR_Msk), + "Stacking or Data Access Violation error " + "without stack guard, user-mode or null-pointer detection\n"); #endif /* CONFIG_MPU_STACK_GUARD || CONFIG_USERSPACE */ } @@ -408,13 +399,10 @@ static int bus_fault(struct arch_esf *esf, int from_hard_fault, bool *recoverabl PR_FAULT_INFO(" NXP MPU error, port %d", i); PR_FAULT_INFO(" Mode: %s, %s Address: 0x%x", - edr & BIT(2) ? "Supervisor" : "User", - edr & BIT(1) ? "Data" : "Instruction", - ear); - PR_FAULT_INFO( - " Type: %s, Master: %d, Regions: 0x%x", - edr & BIT(0) ? "Write" : "Read", - EMN(edr), EACD(edr)); + edr & BIT(2) ? "Supervisor" : "User", + edr & BIT(1) ? "Data" : "Instruction", ear); + PR_FAULT_INFO(" Type: %s, Master: %d, Regions: 0x%x", + edr & BIT(0) ? "Write" : "Read", EMN(edr), EACD(edr)); /* When stack protection is enabled, we need to assess * if the memory violation error is a stack corruption. @@ -437,8 +425,7 @@ static int bus_fault(struct arch_esf *esf, int from_hard_fault, bool *recoverabl */ if (SCB->ICSR & SCB_ICSR_RETTOBASE_Msk) { uint32_t min_stack_ptr = - z_check_thread_stack_fail(ear, - ((uint32_t) &esf[0])); + z_check_thread_stack_fail(ear, ((uint32_t)&esf[0])); if (min_stack_ptr) { /* When BusFault Stacking Error @@ -468,16 +455,14 @@ static int bus_fault(struct arch_esf *esf, int from_hard_fault, bool *recoverabl */ __set_PSP(min_stack_ptr); - reason = - K_ERR_STACK_CHK_FAIL; + reason = K_ERR_STACK_CHK_FAIL; break; } } #else (void)ear; __ASSERT(0, - "Stacking error without stack guard" - "or User-mode support"); + "Stacking error without stack guard or User-mode support"); #endif /* CONFIG_MPU_STACK_GUARD || CONFIG_USERSPACE */ } } @@ -617,8 +602,7 @@ static void debug_monitor(struct arch_esf *esf, bool *recoverable) { *recoverable = false; - PR_FAULT_INFO( - "***** Debug monitor exception *****"); + PR_FAULT_INFO("***** Debug monitor exception *****"); #if defined(CONFIG_NULL_POINTER_EXCEPTION_DETECTION_DWT) if (!z_arm_debug_monitor_event_error_check()) { @@ -675,7 +659,7 @@ static inline bool z_arm_is_synchronous_svc(struct arch_esf *esf) #endif /* ARMV6_M_ARMV8_M_BASELINE && !ARMV8_M_BASELINE */ if (((fault_insn & 0xff00) == _SVC_OPCODE) && - ((fault_insn & 0x00ff) == _SVC_CALL_RUNTIME_EXCEPT)) { + ((fault_insn & 0x00ff) == _SVC_CALL_RUNTIME_EXCEPT)) { return true; } #undef _SVC_OPCODE @@ -759,13 +743,11 @@ static uint32_t hard_fault(struct arch_esf *esf, bool *recoverable) reason = secure_fault(esf); #endif /* CONFIG_ARM_SECURE_FIRMWARE */ } else { - __ASSERT(0, - "Fault escalation without FSR info"); + __ASSERT(0, "Fault escalation without FSR info"); } } else { - __ASSERT(0, - "HardFault without HFSR info" - " Shall never occur"); + __ASSERT(0, "HardFault without HFSR info" + " Shall never occur"); } #else #error Unknown ARM architecture @@ -786,8 +768,7 @@ static void reserved_exception(const struct arch_esf *esf, int fault) ARG_UNUSED(esf); PR_FAULT_INFO("***** %s %d) *****", - fault < 16 ? "Reserved Exception (" : "Spurious interrupt (IRQ ", - fault - 16); + fault < 16 ? "Reserved Exception (" : "Spurious interrupt (IRQ ", fault - 16); } /* Handler function for ARM fault conditions. */ @@ -802,7 +783,7 @@ static uint32_t fault_handle(struct arch_esf *esf, int fault, bool *recoverable) reason = hard_fault(esf, recoverable); break; #if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) - /* HardFault is raised for all fault conditions on ARMv6-M. */ + /* HardFault is raised for all fault conditions on ARMv6-M. */ #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) case 4: reason = mem_manage_fault(esf, 0, recoverable); @@ -860,7 +841,7 @@ static void secure_stack_dump(const struct arch_esf *secure_esf) uint32_t sec_ret_addr; #if defined(CONFIG_ARMV7_M_ARMV8_M_FP) if ((*top_of_sec_stack == INTEGRITY_SIGNATURE_STD) || - (*top_of_sec_stack == INTEGRITY_SIGNATURE_EXT)) { + (*top_of_sec_stack == INTEGRITY_SIGNATURE_EXT)) { #else if (*top_of_sec_stack == INTEGRITY_SIGNATURE) { #endif /* CONFIG_ARMV7_M_ARMV8_M_FP */ @@ -879,7 +860,6 @@ static void secure_stack_dump(const struct arch_esf *secure_esf) sec_ret_addr = *top_of_sec_stack; } PR_FAULT_INFO(" S instruction address: 0x%x", sec_ret_addr); - } #define SECURE_STACK_DUMP(esf) secure_stack_dump(esf) #else @@ -900,15 +880,14 @@ static void secure_stack_dump(const struct arch_esf *secure_esf) * @return ESF pointer on success, otherwise return NULL */ static inline struct arch_esf *get_esf(uint32_t msp, uint32_t psp, uint32_t exc_return, - bool *nested_exc) + bool *nested_exc) { bool alternative_state_exc = false; struct arch_esf *ptr_esf = NULL; *nested_exc = false; - if ((exc_return & EXC_RETURN_INDICATOR_PREFIX) != - EXC_RETURN_INDICATOR_PREFIX) { + if ((exc_return & EXC_RETURN_INDICATOR_PREFIX) != EXC_RETURN_INDICATOR_PREFIX) { /* Invalid EXC_RETURN value. This is a fatal error. */ return NULL; } @@ -988,8 +967,7 @@ static inline struct arch_esf *get_esf(uint32_t msp, uint32_t psp, uint32_t exc_ /* The processor has a single execution state. * We verify that the Thread mode is using PSP. */ - if ((exc_return & EXC_RETURN_MODE_THREAD) && - (!(exc_return & EXC_RETURN_SPSEL_PROCESS))) { + if ((exc_return & EXC_RETURN_MODE_THREAD) && (!(exc_return & EXC_RETURN_SPSEL_PROCESS))) { PR_EXC("SPSEL in thread mode does not indicate PSP"); return NULL; } @@ -998,7 +976,7 @@ static inline struct arch_esf *get_esf(uint32_t msp, uint32_t psp, uint32_t exc_ if (!alternative_state_exc) { if (exc_return & EXC_RETURN_MODE_THREAD) { /* Returning to thread mode */ - ptr_esf = (struct arch_esf *)psp; + ptr_esf = (struct arch_esf *)psp; } else { /* Returning to handler mode */ @@ -1041,8 +1019,7 @@ static inline struct arch_esf *get_esf(uint32_t msp, uint32_t psp, uint32_t exc_ * @param callee_regs Callee-saved registers (R4-R11, PSP) * */ -void z_arm_fault(uint32_t msp, uint32_t psp, uint32_t exc_return, - _callee_saved_t *callee_regs) +void z_arm_fault(uint32_t msp, uint32_t psp, uint32_t exc_return, _callee_saved_t *callee_regs) { uint32_t reason = K_ERR_CPU_EXCEPTION; int fault = SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk; @@ -1060,9 +1037,8 @@ void z_arm_fault(uint32_t msp, uint32_t psp, uint32_t exc_return, /* Retrieve the Exception Stack Frame (ESF) to be supplied * as argument to the remainder of the fault handling process. */ - esf = get_esf(msp, psp, exc_return, &nested_exc); - __ASSERT(esf != NULL, - "ESF could not be retrieved successfully. Shall never occur."); + esf = get_esf(msp, psp, exc_return, &nested_exc); + __ASSERT(esf != NULL, "ESF could not be retrieved successfully. Shall never occur."); z_arm_set_fault_sp(esf, exc_return); @@ -1080,11 +1056,8 @@ void z_arm_fault(uint32_t msp, uint32_t psp, uint32_t exc_return, * so we only copy the fields before those. */ memcpy(&esf_copy, esf, offsetof(struct arch_esf, extra_info)); - esf_copy.extra_info = (struct __extra_esf_info) { - .callee = callee_regs, - .exc_return = exc_return, - .msp = msp - }; + esf_copy.extra_info = (struct __extra_esf_info){ + .callee = callee_regs, .exc_return = exc_return, .msp = msp}; #endif /* CONFIG_EXTRA_EXCEPTION_INFO */ /* Overwrite stacked IPSR to mark a nested exception, diff --git a/arch/arm/core/cortex_m/fpu.c b/arch/arm/core/cortex_m/fpu.c index a9c964d14d1a7..b937d725c2834 100644 --- a/arch/arm/core/cortex_m/fpu.c +++ b/arch/arm/core/cortex_m/fpu.c @@ -23,11 +23,10 @@ void z_arm_save_fp_context(struct fpu_ctx_full *buffer) if (CONTROL & CONTROL_FPCA_Msk) { /* Store caller-saved and callee-saved FP registers. */ - __asm__ volatile( - "vstmia %0, {s0-s15}\n" - "vstmia %1, {s16-s31}\n" - :: "r" (buffer->caller_saved), "r" (buffer->callee_saved) : - ); + __asm__ volatile("vstmia %0, {s0-s15}\n" + "vstmia %1, {s16-s31}\n" ::"r"(buffer->caller_saved), + "r"(buffer->callee_saved) + :); buffer->fpscr = __get_FPSCR(); buffer->ctx_saved = true; @@ -55,11 +54,10 @@ void z_arm_restore_fp_context(const struct fpu_ctx_full *buffer) /* Restore FP state. */ __set_FPSCR(buffer->fpscr); - __asm__ volatile( - "vldmia %0, {s0-s15}\n" - "vldmia %1, {s16-s31}\n" - :: "r" (buffer->caller_saved), "r" (buffer->callee_saved) : - ); + __asm__ volatile("vldmia %0, {s0-s15}\n" + "vldmia %1, {s16-s31}\n" ::"r"(buffer->caller_saved), + "r"(buffer->callee_saved) + :); } #endif } diff --git a/arch/arm/core/cortex_m/irq_init.c b/arch/arm/core/cortex_m/irq_init.c index b6b128e3368ff..edd1f519677cb 100644 --- a/arch/arm/core/cortex_m/irq_init.c +++ b/arch/arm/core/cortex_m/irq_init.c @@ -27,7 +27,12 @@ void z_arm_interrupt_init(void) { int irq = 0; +/* CONFIG_2ND_LVL_ISR_TBL_OFFSET could be treated as total number of level1 interrupts */ +#if defined(CONFIG_MULTI_LEVEL_INTERRUPTS) && defined(CONFIG_2ND_LVL_ISR_TBL_OFFSET) + for (; irq < CONFIG_2ND_LVL_ISR_TBL_OFFSET; irq++) { +#else for (; irq < CONFIG_NUM_IRQS; irq++) { +#endif NVIC_SetPriority((IRQn_Type)irq, _IRQ_PRIO_OFFSET); } } diff --git a/arch/arm/core/cortex_m/irq_manage.c b/arch/arm/core/cortex_m/irq_manage.c index cc62386e8acad..6d1c8917c4dce 100644 --- a/arch/arm/core/cortex_m/irq_manage.c +++ b/arch/arm/core/cortex_m/irq_manage.c @@ -28,23 +28,42 @@ extern void z_arm_reserved(void); -#define NUM_IRQS_PER_REG 32 +#define NUM_IRQS_PER_REG 32 #define REG_FROM_IRQ(irq) (irq / NUM_IRQS_PER_REG) #define BIT_FROM_IRQ(irq) (irq % NUM_IRQS_PER_REG) +/* + * For Cortex-M core, the default interrupt controller is the ARM + * NVIC and therefore the architecture interrupt control functions + * are mapped to the NVIC driver interface. + * + * When NVIC is used together with other interrupt controller for + * multi-level interrupts support (i.e. CONFIG_MULTI_LEVEL_INTERRUPTS + * is enabled), the architecture interrupt control functions are mapped + * to the SoC layer in `include/arch/arm/irq.h`. + * The exported arm interrupt control functions which are wrappers of + * NVIC control could be used for SoC to do level 1 irq control to implement SoC + * layer interrupt control functions. + * + * When a custom interrupt controller is used (i.e. + * CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER is enabled), the architecture + * interrupt control functions are mapped to the SoC layer in + * `include/arch/arm/irq.h`. + */ + #if !defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER) -void arch_irq_enable(unsigned int irq) +void arm_irq_enable(unsigned int irq) { NVIC_EnableIRQ((IRQn_Type)irq); } -void arch_irq_disable(unsigned int irq) +void arm_irq_disable(unsigned int irq) { NVIC_DisableIRQ((IRQn_Type)irq); } -int arch_irq_is_enabled(unsigned int irq) +int arm_irq_is_enabled(unsigned int irq) { return NVIC->ISER[REG_FROM_IRQ(irq)] & BIT(BIT_FROM_IRQ(irq)); } @@ -58,7 +77,7 @@ int arch_irq_is_enabled(unsigned int irq) * of priority levels is a little complex, as there are some hardware * priority levels which are reserved. */ -void z_arm_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) +void arm_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) { /* The kernel may reserve some of the highest priority levels. * So we offset the requested priority level with the number @@ -87,8 +106,7 @@ void z_arm_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) */ __ASSERT(prio <= (BIT(NUM_IRQ_PRIO_BITS) - 1), "invalid priority %d for %d irq! values must be less than %lu\n", - prio - _IRQ_PRIO_OFFSET, irq, - BIT(NUM_IRQ_PRIO_BITS) - (_IRQ_PRIO_OFFSET)); + prio - _IRQ_PRIO_OFFSET, irq, BIT(NUM_IRQ_PRIO_BITS) - (_IRQ_PRIO_OFFSET)); NVIC_SetPriority((IRQn_Type)irq, prio); } @@ -141,7 +159,6 @@ void _arch_isr_direct_pm(void) #else #error Unknown ARM architecture #endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */ - } #endif @@ -165,8 +182,7 @@ void _arch_isr_direct_pm(void) * * @return The resulting target state of the given IRQ */ -irq_target_state_t irq_target_state_set(unsigned int irq, - irq_target_state_t irq_target_state) +irq_target_state_t irq_target_state_set(unsigned int irq, irq_target_state_t irq_target_state) { uint32_t result; @@ -217,7 +233,7 @@ int irq_target_state_is_secure(unsigned int irq) * - Bits corresponding to un-implemented interrupts are RES0, so writes * will be ignored. * -*/ + */ void irq_target_state_set_all_non_secure(void) { int i; @@ -241,8 +257,8 @@ void irq_target_state_set_all_non_secure(void) #ifdef CONFIG_DYNAMIC_INTERRUPTS #ifdef CONFIG_GEN_ISR_TABLES int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority, - void (*routine)(const void *parameter), - const void *parameter, uint32_t flags) + void (*routine)(const void *parameter), const void *parameter, + uint32_t flags) { z_isr_install(irq, routine, parameter); z_arm_irq_priority_set(irq, priority, flags); diff --git a/arch/arm/core/cortex_m/isr_wrapper.c b/arch/arm/core/cortex_m/isr_wrapper.c index 46aac160c3bf9..f75963c413f7b 100644 --- a/arch/arm/core/cortex_m/isr_wrapper.c +++ b/arch/arm/core/cortex_m/isr_wrapper.c @@ -68,7 +68,7 @@ void _isr_wrapper(void) #if defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER) int32_t irq_number = z_soc_irq_get_active(); #else - /* _sw_isr_table does not map the expections, only the interrupts. */ + /* _sw_isr_table does not map the exceptions, only the interrupts. */ int32_t irq_number = __get_IPSR(); #endif irq_number -= 16; diff --git a/arch/arm/core/cortex_m/pm_s2ram.S b/arch/arm/core/cortex_m/pm_s2ram.S index 4b43fb8d74f91..3e797c749c328 100644 --- a/arch/arm/core/cortex_m/pm_s2ram.S +++ b/arch/arm/core/cortex_m/pm_s2ram.S @@ -178,9 +178,7 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend) /* * Mark entering suspend to RAM. */ - mov r1, lr - bl pm_s2ram_mark_set - mov lr, r1 + bl pm_s2ram_mark_set /* * Call the system_off function passed as parameter. This should never @@ -199,9 +197,7 @@ SECTION_FUNC(TEXT, arch_pm_s2ram_suspend) /* * Reset the marking of suspend to RAM, return is ignored. */ - mov r1, lr - bl pm_s2ram_mark_check_and_clear - mov lr, r1 + bl pm_s2ram_mark_check_and_clear /* Move the stored return value of system_off back to r0, * setting it as return value for this function. @@ -216,13 +212,16 @@ GTEXT(arch_pm_s2ram_resume) SECTION_FUNC(TEXT, arch_pm_s2ram_resume) /* * Check if reset occurred after suspending to RAM. + * Store LR to ensure we can continue boot when we are not suspended + * to RAM. In addition to LR, R0 is pushed too, to ensure "SP mod 8 = 0", + * as stated by ARM rule 6.2.1.2 for AAPCS32. */ - mov r1, lr - bl pm_s2ram_mark_check_and_clear - mov lr, r1 - cmp r0, #0x1 - beq .L_resume - bx lr + push {r0, lr} + bl pm_s2ram_mark_check_and_clear + cmp r0, #0x1 + pop {r0, lr} + beq .L_resume + bx lr .L_resume: /* diff --git a/arch/arm/core/cortex_m/pm_s2ram.c b/arch/arm/core/cortex_m/pm_s2ram.c index b7fe5d9b62601..2657d48dc32a1 100644 --- a/arch/arm/core/cortex_m/pm_s2ram.c +++ b/arch/arm/core/cortex_m/pm_s2ram.c @@ -22,44 +22,20 @@ __noinit _cpu_context_t _cpu_context; */ static __noinit uint32_t marker; -void __attribute__((naked)) pm_s2ram_mark_set(void) +void pm_s2ram_mark_set(void) { - __asm__ volatile( - /* Set the marker to MAGIC value */ - "str %[_magic_val], [%[_marker]]\n" - - "bx lr\n" - : - : [_magic_val] "r"(MAGIC), [_marker] "r"(&marker) - : "r1", "r4", "memory"); + marker = MAGIC; } -bool __attribute__((naked)) pm_s2ram_mark_check_and_clear(void) +bool pm_s2ram_mark_check_and_clear(void) { - __asm__ volatile( - /* Set return value to 0 */ - "mov r0, #0\n" - - /* Check the marker */ - "ldr r3, [%[_marker]]\n" - "cmp r3, %[_magic_val]\n" - "bne exit\n" - - /* - * Reset the marker - */ - "str r0, [%[_marker]]\n" + if (marker == MAGIC) { + marker = 0; - /* - * Set return value to 1 - */ - "mov r0, #1\n" + return true; + } - "exit:\n" - "bx lr\n" - : - : [_magic_val] "r"(MAGIC), [_marker] "r"(&marker) - : "r0", "r1", "r3", "r4", "memory"); + return false; } #endif /* CONFIG_PM_S2RAM_CUSTOM_MARKING */ diff --git a/arch/arm/core/cortex_m/prep_c.c b/arch/arm/core/cortex_m/prep_c.c index ae59960584ce2..ec43970c17cf4 100644 --- a/arch/arm/core/cortex_m/prep_c.c +++ b/arch/arm/core/cortex_m/prep_c.c @@ -23,22 +23,18 @@ #include #include -#if defined(__GNUC__) /* * GCC can detect if memcpy is passed a NULL argument, however one of * the cases of relocate_vector_table() it is valid to pass NULL, so we * suppress the warning for this case. We need to do this before * string.h is included to get the declaration of memcpy. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnonnull" -#endif +TOOLCHAIN_DISABLE_WARNING(TOOLCHAIN_WARNING_NONNULL) #include #if defined(CONFIG_SW_VECTOR_RELAY) || defined(CONFIG_SW_VECTOR_RELAY_CLIENT) -Z_GENERIC_SECTION(.vt_pointer_section) __attribute__((used)) -void *_vector_table_pointer; +Z_GENERIC_SECTION(.vt_pointer_section) __attribute__((used)) void *_vector_table_pointer; #endif #ifdef CONFIG_CPU_CORTEX_M_HAS_VTOR @@ -52,7 +48,7 @@ void *_vector_table_pointer; #define VTOR_MASK SCB_VTOR_TBLOFF_Msk #endif -static inline void relocate_vector_table(void) +void __weak relocate_vector_table(void) { SCB->VTOR = VECTOR_ADDRESS & VTOR_MASK; barrier_dsync_fence_full(); @@ -64,8 +60,8 @@ static inline void relocate_vector_table(void) void __weak relocate_vector_table(void) { -#if defined(CONFIG_XIP) && (CONFIG_FLASH_BASE_ADDRESS != 0) || \ - !defined(CONFIG_XIP) && (CONFIG_SRAM_BASE_ADDRESS != 0) +#if defined(CONFIG_XIP) && (CONFIG_FLASH_BASE_ADDRESS != 0) || \ + !defined(CONFIG_XIP) && (CONFIG_SRAM_BASE_ADDRESS != 0) size_t vector_size = (size_t)_vector_end - (size_t)_vector_start; (void)memcpy(VECTOR_ADDRESS, _vector_start, vector_size); #elif defined(CONFIG_SW_VECTOR_RELAY) || defined(CONFIG_SW_VECTOR_RELAY_CLIENT) @@ -73,9 +69,7 @@ void __weak relocate_vector_table(void) #endif } -#if defined(__GNUC__) -#pragma GCC diagnostic pop -#endif +TOOLCHAIN_ENABLE_WARNING(TOOLCHAIN_WARNING_NONNULL) #endif /* CONFIG_CPU_CORTEX_M_HAS_VTOR */ @@ -100,7 +94,7 @@ static inline void z_arm_floating_point_init(void) #else /* Privileged access only */ SCB->CPACR |= CPACR_CP10_PRIV_ACCESS | CPACR_CP11_PRIV_ACCESS; -#endif /* CONFIG_USERSPACE */ +#endif /* CONFIG_USERSPACE */ /* * Upon reset, the FPU Context Control Register is 0xC0000000 * (both Automatic and Lazy state preservation is enabled). @@ -170,7 +164,7 @@ static inline void z_arm_floating_point_init(void) * * If CONFIG_INIT_ARCH_HW_AT_BOOT is set, CONTROL is cleared at reset. */ -#if (!defined(CONFIG_FPU) || !defined(CONFIG_FPU_SHARING)) && \ +#if (!defined(CONFIG_FPU) || !defined(CONFIG_FPU_SHARING)) && \ (!defined(CONFIG_INIT_ARCH_HW_AT_BOOT)) __set_CONTROL(__get_CONTROL() & (~(CONTROL_FPCA_Msk))); diff --git a/arch/arm/core/cortex_m/reset.S b/arch/arm/core/cortex_m/reset.S index 742a3fe3d6500..c3f9362eca85d 100644 --- a/arch/arm/core/cortex_m/reset.S +++ b/arch/arm/core/cortex_m/reset.S @@ -21,6 +21,7 @@ _ASM_FILE_PROLOGUE GTEXT(z_arm_reset) GTEXT(z_early_memset) GDATA(z_interrupt_stacks) +GDATA(z_main_stack) #if defined(CONFIG_DEBUG_THREAD_INFO) GDATA(z_sys_post_kernel) #endif @@ -29,7 +30,6 @@ GTEXT(soc_reset_hook) #endif #if defined(CONFIG_INIT_ARCH_HW_AT_BOOT) GTEXT(z_arm_init_arch_hw_at_boot) -GDATA(z_main_stack) #endif #if defined(CONFIG_PM_S2RAM) GTEXT(arch_pm_s2ram_resume) @@ -83,9 +83,44 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start) #endif /* CONFIG_INIT_ARCH_HW_AT_BOOT */ #if defined(CONFIG_PM_S2RAM) + /* + * Temporarily set MSP to interrupt stack so that arch_pm_s2ram_resume can + * use stack for calling pm_s2ram_mark_check_and_clear. + * This is safe because suspend never being called from an ISR ensures that + * interrupt stack was not live during suspend. + * Note: + * if resuming from suspend, MSP is restored from cpu context + * if not resuming, MSP will be set back to z_main_stack for proper init + * And, apart from arch_pm_s2ram_resume being able to use the stack for + * a short while, there is no change in behavior in either of the paths. + */ + ldr r0, =z_interrupt_stacks + CONFIG_ISR_STACK_SIZE + MPU_GUARD_ALIGN_AND_SIZE + msr msp, r0 + bl arch_pm_s2ram_resume #endif /* CONFIG_PM_S2RAM */ + /* + * MSP needs to be set to main stack for following scenarios: + * - If CONFIG_PM_S2RAM is enabled, MSP is set to z_interrupt_stacks + * for resume functions to make use of a stack. However, + * if the device was not suspended and if resume functions return, + * MSP needs to be set back to z_main_stack to ensure proper + * initialization. + * - If CONFIG_PM_S2RAM is not enabled but CONFIG_INIT_ARCH_HW_AT_BOOT is, + * MSP needs to be set to z_main_stack for proper initialization in case + * device was loaded through chain loading or a debugger, as the initial + * value of MSP would be anything that the previous image loaded. + * - If CONFIG_INIT_STACKS is enabled, we need to ensure MSP is not set + * to z_interrupt_stacks, so we set it to z_main_stack. + * + * Since these scenarios cover most of the cases, we set MSP to + * z_main_stack here. + * + */ + ldr r0, =z_main_stack + CONFIG_MAIN_STACK_SIZE + msr msp, r0 + /* Note: Make sure that variables like z_sys_post_kernel * are set after the call to arch_pm_s2ram_resume * to avoid any issues with suspend/resume path. @@ -110,8 +145,6 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start) str r0, [r1] dsb #endif /* CONFIG_CPU_HAS_ARM_MPU */ - ldr r0, =z_main_stack + CONFIG_MAIN_STACK_SIZE - msr msp, r0 /* Initialize core architecture registers and system blocks */ bl z_arm_init_arch_hw_at_boot diff --git a/arch/arm/core/cortex_m/scb.c b/arch/arm/core/cortex_m/scb.c index a511a8de9b1be..957c66dcc9f50 100644 --- a/arch/arm/core/cortex_m/scb.c +++ b/arch/arm/core/cortex_m/scb.c @@ -55,8 +55,7 @@ void z_arm_clear_arm_mpu_config(void) { int i; - int num_regions = - ((MPU->TYPE & MPU_TYPE_DREGION_Msk) >> MPU_TYPE_DREGION_Pos); + int num_regions = ((MPU->TYPE & MPU_TYPE_DREGION_Msk) >> MPU_TYPE_DREGION_Pos); for (i = 0; i < num_regions; i++) { ARM_MPU_ClrRegion(i); @@ -90,7 +89,7 @@ void z_arm_clear_arm_mpu_config(void) */ void z_arm_init_arch_hw_at_boot(void) { - /* Disable interrupts */ + /* Disable interrupts */ __disable_irq(); #if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) diff --git a/arch/arm/core/cortex_m/semihost.c b/arch/arm/core/cortex_m/semihost.c index 2a8c6d55a0515..51ecd1f478c1c 100644 --- a/arch/arm/core/cortex_m/semihost.c +++ b/arch/arm/core/cortex_m/semihost.c @@ -9,11 +9,10 @@ long semihost_exec(enum semihost_instr instr, void *args) { - register unsigned int r0 __asm__ ("r0") = instr; - register void *r1 __asm__ ("r1") = args; - register int ret __asm__ ("r0"); + register unsigned int r0 __asm__("r0") = instr; + register void *r1 __asm__("r1") = args; + register int ret __asm__("r0"); - __asm__ __volatile__ ("bkpt 0xab" - : "=r" (ret) : "r" (r0), "r" (r1) : "memory"); + __asm__ volatile("bkpt 0xab" : "=r"(ret) : "r"(r0), "r"(r1) : "memory"); return ret; } diff --git a/arch/arm/core/cortex_m/thread.c b/arch/arm/core/cortex_m/thread.c index c88fd8e41a0fe..f1fc2019d9c43 100644 --- a/arch/arm/core/cortex_m/thread.c +++ b/arch/arm/core/cortex_m/thread.c @@ -22,15 +22,14 @@ #include #if (MPU_GUARD_ALIGN_AND_SIZE_FLOAT > MPU_GUARD_ALIGN_AND_SIZE) -#define FP_GUARD_EXTRA_SIZE (MPU_GUARD_ALIGN_AND_SIZE_FLOAT - \ - MPU_GUARD_ALIGN_AND_SIZE) +#define FP_GUARD_EXTRA_SIZE (MPU_GUARD_ALIGN_AND_SIZE_FLOAT - MPU_GUARD_ALIGN_AND_SIZE) #else -#define FP_GUARD_EXTRA_SIZE 0 +#define FP_GUARD_EXTRA_SIZE 0 #endif #ifndef EXC_RETURN_FTYPE /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ -#define EXC_RETURN_FTYPE (0x00000010UL) +#define EXC_RETURN_FTYPE (0x00000010UL) #endif /* Default last octet of EXC_RETURN, for threads that have not run yet. @@ -58,9 +57,8 @@ K_THREAD_STACK_DECLARE(z_main_stack, CONFIG_MAIN_STACK_SIZE); * addresses, we have to unset it manually before storing it in the 'pc' field * of the ESF. */ -void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, - char *stack_ptr, k_thread_entry_t entry, - void *p1, void *p2, void *p3) +void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, char *stack_ptr, + k_thread_entry_t entry, void *p1, void *p2, void *p3) { struct __basic_sf *iframe; @@ -105,8 +103,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, iframe->a3 = (uint32_t)p2; iframe->a4 = (uint32_t)p3; - iframe->xpsr = - 0x01000000UL; /* clear all, thumb bit is 1, even if RO */ + iframe->xpsr = 0x01000000UL; /* clear all, thumb bit is 1, even if RO */ thread->callee_saved.psp = (uint32_t)iframe; thread->arch.basepri = 0; @@ -131,52 +128,42 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, */ } -#if defined(CONFIG_MPU_STACK_GUARD) && defined(CONFIG_FPU) \ - && defined(CONFIG_FPU_SHARING) +#if defined(CONFIG_MPU_STACK_GUARD) && defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING) -static inline void z_arm_thread_stack_info_adjust(struct k_thread *thread, - bool use_large_guard) +static inline void z_arm_thread_stack_info_adjust(struct k_thread *thread, bool use_large_guard) { if (use_large_guard) { /* Switch to use a large MPU guard if not already. */ - if ((thread->arch.mode & - Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) == 0) { + if ((thread->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) == 0) { /* Default guard size is used. Update required. */ thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk; #if defined(CONFIG_USERSPACE) if (thread->arch.priv_stack_start) { /* User thread */ - thread->arch.priv_stack_start += - FP_GUARD_EXTRA_SIZE; + thread->arch.priv_stack_start += FP_GUARD_EXTRA_SIZE; } else #endif /* CONFIG_USERSPACE */ { /* Privileged thread */ - thread->stack_info.start += - FP_GUARD_EXTRA_SIZE; - thread->stack_info.size -= - FP_GUARD_EXTRA_SIZE; + thread->stack_info.start += FP_GUARD_EXTRA_SIZE; + thread->stack_info.size -= FP_GUARD_EXTRA_SIZE; } } } else { /* Switch to use the default MPU guard size if not already. */ - if ((thread->arch.mode & - Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) { + if ((thread->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) { /* Large guard size is used. Update required. */ thread->arch.mode &= ~Z_ARM_MODE_MPU_GUARD_FLOAT_Msk; #if defined(CONFIG_USERSPACE) if (thread->arch.priv_stack_start) { /* User thread */ - thread->arch.priv_stack_start -= - FP_GUARD_EXTRA_SIZE; + thread->arch.priv_stack_start -= FP_GUARD_EXTRA_SIZE; } else #endif /* CONFIG_USERSPACE */ { /* Privileged thread */ - thread->stack_info.start -= - FP_GUARD_EXTRA_SIZE; - thread->stack_info.size += - FP_GUARD_EXTRA_SIZE; + thread->stack_info.start -= FP_GUARD_EXTRA_SIZE; + thread->stack_info.size += FP_GUARD_EXTRA_SIZE; } } } @@ -190,7 +177,7 @@ static inline void z_arm_thread_stack_info_adjust(struct k_thread *thread, uint32_t z_arm_mpu_stack_guard_and_fpu_adjust(struct k_thread *thread) { if (((thread->base.user_options & K_FP_REGS) != 0) || - ((thread->arch.mode_exc_return & EXC_RETURN_FTYPE) == 0)) { + ((thread->arch.mode_exc_return & EXC_RETURN_FTYPE) == 0)) { /* The thread has been pre-tagged (at creation or later) with * K_FP_REGS, i.e. it is expected to be using the FPU registers * (if not already). Activate lazy stacking and program a large @@ -226,13 +213,11 @@ uint32_t z_arm_mpu_stack_guard_and_fpu_adjust(struct k_thread *thread) #endif #ifdef CONFIG_USERSPACE -FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry, - void *p1, void *p2, void *p3) +FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry, void *p1, void *p2, void *p3) { /* Set up privileged stack before entering user mode */ - _current->arch.priv_stack_start = - (uint32_t)z_priv_stack_find(_current->stack_obj); + _current->arch.priv_stack_start = (uint32_t)z_priv_stack_find(_current->stack_obj); #if defined(CONFIG_MPU_STACK_GUARD) #if defined(CONFIG_THREAD_STACK_INFO) /* We're dropping to user mode which means the guard area is no @@ -256,21 +241,19 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry, */ #if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING) _current->arch.priv_stack_start += - ((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ? - MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE; + ((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) + ? MPU_GUARD_ALIGN_AND_SIZE_FLOAT + : MPU_GUARD_ALIGN_AND_SIZE; #else _current->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE; #endif /* CONFIG_FPU && CONFIG_FPU_SHARING */ #endif /* CONFIG_MPU_STACK_GUARD */ - z_arm_userspace_enter(user_entry, p1, p2, p3, - (uint32_t)_current->stack_info.start, - _current->stack_info.size - - _current->stack_info.delta); + z_arm_userspace_enter(user_entry, p1, p2, p3, (uint32_t)_current->stack_info.start, + _current->stack_info.size - _current->stack_info.delta); CODE_UNREACHABLE; } - bool z_arm_thread_is_in_user_mode(void) { uint32_t value; @@ -311,14 +294,12 @@ void configure_builtin_stack_guard(struct k_thread *thread) * than the default thread stack (ensured by design). */ uint32_t guard_start = - ((thread->arch.priv_stack_start) && - (__get_PSP() >= thread->arch.priv_stack_start)) ? - (uint32_t)thread->arch.priv_stack_start : - (uint32_t)thread->stack_obj; + ((thread->arch.priv_stack_start) && (__get_PSP() >= thread->arch.priv_stack_start)) + ? (uint32_t)thread->arch.priv_stack_start + : (uint32_t)thread->stack_obj; __ASSERT(thread->stack_info.start == ((uint32_t)thread->stack_obj), - "stack_info.start does not point to the start of the" - "thread allocated area."); + "stack_info.start does not point to the start of the thread allocated area."); #else uint32_t guard_start = thread->stack_info.start; #endif @@ -332,13 +313,11 @@ void configure_builtin_stack_guard(struct k_thread *thread) #if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE) -#define IS_MPU_GUARD_VIOLATION(guard_start, guard_len, fault_addr, stack_ptr) \ - ((fault_addr != -EINVAL) ? \ - ((fault_addr >= guard_start) && \ - (fault_addr < (guard_start + guard_len)) && \ - (stack_ptr < (guard_start + guard_len))) \ - : \ - (stack_ptr < (guard_start + guard_len))) +#define IS_MPU_GUARD_VIOLATION(guard_start, guard_len, fault_addr, stack_ptr) \ + ((fault_addr != -EINVAL) \ + ? ((fault_addr >= guard_start) && (fault_addr < (guard_start + guard_len)) && \ + (stack_ptr < (guard_start + guard_len))) \ + : (stack_ptr < (guard_start + guard_len))) /** * @brief Assess occurrence of current thread's stack corruption @@ -386,11 +365,10 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp } #endif -#if (defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)) && \ - defined(CONFIG_MPU_STACK_GUARD) - uint32_t guard_len = - ((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ? - MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE; +#if (defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)) && defined(CONFIG_MPU_STACK_GUARD) + uint32_t guard_len = ((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) + ? MPU_GUARD_ALIGN_AND_SIZE_FLOAT + : MPU_GUARD_ALIGN_AND_SIZE; #else /* If MPU_STACK_GUARD is not enabled, the guard length is * effectively zero. Stack overflows may be detected only @@ -404,10 +382,8 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp /* User thread */ if (z_arm_thread_is_in_user_mode() == false) { /* User thread in privilege mode */ - if (IS_MPU_GUARD_VIOLATION( - thread->arch.priv_stack_start - guard_len, - guard_len, - fault_addr, psp)) { + if (IS_MPU_GUARD_VIOLATION(thread->arch.priv_stack_start - guard_len, + guard_len, fault_addr, psp)) { /* Thread's privilege stack corruption */ return thread->arch.priv_stack_start; } @@ -419,26 +395,21 @@ uint32_t z_check_thread_stack_fail(const uint32_t fault_addr, const uint32_t psp } } else { /* Supervisor thread */ - if (IS_MPU_GUARD_VIOLATION(thread->stack_info.start - - guard_len, - guard_len, - fault_addr, psp)) { + if (IS_MPU_GUARD_VIOLATION(thread->stack_info.start - guard_len, guard_len, + fault_addr, psp)) { /* Supervisor thread stack corruption */ return thread->stack_info.start; } } #else /* CONFIG_USERSPACE */ #if defined(CONFIG_MULTITHREADING) - if (IS_MPU_GUARD_VIOLATION(thread->stack_info.start - guard_len, - guard_len, - fault_addr, psp)) { + if (IS_MPU_GUARD_VIOLATION(thread->stack_info.start - guard_len, guard_len, fault_addr, + psp)) { /* Thread stack corruption */ return thread->stack_info.start; } #else - if (IS_MPU_GUARD_VIOLATION((uint32_t)z_main_stack, - guard_len, - fault_addr, psp)) { + if (IS_MPU_GUARD_VIOLATION((uint32_t)z_main_stack, guard_len, fault_addr, psp)) { /* Thread stack corruption */ return (uint32_t)K_THREAD_STACK_BUFFER(z_main_stack); } @@ -572,23 +543,23 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr, * When calling arch_irq_unlock_outlined, LR is lost which is fine since * we do not intend to return after calling z_thread_entry. */ - __asm__ volatile ( - "mov r4, %0\n" /* force _main to be stored in a register */ - "msr PSP, %1\n" /* __set_PSP(stack_ptr) */ - - "movs r0, #0\n" /* arch_irq_unlock(0) */ - "ldr r3, =arch_irq_unlock_outlined\n" - "blx r3\n" - - "mov r0, r4\n" /* z_thread_entry(_main, NULL, NULL, NULL) */ - "movs r1, #0\n" - "movs r2, #0\n" - "movs r3, #0\n" - "ldr r4, =z_thread_entry\n" - "bx r4\n" /* We don’t intend to return, so there is no need to link. */ - : - : "r" (_main), "r" (stack_ptr) - : "r0", "r1", "r2", "r3", "r4", "ip", "lr", "memory"); + __asm__ volatile("mov r4, %0\n" /* force _main to be stored in a register */ + "msr PSP, %1\n" /* __set_PSP(stack_ptr) */ + + "movs r0, #0\n" /* arch_irq_unlock(0) */ + "ldr r3, =arch_irq_unlock_outlined\n" + "blx r3\n" + + "mov r0, r4\n" /* z_thread_entry(_main, NULL, NULL, NULL) */ + "movs r1, #0\n" + "movs r2, #0\n" + "movs r3, #0\n" + "ldr r4, =z_thread_entry\n" + /* We don’t intend to return, so there is no need to link. */ + "bx r4\n" + : + : "r"(_main), "r"(stack_ptr) + : "r0", "r1", "r2", "r3", "r4", "ip", "lr", "memory"); CODE_UNREACHABLE; } @@ -597,7 +568,7 @@ __used void arch_irq_unlock_outlined(unsigned int key) { #if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) __enable_fault_irq(); /* alters FAULTMASK */ - __enable_irq(); /* alters PRIMASK */ + __enable_irq(); /* alters PRIMASK */ #endif arch_irq_unlock(key); } @@ -609,14 +580,13 @@ __used unsigned int arch_irq_lock_outlined(void) #if !defined(CONFIG_MULTITHREADING) -FUNC_NORETURN void z_arm_switch_to_main_no_multithreading( - k_thread_entry_t main_entry, void *p1, void *p2, void *p3) +FUNC_NORETURN void z_arm_switch_to_main_no_multithreading(k_thread_entry_t main_entry, void *p1, + void *p2, void *p3) { z_arm_prepare_switch_to_main(); /* Set PSP to the highest address of the main stack. */ - char *psp = K_THREAD_STACK_BUFFER(z_main_stack) + - K_THREAD_STACK_SIZEOF(z_main_stack); + char *psp = K_THREAD_STACK_BUFFER(z_main_stack) + K_THREAD_STACK_SIZEOF(z_main_stack); #if defined(CONFIG_BUILTIN_STACK_GUARD) char *psplim = (K_THREAD_STACK_BUFFER(z_main_stack)); @@ -636,31 +606,31 @@ FUNC_NORETURN void z_arm_switch_to_main_no_multithreading( * with the thread entry process. */ - __asm__ volatile ( + __asm__ volatile( #ifdef CONFIG_BUILTIN_STACK_GUARD - "msr PSPLIM, %[_psplim]\n" /* __set_PSPLIM(_psplim) */ + "msr PSPLIM, %[_psplim]\n" /* __set_PSPLIM(_psplim) */ #endif - "msr PSP, %[_psp]\n" /* __set_PSP(psp) */ - "mov r0, #0\n" - "ldr r1, =arch_irq_unlock_outlined\n" - "blx r1\n" - - "mov r0, %[_p1]\n" - "mov r1, %[_p2]\n" - "mov r2, %[_p3]\n" - "blx %[_main_entry]\n" /* main_entry(p1, p2, p3) */ - - "ldr r0, =arch_irq_lock_outlined\n" - "blx r0\n" - "loop: b loop\n\t" /* while (true); */ - : - : [_p1]"r" (p1), [_p2]"r" (p2), [_p3]"r" (p3), - [_psp]"r" (psp), [_main_entry]"r" (main_entry) + "msr PSP, %[_psp]\n" /* __set_PSP(psp) */ + "movs r0, #0\n" + "ldr r1, =arch_irq_unlock_outlined\n" + "blx r1\n" + + "mov r0, %[_p1]\n" + "mov r1, %[_p2]\n" + "mov r2, %[_p3]\n" + "blx %[_main_entry]\n" /* main_entry(p1, p2, p3) */ + + "ldr r0, =arch_irq_lock_outlined\n" + "blx r0\n" + "loop: b loop\n\t" /* while (true); */ + : + : [_p1] "r"(p1), [_p2] "r"(p2), [_p3] "r"(p3), [_psp] "r"(psp), + [_main_entry] "r"(main_entry) #ifdef CONFIG_BUILTIN_STACK_GUARD - , [_psplim]"r" (psplim) + , + [_psplim] "r"(psplim) #endif - : "r0", "r1", "r2", "ip", "lr" - ); + : "r0", "r1", "r2", "ip", "lr"); CODE_UNREACHABLE; /* LCOV_EXCL_LINE */ } diff --git a/arch/arm/core/cortex_m/timing.c b/arch/arm/core/cortex_m/timing.c index 6cb157552ace2..2ce7f64552ba5 100644 --- a/arch/arm/core/cortex_m/timing.c +++ b/arch/arm/core/cortex_m/timing.c @@ -73,7 +73,6 @@ static inline uint64_t z_arm_dwt_freq_get(void) } while ((dcyc == 0) || (ddwt == 0)); dwt_frequency = (cyc_freq * ddwt) / dcyc; - } return dwt_frequency; #endif /* CONFIG_SOC_FAMILY_NORDIC_NRF */ @@ -100,8 +99,7 @@ timing_t arch_timing_counter_get(void) return (timing_t)z_arm_dwt_get_cycles(); } -uint64_t arch_timing_cycles_get(volatile timing_t *const start, - volatile timing_t *const end) +uint64_t arch_timing_cycles_get(volatile timing_t *const start, volatile timing_t *const end) { return ((uint32_t)*end - (uint32_t)*start); } diff --git a/arch/arm/core/cortex_m/tz/CMakeLists.txt b/arch/arm/core/cortex_m/tz/CMakeLists.txt index 19c67476e40ee..aac4f65161941 100644 --- a/arch/arm/core/cortex_m/tz/CMakeLists.txt +++ b/arch/arm/core/cortex_m/tz/CMakeLists.txt @@ -2,7 +2,10 @@ # '-mcmse' enables the generation of code for the Secure state of the ARMv8-M # Security Extensions. This option is required when building a Secure firmware. -zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE -mcmse) + +zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE $<$:$>) +zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE $<$:$>) +zephyr_compile_options_ifdef(CONFIG_ARM_SECURE_FIRMWARE $<$:$>) if(CONFIG_ARM_FIRMWARE_HAS_SECURE_ENTRY_FUNCS) diff --git a/arch/arm/core/elf.c b/arch/arm/core/elf.c index 5fdc5471a6bbc..d44e7dd2e2c2b 100644 --- a/arch/arm/core/elf.c +++ b/arch/arm/core/elf.c @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -316,11 +317,32 @@ static void thm_movs_handler(elf_word reloc_type, uint32_t loc, * Do NOT mix them with not 'Thumb instructions' in the below switch/case: they are not * intended to work together. */ -int arch_elf_relocate(elf_rela_t *rel, uintptr_t loc, uintptr_t sym_base_addr, - const char *sym_name, uintptr_t load_bias) +int arch_elf_relocate(struct llext_loader *ldr, struct llext *ext, elf_rela_t *rel, + const elf_shdr_t *shdr) { int ret = 0; elf_word reloc_type = ELF32_R_TYPE(rel->r_info); + const uintptr_t load_bias = (uintptr_t)ext->mem[LLEXT_MEM_TEXT]; + const uintptr_t loc = llext_get_reloc_instruction_location(ldr, ext, shdr->sh_info, rel); + elf_sym_t sym; + uintptr_t sym_base_addr; + const char *sym_name; + + ret = llext_read_symbol(ldr, ext, rel, &sym); + + if (ret != 0) { + LOG_ERR("Could not read symbol from binary!"); + return ret; + } + + sym_name = llext_symbol_name(ldr, ext, &sym); + + ret = llext_lookup_symbol(ldr, ext, &sym_base_addr, rel, &sym, sym_name, shdr); + + if (ret != 0) { + LOG_ERR("Could not find symbol %s!", sym_name); + return ret; + } LOG_DBG("%d %lx %lx %s", reloc_type, loc, sym_base_addr, sym_name); diff --git a/arch/arm/core/mmu/arm_mmu.c b/arch/arm/core/mmu/arm_mmu.c index 4b398eb2d16e8..62ef1492557c7 100644 --- a/arch/arm/core/mmu/arm_mmu.c +++ b/arch/arm/core/mmu/arm_mmu.c @@ -805,10 +805,10 @@ int z_arm_mmu_init(void) } /* Clear TTBR1 */ - __asm__ __volatile__("mcr p15, 0, %0, c2, c0, 1" : : "r"(reg_val)); + __asm__ volatile("mcr p15, 0, %0, c2, c0, 1" : : "r"(reg_val)); /* Write TTBCR: EAE, security not yet relevant, N[2:0] = 0 */ - __asm__ __volatile__("mcr p15, 0, %0, c2, c0, 2" + __asm__ volatile("mcr p15, 0, %0, c2, c0, 2" : : "r"(reg_val)); /* Write TTBR0 */ diff --git a/arch/arm/core/mpu/Kconfig b/arch/arm/core/mpu/Kconfig index 67baee979c9bd..ff48692ec65fe 100644 --- a/arch/arm/core/mpu/Kconfig +++ b/arch/arm/core/mpu/Kconfig @@ -1,6 +1,7 @@ # Memory Protection Unit (MPU) configuration options # Copyright (c) 2017 Linaro Limited +# Copyright 2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 if CPU_HAS_MPU @@ -68,6 +69,15 @@ config CUSTOM_SECTION_MIN_ALIGN_SIZE size is configured by users, it must also respect the power of two regulation if hardware requires. +config ARM_MPU_PXN + bool + depends on ARMV8_1_M_MAINLINE + help + Enable support for Armv8.1-m MPU's Privileged Execute Never (PXN) attr. + An MPU region marked with PXN attribute can only be executed from an + unprivileged mode and executing such region from privileged mode will + result in a Memory Management fault. + endif # ARM_MPU endif # CPU_HAS_MPU diff --git a/arch/arm/core/mpu/arm_core_mpu.c b/arch/arm/core/mpu/arm_core_mpu.c index dde98c0b07fa8..03d02e9b6ea97 100644 --- a/arch/arm/core/mpu/arm_core_mpu.c +++ b/arch/arm/core/mpu/arm_core_mpu.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017 Linaro Limited. + * Copyright 2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -64,53 +65,61 @@ extern char __ram_text_reloc_size[]; static const struct z_arm_mpu_partition static_regions[] = { #if defined(CONFIG_COVERAGE_GCOV) && defined(CONFIG_USERSPACE) - { + { /* GCOV code coverage accounting area. Needs User permissions * to function */ .start = (uint32_t)&__gcov_bss_start, .size = (uint32_t)&__gcov_bss_size, .attr = K_MEM_PARTITION_P_RW_U_RW, - }, + }, #endif /* CONFIG_COVERAGE_GCOV && CONFIG_USERSPACE */ #if defined(CONFIG_NOCACHE_MEMORY) - { + { /* Special non-cacheable RAM area */ .start = (uint32_t)&_nocache_ram_start, .size = (uint32_t)&_nocache_ram_size, .attr = K_MEM_PARTITION_P_RW_U_NA_NOCACHE, - }, + }, #endif /* CONFIG_NOCACHE_MEMORY */ #if defined(CONFIG_ARCH_HAS_RAMFUNC_SUPPORT) - { + { /* Special RAM area for program text */ .start = (uint32_t)&__ramfunc_start, .size = (uint32_t)&__ramfunc_size, +#if defined(CONFIG_ARM_MPU_PXN) && defined(CONFIG_USERSPACE) + .attr = K_MEM_PARTITION_P_R_U_RX, +#else .attr = K_MEM_PARTITION_P_RX_U_RX, - }, +#endif + }, #endif /* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT */ #if defined(CONFIG_CODE_DATA_RELOCATION_SRAM) - { + { /* RAM area for relocated text */ .start = (uint32_t)&__ram_text_reloc_start, .size = (uint32_t)&__ram_text_reloc_size, +#if defined(CONFIG_ARM_MPU_PXN) && defined(CONFIG_USERSPACE) + .attr = K_MEM_PARTITION_P_R_U_RX, +#else .attr = K_MEM_PARTITION_P_RX_U_RX, - }, +#endif + }, #endif /* CONFIG_CODE_DATA_RELOCATION_SRAM */ #if !defined(CONFIG_MULTITHREADING) && defined(CONFIG_MPU_STACK_GUARD) - /* Main stack MPU guard to detect overflow. - * Note: - * FPU_SHARING and USERSPACE are not supported features - * under CONFIG_MULTITHREADING=n, so the MPU guard (if - * exists) is reserved aside of CONFIG_MAIN_STACK_SIZE - * and there is no requirement for larger guard area (FP - * context is not stacked). - */ - { - .start = (uint32_t)z_main_stack, - .size = (uint32_t)MPU_GUARD_ALIGN_AND_SIZE, - .attr = K_MEM_PARTITION_P_RO_U_NA, - }, + /* Main stack MPU guard to detect overflow. + * Note: + * FPU_SHARING and USERSPACE are not supported features + * under CONFIG_MULTITHREADING=n, so the MPU guard (if + * exists) is reserved aside of CONFIG_MAIN_STACK_SIZE + * and there is no requirement for larger guard area (FP + * context is not stacked). + */ + { + .start = (uint32_t)z_main_stack, + .size = (uint32_t)MPU_GUARD_ALIGN_AND_SIZE, + .attr = K_MEM_PARTITION_P_RO_U_NA, + }, #endif /* !CONFIG_MULTITHREADING && CONFIG_MPU_STACK_GUARD */ }; diff --git a/arch/arm/core/mpu/arm_mpu.c b/arch/arm/core/mpu/arm_mpu.c index bec7b18a4f2c2..f9a5397da4644 100644 --- a/arch/arm/core/mpu/arm_mpu.c +++ b/arch/arm/core/mpu/arm_mpu.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017 Linaro Limited. + * Copyright 2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -93,7 +94,7 @@ static int region_allocate_and_init(const uint8_t index, (reg).dt_addr, \ (reg).dt_size, \ _ATTR) - +#ifdef CONFIG_MEM_ATTR /* This internal function programs the MPU regions defined in the DT when using * the `zephyr,memory-attr = <( DT_MEM_ARM(...) )>` property. */ @@ -111,6 +112,11 @@ static int mpu_configure_regions_from_dt(uint8_t *reg_index) case DT_MEM_ARM_MPU_RAM: region_conf = _BUILD_REGION_CONF(region[idx], REGION_RAM_ATTR); break; +#ifdef CONFIG_ARM_MPU_PXN + case DT_MEM_ARM_MPU_RAM_PXN: + region_conf = _BUILD_REGION_CONF(region[idx], REGION_RAM_ATTR_PXN); + break; +#endif #ifdef REGION_RAM_NOCACHE_ATTR case DT_MEM_ARM_MPU_RAM_NOCACHE: region_conf = _BUILD_REGION_CONF(region[idx], REGION_RAM_NOCACHE_ATTR); @@ -158,7 +164,7 @@ static int mpu_configure_regions_from_dt(uint8_t *reg_index) return 0; } - +#endif /* CONFIG_MEM_ATTR */ /* This internal function programs an MPU region * of a given configuration at a given MPU index. */ @@ -459,13 +465,13 @@ int z_arm_mpu_init(void) /* Update the number of programmed MPU regions. */ static_regions_num = mpu_config.num_regions; - +#ifdef CONFIG_MEM_ATTR /* DT-defined MPU regions. */ if (mpu_configure_regions_from_dt(&static_regions_num) == -EINVAL) { __ASSERT(0, "Failed to allocate MPU regions from DT\n"); return -EINVAL; } - +#endif /* CONFIG_MEM_ATTR */ /* Clear all regions before enabling MPU */ for (int i = static_regions_num; i < get_num_regions(); i++) { mpu_clear_region(i); diff --git a/arch/arm/core/mpu/arm_mpu_v8_internal.h b/arch/arm/core/mpu/arm_mpu_v8_internal.h index 51ab093d17c55..0716c017ff964 100644 --- a/arch/arm/core/mpu/arm_mpu_v8_internal.h +++ b/arch/arm/core/mpu/arm_mpu_v8_internal.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2017 Linaro Limited. * Copyright (c) 2018 Nordic Semiconductor ASA. + * Copyright 2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -158,6 +159,7 @@ static void mpu_set_region(uint32_t rnr, uint32_t rbar, uint32_t rlar) static void region_init(const uint32_t index, const struct arm_mpu_region *region_conf) { + /* clang-format off */ mpu_set_region( /* RNR */ index, @@ -170,7 +172,11 @@ static void region_init(const uint32_t index, | ((region_conf->attr.mair_idx << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | MPU_RLAR_EN_Msk +#ifdef CONFIG_ARM_MPU_PXN + | ((region_conf->attr.pxn << MPU_RLAR_PXN_Pos) & MPU_RLAR_PXN_Msk) +#endif ); + /* clang-format on */ LOG_DBG("[%d] 0x%08x 0x%08x 0x%08x 0x%08x", index, region_conf->base, region_conf->attr.rbar, @@ -279,6 +285,9 @@ static inline void mpu_region_get_access_attr(const uint32_t index, (MPU_RBAR_XN_Msk | MPU_RBAR_AP_Msk | MPU_RBAR_SH_Msk); attr->mair_idx = (mpu_get_rlar() & MPU_RLAR_AttrIndx_Msk) >> MPU_RLAR_AttrIndx_Pos; +#ifdef CONFIG_ARM_MPU_PXN + attr->pxn = (mpu_get_rlar() & MPU_RLAR_PXN_Msk) >> MPU_RLAR_PXN_Pos; +#endif } static inline void mpu_region_get_conf(const uint32_t index, @@ -313,6 +322,9 @@ static inline void get_region_attr_from_mpu_partition_info( (MPU_RBAR_XN_Msk | MPU_RBAR_AP_Msk | MPU_RBAR_SH_Msk); p_attr->mair_idx = attr->mair_idx; p_attr->r_limit = REGION_LIMIT_ADDR(base, size); +#ifdef CONFIG_ARM_MPU_PXN + p_attr->pxn = attr->pxn; +#endif } #if defined(CONFIG_USERSPACE) diff --git a/arch/arm/core/mpu/nxp_mpu.c b/arch/arm/core/mpu/nxp_mpu.c index b0fe24c6bf617..ae893086901ce 100644 --- a/arch/arm/core/mpu/nxp_mpu.c +++ b/arch/arm/core/mpu/nxp_mpu.c @@ -151,7 +151,7 @@ static int region_allocate_and_init(const uint8_t index, .end = (reg).dt_addr + (reg).dt_size, \ .attr = _ATTR, \ } - +#ifdef CONFIG_MEM_ATTR /* This internal function programs the MPU regions defined in the DT when using * the `zephyr,memory-attr = <( DT_MEM_ARM(...) )>` property. */ @@ -198,7 +198,7 @@ static int mpu_configure_regions_from_dt(uint8_t *reg_index) return 0; } - +#endif /* CONFIG_MEM_ATTR */ /** * This internal function is utilized by the MPU driver to combine a given * region attribute configuration and size and fill-in a driver-specific @@ -700,13 +700,13 @@ int z_arm_mpu_init(void) /* Update the number of programmed MPU regions. */ static_regions_num = mpu_config.num_regions; - +#ifdef CONFIG_MEM_ATTR /* DT-defined MPU regions. */ if (mpu_configure_regions_from_dt(&static_regions_num) == -EINVAL) { __ASSERT(0, "Failed to allocate MPU regions from DT\n"); return -EINVAL; } - +#endif /* CONFIG_MEM_ATTR */ arm_core_mpu_enable(); return 0; diff --git a/arch/arm/core/tls.c b/arch/arm/core/tls.c index 9b731286c7da8..0dc21285a916d 100644 --- a/arch/arm/core/tls.c +++ b/arch/arm/core/tls.c @@ -40,8 +40,10 @@ size_t arch_tls_stack_setup(struct k_thread *new_thread, char *stack_ptr) stack_ptr -= z_tls_data_size(); z_tls_copy(stack_ptr); +#ifndef __IAR_SYSTEMS_ICC__ /* Skip two pointers due to toolchain */ stack_ptr -= sizeof(uintptr_t) * 2; +#endif /* * Set thread TLS pointer which is used in diff --git a/arch/arm/include/cortex_m/cmse.h b/arch/arm/include/cortex_m/cmse.h index ff5e5120d8d39..ca997220dbd16 100644 --- a/arch/arm/include/cortex_m/cmse.h +++ b/arch/arm/include/cortex_m/cmse.h @@ -139,7 +139,7 @@ int arm_cmse_addr_range_readwrite_ok(uint32_t addr, uint32_t size, int force_npr * where typeof is used instead of __typeof__) */ #ifndef typeof -#define typeof __typeof__ +#define typeof __typeof__ #endif /** @@ -157,8 +157,7 @@ int arm_cmse_addr_range_readwrite_ok(uint32_t addr, uint32_t size, int force_npr * * @return p_obj if object is readable, NULL otherwise. */ -#define ARM_CMSE_OBJECT_READ_OK(p_obj) \ - cmse_check_pointed_object(p_obj, CMSE_MPU_READ) +#define ARM_CMSE_OBJECT_READ_OK(p_obj) cmse_check_pointed_object(p_obj, CMSE_MPU_READ) /** * @brief Read accessibility of an object (nPRIV mode) @@ -175,7 +174,7 @@ int arm_cmse_addr_range_readwrite_ok(uint32_t addr, uint32_t size, int force_npr * * @return p_obj if object is readable, NULL otherwise. */ -#define ARM_CMSE_OBJECT_UNPRIV_READ_OK(p_obj) \ +#define ARM_CMSE_OBJECT_UNPRIV_READ_OK(p_obj) \ cmse_check_pointed_object(p_obj, CMSE_MPU_UNPRIV | CMSE_MPU_READ) /** @@ -193,8 +192,7 @@ int arm_cmse_addr_range_readwrite_ok(uint32_t addr, uint32_t size, int force_npr * * @return p_obj if object is Read and Writable, NULL otherwise. */ -#define ARM_CMSE_OBJECT_READWRITE_OK(p_obj) \ - cmse_check_pointed_object(p_obj, CMSE_MPU_READWRITE) +#define ARM_CMSE_OBJECT_READWRITE_OK(p_obj) cmse_check_pointed_object(p_obj, CMSE_MPU_READWRITE) /** * @brief Read and Write accessibility of an object (nPRIV mode) @@ -211,7 +209,7 @@ int arm_cmse_addr_range_readwrite_ok(uint32_t addr, uint32_t size, int force_npr * * @return p_obj if object is Read and Writable, NULL otherwise. */ -#define ARM_CMSE_OBJECT_UNPRIV_READWRITE_OK(p_obj) \ +#define ARM_CMSE_OBJECT_UNPRIV_READWRITE_OK(p_obj) \ cmse_check_pointed_object(p_obj, CMSE_MPU_UNPRIV | CMSE_MPU_READWRITE) #if defined(CONFIG_ARM_SECURE_FIRMWARE) @@ -231,7 +229,7 @@ int arm_cmse_addr_range_readwrite_ok(uint32_t addr, uint32_t size, int force_npr * @param addr The address for which the MPU region is requested * * @return a valid MPU region number or -EINVAL - */ + */ int arm_cmse_mpu_nonsecure_region_get(uint32_t addr); /** @@ -249,7 +247,7 @@ int arm_cmse_mpu_nonsecure_region_get(uint32_t addr); * @param addr The address for which the SAU region is requested * * @return a valid SAU region number or -EINVAL - */ + */ int arm_cmse_sau_region_get(uint32_t addr); /** @@ -267,7 +265,7 @@ int arm_cmse_sau_region_get(uint32_t addr); * @param addr The address for which the IDAU region is requested * * @return a valid IDAU region number or -EINVAL - */ + */ int arm_cmse_idau_region_get(uint32_t addr); /** @@ -342,8 +340,7 @@ int arm_cmse_addr_nonsecure_readwrite_ok(uint32_t addr, int force_npriv); * * @return 1 if address range is readable, 0 otherwise. */ -int arm_cmse_addr_range_nonsecure_read_ok(uint32_t addr, uint32_t size, - int force_npriv); +int arm_cmse_addr_range_nonsecure_read_ok(uint32_t addr, uint32_t size, int force_npriv); /** * @brief Non-Secure Read and Write accessibility of an address range @@ -365,8 +362,7 @@ int arm_cmse_addr_range_nonsecure_read_ok(uint32_t addr, uint32_t size, * * @return 1 if address range is readable, 0 otherwise. */ -int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, - int force_npriv); +int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, int force_npriv); /** * @brief Non-Secure Read accessibility of an object @@ -383,7 +379,7 @@ int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, * * @return p_obj if object is readable from Non-Secure state, NULL otherwise. */ -#define ARM_CMSE_OBJECT_NONSECURE_READ_OK(p_obj) \ +#define ARM_CMSE_OBJECT_NONSECURE_READ_OK(p_obj) \ cmse_check_pointed_object(p_obj, CMSE_NONSECURE | CMSE_MPU_READ) /** @@ -401,9 +397,8 @@ int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, * * @return p_obj if object is readable from Non-Secure state, NULL otherwise. */ -#define ARM_CMSE_OBJECT_NONSECURE_UNPRIV_READ_OK(p_obj) \ - cmse_check_pointed_object(p_obj, \ - CMSE_NONSECURE | CMSE_MPU_UNPRIV | CMSE_MPU_READ) +#define ARM_CMSE_OBJECT_NONSECURE_UNPRIV_READ_OK(p_obj) \ + cmse_check_pointed_object(p_obj, CMSE_NONSECURE | CMSE_MPU_UNPRIV | CMSE_MPU_READ) /** * @brief Non-Secure Read and Write accessibility of an object @@ -420,7 +415,7 @@ int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, * * @return p_obj if object is Non-Secure Read and Writable, NULL otherwise. */ -#define ARM_CMSE_OBJECT_NONSECURE_READWRITE_OK(p_obj) \ +#define ARM_CMSE_OBJECT_NONSECURE_READWRITE_OK(p_obj) \ cmse_check_pointed_object(p_obj, CMSE_NONSECURE | CMSE_MPU_READWRITE) /** @@ -438,9 +433,8 @@ int arm_cmse_addr_range_nonsecure_readwrite_ok(uint32_t addr, uint32_t size, * * @return p_obj if object is Non-Secure Read and Writable, NULL otherwise. */ -#define ARM_CMSE_OBJECT_NON_SECURE_UNPRIV_READWRITE_OK(p_obj) \ - cmse_check_pointed_object(p_obj, \ - CMSE_NONSECURE | CMSE_MPU_UNPRIV | CMSE_MPU_READWRITE) +#define ARM_CMSE_OBJECT_NON_SECURE_UNPRIV_READWRITE_OK(p_obj) \ + cmse_check_pointed_object(p_obj, CMSE_NONSECURE | CMSE_MPU_UNPRIV | CMSE_MPU_READWRITE) #endif /* CONFIG_ARM_SECURE_FIRMWARE */ diff --git a/arch/arm/include/cortex_m/dwt.h b/arch/arm/include/cortex_m/dwt.h index ed0df44dfde56..947b35dca92e8 100644 --- a/arch/arm/include/cortex_m/dwt.h +++ b/arch/arm/include/cortex_m/dwt.h @@ -64,7 +64,7 @@ static inline void dwt_access(bool ena) } } } -#else /* CONFIG_CPU_CORTEX_M7 */ +#else /* CONFIG_CPU_CORTEX_M7 */ ARG_UNUSED(ena); #endif /* CONFIG_CPU_CORTEX_M7 */ } @@ -103,9 +103,8 @@ static inline int z_arm_dwt_init_cycle_counter(void) /* Assert that the cycle counter is indeed implemented. * The field is called NOCYCCNT. So 1 means there is no cycle counter. */ - __ASSERT((DWT->CTRL & DWT_CTRL_NOCYCCNT_Msk) == 0, - "DWT implements no cycle counter. " - "Cannot be used for cycle counting\n"); + __ASSERT((DWT->CTRL & DWT_CTRL_NOCYCCNT_Msk) == 0, "DWT implements no cycle counter. " + "Cannot be used for cycle counting\n"); return 0; } @@ -148,7 +147,7 @@ static inline void z_arm_dwt_enable_debug_monitor(void) * assert that the CPU is in normal mode. */ __ASSERT((CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) == 0, - "Cannot enable DBM when CPU is in Debug mode\n"); + "Cannot enable DBM when CPU is in Debug mode\n"); #if defined(CONFIG_ARMV8_M_SE) && !defined(CONFIG_ARM_NONSECURE_FIRMWARE) /* @@ -158,8 +157,7 @@ static inline void z_arm_dwt_enable_debug_monitor(void) * when enabling the DebugMonitor exception, assert that * it is not targeting the Non Secure domain. */ - __ASSERT((CoreDebug->DEMCR & DCB_DEMCR_SDME_Msk) != 0, - "DebugMonitor targets Non-Secure\n"); + __ASSERT((CoreDebug->DEMCR & DCB_DEMCR_SDME_Msk) != 0, "DebugMonitor targets Non-Secure\n"); #endif /* The DebugMonitor handler priority is set already diff --git a/arch/arm/include/cortex_m/exception.h b/arch/arm/include/cortex_m/exception.h index c021d59d76411..0800a16436f16 100644 --- a/arch/arm/include/cortex_m/exception.h +++ b/arch/arm/include/cortex_m/exception.h @@ -37,7 +37,7 @@ extern volatile irq_offload_routine_t offload_routine; /* Writes to the AIRCR must be accompanied by a write of the value 0x05FA * to the Vector Key field, otherwise the writes are ignored. */ -#define AIRCR_VECT_KEY_PERMIT_WRITE 0x05FAUL +#define AIRCR_VECT_KEY_PERMIT_WRITE 0x05FAUL /* Exception Return (EXC_RETURN) is provided in LR upon exception entry. * It is used to perform an exception return and to detect possible state @@ -47,45 +47,44 @@ extern volatile irq_offload_routine_t offload_routine; /* Prefix. Indicates that this is an EXC_RETURN value. * This field reads as 0b11111111. */ -#define EXC_RETURN_INDICATOR_PREFIX (0xFF << 24) +#define EXC_RETURN_INDICATOR_PREFIX (0xFF << 24) /* bit[0]: Exception Secure. The security domain the exception was taken to. */ -#define EXC_RETURN_EXCEPTION_SECURE_Pos 0 -#define EXC_RETURN_EXCEPTION_SECURE_Msk \ - BIT(EXC_RETURN_EXCEPTION_SECURE_Pos) +#define EXC_RETURN_EXCEPTION_SECURE_Pos 0 +#define EXC_RETURN_EXCEPTION_SECURE_Msk BIT(EXC_RETURN_EXCEPTION_SECURE_Pos) #define EXC_RETURN_EXCEPTION_SECURE_Non_Secure 0 -#define EXC_RETURN_EXCEPTION_SECURE_Secure EXC_RETURN_EXCEPTION_SECURE_Msk +#define EXC_RETURN_EXCEPTION_SECURE_Secure EXC_RETURN_EXCEPTION_SECURE_Msk /* bit[2]: Stack Pointer selection. */ -#define EXC_RETURN_SPSEL_Pos 2 -#define EXC_RETURN_SPSEL_Msk BIT(EXC_RETURN_SPSEL_Pos) -#define EXC_RETURN_SPSEL_MAIN 0 -#define EXC_RETURN_SPSEL_PROCESS EXC_RETURN_SPSEL_Msk +#define EXC_RETURN_SPSEL_Pos 2 +#define EXC_RETURN_SPSEL_Msk BIT(EXC_RETURN_SPSEL_Pos) +#define EXC_RETURN_SPSEL_MAIN 0 +#define EXC_RETURN_SPSEL_PROCESS EXC_RETURN_SPSEL_Msk /* bit[3]: Mode. Indicates the Mode that was stacked from. */ -#define EXC_RETURN_MODE_Pos 3 -#define EXC_RETURN_MODE_Msk BIT(EXC_RETURN_MODE_Pos) -#define EXC_RETURN_MODE_HANDLER 0 -#define EXC_RETURN_MODE_THREAD EXC_RETURN_MODE_Msk +#define EXC_RETURN_MODE_Pos 3 +#define EXC_RETURN_MODE_Msk BIT(EXC_RETURN_MODE_Pos) +#define EXC_RETURN_MODE_HANDLER 0 +#define EXC_RETURN_MODE_THREAD EXC_RETURN_MODE_Msk /* bit[4]: Stack frame type. Indicates whether the stack frame is a standard * integer only stack frame or an extended floating-point stack frame. */ -#define EXC_RETURN_STACK_FRAME_TYPE_Pos 4 -#define EXC_RETURN_STACK_FRAME_TYPE_Msk BIT(EXC_RETURN_STACK_FRAME_TYPE_Pos) -#define EXC_RETURN_STACK_FRAME_TYPE_EXTENDED 0 -#define EXC_RETURN_STACK_FRAME_TYPE_STANDARD EXC_RETURN_STACK_FRAME_TYPE_Msk +#define EXC_RETURN_STACK_FRAME_TYPE_Pos 4 +#define EXC_RETURN_STACK_FRAME_TYPE_Msk BIT(EXC_RETURN_STACK_FRAME_TYPE_Pos) +#define EXC_RETURN_STACK_FRAME_TYPE_EXTENDED 0 +#define EXC_RETURN_STACK_FRAME_TYPE_STANDARD EXC_RETURN_STACK_FRAME_TYPE_Msk /* bit[5]: Default callee register stacking. Indicates whether the default * stacking rules apply, or whether the callee registers are already on the * stack. */ -#define EXC_RETURN_CALLEE_STACK_Pos 5 -#define EXC_RETURN_CALLEE_STACK_Msk BIT(EXC_RETURN_CALLEE_STACK_Pos) -#define EXC_RETURN_CALLEE_STACK_SKIPPED 0 -#define EXC_RETURN_CALLEE_STACK_DEFAULT EXC_RETURN_CALLEE_STACK_Msk +#define EXC_RETURN_CALLEE_STACK_Pos 5 +#define EXC_RETURN_CALLEE_STACK_Msk BIT(EXC_RETURN_CALLEE_STACK_Pos) +#define EXC_RETURN_CALLEE_STACK_SKIPPED 0 +#define EXC_RETURN_CALLEE_STACK_DEFAULT EXC_RETURN_CALLEE_STACK_Msk /* bit[6]: Secure or Non-secure stack. Indicates whether a Secure or * Non-secure stack is used to restore stack frame on exception return. */ -#define EXC_RETURN_RETURN_STACK_Pos 6 -#define EXC_RETURN_RETURN_STACK_Msk BIT(EXC_RETURN_RETURN_STACK_Pos) -#define EXC_RETURN_RETURN_STACK_Non_Secure 0 -#define EXC_RETURN_RETURN_STACK_Secure EXC_RETURN_RETURN_STACK_Msk +#define EXC_RETURN_RETURN_STACK_Pos 6 +#define EXC_RETURN_RETURN_STACK_Msk BIT(EXC_RETURN_RETURN_STACK_Pos) +#define EXC_RETURN_RETURN_STACK_Non_Secure 0 +#define EXC_RETURN_RETURN_STACK_Secure EXC_RETURN_RETURN_STACK_Msk /* * The current executing vector is found in the IPSR register. All @@ -170,8 +169,8 @@ static ALWAYS_INLINE void z_arm_exc_setup(void) #endif /* CONFIG_ARM_SECURE_FIRMWARE */ /* Enable Usage, Mem, & Bus Faults */ - SCB->SHCSR |= SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_MEMFAULTENA_Msk | - SCB_SHCSR_BUSFAULTENA_Msk; + SCB->SHCSR |= + SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_MEMFAULTENA_Msk | SCB_SHCSR_BUSFAULTENA_Msk; #if defined(CONFIG_ARM_SECURE_FIRMWARE) /* Enable Secure Fault */ SCB->SHCSR |= SCB_SHCSR_SECUREFAULTENA_Msk; @@ -180,25 +179,21 @@ static ALWAYS_INLINE void z_arm_exc_setup(void) #endif /* CONFIG_ARM_SECURE_FIRMWARE */ #endif /* CONFIG_CPU_CORTEX_M_HAS_PROGRAMMABLE_FAULT_PRIOS */ -#if defined(CONFIG_ARM_SECURE_FIRMWARE) && \ - !defined(CONFIG_ARM_SECURE_BUSFAULT_HARDFAULT_NMI) +#if defined(CONFIG_ARM_SECURE_FIRMWARE) && !defined(CONFIG_ARM_SECURE_BUSFAULT_HARDFAULT_NMI) /* Set NMI, Hard, and Bus Faults as Non-Secure. * NMI and Bus Faults targeting the Secure state will * escalate to a SecureFault or SecureHardFault. */ SCB->AIRCR = - (SCB->AIRCR & (~(SCB_AIRCR_VECTKEY_Msk))) - | SCB_AIRCR_BFHFNMINS_Msk - | ((AIRCR_VECT_KEY_PERMIT_WRITE << SCB_AIRCR_VECTKEY_Pos) & - SCB_AIRCR_VECTKEY_Msk); + (SCB->AIRCR & (~(SCB_AIRCR_VECTKEY_Msk))) | SCB_AIRCR_BFHFNMINS_Msk | + ((AIRCR_VECT_KEY_PERMIT_WRITE << SCB_AIRCR_VECTKEY_Pos) & SCB_AIRCR_VECTKEY_Msk); /* Note: Fault conditions that would generate a SecureFault * in a PE with the Main Extension instead generate a * SecureHardFault in a PE without the Main Extension. */ #endif /* ARM_SECURE_FIRMWARE && !ARM_SECURE_BUSFAULT_HARDFAULT_NMI */ -#if defined(CONFIG_CPU_CORTEX_M_HAS_SYSTICK) && \ - !defined(CONFIG_CORTEX_M_SYSTICK) +#if defined(CONFIG_CPU_CORTEX_M_HAS_SYSTICK) && !defined(CONFIG_CORTEX_M_SYSTICK) /* SoC implements SysTick, but the system does not use it * as driver for system timing. However, the SysTick IRQ is * always enabled, so we must ensure the interrupt priority @@ -208,7 +203,6 @@ static ALWAYS_INLINE void z_arm_exc_setup(void) */ NVIC_SetPriority(SysTick_IRQn, _EXC_IRQ_DEFAULT_PRIO); #endif /* CPU_CORTEX_M_HAS_SYSTICK && ! CORTEX_M_SYSTICK */ - } /** @@ -221,9 +215,7 @@ static ALWAYS_INLINE void z_arm_clear_faults(void) #if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) /* Reset all faults */ - SCB->CFSR = SCB_CFSR_USGFAULTSR_Msk | - SCB_CFSR_MEMFAULTSR_Msk | - SCB_CFSR_BUSFAULTSR_Msk; + SCB->CFSR = SCB_CFSR_USGFAULTSR_Msk | SCB_CFSR_MEMFAULTSR_Msk | SCB_CFSR_BUSFAULTSR_Msk; /* Clear all Hard Faults - HFSR is write-one-to-clear */ SCB->HFSR = 0xffffffff; @@ -253,7 +245,7 @@ static ALWAYS_INLINE void z_arm_set_fault_sp(const struct arch_esf *esf, uint32_ * registers if necessary */ if ((exc_return & EXC_RETURN_STACK_FRAME_TYPE_STANDARD) == - EXC_RETURN_STACK_FRAME_TYPE_EXTENDED) { + EXC_RETURN_STACK_FRAME_TYPE_EXTENDED) { z_arm_coredump_fault_sp += sizeof(esf->fpu); } #endif /* CONFIG_FPU && CONFIG_FPU_SHARING */ diff --git a/arch/arm/include/cortex_m/kernel_arch_func.h b/arch/arm/include/cortex_m/kernel_arch_func.h index 2a24103a32de0..5abe5870762cf 100644 --- a/arch/arm/include/cortex_m/kernel_arch_func.h +++ b/arch/arm/include/cortex_m/kernel_arch_func.h @@ -61,26 +61,21 @@ static ALWAYS_INLINE void arch_kernel_init(void) #endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */ } -static ALWAYS_INLINE void -arch_thread_return_value_set(struct k_thread *thread, unsigned int value) +static ALWAYS_INLINE void arch_thread_return_value_set(struct k_thread *thread, unsigned int value) { thread->arch.swap_return_value = value; } #if !defined(CONFIG_MULTITHREADING) -extern FUNC_NORETURN void z_arm_switch_to_main_no_multithreading( - k_thread_entry_t main_func, - void *p1, void *p2, void *p3); +extern FUNC_NORETURN void z_arm_switch_to_main_no_multithreading(k_thread_entry_t main_func, + void *p1, void *p2, void *p3); -#define ARCH_SWITCH_TO_MAIN_NO_MULTITHREADING \ - z_arm_switch_to_main_no_multithreading +#define ARCH_SWITCH_TO_MAIN_NO_MULTITHREADING z_arm_switch_to_main_no_multithreading #endif /* !CONFIG_MULTITHREADING */ -extern FUNC_NORETURN void z_arm_userspace_enter(k_thread_entry_t user_entry, - void *p1, void *p2, void *p3, - uint32_t stack_end, - uint32_t stack_start); +extern FUNC_NORETURN void z_arm_userspace_enter(k_thread_entry_t user_entry, void *p1, void *p2, + void *p3, uint32_t stack_end, uint32_t stack_start); extern void z_arm_fatal_error(unsigned int reason, const struct arch_esf *esf); @@ -102,7 +97,6 @@ static ALWAYS_INLINE int arch_swap(unsigned int key) return _current->arch.swap_return_value; } - #endif /* _ASMLANGUAGE */ #ifdef __cplusplus diff --git a/arch/arm/include/cortex_m/stack.h b/arch/arm/include/cortex_m/stack.h index feeaf719a88e0..6b534a3ea5b1a 100644 --- a/arch/arm/include/cortex_m/stack.h +++ b/arch/arm/include/cortex_m/stack.h @@ -26,8 +26,7 @@ extern "C" { #endif -K_KERNEL_STACK_ARRAY_DECLARE(z_interrupt_stacks, CONFIG_MP_MAX_NUM_CPUS, - CONFIG_ISR_STACK_SIZE); +K_KERNEL_STACK_ARRAY_DECLARE(z_interrupt_stacks, CONFIG_MP_MAX_NUM_CPUS, CONFIG_ISR_STACK_SIZE); /** * @@ -39,9 +38,8 @@ K_KERNEL_STACK_ARRAY_DECLARE(z_interrupt_stacks, CONFIG_MP_MAX_NUM_CPUS, */ static ALWAYS_INLINE void z_arm_interrupt_stack_setup(void) { - uint32_t msp = - (uint32_t)(K_KERNEL_STACK_BUFFER(z_interrupt_stacks[0])) + - K_KERNEL_STACK_SIZEOF(z_interrupt_stacks[0]); + uint32_t msp = (uint32_t)(K_KERNEL_STACK_BUFFER(z_interrupt_stacks[0])) + + K_KERNEL_STACK_SIZEOF(z_interrupt_stacks[0]); __set_MSP(msp); #if defined(CONFIG_BUILTIN_STACK_GUARD) diff --git a/arch/arm/include/cortex_m/tz_ns.h b/arch/arm/include/cortex_m/tz_ns.h index 51ed5eb1ca9fe..dd6dcb4c22e56 100644 --- a/arch/arm/include/cortex_m/tz_ns.h +++ b/arch/arm/include/cortex_m/tz_ns.h @@ -46,24 +46,18 @@ * the functions have been called. This instruction must leave * r0-r3 unmodified. */ -#define __TZ_WRAP_FUNC_RAW(preface, name, postface, store_lr, load_lr) \ - __asm__ volatile( \ - ".global "#preface"; .type "#preface", %function"); \ - __asm__ volatile( \ - ".global "#name"; .type "#name", %function"); \ - __asm__ volatile( \ - ".global "#postface"; .type "#postface", %function"); \ - __asm__ volatile( \ - store_lr "\n\t" \ - "push {r0-r3}\n\t" \ - "bl " #preface "\n\t" \ - "pop {r0-r3}\n\t" \ - "bl " #name " \n\t" \ - "push {r0-r3}\n\t" \ - "bl " #postface "\n\t" \ - "pop {r0-r3}\n\t" \ - load_lr "\n\t" \ - ::); +#define __TZ_WRAP_FUNC_RAW(preface, name, postface, store_lr, load_lr) \ + __asm__ volatile(".global " #preface "; .type " #preface ", %function"); \ + __asm__ volatile(".global " #name "; .type " #name ", %function"); \ + __asm__ volatile(".global " #postface "; .type " #postface ", %function"); \ + __asm__ volatile(store_lr "\n\t" \ + "push {r0-r3}\n\t" \ + "bl " #preface "\n\t" \ + "pop {r0-r3}\n\t" \ + "bl " #name "\n\t" \ + "push {r0-r3}\n\t" \ + "bl " #postface "\n\t" \ + "pop {r0-r3}\n\t" load_lr "\n\t" ::); /** * @brief Macro for "sandwiching" a function call (@p name) in two other calls @@ -98,10 +92,8 @@ * * See @ref __TZ_WRAP_FUNC_RAW for more information. */ -#define __TZ_WRAP_FUNC(preface, name, postface) \ - __TZ_WRAP_FUNC_RAW(preface, name, postface, "push {r4, lr}", \ - "pop {r4, pc}") - +#define __TZ_WRAP_FUNC(preface, name, postface) \ + __TZ_WRAP_FUNC_RAW(preface, name, postface, "push {r4, lr}", "pop {r4, pc}") #ifdef CONFIG_ARM_FIRMWARE_USES_SECURE_ENTRY_FUNCS /** @@ -130,10 +122,10 @@ * @param ... The rest of the signature of the function. This must be the same * signature as the corresponding NS entry function. */ -#define TZ_THREAD_SAFE_NONSECURE_ENTRY_FUNC(name, ret, nsc_name, ...) \ - ret __attribute__((naked)) name(__VA_ARGS__) \ - { \ - __TZ_WRAP_FUNC(k_sched_lock, nsc_name, k_sched_unlock); \ +#define TZ_THREAD_SAFE_NONSECURE_ENTRY_FUNC(name, ret, nsc_name, ...) \ + ret __attribute__((naked)) name(__VA_ARGS__) \ + { \ + __TZ_WRAP_FUNC(k_sched_lock, nsc_name, k_sched_unlock); \ } #endif /* CONFIG_ARM_FIRMWARE_USES_SECURE_ENTRY_FUNCS */ diff --git a/arch/arm64/core/cortex_r/arm_mpu.c b/arch/arm64/core/cortex_r/arm_mpu.c index 2bd6d265c9a9e..3053d90cb75f6 100644 --- a/arch/arm64/core/cortex_r/arm_mpu.c +++ b/arch/arm64/core/cortex_r/arm_mpu.c @@ -196,7 +196,7 @@ static ALWAYS_INLINE void region_init(const uint32_t index, .limit = (reg).dt_addr + (reg).dt_size, \ .attr = _ATTR, \ } - +#ifdef CONFIG_MEM_ATTR /* This internal function programs the MPU regions defined in the DT when using * the `zephyr,memory-attr = <( DT_MEM_ARM(...) )>` property. */ @@ -247,7 +247,7 @@ static int mpu_configure_regions_from_dt(uint8_t *reg_index) return 0; } - +#endif /* CONFIG_MEM_ATTR */ /* * @brief MPU default configuration * @@ -303,13 +303,13 @@ FUNC_NO_STACK_PROTECTOR void z_arm64_mm_init(bool is_primary_core) /* Update the number of programmed MPU regions. */ tmp_static_num = mpu_config.num_regions; - +#ifdef CONFIG_MEM_ATTR /* DT-defined MPU regions. */ if (mpu_configure_regions_from_dt(&tmp_static_num) == -EINVAL) { __ASSERT(0, "Failed to allocate MPU regions from DT\n"); return; } - +#endif arm_core_mpu_enable(); if (!is_primary_core) { diff --git a/arch/arm64/core/elf.c b/arch/arm64/core/elf.c index 66e9f21fc06f8..c60c99fad46a6 100644 --- a/arch/arm64/core/elf.c +++ b/arch/arm64/core/elf.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -430,12 +431,32 @@ static int imm_reloc_handler(elf_rela_t *rel, elf_word reloc_type, uintptr_t loc * @retval -ENOTSUP Unsupported relocation * @retval -ENOEXEC Invalid relocation */ -int arch_elf_relocate(elf_rela_t *rel, uintptr_t loc, uintptr_t sym_base_addr, const char *sym_name, - uintptr_t load_bias) +int arch_elf_relocate(struct llext_loader *ldr, struct llext *ext, elf_rela_t *rel, + const elf_shdr_t *shdr) { int ret = 0; bool overflow_check = true; elf_word reloc_type = ELF_R_TYPE(rel->r_info); + const uintptr_t loc = llext_get_reloc_instruction_location(ldr, ext, shdr->sh_info, rel); + elf_sym_t sym; + uintptr_t sym_base_addr; + const char *sym_name; + + ret = llext_read_symbol(ldr, ext, rel, &sym); + + if (ret != 0) { + LOG_ERR("Could not read symbol from binary!"); + return ret; + } + + sym_name = llext_symbol_name(ldr, ext, &sym); + + ret = llext_lookup_symbol(ldr, ext, &sym_base_addr, rel, &sym, sym_name, shdr); + + if (ret != 0) { + LOG_ERR("Could not find symbol %s!", sym_name); + return ret; + } switch (reloc_type) { case R_ARM_NONE: diff --git a/arch/arm64/core/fatal.c b/arch/arm64/core/fatal.c index 7955b6f7d6d16..e7480c9de15aa 100644 --- a/arch/arm64/core/fatal.c +++ b/arch/arm64/core/fatal.c @@ -17,9 +17,11 @@ #include #include #include +#include #include #include #include +#include #include "paging.h" @@ -201,6 +203,33 @@ static void esf_dump(const struct arch_esf *esf) #ifdef CONFIG_ARCH_STACKWALK typedef bool (*arm64_stacktrace_cb)(void *cookie, unsigned long addr, void *fp); +static bool is_address_mapped(uint64_t *addr) +{ + uintptr_t *phys = NULL; + + if (*addr == 0U) + return false; + + /* Check alignment. */ + if ((*addr & (sizeof(uint32_t) - 1U)) != 0U) + return false; + + return !arch_page_phys_get((void *) addr, phys); +} + +static bool is_valid_jump_address(uint64_t *addr) +{ + if (*addr == 0U) + return false; + + /* Check alignment. */ + if ((*addr & (sizeof(uint32_t) - 1U)) != 0U) + return false; + + return ((*addr >= (uint64_t)__text_region_start) && + (*addr <= (uint64_t)(__text_region_end))); +} + static void walk_stackframe(arm64_stacktrace_cb cb, void *cookie, const struct arch_esf *esf, int max_frames) { @@ -234,7 +263,11 @@ static void walk_stackframe(arm64_stacktrace_cb cb, void *cookie, const struct a } for (int i = 0; (fp != NULL) && (i < max_frames); i++) { + if (!is_address_mapped(fp)) + break; lr = fp[1]; + if (!is_valid_jump_address(&lr)) + break; if (!cb(cookie, lr, fp)) { break; } @@ -414,8 +447,6 @@ void z_arm64_fatal_error(unsigned int reason, struct arch_esf *esf) #endif /* CONFIG_EXCEPTION_DEBUG */ z_fatal_error(reason, esf); - - CODE_UNREACHABLE; } /** diff --git a/arch/arm64/core/reset.S b/arch/arm64/core/reset.S index a01139ad70091..235156f9a1c8c 100644 --- a/arch/arm64/core/reset.S +++ b/arch/arm64/core/reset.S @@ -58,9 +58,10 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__reset_prep_c) b out #endif /* CONFIG_ARMV8_R */ 2: - /* Disable alignment fault checking */ + /* Disable alignment fault checking, disable D-Cache, I-Cache, MMU for safety */ mrs x0, sctlr_el2 - bic x0, x0, SCTLR_A_BIT + mov x1, #(SCTLR_A_BIT | SCTLR_C_BIT | SCTLR_M_BIT | SCTLR_I_BIT) + bic x0, x0, x1 msr sctlr_el2, x0 isb diff --git a/arch/arm64/core/thread.c b/arch/arm64/core/thread.c index 18f49945eda49..c48672a5f0761 100644 --- a/arch/arm64/core/thread.c +++ b/arch/arm64/core/thread.c @@ -30,7 +30,7 @@ * privileged portion of the user stack without touching SP_EL0. This portion * is marked as not user accessible in the MMU/MPU. * - * - a stack guard region will be added bellow the kernel stack when + * - a stack guard region will be added below the kernel stack when * ARM64_STACK_PROTECTION is enabled. In this case, SP_EL0 will always point * to the safe exception stack in the kernel space. For the kernel thread, * SP_EL0 will not change always pointing to safe exception stack. For the diff --git a/arch/arm64/core/vector_table.S b/arch/arm64/core/vector_table.S index 632304b70299e..1c2f4218ff1ac 100644 --- a/arch/arm64/core/vector_table.S +++ b/arch/arm64/core/vector_table.S @@ -63,7 +63,7 @@ _ASM_FILE_PROLOGUE stp x12, x13, [sp, ___esf_t_x12_x13_OFFSET] stp x14, x15, [sp, ___esf_t_x14_x15_OFFSET] #ifdef CONFIG_ARM64_SAFE_EXCEPTION_STACK - /* The expection from el1 does not need to save x16, x17, x18 and lr */ + /* The exception from el1 does not need to save x16, x17, x18 and lr */ .if \el == el0 #endif stp x16, x17, [sp, ___esf_t_x16_x17_OFFSET] diff --git a/arch/common/CMakeLists.txt b/arch/common/CMakeLists.txt index e79b7cd0abfa6..6f84bb9635123 100644 --- a/arch/common/CMakeLists.txt +++ b/arch/common/CMakeLists.txt @@ -56,12 +56,21 @@ zephyr_linker_sources_ifdef(CONFIG_GEN_IRQ_VECTOR_TABLE ) if(CONFIG_GEN_ISR_TABLES) - zephyr_linker_section(NAME .intList VMA IDT_LIST LMA IDT_LIST NOINPUT PASS NOT LINKER_ZEPHYR_FINAL) - zephyr_linker_section_configure(SECTION .intList KEEP INPUT ".irq_info" FIRST) - zephyr_linker_section_configure(SECTION .intList KEEP INPUT ".intList") - - zephyr_linker_section_configure(SECTION /DISCARD/ KEEP INPUT ".irq_info" PASS LINKER_ZEPHYR_FINAL) - zephyr_linker_section_configure(SECTION /DISCARD/ KEEP INPUT ".intList" PASS LINKER_ZEPHYR_FINAL) + # IAR Toolchain is having problems with discarding .intList + # This will always keep .intList in a harmless location + # until we can implement a proper DISCARD. + if(ZEPHYR_TOOLCHAIN_VARIANT STREQUAL "iar") + zephyr_linker_section(NAME .intList GROUP RODATA_REGION NOINPUT) + zephyr_linker_section_configure(SECTION .intList KEEP INPUT ".irq_info" FIRST) + zephyr_linker_section_configure(SECTION .intList KEEP INPUT ".intList") + else() + zephyr_linker_section(NAME .intList VMA IDT_LIST LMA IDT_LIST NOINPUT PASS NOT LINKER_ZEPHYR_FINAL) + zephyr_linker_section_configure(SECTION .intList KEEP INPUT ".irq_info" FIRST) + zephyr_linker_section_configure(SECTION .intList KEEP INPUT ".intList") + + zephyr_linker_section_configure(SECTION /DISCARD/ KEEP INPUT ".irq_info" PASS LINKER_ZEPHYR_FINAL) + zephyr_linker_section_configure(SECTION /DISCARD/ KEEP INPUT ".intList" PASS LINKER_ZEPHYR_FINAL) + endif() endif() zephyr_linker_sources_ifdef(CONFIG_ARCH_HAS_RAMFUNC_SUPPORT diff --git a/arch/posix/CMakeLists.txt b/arch/posix/CMakeLists.txt index 8dfc696bc6d5f..21b6bf7f197d0 100644 --- a/arch/posix/CMakeLists.txt +++ b/arch/posix/CMakeLists.txt @@ -75,6 +75,10 @@ if (CONFIG_NATIVE_APPLICATION) zephyr_compile_options( -include ${ZEPHYR_BASE}/arch/posix/include/posix_cheats.h ) + # About this -include directive: The reason to do it this way, is because in this + # manner it is transparent to the application. Otherwise posix_cheats.h needs to + # be included in all the applications' files which define main( ), and in any + # app file which uses any of the APIs renamed in that header. elseif (CONFIG_NATIVE_LIBRARY) zephyr_compile_options( -fvisibility=hidden @@ -146,14 +150,6 @@ if (CONFIG_NATIVE_APPLICATION) ) endif() -# About the -include directive: The reason to do it this way, is because in this -# manner it is transparent to the application. Otherwise posix_cheats.h needs to -# be included in all the applications' files which define main( ), and in any -# app file which uses the pthreads like API provided by Zephyr -# ( include/posix/pthread.h / kernel/pthread.c ) [And any future API added to -# Zephyr which will clash with the native POSIX API] . It would also need to -# be included in a few zephyr kernel files. - # # Support for the LLVM Sanitizer toolchain instrumentation frameworks # (supported by current gcc's as well) @@ -199,4 +195,5 @@ if(NOT ${LLVM_SANITIZERS_ARG} STREQUAL "") target_compile_options(native_simulator INTERFACE ${LLVM_SANITIZERS_ARG}) endif() +include(natsim_optional.cmake) add_subdirectory(core) diff --git a/arch/posix/Kconfig b/arch/posix/Kconfig index 1ed79b38976d8..f7ed30cf175e6 100644 --- a/arch/posix/Kconfig +++ b/arch/posix/Kconfig @@ -3,7 +3,7 @@ # Copyright (c) 2017 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -menu "POSIX (native) Options" +menu "Native (POSIX) Architecture Options" depends on ARCH_POSIX config ARCH @@ -27,7 +27,7 @@ config ARCH_POSIX_LIBFUZZER help Build as an LLVM libfuzzer target. Requires support from the toolchain (currently only clang works, and - only on native_{posix,sim}[//64]), and should normally be used in + only on native_sim[//64]), and should normally be used in concert with some of CONFIG_ASAN/UBSAN/MSAN for validation. The application needs to implement the LLVMFuzzerTestOneInput() entry point, which runs in the host @@ -41,4 +41,6 @@ config ARCH_POSIX_TRAP_ON_FATAL Raise a SIGTRAP signal on fatal error before exiting. This automatically suspends the target if a debugger is attached. +rsource "Kconfig.natsim_optional" + endmenu diff --git a/arch/posix/Kconfig.natsim_optional b/arch/posix/Kconfig.natsim_optional new file mode 100644 index 0000000000000..4ec8dcdc4a559 --- /dev/null +++ b/arch/posix/Kconfig.natsim_optional @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config NATIVE_USE_NSI_ERRNO + bool + help + Build the native simulator nsi_errno component with the Zephyr embedded code. + This component allows translating errno values from/to the embedded libC to/from the host libC. diff --git a/arch/posix/include/posix_cheats.h b/arch/posix/include/posix_cheats.h index d8307df0ef8d3..fa62dc2a2aaac 100644 --- a/arch/posix/include/posix_cheats.h +++ b/arch/posix/include/posix_cheats.h @@ -16,8 +16,8 @@ * If you do see a link error telling you that zap_something is undefined, it is * likely that you forgot to select the corresponding Zephyr POSIX API. * - * This header is included automatically when targeting some POSIX ARCH boards - * (for ex. native_posix). + * This header is included automatically when targeting old POSIX ARCH boards + * based on the CONFIG_NATIVE_APPLICATION architecture. * It will be included in _all_ Zephyr and application source files * (it is passed with the option "-include" to the compiler call) * @@ -34,7 +34,7 @@ /* * Normally main() is the main entry point of a C executable. - * When compiling for native_posix, the Zephyr "application" is not the actual + * When compiling using CONFIG_NATIVE_APPLICATION, the Zephyr "application" is not the actual * entry point of the executable but something the Zephyr OS calls during * boot. * Therefore we need to rename this application main something else, so @@ -58,7 +58,7 @@ extern "C" int _posix_zephyr_main(void); /* * The defines below in this header exist only to enable the Zephyr POSIX API * (include/posix/), and applications using it, to be compiled on top of - * native_posix. + * the deprecated CONFIG_NATIVE_APPLICATION targets. * * Without this header, both the Zephyr POSIX API functions and the equivalent * host OS functions would have the same name. This would result in the linker @@ -72,8 +72,8 @@ extern "C" int _posix_zephyr_main(void); * into something which is unlikely to collide with other real functions * (Any unlikely string would have done) * - * If you want to link an external library together with Zephyr code for the - * native_posix target, where that external library calls into the Zephyr + * If you want to link an external library together with Zephyr code for a + * CONFIG_NATIVE_APPLICATION based target, where that external library calls into the Zephyr * POSIX API, you may want to include this header when compiling that library, * or rename the calls to match the ones in the defines below. */ diff --git a/arch/posix/include/posix_core.h b/arch/posix/include/posix_core.h index 983f80a3abd2f..8f72a267389b9 100644 --- a/arch/posix/include/posix_core.h +++ b/arch/posix/include/posix_core.h @@ -31,10 +31,9 @@ typedef struct { * Note: If more elements are added to this structure, remember to * update ARCH_POSIX_RECOMMENDED_STACK_SIZE in the configuration. * - * Currently there are 4 pointers + 2 ints, on a 32-bit native posix - * implementation this will result in 24 bytes ( 4*4 + 2*4). - * For a 64-bit implementation the recommended stack size will be - * 40 bytes ( 4*8 + 2*4 ). + * Currently there are 4 pointers + 2 ints, on a 32-bit build this will result in 24 bytes + * (4*4 + 2*4). + * For a 64-bit build the recommended stack size will be 40 bytes ( 4*8 + 2*4 ). */ } posix_thread_status_t; diff --git a/arch/posix/natsim_optional.cmake b/arch/posix/natsim_optional.cmake new file mode 100644 index 0000000000000..e2f3d5f0eb3aa --- /dev/null +++ b/arch/posix/natsim_optional.cmake @@ -0,0 +1,10 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Selection of optional components provided by the native simulator + +if(CONFIG_NATIVE_USE_NSI_ERRNO) + zephyr_library() + + zephyr_library_sources(${NSI_DIR}/common/src/nsi_errno.c) +endif() diff --git a/arch/riscv/core/cpu_idle.c b/arch/riscv/core/cpu_idle.c index 413b911a53e31..6991da4090528 100644 --- a/arch/riscv/core/cpu_idle.c +++ b/arch/riscv/core/cpu_idle.c @@ -12,6 +12,7 @@ void arch_cpu_idle(void) { sys_trace_idle(); __asm__ volatile("wfi"); + sys_trace_idle_exit(); irq_unlock(MSTATUS_IEN); } #endif @@ -21,6 +22,7 @@ void arch_cpu_atomic_idle(unsigned int key) { sys_trace_idle(); __asm__ volatile("wfi"); + sys_trace_idle_exit(); irq_unlock(key); } #endif diff --git a/arch/riscv/core/elf.c b/arch/riscv/core/elf.c index e0630876dd4c6..2ae4b50d132bf 100644 --- a/arch/riscv/core/elf.c +++ b/arch/riscv/core/elf.c @@ -8,6 +8,9 @@ */ #include #include +#include +#include + #include #include @@ -59,7 +62,133 @@ static inline int riscv_relocation_fits(long long jump_target, long long max_dis return 0; } -static long long last_u_type_jump_target; +static size_t riscv_last_rel_idx; + +/** + * @brief On RISC-V, PC-relative relocations (PCREL_LO12_I, PCREL_LO12_S) do not refer to + * the actual symbol. Instead, they refer to the location of a different instruction in the + * same section, which has a PCREL_HI20 relocation. The relocation offset is then computed based + * on the location and symbol from the HI20 relocation. 20 bits from the offset go into the + * instruction that has the HI20 relocation, and 12 bits go into the PCREL_LO12 instruction. + * + * @param[in] ldr llext loader + * @param[in] ext current extension + * @param[in] pcrel_lo12 the elf relocation structure for the PCREL_LO12I/S relocation. + * @param[in] shdr ELF section header for the relocation + * @param[in] sym ELF symbol for PCREL_LO12I + * @param[out] link_addr_out computed link address + * + */ +static int llext_riscv_find_sym_pcrel(struct llext_loader *ldr, struct llext *ext, + const elf_rela_t *pcrel_lo12, const elf_shdr_t *shdr, + const elf_sym_t *sym, intptr_t *link_addr_out) +{ + int ret; + elf_rela_t candidate; + uintptr_t candidate_loc; + elf_word reloc_type; + elf_sym_t candidate_sym; + uintptr_t link_addr; + const char *symbol_name; + int iteration_start = riscv_last_rel_idx; + bool is_first = true; + const elf_word rel_cnt = shdr->sh_size / shdr->sh_entsize; + const uintptr_t sect_base = (uintptr_t)llext_loaded_sect_ptr(ldr, ext, shdr->sh_info); + bool found_candidate = false; + + if (iteration_start >= rel_cnt) { + /* value left over from a different section */ + iteration_start = 0; + } + + reloc_type = ELF32_R_TYPE(pcrel_lo12->r_info); + + if (reloc_type != R_RISCV_PCREL_LO12_I && reloc_type != R_RISCV_PCREL_LO12_S) { + /* this function does not apply - the symbol is already correct */ + return 0; + } + + for (int i = iteration_start; i != iteration_start || is_first; i++) { + + is_first = false; + + /* get each relocation entry */ + ret = llext_seek(ldr, shdr->sh_offset + i * shdr->sh_entsize); + if (ret != 0) { + return ret; + } + + ret = llext_read(ldr, &candidate, shdr->sh_entsize); + if (ret != 0) { + return ret; + } + + /* FIXME currently, RISC-V relocations all fit in ELF_32_R_TYPE */ + reloc_type = ELF32_R_TYPE(candidate.r_info); + + candidate_loc = sect_base + candidate.r_offset; + + /* + * RISC-V ELF specification: "value" of the symbol for the PCREL_LO12 relocation + * is actually the offset of the PCREL_HI20 relocation instruction from section + * start + */ + if (candidate.r_offset == sym->st_value && reloc_type == R_RISCV_PCREL_HI20) { + found_candidate = true; + + /* + * start here in next iteration + * it is fairly likely (albeit not guaranteed) that we require PCREL_HI20 + * relocations in order + * we can safely write this even if an error occurs after the loop - + * in that case,we can safely abort the execution anyway + */ + riscv_last_rel_idx = i; + + break; + } + + if (i + 1 >= rel_cnt) { + /* wrap around and search in previously processed indices as well */ + i = -1; + } + } + + if (!found_candidate) { + LOG_ERR("Could not find R_RISCV_PCREL_HI20 relocation for " + "R_RISCV_PCREL_LO12 relocation!"); + return -ENOEXEC; + } + + /* we found a match - need to compute the relocation for this instruction */ + /* lower 12 bits go to the PCREL_LO12 relocation */ + + /* get corresponding / "actual" symbol */ + ret = llext_seek(ldr, ldr->sects[LLEXT_MEM_SYMTAB].sh_offset + + ELF_R_SYM(candidate.r_info) * sizeof(elf_sym_t)); + if (ret != 0) { + return ret; + } + + ret = llext_read(ldr, &candidate_sym, sizeof(elf_sym_t)); + if (ret != 0) { + return ret; + } + + symbol_name = llext_symbol_name(ldr, ext, &candidate_sym); + + ret = llext_lookup_symbol(ldr, ext, &link_addr, &candidate, &candidate_sym, + symbol_name, shdr); + + if (ret != 0) { + return ret; + } + + *link_addr_out = (intptr_t)(link_addr + candidate.r_addend - candidate_loc); /* S + A - P */ + + /* found the matching entry */ + return 0; +} /** * @brief RISC-V specific function for relocating partially linked ELF binaries @@ -68,11 +197,32 @@ static long long last_u_type_jump_target; * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc * */ -int arch_elf_relocate(elf_rela_t *rel, uintptr_t loc_unsigned, uintptr_t sym_base_addr_unsigned, - const char *sym_name, uintptr_t load_bias) +int arch_elf_relocate(struct llext_loader *ldr, struct llext *ext, elf_rela_t *rel, + const elf_shdr_t *shdr) { /* FIXME currently, RISC-V relocations all fit in ELF_32_R_TYPE */ elf_word reloc_type = ELF32_R_TYPE(rel->r_info); + const uintptr_t load_bias = (uintptr_t)ext->mem[LLEXT_MEM_TEXT]; + const uintptr_t loc_unsigned = llext_get_reloc_instruction_location(ldr, ext, + shdr->sh_info, rel); + elf_sym_t sym; + uintptr_t sym_base_addr_unsigned; + const char *sym_name; + int ret; + + ret = llext_read_symbol(ldr, ext, rel, &sym); + if (ret != 0) { + LOG_ERR("Could not read symbol from binary!"); + return ret; + } + + sym_name = llext_symbol_name(ldr, ext, &sym); + ret = llext_lookup_symbol(ldr, ext, &sym_base_addr_unsigned, rel, &sym, sym_name, shdr); + + if (ret != 0) { + LOG_ERR("Could not find symbol %s!", sym_name); + return ret; + } /* * The RISC-V specification uses the following symbolic names for the relocations: * @@ -99,7 +249,22 @@ int arch_elf_relocate(elf_rela_t *rel, uintptr_t loc_unsigned, uintptr_t sym_bas long long original_imm8, jump_target; int16_t compressed_imm8; __typeof__(rel->r_addend) target_alignment = 1; - const intptr_t sym_base_addr = (intptr_t)sym_base_addr_unsigned; + intptr_t sym_base_addr = (intptr_t)sym_base_addr_unsigned; + + /* + * For HI20/LO12 ("PCREL") relocation pairs, we need a helper function to + * determine the address for the LO12 relocation, as it depends on the + * value in the HI20 relocation. + */ + ret = llext_riscv_find_sym_pcrel(ldr, ext, rel, shdr, &sym, &sym_base_addr); + + if (ret != 0) { + LOG_ERR("Failed to resolve RISC-V PCREL relocation for symbol %s at %p " + "with base address %p load address %p type %" PRIu64, + sym_name, (void *)loc, (void *)sym_base_addr, (void *)load_bias, + (uint64_t)reloc_type); + return ret; + } LOG_DBG("Relocating symbol %s at %p with base address %p load address %p type %" PRIu64, sym_name, (void *)loc, (void *)sym_base_addr, (void *)load_bias, @@ -176,43 +341,32 @@ int arch_elf_relocate(elf_rela_t *rel, uintptr_t loc_unsigned, uintptr_t sym_bas UNALIGNED_PUT(modified_operand, loc32); } - last_u_type_jump_target = jump_target; - return riscv_relocation_fits(jump_target, RISCV_MAX_JUMP_DISTANCE_U_PLUS_I_TYPE, reloc_type); case R_RISCV_PCREL_LO12_I: - /* need the same jump target as preceding U-type relocation */ - if (last_u_type_jump_target == 0) { - LOG_ERR("R_RISCV_PCREL_LO12_I relocation without preceding U-type " - "relocation!"); - return -ENOEXEC; - } + /* + * Jump target is resolved in llext_riscv_find_sym_pcrel in llext_link.c + * as it depends on other relocations. + */ modified_operand = UNALIGNED_GET(loc32); - jump_target = last_u_type_jump_target; /* S - P */ - last_u_type_jump_target = 0; - imm8 = jump_target; + imm8 = (int32_t)sym_base_addr; /* already computed */ modified_operand = R_RISCV_CLEAR_ITYPE_IMM8(modified_operand); modified_operand = R_RISCV_SET_ITYPE_IMM8(modified_operand, imm8); UNALIGNED_PUT(modified_operand, loc32); - return riscv_relocation_fits(jump_target, RISCV_MAX_JUMP_DISTANCE_U_PLUS_I_TYPE, - reloc_type); + /* we have checked that this fits with the associated relocation */ break; case R_RISCV_PCREL_LO12_S: - /* need the same jump target as preceding U-type relocation */ - if (last_u_type_jump_target == 0) { - LOG_ERR("R_RISCV_PCREL_LO12_I relocation without preceding U-type " - "relocation!"); - return -ENOEXEC; - } + /* + * Jump target is resolved in llext_riscv_find_sym_pcrel in llext_link.c + * as it depends on other relocations. + */ modified_operand = UNALIGNED_GET(loc32); - jump_target = last_u_type_jump_target; /* S - P */ - last_u_type_jump_target = 0; - imm8 = jump_target; + imm8 = (int32_t)sym_base_addr; /* already computed */ modified_operand = R_RISCV_CLEAR_STYPE_IMM8(modified_operand); modified_operand = R_RISCV_SET_STYPE_IMM8(modified_operand, imm8); UNALIGNED_PUT(modified_operand, loc32); - return riscv_relocation_fits(jump_target, RISCV_MAX_JUMP_DISTANCE_U_PLUS_I_TYPE, - reloc_type); + /* we have checked that this fits with the associated relocation */ + break; case R_RISCV_HI20: jump_target = sym_base_addr + rel->r_addend; /* S + A */ modified_operand = UNALIGNED_GET(loc32); diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c947c0afc1b83..a9a883a3104f6 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -83,6 +83,7 @@ config X86_64 select X86_MMX select X86_SSE select X86_SSE2 + select ARCH_HAS_DIRECTED_IPIS if !X2APIC menu "x86 Features" diff --git a/arch/x86/core/CMakeLists.txt b/arch/x86/core/CMakeLists.txt index e8055c6fae277..abbc052a62472 100644 --- a/arch/x86/core/CMakeLists.txt +++ b/arch/x86/core/CMakeLists.txt @@ -21,6 +21,8 @@ zephyr_library_sources_ifdef(CONFIG_X86_MMU x86_mmu.c) zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.c) zephyr_library_sources_ifdef(CONFIG_ARCH_CACHE cache.c) +zephyr_library_sources_ifdef(CONFIG_DYNAMIC_BOOTARGS bootargs.c) + zephyr_library_sources_ifdef(CONFIG_X86_VERY_EARLY_CONSOLE early_serial.c) zephyr_library_sources_ifdef(CONFIG_THREAD_LOCAL_STORAGE tls.c) diff --git a/arch/x86/core/bootargs.c b/arch/x86/core/bootargs.c new file mode 100644 index 0000000000000..5ae4c2b0f9503 --- /dev/null +++ b/arch/x86/core/bootargs.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#if defined(CONFIG_MULTIBOOT_INFO) + +__pinned_noinit char multiboot_cmdline[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE]; + +const char *get_bootargs(void) +{ + return multiboot_cmdline; +} + +#elif defined(CONFIG_X86_EFI) + +__pinned_noinit char efi_bootargs[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE]; + +const char *get_bootargs(void) +{ + return efi_bootargs; +} + +#endif diff --git a/arch/x86/core/efi.c b/arch/x86/core/efi.c index 64faeb9efa533..e5470e6d8a364 100644 --- a/arch/x86/core/efi.c +++ b/arch/x86/core/efi.c @@ -18,10 +18,6 @@ static uint64_t __aligned(64) efi_stack[1024]; struct efi_boot_arg *efi; -#ifdef CONFIG_DYNAMIC_BOOTARGS -__pinned_noinit char efi_bootargs[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE]; -#endif - void *efi_get_acpi_rsdp(void) { if (efi == NULL) { @@ -173,10 +169,3 @@ int arch_printk_char_out(int c) return efi_console_putchar(c); } #endif - -#ifdef CONFIG_DYNAMIC_BOOTARGS -const char *get_bootargs(void) -{ - return efi_bootargs; -} -#endif /* CONFIG_DYNAMIC_BOOTARGS */ diff --git a/arch/x86/core/ia32/float.c b/arch/x86/core/ia32/float.c index c89bf7accd5a1..9b6f4daa18e06 100644 --- a/arch/x86/core/ia32/float.c +++ b/arch/x86/core/ia32/float.c @@ -194,7 +194,7 @@ void z_float_enable(struct k_thread *thread, unsigned int options) * must be preserved). */ - fp_owner = _kernel.current_fp; + fp_owner = _kernel.cpus[0].arch.fpu_owner; if (fp_owner != NULL) { if ((fp_owner->arch.flags & X86_THREAD_FLAG_ALL) != 0) { FpCtxSave(fp_owner); @@ -215,7 +215,7 @@ void z_float_enable(struct k_thread *thread, unsigned int options) * (The FP context is "live" in hardware, not saved in TCS.) */ - _kernel.current_fp = thread; + _kernel.cpus[0].arch.fpu_owner = thread; } else { /* * When enabling FP support for someone else, assign ownership @@ -230,7 +230,7 @@ void z_float_enable(struct k_thread *thread, unsigned int options) * to its original state. */ - _kernel.current_fp = thread; + _kernel.cpus[0].arch.fpu_owner = thread; z_FpAccessDisable(); } else { /* @@ -280,10 +280,10 @@ int z_float_disable(struct k_thread *thread) if (thread == _current) { z_FpAccessDisable(); - _kernel.current_fp = (struct k_thread *)0; + _kernel.cpus[0].arch.fpu_owner = (struct k_thread *)0; } else { - if (_kernel.current_fp == thread) { - _kernel.current_fp = (struct k_thread *)0; + if (_kernel.cpus[0].arch.fpu_owner == thread) { + _kernel.cpus[0].arch.fpu_owner = (struct k_thread *)0; } } diff --git a/arch/x86/core/ia32/swap.S b/arch/x86/core/ia32/swap.S index af104fdff478b..6103e4bbe5382 100644 --- a/arch/x86/core/ia32/swap.S +++ b/arch/x86/core/ia32/swap.S @@ -50,7 +50,7 @@ * Floating point registers are handled using a lazy save/restore mechanism * since it's expected relatively few threads will be created with the * K_FP_REGS or K_SSE_REGS option bits. The kernel data structure maintains a - * 'current_fp' field to keep track of the thread that "owns" the floating + * 'fpu_owner' field to keep track of the thread that "owns" the floating * point registers. Floating point registers consist of ST0->ST7 (x87 FPU and * MMX registers) and XMM0 -> XMM7. * @@ -176,7 +176,7 @@ SECTION_FUNC(PINNED_TEXT, arch_swap) * If so, there there is no need to restore the floating point context. */ - movl _kernel_offset_to_current_fp(%edi), %ebx + movl _kernel_offset_to_fpu_owner(%edi), %ebx cmpl %ebx, %eax je restoreContext_NoFloatSwap @@ -265,7 +265,7 @@ restoreContext_NoFloatRestore: /* record that the incoming thread "owns" the floating point registers */ - movl %eax, _kernel_offset_to_current_fp(%edi) + movl %eax, _kernel_offset_to_fpu_owner(%edi) /* diff --git a/arch/x86/core/intel64/smp.c b/arch/x86/core/intel64/smp.c index 1e0aeb3e443aa..90bd9724667ff 100644 --- a/arch/x86/core/intel64/smp.c +++ b/arch/x86/core/intel64/smp.c @@ -38,3 +38,16 @@ void arch_sched_broadcast_ipi(void) { z_loapic_ipi(0, LOAPIC_ICR_IPI_OTHERS, CONFIG_SCHED_IPI_VECTOR); } + +void arch_sched_directed_ipi(uint32_t cpu_bitmap) +{ + unsigned int num_cpus = arch_num_cpus(); + + for (unsigned int i = 0; i < num_cpus; i++) { + if ((cpu_bitmap & BIT(i)) == 0) { + continue; + } + + z_loapic_ipi(i, LOAPIC_ICR_IPI_SPECIFIC, CONFIG_SCHED_IPI_VECTOR); + } +} diff --git a/arch/x86/core/multiboot.c b/arch/x86/core/multiboot.c index b6112b75f82ec..06d03c7b80714 100644 --- a/arch/x86/core/multiboot.c +++ b/arch/x86/core/multiboot.c @@ -11,15 +11,6 @@ struct multiboot_info multiboot_info; -#ifdef CONFIG_DYNAMIC_BOOTARGS -__pinned_noinit char multiboot_cmdline[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE]; - -const char *get_bootargs(void) -{ - return multiboot_cmdline; -} -#endif /* CONFIG_DYNAMIC_BOOTARGS */ - /* * called very early in the boot process to fetch data out of the multiboot * info struct. we need to grab the relevant data before any dynamic memory diff --git a/arch/x86/core/offsets/ia32_offsets.c b/arch/x86/core/offsets/ia32_offsets.c index 2dfbb5c38ef28..dcbf3d7d6806e 100644 --- a/arch/x86/core/offsets/ia32_offsets.c +++ b/arch/x86/core/offsets/ia32_offsets.c @@ -33,6 +33,12 @@ GEN_OFFSET_SYM(_thread_arch_t, excNestCount); #endif +#if defined(CONFIG_FPU_SHARING) +GEN_OFFSET_SYM(_kernel_t, cpus); +GEN_OFFSET_SYM(_cpu_t, arch); +GEN_OFFSET_SYM(_cpu_arch_t, fpu_owner); +#endif + #ifdef CONFIG_USERSPACE GEN_OFFSET_SYM(_thread_arch_t, psp); #ifndef CONFIG_X86_COMMON_PAGE_TABLE diff --git a/arch/x86/include/ia32/offsets_short_arch.h b/arch/x86/include/ia32/offsets_short_arch.h index cb5cdb218f0ae..b818cf60b550b 100644 --- a/arch/x86/include/ia32/offsets_short_arch.h +++ b/arch/x86/include/ia32/offsets_short_arch.h @@ -14,6 +14,9 @@ #define _kernel_offset_to_isf \ (___kernel_t_arch_OFFSET + ___kernel_arch_t_isf_OFFSET) +#define _kernel_offset_to_fpu_owner \ + (___kernel_t_cpus_OFFSET + ___cpu_t_arch_OFFSET + ___cpu_arch_t_fpu_owner_OFFSET) + /* end - kernel */ /* threads */ diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index b69d8bcf02b2b..19ce69b011bb1 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -169,7 +169,6 @@ config XTENSA_MMU bool "Xtensa MMU Support" select MMU select ARCH_MEM_DOMAIN_SYNCHRONOUS_API if USERSPACE - select XTENSA_SMALL_VECTOR_TABLE_ENTRY select KERNEL_VM_USE_CUSTOM_MEM_RANGE_CHECK if XTENSA_RPO_CACHE select CURRENT_THREAD_USE_NO_TLS if USERSPACE help @@ -223,12 +222,6 @@ config XTENSA_MMU_DOUBLE_MAP This option specifies that the memory is mapped in two distinct region, cached and uncached. - config XTENSA_INVALIDATE_MEM_DOMAIN_TLB_ON_SWAP - bool - help - This invalidates all TLBs referred by the incoming thread's - memory domain when swapping page tables. - config PRIVILEGED_STACK_SIZE # Must be multiple of CONFIG_MMU_PAGE_SIZE default 4096 diff --git a/arch/xtensa/core/CMakeLists.txt b/arch/xtensa/core/CMakeLists.txt index 7d7e260ca0b08..f3a4419f32c67 100644 --- a/arch/xtensa/core/CMakeLists.txt +++ b/arch/xtensa/core/CMakeLists.txt @@ -73,13 +73,19 @@ else() set(MAY_NEED_SYSCALL_SCRATCH_REG false) endif() +if(CONFIG_KERNEL_COHERENCE AND NOT CONFIG_SCHED_CPU_MASK_PIN_ONLY) + set(NEED_FLUSH_SCRATCH_REG true) +else() + set(NEED_FLUSH_SCRATCH_REG false) +endif() + # Generates a list of device-specific scratch register choices set(ZSR_H ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/zsr.h) add_custom_command(OUTPUT ${ZSR_H} DEPENDS ${CORE_ISA_DM} COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/gen_zsr.py $<$:--mmu> $<$:--syscall-scratch> - $<$:--coherence> + $<$:--flush-reg> ${CORE_ISA_DM} ${ZSR_H}) add_custom_target(zsr_h DEPENDS ${ZSR_H}) add_dependencies(zephyr_interface zsr_h) diff --git a/arch/xtensa/core/elf.c b/arch/xtensa/core/elf.c index 17337f4a7bc6f..6b83a9c0c612c 100644 --- a/arch/xtensa/core/elf.c +++ b/arch/xtensa/core/elf.c @@ -34,13 +34,18 @@ LOG_MODULE_DECLARE(llext, CONFIG_LLEXT_LOG_LEVEL); static void xtensa_elf_relocate(struct llext_loader *ldr, struct llext *ext, const elf_rela_t *rel, uintptr_t addr, - uint8_t *loc, int type, uint32_t stb) + uint8_t *loc, int type, uint32_t stb, + const struct llext_load_param *ldr_parm) { elf_word *got_entry = (elf_word *)loc; switch (type) { case R_XTENSA_RELATIVE: - ; + if (ldr_parm->pre_located) { + /* Relative relocations are already correct in the pre-located case */ + break; + } + /* Relocate a local symbol: Xtensa specific. Seems to only be used with PIC */ unsigned int sh_ndx; @@ -146,7 +151,8 @@ void arch_elf_relocate_local(struct llext_loader *ldr, struct llext *ext, const sh_addr = ldr->sects[LLEXT_MEM_TEXT].sh_addr; } - xtensa_elf_relocate(ldr, ext, rel, sh_addr, rel_addr, type, ELF_ST_BIND(sym->st_info)); + xtensa_elf_relocate(ldr, ext, rel, sh_addr, rel_addr, type, ELF_ST_BIND(sym->st_info), + ldr_parm); } /** @@ -163,5 +169,5 @@ void arch_elf_relocate_global(struct llext_loader *ldr, struct llext *ext, const } xtensa_elf_relocate(ldr, ext, rel, (uintptr_t)link_addr, rel_addr, type, - ELF_ST_BIND(sym->st_info)); + ELF_ST_BIND(sym->st_info), NULL); } diff --git a/arch/xtensa/core/gen_zsr.py b/arch/xtensa/core/gen_zsr.py index 6d9a228303f38..8cb8a713019e3 100755 --- a/arch/xtensa/core/gen_zsr.py +++ b/arch/xtensa/core/gen_zsr.py @@ -14,8 +14,8 @@ def parse_args(): parser = argparse.ArgumentParser(allow_abbrev=False) - parser.add_argument("--coherence", action="store_true", - help="Enable scratch registers for CONFIG_KERNEL_COHERENCE") + parser.add_argument("--flush-reg", action="store_true", + help="Enable scratch register ZSR_FLUSH for cache flushing") parser.add_argument("--mmu", action="store_true", help="Enable scratch registers for MMU usage") parser.add_argument("--syscall-scratch", action="store_true", @@ -32,7 +32,7 @@ def parse_args(): NEEDED = ["A0SAVE", "CPU"] if args.mmu: NEEDED += ["DBLEXC", "DEPC_SAVE", "EXCCAUSE_SAVE"] -if args.coherence: +if args.flush_reg: NEEDED += ["FLUSH"] coreisa = args.coreisa diff --git a/arch/xtensa/core/mmu.c b/arch/xtensa/core/mmu.c index c1073ac0247a7..dd20136427a09 100644 --- a/arch/xtensa/core/mmu.c +++ b/arch/xtensa/core/mmu.c @@ -16,37 +16,33 @@ BUILD_ASSERT((CONFIG_PRIVILEGED_STACK_SIZE > 0) && #define ASID_INVALID 0 -struct tlb_regs { - uint32_t rasid; - uint32_t ptevaddr; - uint32_t ptepin_as; - uint32_t ptepin_at; - uint32_t vecpin_as; - uint32_t vecpin_at; -}; - -static void compute_regs(uint32_t user_asid, uint32_t *l1_page, struct tlb_regs *regs) +extern uint32_t *xtensa_kernel_ptables; + +void xtensa_mmu_compute_domain_regs(struct arch_mem_domain *domain) { uint32_t vecbase = XTENSA_RSR("VECBASE"); + uint32_t *l1_page = domain->ptables; + uint32_t user_asid = domain->asid; __ASSERT_NO_MSG((((uint32_t)l1_page) & 0xfff) == 0); __ASSERT_NO_MSG((user_asid == 0) || ((user_asid > 2) && (user_asid < XTENSA_MMU_SHARED_ASID))); /* We don't use ring 1, ring 0 ASID must be 1 */ - regs->rasid = (XTENSA_MMU_SHARED_ASID << 24) | - (user_asid << 16) | 0x000201; + domain->reg_asid = (XTENSA_MMU_SHARED_ASID << 24) | + (user_asid << 16) | 0x000201; /* Derive PTEVADDR from ASID so each domain gets its own PTE area */ - regs->ptevaddr = CONFIG_XTENSA_MMU_PTEVADDR + user_asid * 0x400000; + domain->reg_ptevaddr = CONFIG_XTENSA_MMU_PTEVADDR + user_asid * 0x400000; /* The ptables code doesn't add the mapping for the l1 page itself */ - l1_page[XTENSA_MMU_L1_POS(regs->ptevaddr)] = + l1_page[XTENSA_MMU_L1_POS(domain->reg_ptevaddr)] = (uint32_t)l1_page | XTENSA_MMU_PAGE_TABLE_ATTR; - regs->ptepin_at = (uint32_t)l1_page; - regs->ptepin_as = XTENSA_MMU_PTE_ENTRY_VADDR(regs->ptevaddr, regs->ptevaddr) - | XTENSA_MMU_PTE_WAY; + domain->reg_ptepin_at = (uint32_t)l1_page; + domain->reg_ptepin_as = XTENSA_MMU_PTE_ENTRY_VADDR(domain->reg_ptevaddr, + domain->reg_ptevaddr) + | XTENSA_MMU_PTE_WAY; /* Pin mapping for refilling the vector address into the ITLB * (for handling TLB miss exceptions). Note: this is NOT an @@ -58,9 +54,10 @@ static void compute_regs(uint32_t user_asid, uint32_t *l1_page, struct tlb_regs */ uint32_t vb_pte = l1_page[XTENSA_MMU_L1_POS(vecbase)]; - regs->vecpin_at = vb_pte; - regs->vecpin_as = XTENSA_MMU_PTE_ENTRY_VADDR(regs->ptevaddr, vecbase) - | XTENSA_MMU_VECBASE_WAY; + domain->reg_vecpin_at = vb_pte; + domain->reg_vecpin_as = XTENSA_MMU_PTE_ENTRY_VADDR(domain->reg_ptevaddr, + vecbase) + | XTENSA_MMU_VECBASE_WAY; } /* Switch to a new page table. There are four items we have to set in @@ -78,18 +75,8 @@ static void compute_regs(uint32_t user_asid, uint32_t *l1_page, struct tlb_regs * couldn't think of a way to do the alignment statically that also * interoperated well with inline assembly). */ -void xtensa_set_paging(uint32_t user_asid, uint32_t *l1_page) +void xtensa_mmu_set_paging(struct arch_mem_domain *domain) { - /* Optimization note: the registers computed here are pure - * functions of the two arguments. With a minor API tweak, - * they could be cached in e.g. a thread struct instead of - * being recomputed. This is called on context switch paths - * and is performance-sensitive. - */ - struct tlb_regs regs; - - compute_regs(user_asid, l1_page, ®s); - __asm__ volatile("j 1f\n" ".align 16\n" /* enough for 5 insns */ "1:\n" @@ -98,12 +85,12 @@ void xtensa_set_paging(uint32_t user_asid, uint32_t *l1_page) "wdtlb %2, %3\n" "wdtlb %4, %5\n" "isync" - :: "r"(regs.ptevaddr), "r"(regs.rasid), - "r"(regs.ptepin_at), "r"(regs.ptepin_as), - "r"(regs.vecpin_at), "r"(regs.vecpin_as)); + :: "r"(domain->reg_ptevaddr), "r"(domain->reg_asid), + "r"(domain->reg_ptepin_at), "r"(domain->reg_ptepin_as), + "r"(domain->reg_vecpin_at), "r"(domain->reg_vecpin_as)); } -/* This is effectively the same algorithm from xtensa_set_paging(), +/* This is effectively the same algorithm from xtensa_mmu_set_paging(), * but it also disables the hardware-initialized 512M TLB entries in * way 6 (because the hardware disallows duplicate TLB mappings). For * instruction fetches this produces a critical ordering constraint: @@ -121,12 +108,19 @@ void xtensa_set_paging(uint32_t user_asid, uint32_t *l1_page) * asm for correctness. The other 13 entries get invalidated in a C * loop at the end. */ -void xtensa_init_paging(uint32_t *l1_page) +void xtensa_mmu_init_paging(void) { extern char z_xt_init_pc; /* defined in asm below */ - struct tlb_regs regs; unsigned int initial_rasid; + /* When this is called in xtensa_mmu_init(), the default memory + * domain struct has not been initialized, and memory domains + * are not ready to be used. So we need a local copy of + * struct arch_mem_domain to store the register values to be + * programmed into hardware. + */ + struct arch_mem_domain domain; + /* The initial rasid after hardware initialization is 0x04030201. * 1 is hardwired to ring 0, other slots must be different * from each other and must not be 0. @@ -146,10 +140,12 @@ void xtensa_init_paging(uint32_t *l1_page) sys_cache_data_flush_and_invd_all(); #endif - compute_regs(ASID_INVALID, l1_page, ®s); + domain.asid = ASID_INVALID; + domain.ptables = xtensa_kernel_ptables; + xtensa_mmu_compute_domain_regs(&domain); - uint32_t idtlb_pte = (regs.ptevaddr & 0xe0000000) | XCHAL_SPANNING_WAY; - uint32_t idtlb_stk = (((uint32_t)®s) & ~0xfff) | XCHAL_SPANNING_WAY; + uint32_t idtlb_pte = (domain.reg_ptevaddr & 0xe0000000) | XCHAL_SPANNING_WAY; + uint32_t idtlb_stk = (((uint32_t)&domain) & ~0xfff) | XCHAL_SPANNING_WAY; uint32_t iitlb_pc = (((uint32_t)&z_xt_init_pc) & ~0xfff) | XCHAL_SPANNING_WAY; /* Note: the jump is mostly pedantry, as it's almost @@ -171,9 +167,9 @@ void xtensa_init_paging(uint32_t *l1_page) "isync\n" "iitlb %8\n" /* invalidate pc */ "isync\n" /* <--- traps a ITLB miss */ - :: "r"(regs.ptevaddr), "r"(initial_rasid), - "r"(regs.ptepin_at), "r"(regs.ptepin_as), - "r"(regs.vecpin_at), "r"(regs.vecpin_as), + :: "r"(domain.reg_ptevaddr), "r"(initial_rasid), + "r"(domain.reg_ptepin_at), "r"(domain.reg_ptepin_as), + "r"(domain.reg_vecpin_at), "r"(domain.reg_vecpin_as), "r"(idtlb_pte), "r"(idtlb_stk), "r"(iitlb_pc)); /* Invalidate the remaining (unused by this function) diff --git a/arch/xtensa/core/offsets/offsets.c b/arch/xtensa/core/offsets/offsets.c index 69df38275bf6b..f0b75c999cc69 100644 --- a/arch/xtensa/core/offsets/offsets.c +++ b/arch/xtensa/core/offsets/offsets.c @@ -67,8 +67,22 @@ GEN_OFFSET_SYM(_xtensa_irq_bsa_t, hifi); #ifdef CONFIG_USERSPACE GEN_OFFSET_SYM(_thread_arch_t, psp); +GEN_OFFSET_SYM(_thread_arch_t, return_ps); +GEN_OFFSET_SYM(_thread_t, switch_handle); #ifdef CONFIG_XTENSA_MMU GEN_OFFSET_SYM(_thread_arch_t, ptables); + +GEN_OFFSET_SYM(_thread_t, mem_domain_info); +GEN_OFFSET_SYM(_mem_domain_info_t, mem_domain); +GEN_OFFSET_SYM(k_mem_domain_t, arch); + +GEN_OFFSET_SYM(arch_mem_domain_t, reg_asid); +GEN_OFFSET_SYM(arch_mem_domain_t, reg_ptevaddr); +GEN_OFFSET_SYM(arch_mem_domain_t, reg_ptepin_as); +GEN_OFFSET_SYM(arch_mem_domain_t, reg_ptepin_at); +GEN_OFFSET_SYM(arch_mem_domain_t, reg_vecpin_as); +GEN_OFFSET_SYM(arch_mem_domain_t, reg_vecpin_at); + #endif #ifdef CONFIG_XTENSA_MPU GEN_OFFSET_SYM(_thread_arch_t, mpu_map); diff --git a/arch/xtensa/core/prep_c.c b/arch/xtensa/core/prep_c.c index 6dbab69f50f5f..771ad7e423077 100644 --- a/arch/xtensa/core/prep_c.c +++ b/arch/xtensa/core/prep_c.c @@ -44,10 +44,12 @@ void z_prep_c(void) */ sys_cache_data_flush_and_invd_all(); +#if !defined(CONFIG_SCHED_CPU_MASK_PIN_ONLY) /* Our cache top stash location might have junk in it from a * pre-boot environment. Must be zero or valid! */ XTENSA_WSR(ZSR_FLUSH_STR, 0); +#endif #endif cpu0->nested = 0; diff --git a/arch/xtensa/core/ptables.c b/arch/xtensa/core/ptables.c index c02ecc64b0dbe..fa7d4fb0f703b 100644 --- a/arch/xtensa/core/ptables.c +++ b/arch/xtensa/core/ptables.c @@ -157,17 +157,6 @@ static const struct xtensa_mmu_range mmu_zephyr_ranges[] = { }, }; -static inline uint32_t *thread_page_tables_get(const struct k_thread *thread) -{ -#ifdef CONFIG_USERSPACE - if ((thread->base.user_options & K_USER) != 0U) { - return thread->arch.ptables; - } -#endif - - return xtensa_kernel_ptables; -} - /** * @brief Check if the page table entry is illegal. * @@ -250,18 +239,25 @@ static void map_memory_range(const uint32_t start, const uint32_t end, static void map_memory(const uint32_t start, const uint32_t end, const uint32_t attrs) { - map_memory_range(start, end, attrs); - #ifdef CONFIG_XTENSA_MMU_DOUBLE_MAP + uint32_t uc_attrs = attrs & ~XTENSA_MMU_PTE_ATTR_CACHED_MASK; + uint32_t c_attrs = attrs | XTENSA_MMU_CACHED_WB; + if (sys_cache_is_ptr_uncached((void *)start)) { + map_memory_range(start, end, uc_attrs); + map_memory_range(POINTER_TO_UINT(sys_cache_cached_ptr_get((void *)start)), - POINTER_TO_UINT(sys_cache_cached_ptr_get((void *)end)), - attrs | XTENSA_MMU_CACHED_WB); + POINTER_TO_UINT(sys_cache_cached_ptr_get((void *)end)), c_attrs); } else if (sys_cache_is_ptr_cached((void *)start)) { + map_memory_range(start, end, c_attrs); + map_memory_range(POINTER_TO_UINT(sys_cache_uncached_ptr_get((void *)start)), - POINTER_TO_UINT(sys_cache_uncached_ptr_get((void *)end)), attrs); - } + POINTER_TO_UINT(sys_cache_uncached_ptr_get((void *)end)), uc_attrs); + } else #endif + { + map_memory_range(start, end, attrs); + } } static void xtensa_init_page_tables(void) @@ -313,7 +309,7 @@ void xtensa_mmu_init(void) { xtensa_init_page_tables(); - xtensa_init_paging(xtensa_kernel_ptables); + xtensa_mmu_init_paging(); /* * This is used to determine whether we are faulting inside double @@ -328,7 +324,7 @@ void xtensa_mmu_init(void) void xtensa_mmu_reinit(void) { /* First initialize the hardware */ - xtensa_init_paging(xtensa_kernel_ptables); + xtensa_mmu_init_paging(); #ifdef CONFIG_USERSPACE struct k_thread *thread = _current_cpu->current; @@ -337,7 +333,7 @@ void xtensa_mmu_reinit(void) /* Set the page table for current context */ - xtensa_set_paging(domain->asid, domain->ptables); + xtensa_mmu_set_paging(domain); #endif /* CONFIG_USERSPACE */ arch_xtensa_mmu_post_init(_current_cpu->id == 0); @@ -706,7 +702,7 @@ void xtensa_mmu_tlb_shootdown(void) */ struct arch_mem_domain *domain = &(thread->mem_domain_info.mem_domain->arch); - xtensa_set_paging(domain->asid, (uint32_t *)thread_ptables); + xtensa_mmu_set_paging(domain); } } @@ -725,6 +721,15 @@ void xtensa_mmu_tlb_shootdown(void) #ifdef CONFIG_USERSPACE +static inline uint32_t *thread_page_tables_get(const struct k_thread *thread) +{ + if ((thread->base.user_options & K_USER) != 0U) { + return thread->arch.ptables; + } + + return xtensa_kernel_ptables; +} + static inline uint32_t *alloc_l1_table(void) { uint16_t idx; @@ -833,6 +838,7 @@ int arch_mem_domain_init(struct k_mem_domain *domain) sys_slist_append(&xtensa_domain_list, &domain->arch.node); end: + xtensa_mmu_compute_domain_regs(&domain->arch); ret = 0; err: @@ -995,7 +1001,9 @@ int arch_mem_domain_thread_add(struct k_thread *thread) * the current thread running. */ if (thread == _current_cpu->current) { - xtensa_set_paging(domain->arch.asid, thread->arch.ptables); + struct arch_mem_domain *arch_domain = &(domain->arch); + + xtensa_mmu_set_paging(arch_domain); } #if CONFIG_MP_MAX_NUM_CPUS > 1 @@ -1114,26 +1122,4 @@ int arch_buffer_validate(const void *addr, size_t size, int write) return mem_buffer_validate(addr, size, write, XTENSA_MMU_USER_RING); } -void xtensa_swap_update_page_tables(struct k_thread *incoming) -{ - uint32_t *ptables = incoming->arch.ptables; - struct arch_mem_domain *domain = - &(incoming->mem_domain_info.mem_domain->arch); - - xtensa_set_paging(domain->asid, ptables); - -#ifdef CONFIG_XTENSA_INVALIDATE_MEM_DOMAIN_TLB_ON_SWAP - struct k_mem_domain *mem_domain = incoming->mem_domain_info.mem_domain; - - for (int idx = 0; idx < mem_domain->num_partitions; idx++) { - struct k_mem_partition *part = &mem_domain->partitions[idx]; - uintptr_t end = part->start + part->size; - - for (uintptr_t addr = part->start; addr < end; addr += CONFIG_MMU_PAGE_SIZE) { - xtensa_dtlb_vaddr_invalidate((void *)addr); - } - } -#endif -} - #endif /* CONFIG_USERSPACE */ diff --git a/arch/xtensa/core/syscall_helper.c b/arch/xtensa/core/syscall_helper.c index f9673e67814c8..9e14a560e7e19 100644 --- a/arch/xtensa/core/syscall_helper.c +++ b/arch/xtensa/core/syscall_helper.c @@ -25,7 +25,7 @@ uintptr_t xtensa_syscall_helper_args_6(uintptr_t arg1, uintptr_t arg2, register uintptr_t a8 __asm__("%a8") = arg5; register uintptr_t a9 __asm__("%a9") = arg6; - __asm__ volatile("syscall\n\t" + __asm__ volatile(XTENSA_SYSCALL_ASM : "=r" (a2) : "r" (a2), "r" (a6), "r" (a3), "r" (a4), "r" (a5), "r" (a8), "r" (a9) @@ -45,7 +45,7 @@ uintptr_t xtensa_syscall_helper_args_5(uintptr_t arg1, uintptr_t arg2, register uintptr_t a5 __asm__("%a5") = arg4; register uintptr_t a8 __asm__("%a8") = arg5; - __asm__ volatile("syscall\n\t" + __asm__ volatile(XTENSA_SYSCALL_ASM : "=r" (a2) : "r" (a2), "r" (a6), "r" (a3), "r" (a4), "r" (a5), "r" (a8) @@ -64,7 +64,7 @@ uintptr_t xtensa_syscall_helper_args_4(uintptr_t arg1, uintptr_t arg2, register uintptr_t a4 __asm__("%a4") = arg3; register uintptr_t a5 __asm__("%a5") = arg4; - __asm__ volatile("syscall\n\t" + __asm__ volatile(XTENSA_SYSCALL_ASM : "=r" (a2) : "r" (a2), "r" (a6), "r" (a3), "r" (a4), "r" (a5) @@ -73,61 +73,6 @@ uintptr_t xtensa_syscall_helper_args_4(uintptr_t arg1, uintptr_t arg2, return a2; } -uintptr_t xtensa_syscall_helper_args_3(uintptr_t arg1, uintptr_t arg2, - uintptr_t arg3, uintptr_t call_id) -{ - register uintptr_t a2 __asm__("%a2") = call_id; - register uintptr_t a6 __asm__("%a6") = arg1; - register uintptr_t a3 __asm__("%a3") = arg2; - register uintptr_t a4 __asm__("%a4") = arg3; - - __asm__ volatile("syscall\n\t" - : "=r" (a2) - : "r" (a2), "r" (a6), "r" (a3), "r" (a4) - : "memory"); - - return a2; -} - -uintptr_t xtensa_syscall_helper_args_2(uintptr_t arg1, uintptr_t arg2, - uintptr_t call_id) -{ - register uintptr_t a2 __asm__("%a2") = call_id; - register uintptr_t a6 __asm__("%a6") = arg1; - register uintptr_t a3 __asm__("%a3") = arg2; - - __asm__ volatile("syscall\n\t" - : "=r" (a2) - : "r" (a2), "r" (a6), "r" (a3) - : "memory"); - - return a2; -} - -uintptr_t xtensa_syscall_helper_args_1(uintptr_t arg1, uintptr_t call_id) -{ - register uintptr_t a2 __asm__("%a2") = call_id; - register uintptr_t a6 __asm__("%a6") = arg1; - - __asm__ volatile("syscall\n\t" - : "=r" (a2) - : "r" (a2), "r" (a6) - : "memory"); - - return a2; -} - -uintptr_t xtensa_syscall_helper_args_0(uintptr_t call_id) -{ - register uintptr_t a2 __asm__("%a2") = call_id; - - __asm__ volatile("syscall\n\t" - : "=r" (a2) - : "r" (a2) - : "memory"); - - return a2; -} #endif /* CONFIG_XTENSA_SYSCALL_USE_HELPER */ #if XCHAL_HAVE_THREADPTR == 0 diff --git a/arch/xtensa/core/thread.c b/arch/xtensa/core/thread.c index f9b8179173d4e..2bf1a7e11d379 100644 --- a/arch/xtensa/core/thread.c +++ b/arch/xtensa/core/thread.c @@ -42,11 +42,7 @@ static void *init_stack(struct k_thread *thread, int *stack_top, void *ret; _xtensa_irq_stack_frame_a11_t *frame; #ifdef CONFIG_USERSPACE - struct xtensa_thread_stack_header *header = - (struct xtensa_thread_stack_header *)thread->stack_obj; - - thread->arch.psp = header->privilege_stack + - sizeof(header->privilege_stack); + thread->arch.psp = NULL; #endif /* Not-a-cpu ID Ensures that the first time this is run, the @@ -70,26 +66,19 @@ static void *init_stack(struct k_thread *thread, int *stack_top, (void)memset(frame, 0, bsasz); - frame->bsa.ps = PS_WOE | PS_UM | PS_CALLINC(1); #ifdef CONFIG_USERSPACE - if ((thread->base.user_options & K_USER) == K_USER) { -#ifdef CONFIG_INIT_STACKS - /* setup_thread_stack() does not initialize the architecture specific - * privileged stack. So we need to do it manually here as this function - * is called by arch_new_thread() via z_setup_new_thread() after - * setup_thread_stack() but before thread starts running. - * - * Note that only user threads have privileged stacks and kernel - * only threads do not. - */ - (void)memset(&header->privilege_stack[0], 0xaa, sizeof(header->privilege_stack)); -#endif + /* _restore_context uses this instead of frame->bsa.ps to + * restore PS value. + */ + thread->arch.return_ps = PS_WOE | PS_UM | PS_CALLINC(1); + if ((thread->base.user_options & K_USER) == K_USER) { frame->bsa.pc = (uintptr_t)arch_user_mode_enter; } else { frame->bsa.pc = (uintptr_t)z_thread_entry; } #else + frame->bsa.ps = PS_WOE | PS_UM | PS_CALLINC(1); frame->bsa.pc = (uintptr_t)z_thread_entry; #endif @@ -159,6 +148,30 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry, struct k_thread *current = _current; size_t stack_end; + struct xtensa_thread_stack_header *header = + (struct xtensa_thread_stack_header *)current->stack_obj; + + current->arch.psp = header->privilege_stack + + sizeof(header->privilege_stack); + +#ifdef CONFIG_INIT_STACKS + /* setup_thread_stack() does not initialize the architecture specific + * privileged stack. So we need to do it manually here as this function + * is called by arch_new_thread() via z_setup_new_thread() after + * setup_thread_stack() but before thread starts running. + * + * Note that only user threads have privileged stacks and kernel + * only threads do not. + */ + (void)memset(&header->privilege_stack[0], 0xaa, sizeof(header->privilege_stack)); + +#endif + +#ifdef CONFIG_KERNEL_COHERENCE + sys_cache_data_flush_and_invd_range(&header->privilege_stack[0], + sizeof(header->privilege_stack)); +#endif + /* Transition will reset stack pointer to initial, discarding * any old context since this is a one-way operation */ diff --git a/arch/xtensa/core/userspace.S b/arch/xtensa/core/userspace.S index 3db5d8cea8d6b..be143ed1f3a4e 100644 --- a/arch/xtensa/core/userspace.S +++ b/arch/xtensa/core/userspace.S @@ -53,6 +53,12 @@ _is_user_context_return: _not_checking_user_context: rsr a2, ZSR_SYSCALL_SCRATCH #endif + + /* Need to disable any interrupts while we are saving + * register content to avoid any interferences. + */ + rsil a0, 0xf + rsr a0, ZSR_CPU l32i a0, a0, ___cpu_t_current_OFFSET l32i a0, a0, _thread_offset_to_psp @@ -65,21 +71,27 @@ _not_checking_user_context: rsr a2, ZSR_A0SAVE s32i a2, a0, ___xtensa_irq_bsa_t_a0_OFFSET rsr.ps a2 - movi a3, ~PS_OWB_MASK + movi a3, ~PS_OWB_MASK & ~PS_EXCM_MASK and a2, a2, a3 s32i a2, a0, ___xtensa_irq_bsa_t_ps_OFFSET - rsr.epc1 a2 - s32i a2, a0, ___xtensa_irq_bsa_t_pc_OFFSET -#if XCHAL_HAVE_NMI - movi a2, PS_WOE|PS_INTLEVEL(XCHAL_NMILEVEL) -#elif XCHAL_HAVE_INTERRUPTS - movi a2, PS_WOE|PS_INTLEVEL(XCHAL_NUM_INTLEVELS) -#else -#error Xtensa core with no interrupt support is used -#endif + /* Manipulate PC where we will return to after syscall. + * This is needed as syscall will stash the PC where + * the syscall instruction locates, instead of + * the instruction after it. We need to increment it to + * execute the next instruction when we return. + * The instruction size is 3 bytes, so lets just add it. + */ + rsr.epc1 a3 + addi a3, a3, 3 + s32i a3, a0, ___xtensa_irq_bsa_t_pc_OFFSET + + /* Need to setup PS so we can spill all registers. + * EXCM and RING bits need to be cleared as CPU + * needs to run in kernel and non-exception modes + * for window rotation to work. + */ rsr.ps a3 - or a3, a3, a2 movi a2, ~(PS_EXCM | PS_RING_MASK) and a3, a3, a2 wsr.ps a3 @@ -95,34 +107,7 @@ _not_checking_user_context: mov a1, a0 - l32i a3, a1, ___xtensa_irq_bsa_t_pc_OFFSET -#if XCHAL_HAVE_LOOPS - /* If the syscall instruction was the last instruction in the body of - * a zero-overhead loop, and the loop will execute again, decrement - * the loop count and resume execution at the head of the loop. - */ - rsr.lend a2 - addi a3, a3, 3 - bne a2, a3, end_loop - rsr.lcount a2 - beqz a2, end_loop - addi a2, a2, -1 - wsr.lcount a2 - rsr.lbeg a3 -end_loop: -#else - /* EPC1 (and now a3) contains the address that invoked syscall. - * We need to increment it to execute the next instruction when - * we return. The instruction size is 3 bytes, so lets just add it. - */ - addi a3, a3, 3 -#endif - s32i a3, a1, ___xtensa_irq_bsa_t_pc_OFFSET - ODD_REG_SAVE - -#if defined(CONFIG_XTENSA_HIFI_SHARING) - call0 _xtensa_hifi_save -#endif + ODD_REG_SAVE a0, a1 call0 xtensa_save_high_regs @@ -134,8 +119,7 @@ end_loop: _id_ok: /* Find the function handler for the given syscall id. */ movi a3, _k_syscall_table - slli a2, a2, 2 - add a2, a2, a3 + addx4 a2, a2, a3 l32i a2, a2, 0 #if XCHAL_HAVE_THREADPTR @@ -173,12 +157,14 @@ _id_ok: /* Stack frame pointer is the 7th argument to z_mrsh_*() * as ssf, and must be put on stack to be consumed. + * + * Subtract 16 bytes as stack needs to be 16-byte aligned. */ mov a3, a1 - addi a1, a1, -4 + addi a1, a1, -16 s32i a3, a1, 0 - l32i a3, a1, 4 + l32i a3, a1, 16 l32i a7, a3, ___xtensa_irq_bsa_t_a3_OFFSET @@ -195,7 +181,7 @@ _id_ok: * actual the stack frame. So restoration of registers * can be done properly when finishing syscalls. */ - addi a1, a1, 4 + addi a1, a1, 16 /* copy return value. Lets put it in the top of stack * because registers will be clobbered in @@ -204,25 +190,13 @@ _id_ok: l32i a3, a1, 0 s32i a6, a3, ___xtensa_irq_bsa_t_a2_OFFSET - j _syscall_returned - _syscall_returned: + /* Disable interrupts as we are restoring context. */ + rsil a0, 0xf + call0 xtensa_restore_high_regs - l32i a3, a1, ___xtensa_irq_bsa_t_sar_OFFSET - wsr a3, SAR -#if XCHAL_HAVE_LOOPS - l32i a3, a1, ___xtensa_irq_bsa_t_lbeg_OFFSET - wsr a3, LBEG - l32i a3, a1, ___xtensa_irq_bsa_t_lend_OFFSET - wsr a3, LEND - l32i a3, a1, ___xtensa_irq_bsa_t_lcount_OFFSET - wsr a3, LCOUNT -#endif -#if XCHAL_HAVE_S32C1I - l32i a3, a1, ___xtensa_irq_bsa_t_scompare1_OFFSET - wsr a3, SCOMPARE1 -#endif + ODD_REG_RESTORE a3, a1 #if XCHAL_HAVE_THREADPTR #ifdef CONFIG_THREAD_LOCAL_STORAGE @@ -231,18 +205,14 @@ _syscall_returned: add a0, a3, a0 movi a3, 1 s32i a3, a0, 0 -#else - rsr a3, ZSR_CPU - l32i a3, a3, ___cpu_t_current_OFFSET - wur.THREADPTR a3 #endif #endif /* XCHAL_HAVE_THREADPTR */ l32i a3, a1, ___xtensa_irq_bsa_t_ps_OFFSET - wsr.ps a3 + wsr.ZSR_EPS a3 l32i a3, a1, ___xtensa_irq_bsa_t_pc_OFFSET - wsr.epc1 a3 + wsr.ZSR_EPC a3 l32i a0, a1, ___xtensa_irq_bsa_t_a0_OFFSET l32i a2, a1, ___xtensa_irq_bsa_t_a2_OFFSET @@ -251,7 +221,7 @@ _syscall_returned: l32i a1, a1, ___xtensa_irq_bsa_t_scratch_OFFSET rsync - rfe + rfi ZSR_RFI_LEVEL _bad_syscall: movi a2, K_SYSCALL_BAD @@ -300,7 +270,7 @@ xtensa_userspace_enter: l32i a6, a1, 24 #ifdef CONFIG_XTENSA_MMU - call4 xtensa_swap_update_page_tables + SWAP_PAGE_TABLE a6, a3, a7 #endif #ifdef CONFIG_XTENSA_MPU call4 xtensa_mpu_map_write @@ -331,8 +301,11 @@ xtensa_userspace_enter: /* Go back to user stack */ l32i a1, a1, 4 + /* Disabling interrupts as we need to use ZSR_EPC and ZSR_EPS */ + rsil a0, 0xf + movi a0, z_thread_entry - wsr.epc2 a0 + wsr.ZSR_EPC a0 /* Configuring PS register. * We have to set callinc as well, since the called @@ -346,9 +319,9 @@ xtensa_userspace_enter: movi a0, PS_WOE|PS_CALLINC(1)|PS_UM|PS_RING(1) #endif - wsr a0, EPS2 + wsr.ZSR_EPS a0 /* Wipe out a0 (thre is no return from this function */ movi a0, 0 - rfi 2 + rfi ZSR_RFI_LEVEL diff --git a/arch/xtensa/core/xtensa_asm2_util.S b/arch/xtensa/core/xtensa_asm2_util.S index 11b18013033c0..6892831f52ac8 100644 --- a/arch/xtensa/core/xtensa_asm2_util.S +++ b/arch/xtensa/core/xtensa_asm2_util.S @@ -153,9 +153,34 @@ _restore_context: l32i a0, a1, ___xtensa_irq_bsa_t_pc_OFFSET wsr a0, ZSR_EPC + +#ifdef CONFIG_USERSPACE + /* When restoring context via xtensa_switch and + * returning from non-nested interrupts, we use + * the stashed PS value in the thread struct + * instead of the one in the thread stack. + * Both scenarios will have nested value of 0. + */ + rsr.ZSR_CPU a2 + l32i a0, a2, ___cpu_t_nested_OFFSET + bnez a0, _restore_ps_from_stack + + l32i a0, a2, ___cpu_t_current_OFFSET + l32i a0, a0, _thread_offset_to_return_ps + wsr a0, ZSR_EPS + + j _restore_ps_after + +_restore_ps_from_stack: +#endif + l32i a0, a1, ___xtensa_irq_bsa_t_ps_OFFSET wsr a0, ZSR_EPS +#ifdef CONFIG_USERSPACE +_restore_ps_after: +#endif + #if XCHAL_HAVE_FP && defined(CONFIG_CPU_HAS_FPU) && defined(CONFIG_FPU_SHARING) FPU_REG_RESTORE #endif @@ -165,25 +190,8 @@ _restore_context: call0 _xtensa_hifi_load #endif - l32i a0, a1, ___xtensa_irq_bsa_t_sar_OFFSET - wsr a0, SAR -#if XCHAL_HAVE_LOOPS - l32i a0, a1, ___xtensa_irq_bsa_t_lbeg_OFFSET - wsr a0, LBEG - l32i a0, a1, ___xtensa_irq_bsa_t_lend_OFFSET - wsr a0, LEND - l32i a0, a1, ___xtensa_irq_bsa_t_lcount_OFFSET - wsr a0, LCOUNT -#endif -#if XCHAL_HAVE_S32C1I - l32i a0, a1, ___xtensa_irq_bsa_t_scompare1_OFFSET - wsr a0, SCOMPARE1 -#endif -#if XCHAL_HAVE_THREADPTR && \ - (defined(CONFIG_USERSPACE) || defined(CONFIG_THREAD_LOCAL_STORAGE)) - l32i a0, a1, ___xtensa_irq_bsa_t_threadptr_OFFSET - wur a0, THREADPTR -#endif + ODD_REG_RESTORE a0, a1 + rsync l32i a0, a1, ___xtensa_irq_bsa_t_a0_OFFSET @@ -232,7 +240,31 @@ xtensa_arch_kernel_oops_epc: .global xtensa_switch .align 4 xtensa_switch: +#ifdef CONFIG_USERSPACE + entry a1, 32 + + s32i a4, a1, 0 + s32i a5, a1, 4 + s32i a6, a1, 8 + s32i a7, a1, 12 + + rsr a6, ZSR_CPU + l32i a6, a6, ___cpu_t_current_OFFSET +#ifdef CONFIG_XTENSA_MMU + SWAP_PAGE_TABLE a6, a4, a7 +#endif +#ifdef CONFIG_XTENSA_MPU + call4 xtensa_mpu_map_write +#endif + + l32i a7, a1, 12 + l32i a6, a1, 8 + l32i a5, a1, 4 + l32i a4, a1, 0 +#else entry a1, 16 +#endif + SPILL_ALL_WINDOWS addi a1, a1, -___xtensa_irq_bsa_t_SIZEOF @@ -245,11 +277,27 @@ xtensa_switch: s32i a0, a1, ___xtensa_irq_bsa_t_a0_OFFSET s32i a2, a1, ___xtensa_irq_bsa_t_a2_OFFSET s32i a3, a1, ___xtensa_irq_bsa_t_a3_OFFSET - ODD_REG_SAVE + ODD_REG_SAVE a0, a1 + +#if XCHAL_HAVE_FP && defined(CONFIG_CPU_HAS_FPU) && defined(CONFIG_FPU_SHARING) + FPU_REG_SAVE +#endif /* Stash our PS register contents and a "restore" PC. */ rsr a0, PS s32i a0, a1, ___xtensa_irq_bsa_t_ps_OFFSET + +#ifdef CONFIG_USERSPACE + /* Backtrack to the head of thread struct and + * then store the PS value to be restored in + * the architecture specific section. + * This will be used to restore PS instead of + * the one stashed inside stack. + */ + addi a3, a3, -___thread_t_switch_handle_OFFSET + s32i a0, a3, _thread_offset_to_return_ps +#endif + movi a0, _switch_restore_pc s32i a0, a1, ___xtensa_irq_bsa_t_pc_OFFSET @@ -260,10 +308,11 @@ xtensa_switch: /* Now the high registers */ call0 xtensa_save_high_regs -#ifdef CONFIG_KERNEL_COHERENCE +#if defined(CONFIG_KERNEL_COHERENCE) && !defined(CONFIG_SCHED_CPU_MASK_PIN_ONLY) /* Flush the stack. The top of stack was stored for us by * arch_cohere_stacks(). It can be NULL for a dummy thread. */ + rsync rsr a0, ZSR_FLUSH beqz a0, noflush mov a3, a1 @@ -282,21 +331,6 @@ noflush: l32i a3, a2, ___xtensa_irq_bsa_t_a3_OFFSET s32i a1, a3, 0 -#ifdef CONFIG_USERSPACE - /* Switch page tables */ - rsr a6, ZSR_CPU - l32i a6, a6, ___cpu_t_current_OFFSET -#ifdef CONFIG_XTENSA_MMU - call4 xtensa_swap_update_page_tables -#endif -#ifdef CONFIG_XTENSA_MPU - call4 xtensa_mpu_map_write -#endif - - l32i a2, a3, 0 - l32i a2, a2, 0 -#endif - /* Switch stack pointer and restore. The jump to * _restore_context does not return as such, but we arrange * for the restored "next" address to be immediately after for diff --git a/arch/xtensa/include/kernel_arch_func.h b/arch/xtensa/include/kernel_arch_func.h index 5e735dedffff7..8e0641f9d4beb 100644 --- a/arch/xtensa/include/kernel_arch_func.h +++ b/arch/xtensa/include/kernel_arch_func.h @@ -39,23 +39,119 @@ static ALWAYS_INLINE void arch_switch(void *switch_to, void **switched_from) } #ifdef CONFIG_KERNEL_COHERENCE +/** + * @brief Invalidate cache between two stack addresses. + * + * This invalidates the cache lines between two stack addresses, + * beginning with the cache line including the start address, up to + * but not including the cache line containing the end address. + * Not invalidating the last cache line is due to the usage in + * arch_cohere_stacks() where it invalidates the unused portion of + * stack. If the stack pointer happens to be in the middle of + * a cache line, the cache line containing the stack pointer + * address will be flushed, and then immediately invalidated. + * If we are swapping back into the same thread (e.g. after + * handling interrupt), that cache line, being invalidated, needs + * to be retrieved from main memory. This creates unnecessary + * data move between main memory and cache. + * + * @param s_addr Starting address of memory region to have cache invalidated. + * @param e_addr Ending address of memory region to have cache invalidated. + */ +static ALWAYS_INLINE void xtensa_cohere_stacks_cache_invd(size_t s_addr, size_t e_addr) +{ + const size_t first = ROUND_DOWN(s_addr, XCHAL_DCACHE_LINESIZE); + const size_t last = ROUND_DOWN(e_addr, XCHAL_DCACHE_LINESIZE); + size_t line; + + for (line = first; line < last; line += XCHAL_DCACHE_LINESIZE) { + __asm__ volatile("dhi %0, 0" :: "r"(line)); + } +} + +/** + * @brief Flush cache between two stack addresses. + * + * This flushes the cache lines between two stack addresses, + * beginning with the cache line including the start address, + * and ending with the cache line including the end address. + * Note that, contrary to xtensa_cohere_stacks_cache_invd(), + * the last cache line will be flushed instead of being + * ignored. + * + * @param s_addr Starting address of memory region to have cache invalidated. + * @param e_addr Ending address of memory region to have cache invalidated. + */ +static ALWAYS_INLINE void xtensa_cohere_stacks_cache_flush(size_t s_addr, size_t e_addr) +{ + const size_t first = ROUND_DOWN(s_addr, XCHAL_DCACHE_LINESIZE); + const size_t last = ROUND_UP(e_addr, XCHAL_DCACHE_LINESIZE); + size_t line; + + for (line = first; line < last; line += XCHAL_DCACHE_LINESIZE) { + __asm__ volatile("dhwb %0, 0" :: "r"(line)); + } +} + +/** + * @brief Flush and invalidate cache between two stack addresses. + * + * This flushes the cache lines between two stack addresses, + * beginning with the cache line including the start address, + * and ending with the cache line including the end address. + * Note that, contrary to xtensa_cohere_stacks_cache_invd(), + * the last cache line will be flushed and invalidated instead + * of being ignored. + * + * @param s_addr Starting address of memory region to have cache manipulated. + * @param e_addr Ending address of memory region to have cache manipulated. + */ +static ALWAYS_INLINE void xtensa_cohere_stacks_cache_flush_invd(size_t s_addr, size_t e_addr) +{ + const size_t first = ROUND_DOWN(s_addr, XCHAL_DCACHE_LINESIZE); + const size_t last = ROUND_UP(e_addr, XCHAL_DCACHE_LINESIZE); + size_t line; + + for (line = first; line < last; line += XCHAL_DCACHE_LINESIZE) { + __asm__ volatile("dhwbi %0, 0" :: "r"(line)); + } +} + static ALWAYS_INLINE void arch_cohere_stacks(struct k_thread *old_thread, void *old_switch_handle, struct k_thread *new_thread) { +#ifdef CONFIG_SCHED_CPU_MASK_PIN_ONLY + ARG_UNUSED(old_thread); + ARG_UNUSED(old_switch_handle); + ARG_UNUSED(new_thread); + + /* This kconfig option ensures that a living thread will never + * be executed in a different CPU so we can safely return without + * invalidate and/or flush threads cache. + */ + return; +#endif /* CONFIG_SCHED_CPU_MASK_PIN_ONLY */ + +#if !defined(CONFIG_SCHED_CPU_MASK_PIN_ONLY) int32_t curr_cpu = _current_cpu->id; size_t ostack = old_thread->stack_info.start; - size_t osz = old_thread->stack_info.size; + size_t oend = ostack + old_thread->stack_info.size; size_t osp = (size_t) old_switch_handle; size_t nstack = new_thread->stack_info.start; - size_t nsz = new_thread->stack_info.size; + size_t nend = nstack + new_thread->stack_info.size; size_t nsp = (size_t) new_thread->switch_handle; - int zero = 0; + uint32_t flush_end = 0; + +#ifdef CONFIG_USERSPACE + /* End of old_thread privileged stack. */ + void *o_psp_end = old_thread->arch.psp; +#endif - __asm__ volatile("wsr %0, " ZSR_FLUSH_STR :: "r"(zero)); + __asm__ volatile("wsr %0, " ZSR_FLUSH_STR :: "r"(flush_end)); if (old_switch_handle != NULL) { int32_t a0save; @@ -66,14 +162,6 @@ static ALWAYS_INLINE void arch_cohere_stacks(struct k_thread *old_thread, : "=r"(a0save)); } - /* The following option ensures that a living thread will never - * be executed in a different CPU so we can safely return without - * invalidate and/or flush threads cache. - */ - if (IS_ENABLED(CONFIG_SCHED_CPU_MASK_PIN_ONLY)) { - return; - } - /* The "live" area (the region between the switch handle, * which is the stack pointer, and the top of the stack * memory) of the inbound stack needs to be invalidated if we @@ -88,7 +176,7 @@ static ALWAYS_INLINE void arch_cohere_stacks(struct k_thread *old_thread, * automatically overwritten as needed. */ if (curr_cpu != new_thread->arch.last_cpu) { - sys_cache_data_invd_range((void *)nsp, (nstack + nsz) - nsp); + xtensa_cohere_stacks_cache_invd(nsp, nend); } old_thread->arch.last_cpu = curr_cpu; @@ -116,8 +204,13 @@ static ALWAYS_INLINE void arch_cohere_stacks(struct k_thread *old_thread, * to the stack top stashed in a special register. */ if (old_switch_handle != NULL) { - sys_cache_data_flush_range((void *)osp, (ostack + osz) - osp); - sys_cache_data_invd_range((void *)ostack, osp - ostack); +#ifdef CONFIG_USERSPACE + if (o_psp_end == NULL) +#endif + { + xtensa_cohere_stacks_cache_flush(osp, oend); + xtensa_cohere_stacks_cache_invd(ostack, osp); + } } else { /* When in a switch, our current stack is the outbound * stack. Flush the single line containing the stack @@ -128,13 +221,58 @@ static ALWAYS_INLINE void arch_cohere_stacks(struct k_thread *old_thread, */ __asm__ volatile("mov %0, a1" : "=r"(osp)); osp -= 16; - sys_cache_data_flush_range((void *)osp, 1); - sys_cache_data_invd_range((void *)ostack, osp - ostack); + xtensa_cohere_stacks_cache_flush(osp, osp + 16); - uint32_t end = ostack + osz; +#ifdef CONFIG_USERSPACE + if (o_psp_end == NULL) +#endif + { + xtensa_cohere_stacks_cache_invd(ostack, osp); - __asm__ volatile("wsr %0, " ZSR_FLUSH_STR :: "r"(end)); + flush_end = oend; + } } + +#ifdef CONFIG_USERSPACE + /* User threads need a bit more processing due to having + * privileged stack for handling syscalls. The privileged + * stack always immediately precedes the thread stack. + * + * Note that, with userspace enabled, we need to swap + * page table during context switch via function calls. + * This means that the stack is being actively used + * unlike the non-userspace case mentioned above. + * Therefore we need to set ZSR_FLUSH_STR to make sure + * we flush the cached data in the stack. + */ + if (o_psp_end != NULL) { + /* Start of old_thread privileged stack. + * + * struct xtensa_thread_stack_header wholly contains + * a array for the privileged stack, so we can use + * its size to calculate where the start is. + */ + size_t o_psp_start = (size_t)o_psp_end - sizeof(struct xtensa_thread_stack_header); + + if ((osp >= ostack) && (osp < oend)) { + /* osp in user stack. */ + xtensa_cohere_stacks_cache_invd(o_psp_start, osp); + + flush_end = oend; + } else if ((osp >= o_psp_start) && (osp < ostack)) { + /* osp in privileged stack. */ + xtensa_cohere_stacks_cache_flush(ostack, oend); + xtensa_cohere_stacks_cache_invd(o_psp_start, osp); + + flush_end = (size_t)old_thread->arch.psp; + } + } +#endif /* CONFIG_USERSPACE */ + + flush_end = ROUND_DOWN(flush_end, XCHAL_DCACHE_LINESIZE); + __asm__ volatile("wsr %0, " ZSR_FLUSH_STR :: "r"(flush_end)); + +#endif /* !CONFIG_SCHED_CPU_MASK_PIN_ONLY */ } #endif diff --git a/arch/xtensa/include/offsets_short_arch.h b/arch/xtensa/include/offsets_short_arch.h index f19750dc0ac8b..80ece2b1dee30 100644 --- a/arch/xtensa/include/offsets_short_arch.h +++ b/arch/xtensa/include/offsets_short_arch.h @@ -12,8 +12,33 @@ #define _thread_offset_to_psp \ (___thread_t_arch_OFFSET + ___thread_arch_t_psp_OFFSET) +#define _thread_offset_to_return_ps \ + (___thread_t_arch_OFFSET + ___thread_arch_t_return_ps_OFFSET) + #define _thread_offset_to_ptables \ (___thread_t_arch_OFFSET + ___thread_arch_t_ptables_OFFSET) + +#define _thread_offset_to_mem_domain \ + (___thread_t_mem_domain_info_OFFSET + ___mem_domain_info_t_mem_domain_OFFSET) + +#define _k_mem_domain_offset_to_arch_reg_asid \ + (__k_mem_domain_t_arch_OFFSET + __arch_mem_domain_t_reg_asid_OFFSET) + +#define _k_mem_domain_offset_to_arch_reg_ptevaddr \ + (__k_mem_domain_t_arch_OFFSET + __arch_mem_domain_t_reg_ptevaddr_OFFSET) + +#define _k_mem_domain_offset_to_arch_reg_ptepin_as \ + (__k_mem_domain_t_arch_OFFSET + __arch_mem_domain_t_reg_ptepin_as_OFFSET) + +#define _k_mem_domain_offset_to_arch_reg_ptepin_at \ + (__k_mem_domain_t_arch_OFFSET + __arch_mem_domain_t_reg_ptepin_at_OFFSET) + +#define _k_mem_domain_offset_to_arch_reg_vecpin_as \ + (__k_mem_domain_t_arch_OFFSET + __arch_mem_domain_t_reg_vecpin_as_OFFSET) + +#define _k_mem_domain_offset_to_arch_reg_vecpin_at \ + (__k_mem_domain_t_arch_OFFSET + __arch_mem_domain_t_reg_vecpin_at_OFFSET) + #endif /* CONFIG_USERSPACE */ #endif /* ZEPHYR_ARCH_XTENSA_INCLUDE_OFFSETS_SHORT_ARCH_H_ */ diff --git a/arch/xtensa/include/xtensa_asm2_context.h b/arch/xtensa/include/xtensa_asm2_context.h index d5593d7adbc89..ac13a611c67f0 100644 --- a/arch/xtensa/include/xtensa_asm2_context.h +++ b/arch/xtensa/include/xtensa_asm2_context.h @@ -80,6 +80,68 @@ #include #include +/* Stack needs to aligned on 16-bytes as mentioned on Xtensa ISA. + * So we pad _xtensa_irq_bsa_t to achieve that. The followings + * are see how much space is taken depending on features enabled. + */ + +#if XCHAL_HAVE_FP && defined(CONFIG_CPU_HAS_FPU) && defined(CONFIG_FPU_SHARING) +# define _BSA_PADDING_FPU (sizeof(uintptr_t) * 18U) +#else +# define _BSA_PADDING_FPU (0) +#endif + +#if defined(CONFIG_XTENSA_HIFI_SHARING) +# define _BSA_PADDING_HIFI (XCHAL_CP1_SA_SIZE + XCHAL_CP1_SA_ALIGN) +#else +# define _BSA_PADDING_HIFI (0) +#endif + +#if XCHAL_HAVE_THREADPTR +# define _BSA_PADDING_THREADPTR (sizeof(uintptr_t)) +#else +# define _BSA_PADDING_THREADPTR (0) +#endif + +#if XCHAL_HAVE_S32C1I +# define _BSA_PADDING_S32C1I (sizeof(uintptr_t)) +#else +# define _BSA_PADDING_S32C1I (0) +#endif + +#if XCHAL_HAVE_LOOPS +# define _BSA_PADDING_LOOPS (sizeof(uintptr_t) * 3U) +#else +# define _BSA_PADDING_LOOPS (0) +#endif + +/* Must have fields regardless of features. */ +#define _BSA_PADDING_COMMON (sizeof(uintptr_t) * 12U) + +/* Raw size by adding up all the above. */ +#define _BSA_PADDING_BASE_SIZE \ + (_BSA_PADDING_FPU + \ + _BSA_PADDING_HIFI + \ + _BSA_PADDING_THREADPTR + \ + _BSA_PADDING_S32C1I + \ + _BSA_PADDING_LOOPS + \ + _BSA_PADDING_COMMON) + +/* Each stack frame always has a pointer to BSA so we add + * that (+4) to the BSA size before padding the BSA to have + * size aligned on 16 bytes. Each group of high registers to + * be saved (totally 3 groups) consists of 4 registers which + * are 16 bytes already. So each type of stack frame + * (A[3, 7, 11, 15]) do not need any further padding as long + * as the BSA struct is of correct size. + */ +#define _BSA_PADDING_PADDED_SIZE \ + ((((_BSA_PADDING_BASE_SIZE + 4) + 15) / 16 * 16) - 4) + +/* How many extra bytes needed. */ +#define _BSA_PADDING_NEEDED \ + (_BSA_PADDING_PADDED_SIZE - _BSA_PADDING_BASE_SIZE) + /** * Base Save Area (BSA) during interrupt. * @@ -147,6 +209,8 @@ struct xtensa_irq_base_save_area { uintptr_t a2; uintptr_t a3; + uintptr_t padding[_BSA_PADDING_NEEDED / sizeof(uintptr_t)]; + uintptr_t caller_a0; uintptr_t caller_a1; uintptr_t caller_a2; @@ -155,6 +219,16 @@ struct xtensa_irq_base_save_area { typedef struct xtensa_irq_base_save_area _xtensa_irq_bsa_t; +#undef _BSA_PADDING_NEEDED +#undef _BSA_PADDING_PADDED_SIZE +#undef _BSA_PADDING_BASE_SIZE +#undef _BSA_PADDING_COMMON +#undef _BSA_PADDING_LOOPS +#undef _BSA_PADDING_S32C1I +#undef _BSA_PADDING_THREADPTR +#undef _BSA_PADDING_HIFI +#undef _BSA_PADDING_FPU + /** * Raw interrupt stack frame. * diff --git a/arch/xtensa/include/xtensa_asm2_s.h b/arch/xtensa/include/xtensa_asm2_s.h index 150df82c35cb6..198f04f80e838 100644 --- a/arch/xtensa/include/xtensa_asm2_s.h +++ b/arch/xtensa/include/xtensa_asm2_s.h @@ -11,6 +11,7 @@ #include "xtensa_asm2_context.h" #include +#include /* Assembler header! This file contains macros designed to be included * only by the assembler. @@ -156,134 +157,111 @@ * ODD_REG_SAVE * * Stashes the oddball shift/loop context registers in the base save - * area pointed to by the current stack pointer. On exit, A0 will - * have been modified but A2/A3 have not, and the shift/loop - * instructions can be used freely (though note loops don't work in - * exceptions for other reasons!). + * area pointed to by the register specified by parameter BSA_PTR. + * On exit, the scratch register specified by parameter SCRATCH_REG + * will have been modified, and the shift/loop instructions can be + * used freely (though note loops don't work in exceptions for other + * reasons!). * * Does not populate or modify the PS/PC save locations. */ -.macro ODD_REG_SAVE - rsr.sar a0 - s32i a0, a1, ___xtensa_irq_bsa_t_sar_OFFSET +.macro ODD_REG_SAVE SCRATCH_REG, BSA_PTR + rsr.sar \SCRATCH_REG + s32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_sar_OFFSET #if XCHAL_HAVE_LOOPS - rsr.lbeg a0 - s32i a0, a1, ___xtensa_irq_bsa_t_lbeg_OFFSET - rsr.lend a0 - s32i a0, a1, ___xtensa_irq_bsa_t_lend_OFFSET - rsr.lcount a0 - s32i a0, a1, ___xtensa_irq_bsa_t_lcount_OFFSET + rsr.lbeg \SCRATCH_REG + s32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_lbeg_OFFSET + rsr.lend \SCRATCH_REG + s32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_lend_OFFSET + rsr.lcount \SCRATCH_REG + s32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_lcount_OFFSET #endif - rsr.exccause a0 - s32i a0, a1, ___xtensa_irq_bsa_t_exccause_OFFSET + rsr.exccause \SCRATCH_REG + s32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_exccause_OFFSET #if XCHAL_HAVE_S32C1I - rsr.scompare1 a0 - s32i a0, a1, ___xtensa_irq_bsa_t_scompare1_OFFSET + rsr.scompare1 \SCRATCH_REG + s32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_scompare1_OFFSET #endif #if XCHAL_HAVE_THREADPTR && \ (defined(CONFIG_USERSPACE) || defined(CONFIG_THREAD_LOCAL_STORAGE)) - rur.THREADPTR a0 - s32i a0, a1, ___xtensa_irq_bsa_t_threadptr_OFFSET -#endif -#if XCHAL_HAVE_FP && defined(CONFIG_CPU_HAS_FPU) && defined(CONFIG_FPU_SHARING) - FPU_REG_SAVE + rur.THREADPTR \SCRATCH_REG + s32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_threadptr_OFFSET #endif .endm -#ifdef CONFIG_XTENSA_MMU /* - * CALC_PTEVADDR_BASE + * ODD_REG_RESTORE * - * This calculates the virtual address of the first PTE page - * (PTEVADDR base, the one mapping 0x00000000) so that we can - * use this to obtain the virtual address of the PTE page we are - * interested in. This can be obtained via - * (1 << CONFIG_XTENSA_MMU_PTEVADDR_SHIFT). + * Restores the oddball shift/loop context registers in the base save + * area pointed to by the register specified by parameter BSA_PTR. + * On exit, the scratch register specified by parameter SCRATCH_REG + * will have been modified. * - * Note that this is done this way is to avoid any TLB - * miss if we are to use l32r to load the PTEVADDR base. - * If the page containing the PTEVADDR base address is - * not in TLB, we will need to handle the TLB miss which - * we are trying to avoid here. - * - * @param ADDR_REG Register to store the calculated - * PTEVADDR base address. - * - * @note The content of ADDR_REG will be modified. - * Save and restore it around this macro usage. + * Does not restore the PS/PC save locations. */ -.macro CALC_PTEVADDR_BASE ADDR_REG - movi \ADDR_REG, 1 - slli \ADDR_REG, \ADDR_REG, CONFIG_XTENSA_MMU_PTEVADDR_SHIFT +.macro ODD_REG_RESTORE SCRATCH_REG, BSA_PTR + l32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_sar_OFFSET + wsr.sar \SCRATCH_REG +#if XCHAL_HAVE_LOOPS + l32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_lbeg_OFFSET + wsr.lbeg \SCRATCH_REG + l32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_lend_OFFSET + wsr.lend \SCRATCH_REG + l32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_lcount_OFFSET + wsr.lcount \SCRATCH_REG +#endif + l32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_exccause_OFFSET + wsr.exccause \SCRATCH_REG +#if XCHAL_HAVE_S32C1I + l32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_scompare1_OFFSET + wsr.scompare1 \SCRATCH_REG +#endif +#if XCHAL_HAVE_THREADPTR && \ + (defined(CONFIG_USERSPACE) || defined(CONFIG_THREAD_LOCAL_STORAGE)) + l32i \SCRATCH_REG, \BSA_PTR, ___xtensa_irq_bsa_t_threadptr_OFFSET + wur.THREADPTR \SCRATCH_REG +#endif + .endm +#if defined(CONFIG_XTENSA_MMU) && defined(CONFIG_USERSPACE) /* - * PRELOAD_PTEVADDR + * SWAP_PAGE_TABLE * - * This preloads the page table entries for a 4MB region to avoid TLB - * misses. This 4MB region is mapped via a page (4KB) of page table - * entries (PTE). Each entry is 4 bytes mapping a 4KB region. Each page, - * then, has 1024 entries mapping a 4MB region. Filling TLB entries is - * automatically done via hardware, as long as the PTE page associated - * with a particular address is also in TLB. If the PTE page is not in - * TLB, an exception will be raised that must be handled. This TLB miss - * is problematic when we are in the middle of dealing with another - * exception or handling an interrupt. So we need to put the PTE page - * into TLB by simply do a load operation. + * This swaps the page tables by using the pre-computed register values + * inside the architecture-specific memory domain struct. * - * @param ADDR_REG Register containing the target address - * @param PTEVADDR_BASE_REG Register containing the PTEVADDR base + * THREAD_PTR_REG is input containing pointer to the incoming thread struct. + * SC1_REG and SC2_REG are scratch registers. * - * @note Both the content of ADDR_REG will be modified. - * Save and restore it around this macro usage. + * Note that all THREAD_PTR_REG, SC1_REG and SC2_REG are all clobbered. + * Restore the thread pointer after this if necessary. */ -.macro PRELOAD_PTEVADDR ADDR_REG, PTEVADDR_BASE_REG - /* - * Calculate the offset to first PTE page of all memory. - * - * Every page (4KB) of page table entries contains - * 1024 entires (as each entry is 4 bytes). Each entry - * maps one 4KB page. So one page of entries maps 4MB of - * memory. - * - * 1. We need to find the virtual address of the PTE page - * having the page table entry mapping the address in - * register ADDR_REG. To do this, we first need to find - * the offset of this PTE page from the first PTE page - * (the one mapping memory 0x00000000): - * a. Find the beginning address of the 4KB page - * containing address in ADDR_REG. This can simply - * be done by discarding 11 bits (or shifting right - * and then left 12 bits). - * b. Since each PTE page contains 1024 entries, - * we divide the address obtained in step (a) by - * further dividing it by 1024 (shifting right and - * then left 10 bits) to obtain the offset of - * the PTE page. - * - * Step (a) and (b) can be obtained together so that - * we can shift right 22 bits, and then shift left - * 12 bits. - * - * 2. Once we have combine the results from step (1) and - * PTEVADDR_BASE_REG to get the virtual address of - * the PTE page. - * - * 3. Do a l32i to force the PTE page to be in TLB. - */ +.macro SWAP_PAGE_TABLE THREAD_PTR_REG, SC1_REG, SC2_REG + l32i \THREAD_PTR_REG, \THREAD_PTR_REG, _thread_offset_to_mem_domain + + j _swap_page_table_\@ + +.align 16 +_swap_page_table_\@: + l32i \SC1_REG, \THREAD_PTR_REG, _k_mem_domain_offset_to_arch_reg_ptevaddr + l32i \SC2_REG, \THREAD_PTR_REG, _k_mem_domain_offset_to_arch_reg_asid + wsr \SC1_REG, PTEVADDR + wsr \SC2_REG, RASID - /* Step 1 */ - srli \ADDR_REG, \ADDR_REG, 22 - slli \ADDR_REG, \ADDR_REG, 12 + l32i \SC1_REG, \THREAD_PTR_REG, _k_mem_domain_offset_to_arch_reg_ptepin_as + l32i \SC2_REG, \THREAD_PTR_REG, _k_mem_domain_offset_to_arch_reg_ptepin_at + wdtlb \SC2_REG, \SC1_REG - /* Step 2 */ - add \ADDR_REG, \ADDR_REG, \PTEVADDR_BASE_REG + l32i \SC1_REG, \THREAD_PTR_REG, _k_mem_domain_offset_to_arch_reg_vecpin_as + l32i \SC2_REG, \THREAD_PTR_REG, _k_mem_domain_offset_to_arch_reg_vecpin_at + wdtlb \SC2_REG, \SC1_REG - /* Step 3 */ - l32i \ADDR_REG, \ADDR_REG, 0 + isync .endm -#endif /* CONFIG_XTENSA_MMU */ + +#endif /* CONFIG_XTENSA_MMU && CONFIG_USERSPACE */ /* * CROSS_STACK_CALL @@ -353,16 +331,26 @@ * the context save handle in A1 as it's first argument. */ .macro CROSS_STACK_CALL - mov a6, a3 /* place "new sp" in the next frame's A2 */ - mov a10, a1 /* pass "context handle" in 2nd frame's A2 */ - mov a3, a1 /* stash it locally in A3 too */ - mov a11, a2 /* handler in 2nd frame's A3, next frame's A7 */ + /* Since accessing A4-A11 may trigger window overflows so + * we need to setup A0 and A1 correctly before putting + * the function arguments for the next two callx4 into + * A6, A10 and A11. So stach the "context handle" into + * ZSR_EPC, which is usable for now similar to ZSR_EPS. + */ + wsr.ZSR_EPC a1 + rsync /* Recover the interrupted SP from the BSA */ l32i a1, a1, 0 l32i a0, a1, ___xtensa_irq_bsa_t_a0_OFFSET addi a1, a1, ___xtensa_irq_bsa_t_SIZEOF + mov a6, a3 /* place "new sp" in the next frame's A2 */ + + rsr.ZSR_EPC a3 /* restore saved "context handle" in A3 */ + mov a10, a3 /* pass "context handle" in 2nd frame's A2 */ + mov a11, a2 /* handler in 2nd frame's A3, next frame's A7 */ + call4 _xstack_call0_\@ mov a1, a3 /* restore original SP */ mov a2, a6 /* copy return value */ @@ -377,16 +365,46 @@ _xstack_call0_\@: mov a1, a2 rsr.ZSR_EPS a2 wsr.ps a2 - call4 _xstack_call1_\@ + +#ifdef CONFIG_USERSPACE + /* Save "context handle" in A3 as we need it to determine + * if we need to swap page table later. + */ + mov a3, a6 +#endif + + callx4 a7 /* call handler */ mov a2, a6 /* copy return value */ - retw -.align 4 -_xstack_call1_\@: - /* Remember the handler is going to do our ENTRY, so the - * handler pointer is still in A6 (not A2) even though this is - * after the second CALL4. + +#ifdef CONFIG_USERSPACE + rsil a6, XCHAL_NUM_INTLEVELS + + /* If "next" handle to be restored is the same as + * the current handle, there is no need to swap page + * tables or MPU entries since we will return to + * the same thread that was interrupted. + */ + beq a2, a3, _xstack_skip_table_swap_\@ + + /* Need to switch page tables because the "next" handle + * returned above is not the same handle as we started + * with. This means we are being restored to another + * thread. */ - jx a7 + rsr a6, ZSR_CPU + l32i a6, a6, ___cpu_t_current_OFFSET + +#ifdef CONFIG_XTENSA_MMU + SWAP_PAGE_TABLE a6, a3, a7 +#endif +#ifdef CONFIG_XTENSA_MPU + call4 xtensa_mpu_map_write +#endif + +_xstack_skip_table_swap_\@: +#endif /* CONFIG_USERSPACE */ + + retw _xstack_returned_\@: .endm @@ -409,7 +427,11 @@ _xstack_returned_\@: */ s32i a2, a1, ___xtensa_irq_bsa_t_scratch_OFFSET - ODD_REG_SAVE + ODD_REG_SAVE a0, a1 + +#if XCHAL_HAVE_FP && defined(CONFIG_CPU_HAS_FPU) && defined(CONFIG_FPU_SHARING) + FPU_REG_SAVE +#endif #if defined(CONFIG_XTENSA_HIFI_SHARING) call0 _xtensa_hifi_save /* Save HiFi registers */ @@ -430,6 +452,23 @@ _xstack_returned_\@: wur.THREADPTR a0 #endif /* XCHAL_HAVE_THREADPTR && CONFIG_USERSPACE */ + /* Setting up the cross stack call below has states where the + * resulting frames are invalid/non-reentrant, so we can't + * allow nested interrupts. But we do need EXCM unmasked, as + * we use CALL/ENTRY instructions in the process and need to + * handle exceptions to spill caller/interruptee frames. Use + * PS.INTLEVEL at maximum to mask all interrupts and stash the + * current value in our designated EPS register (which is + * guaranteed unused across the call) + */ + rsil a0, 0xf + + /* Since we are unmasking EXCM, we need to set RING bits to kernel + * mode, otherwise we won't be able to run the exception handler in C. + */ + movi a3, ~(PS_EXCM_MASK) & ~(PS_RING_MASK) + and a0, a0, a3 + #ifdef CONFIG_XTENSA_INTERRUPT_NONPREEMPTABLE /* Setting the interrupt mask to the max non-debug level @@ -437,12 +476,11 @@ _xstack_returned_\@: * high level interrupts until processing of that lower level * interrupt has completed. */ - rsr.ps a0 movi a3, ~(PS_INTLEVEL_MASK) and a0, a0, a3 movi a3, PS_INTLEVEL(ZSR_RFI_LEVEL) or a0, a0, a3 - wsr.ps a0 + wsr.ZSR_EPS a0 #else @@ -458,35 +496,20 @@ _xstack_returned_\@: * argument and expand two versions of this handler. An * optimization FIXME, I guess. */ - rsr.ps a0 movi a3, PS_INTLEVEL_MASK - and a0, a0, a3 - bnez a0, _not_l1 - rsr.ps a0 + and a3, a0, a3 + bnez a3, _not_l1 + + /* interrupt masking is zero, so no need to zero it before OR-ing. */ movi a3, PS_INTLEVEL(1) or a0, a0, a3 - wsr.ps a0 _not_l1: + wsr.ZSR_EPS a0 #endif /* CONFIG_XTENSA_INTERRUPT_NONPREEMPTABLE */ - /* Setting up the cross stack call below has states where the - * resulting frames are invalid/non-reentrant, so we can't - * allow nested interrupts. But we do need EXCM unmasked, as - * we use CALL/ENTRY instructions in the process and need to - * handle exceptions to spill caller/interruptee frames. Use - * PS.INTLEVEL at maximum to mask all interrupts and stash the - * current value in our designated EPS register (which is - * guaranteed unused across the call) - */ - rsil a0, 0xf - - /* Since we are unmasking EXCM, we need to set RING bits to kernel - * mode, otherwise we won't be able to run the exception handler in C. - */ - movi a3, ~(PS_EXCM_MASK) & ~(PS_RING_MASK) - and a0, a0, a3 - wsr.ZSR_EPS a0 + movi a3, PS_INTLEVEL(0xf) + or a0, a0, a3 wsr.ps a0 rsync @@ -536,52 +559,48 @@ _do_call_\@: */ beq a6, a1, _restore_\@ -#ifndef CONFIG_USERSPACE +#if !defined(CONFIG_KERNEL_COHERENCE) || \ + (defined(CONFIG_KERNEL_COHERENCE) && defined(CONFIG_SCHED_CPU_MASK_PIN_ONLY)) l32i a1, a1, 0 l32i a0, a1, ___xtensa_irq_bsa_t_a0_OFFSET addi a1, a1, ___xtensa_irq_bsa_t_SIZEOF -#ifndef CONFIG_KERNEL_COHERENCE + /* When using coherence, the registers of the interrupted * context got spilled upstream in arch_cohere_stacks() */ SPILL_ALL_WINDOWS #endif - /* Restore A1 stack pointer from "next" handle. */ - mov a1, a6 -#else - /* With userspace, we cannot simply restore A1 stack pointer - * at this pointer because we need to swap page tables to - * the incoming thread, and we do not want to call that - * function with thread's stack. So we stash the new stack - * pointer into A2 first, then move it to A1 after we have - * swapped the page table. - */ - mov a2, a6 +#if defined(CONFIG_KERNEL_COHERENCE) && \ + defined(CONFIG_USERSPACE) && \ + !defined(CONFIG_SCHED_CPU_MASK_PIN_ONLY) - /* Need to switch page tables because the "next" handle - * returned above is not the same handle as we started - * with. This means we are being restored to another - * thread. + /* With userspace enabled, we need to swap page table via function calls + * above after returning from syscall handler above in CROSS_STACK_CALL. + * This means that the stack is being actively used, and so we need to + * flush the cached data in stack. */ - rsr a6, ZSR_CPU - l32i a6, a6, ___cpu_t_current_OFFSET -#ifdef CONFIG_XTENSA_MMU - call4 xtensa_swap_update_page_tables -#endif -#ifdef CONFIG_XTENSA_MPU - call4 xtensa_mpu_map_write -#endif - l32i a1, a1, 0 - l32i a0, a1, ___xtensa_irq_bsa_t_a0_OFFSET - addi a1, a1, ___xtensa_irq_bsa_t_SIZEOF + movi a2, 0 + xsr.ZSR_FLUSH a2 + beqz a2, _excint_noflush_\@ - SPILL_ALL_WINDOWS + rsr.ZSR_CPU a3 + l32i a3, a3, \NEST_OFF + bnez a3, _excint_noflush_\@ - /* Moved stashed stack pointer to A1 to restore stack. */ - mov a1, a2 -#endif + mov a3, a1 + +_excint_flushloop_\@: + dhwb a3, 0 + addi a3, a3, XCHAL_DCACHE_LINESIZE + blt a3, a2, _excint_flushloop_\@ + +_excint_noflush_\@: +#endif /* CONFIG_KERNEL_COHERENCE && CONFIG_USERSPACE && !CONFIG_SCHED_CPU_MASK_PIN_ONLY */ + + /* Restore A1 stack pointer from "next" handle. */ + mov a1, a6 _restore_\@: j _restore_context @@ -706,6 +725,25 @@ _Level\LVL\()Vector: s32i a0, a1, ___xtensa_irq_bsa_t_ps_OFFSET .endif +#ifdef CONFIG_USERSPACE + /* When restoring context via xtensa_switch and + * returning from non-nested interrupts, we will be + * using the stashed PS value in the thread struct + * instead of the one in the thread stack. Both of + * these scenarios will have nested value of 0. + * So when nested value is zero, we store the PS + * value into thread struct. + */ + rsr.ZSR_CPU a3 + l32i a2, a3, ___cpu_t_nested_OFFSET + bnez a2, _excint_skip_ps_save_to_thread_\LVL + + l32i a2, a3, ___cpu_t_current_OFFSET + s32i a0, a2, _thread_offset_to_return_ps + +_excint_skip_ps_save_to_thread_\LVL: +#endif + rsr.epc\LVL a0 s32i a0, a1, ___xtensa_irq_bsa_t_pc_OFFSET diff --git a/arch/xtensa/include/xtensa_mmu_priv.h b/arch/xtensa/include/xtensa_mmu_priv.h index 608cbac9c4652..b4491ff0bc30b 100644 --- a/arch/xtensa/include/xtensa_mmu_priv.h +++ b/arch/xtensa/include/xtensa_mmu_priv.h @@ -14,6 +14,7 @@ #include #include #include +#include /** * @defgroup xtensa_mmu_internal_apis Xtensa Memory Management Unit (MMU) Internal APIs @@ -509,18 +510,22 @@ static inline void xtensa_dtlb_vaddr_invalidate(void *vaddr) /** * @brief Tell hardware to use a page table very first time after boot. - * - * @param l1_page Pointer to the page table to be used. */ -void xtensa_init_paging(uint32_t *l1_page); +void xtensa_mmu_init_paging(void); /** * @brief Switch to a new page table. * - * @param asid The ASID of the memory domain associated with the incoming page table. - * @param l1_page Page table to be switched to. + * @param domain Architecture-specific memory domain data. + */ +void xtensa_mmu_set_paging(struct arch_mem_domain *domain); + +/** + * @brief Computer the necessary register values when changing page tables. + * + * @param domain Architecture-specific memory domain data. */ -void xtensa_set_paging(uint32_t asid, uint32_t *l1_page); +void xtensa_mmu_compute_domain_regs(struct arch_mem_domain *domain); /** * @} diff --git a/boards/01space/esp32c3_042_oled/doc/index.rst b/boards/01space/esp32c3_042_oled/doc/index.rst index 29fcfc7861502..801e8651cfa67 100644 --- a/boards/01space/esp32c3_042_oled/doc/index.rst +++ b/boards/01space/esp32c3_042_oled/doc/index.rst @@ -34,31 +34,7 @@ It features: Supported Features ================== -The 01space ESP32C3 0.42 OLED board configuration supports the following hardware features: - -+-----------+------------+------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==================+ -| PMP | on-chip | arch/riscv | -+-----------+------------+------------------+ -| INTMTRX | on-chip | intc_esp32c3 | -+-----------+------------+------------------+ -| PINMUX | on-chip | pinctrl_esp32 | -+-----------+------------+------------------+ -| USB UART | on-chip | serial_esp32_usb | -+-----------+------------+------------------+ -| GPIO | on-chip | gpio_esp32 | -+-----------+------------+------------------+ -| UART | on-chip | uart_esp32 | -+-----------+------------+------------------+ -| I2C | on-chip | i2c_esp32 | -+-----------+------------+------------------+ -| SPI | on-chip | spi_esp32_spim | -+-----------+------------+------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+------------------+ -| DISPLAY | off-chip | display | -+-----------+------------+------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -91,6 +67,8 @@ retrieve those files. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Standalone application ====================== diff --git a/boards/Kconfig b/boards/Kconfig index 40e8e5006e129..71b3b9571ad24 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -2,8 +2,7 @@ config BOARD string - # When using hw model v2, then the board is inherited from CMake. - default "$(BOARD)" if "$(HWM_SCHEME)" = "v2" + default "$(BOARD)" help This option holds the name of the board and is used to locate the files related to the board in the source tree (under boards/). @@ -53,7 +52,7 @@ config NET_DRIVERS When building for a qemu target then NET_DRIVERS will be default enabled to allow for easy use of SLIP or PPP -rsource "Kconfig.$(HWM_SCHEME)" +rsource "Kconfig.v2" # Parse shields references # Don't do it as a menuconfig, as shield selection is a CMake feature. diff --git a/boards/Kconfig.v1 b/boards/Kconfig.v1 deleted file mode 100644 index c98bd27d2db85..0000000000000 --- a/boards/Kconfig.v1 +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2022 Nordic Semiconductor ASA - -# SPDX-License-Identifier: Apache-2.0 - -# In HWMv1 the KCONFIG_BOARD_DIR points directly to the BOARD_DIR. -# Set the BOARD_DIR variable for backwards compatibility to legacy hardware model. -BOARD_DIR := $(KCONFIG_BOARD_DIR) - -choice - prompt "Board Selection" - -source "$(KCONFIG_BOARD_DIR)/Kconfig.board" - -endchoice diff --git a/boards/aconno/acn52832/board.cmake b/boards/aconno/acn52832/board.cmake index ddd57ab8839aa..69caa8667e3ad 100644 --- a/boards/aconno/acn52832/board.cmake +++ b/boards/aconno/acn52832/board.cmake @@ -2,5 +2,7 @@ board_runner_args(nrfjprog "--nrf-family=NRF52") board_runner_args(jlink "--device=nrf52" "--speed=4000") + +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/acrn/acrn/Kconfig b/boards/acrn/acrn/Kconfig index 7d7b97605a46c..857bd34707501 100644 --- a/boards/acrn/acrn/Kconfig +++ b/boards/acrn/acrn/Kconfig @@ -1,17 +1,9 @@ -# Copyright (c) 2019-2024 Intel Corporation +# Copyright (c) 2019-2025 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 -config BOARD_ACRN +config ACRN_COMMON bool + default y if BOARD_ACRN || BOARD_ACRN_EHL_CRB || BOARD_ACRN_ADL_CRB select CPU_HAS_FPU select X86_64 - help - "ACRN User OS" - -config BOARD_ACRN_EHL_CRB - bool - select CPU_HAS_FPU - select X86_64 - help - "ACRN User OS on ElkhartLake CRB" diff --git a/boards/acrn/acrn/Kconfig.acrn_adl_crb b/boards/acrn/acrn/Kconfig.acrn_adl_crb new file mode 100644 index 0000000000000..c105411cede57 --- /dev/null +++ b/boards/acrn/acrn/Kconfig.acrn_adl_crb @@ -0,0 +1,6 @@ +# Copyright (c) 2025 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ACRN_ADL_CRB + select SOC_ATOM diff --git a/boards/acrn/acrn/acrn_adl_crb.dts b/boards/acrn/acrn/acrn_adl_crb.dts new file mode 100644 index 0000000000000..c13054d38912f --- /dev/null +++ b/boards/acrn/acrn/acrn_adl_crb.dts @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "acrn.dts" diff --git a/boards/acrn/acrn/acrn_adl_crb.yaml b/boards/acrn/acrn/acrn_adl_crb.yaml new file mode 100644 index 0000000000000..4bb5438c97cdd --- /dev/null +++ b/boards/acrn/acrn/acrn_adl_crb.yaml @@ -0,0 +1,11 @@ +identifier: acrn_adl_crb +name: ACRN on ADL configuration +type: mcu +arch: x86 +toolchain: + - zephyr +ram: 8192 +testing: + ignore_tags: + - net + - bluetooth diff --git a/boards/acrn/acrn/acrn_adl_crb_defconfig b/boards/acrn/acrn/acrn_adl_crb_defconfig new file mode 100644 index 0000000000000..de5dfe547e78a --- /dev/null +++ b/boards/acrn/acrn/acrn_adl_crb_defconfig @@ -0,0 +1,15 @@ +# Copyright (c) 2025 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_PIC_DISABLE=y +CONFIG_LOAPIC=y +CONFIG_X2APIC=y +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1500000000 +CONFIG_BUILD_OUTPUT_BIN=y +CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN=n +CONFIG_KERNEL_VM_SIZE=0x5000000 +CONFIG_APIC_TSC_DEADLINE_TIMER=y diff --git a/boards/acrn/acrn/board.yml b/boards/acrn/acrn/board.yml index dce367c0f96a5..6efec2b876e85 100644 --- a/boards/acrn/acrn/board.yml +++ b/boards/acrn/acrn/board.yml @@ -8,4 +8,9 @@ boards: - name: acrn_ehl_crb full_name: ACRN on EHL hypervisor socs: - - name: elkhart_lake + - name: atom + + - name: acrn_adl_crb + full_name: ACRN Hypervisor on ADL + socs: + - name: atom diff --git a/boards/actinius/icarus/board.cmake b/boards/actinius/icarus/board.cmake index 9c0c33243af67..91aec43ebb51b 100644 --- a/boards/actinius/icarus/board.cmake +++ b/boards/actinius/icarus/board.cmake @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/actinius/icarus_bee/board.cmake b/boards/actinius/icarus_bee/board.cmake index 9c0c33243af67..91aec43ebb51b 100644 --- a/boards/actinius/icarus_bee/board.cmake +++ b/boards/actinius/icarus_bee/board.cmake @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/actinius/icarus_som/board.cmake b/boards/actinius/icarus_som/board.cmake index 9c0c33243af67..91aec43ebb51b 100644 --- a/boards/actinius/icarus_som/board.cmake +++ b/boards/actinius/icarus_som/board.cmake @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/actinius/icarus_som_dk/board.cmake b/boards/actinius/icarus_som_dk/board.cmake index 9c0c33243af67..91aec43ebb51b 100644 --- a/boards/actinius/icarus_som_dk/board.cmake +++ b/boards/actinius/icarus_som_dk/board.cmake @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/adafruit/feather_esp32s2/CMakeLists.txt b/boards/adafruit/feather_esp32s2/CMakeLists.txt new file mode 100644 index 0000000000000..218a0602483ab --- /dev/null +++ b/boards/adafruit/feather_esp32s2/CMakeLists.txt @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_library() +zephyr_library_sources(board.c) diff --git a/boards/adafruit/feather_esp32s2/Kconfig b/boards/adafruit/feather_esp32s2/Kconfig new file mode 100644 index 0000000000000..272e4c39ee9f3 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/Kconfig @@ -0,0 +1,11 @@ +# Copyright (c) 2023 Google, LLC +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 + +config BOARD_NEEDS_LATE_HOOK + bool + default y if BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT || BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT_REVERSE + select BOARD_LATE_INIT_HOOK diff --git a/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2 b/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2 new file mode 100644 index 0000000000000..63f45c11300ec --- /dev/null +++ b/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2 @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Philipp Steiner +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_FEATHER_ESP32S2 + select SOC_ESP32S2_R2 diff --git a/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2_tft b/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2_tft new file mode 100644 index 0000000000000..e54cad03d4221 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2_tft @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Philipp Steiner +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT + select SOC_ESP32S2_R2 diff --git a/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2_tft_reverse b/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2_tft_reverse new file mode 100644 index 0000000000000..1d470f8749063 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/Kconfig.adafruit_feather_esp32s2_tft_reverse @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Philipp Steiner +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT_REVERSE + select SOC_ESP32S2_R2 diff --git a/boards/adafruit/feather_esp32s2/Kconfig.defconfig b/boards/adafruit/feather_esp32s2/Kconfig.defconfig new file mode 100644 index 0000000000000..734863a6654b1 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/Kconfig.defconfig @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Philipp Steiner +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT || BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT_REVERSE + +if DISPLAY + +choice ST7789V_PIXEL_FORMAT + default ST7789V_RGB565 +endchoice + +if LVGL + +config LV_Z_BITS_PER_PIXEL + default 16 + +choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_16 +endchoice + +config LV_COLOR_16_SWAP + default y + +endif # LVGL + +endif # DISPLAY + +endif # BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT || BOARD_ADAFRUIT_FEATHER_ESP32S2_TFT_REVERSE diff --git a/boards/adafruit/feather_esp32s2/Kconfig.sysbuild b/boards/adafruit/feather_esp32s2/Kconfig.sysbuild new file mode 100644 index 0000000000000..3a2d17ac5cfd0 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2-pinctrl.dtsi b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2-pinctrl.dtsi new file mode 100644 index 0000000000000..a6c67847bbb3f --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2-pinctrl.dtsi @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2025 Philipp Steiner . + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + /* Debug TX (DBG) - This is the hardware UART debug pin */ + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + }; + + uart1_default: uart1_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + + group2 { + pinmux = ; + output-low; + }; + }; + + spim3_ws2812_led: spim3_ws2812_led { + group1 { + pinmux = ; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + drive-open-drain; + output-high; + }; + }; + + twai_default: twai_default { + group1 { + pinmux = , + ; + }; + }; +}; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2.dts b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2.dts new file mode 100644 index 0000000000000..e7e3f8efb7b50 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2.dts @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include "adafruit_feather_esp32s2_common.dtsi" +#include "feather_connector.dtsi" + +/ { + model = "Adafruit Feather ESP32-S2"; + compatible = "espressif,esp32s2"; +}; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_B.overlay b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_B.overlay new file mode 100644 index 0000000000000..096357d93eb77 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_B.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + /* + * On-board transistor powers I2C pull-ups and external devices connected + * via the STEMMA QT connector. + */ + i2c_reg: i2c_reg { + label = "I2C Power"; + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + startup-delay-us = <10>; + }; +}; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_B.yaml b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_B.yaml new file mode 100644 index 0000000000000..7246420988f85 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_B.yaml @@ -0,0 +1,20 @@ +identifier: adafruit_feather_esp32s2@B +name: Adafruit Feather ESP32-S2 Rev B +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - spi + - counter + - watchdog + - entropy + - pwm + - dma +vendor: adafruit +testing: + ignore_tags: + - bluetooth diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_C.overlay b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_C.overlay new file mode 100644 index 0000000000000..94550a53acda4 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_C.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + /* + * On-board regulator powers I2C pull-ups and external devices connected + * via the STEMMA QT connector. + */ + i2c_reg: i2c_reg { + label = "I2C Power"; + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + startup-delay-us = <10>; + }; +}; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_C.yaml b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_C.yaml new file mode 100644 index 0000000000000..86ca59f5965d4 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_C.yaml @@ -0,0 +1,20 @@ +identifier: adafruit_feather_esp32s2@C +name: Adafruit Feather ESP32-S2 Rev C +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - spi + - counter + - watchdog + - entropy + - pwm + - dma +vendor: adafruit +testing: + ignore_tags: + - bluetooth diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_common.dtsi b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_common.dtsi new file mode 100644 index 0000000000000..257ea650a298b --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_common.dtsi @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include "adafruit_feather_esp32s2-pinctrl.dtsi" +#include +#include +#include +#include +#include + +/ { + compatible = "espressif,esp32s2"; + + chosen { + zephyr,sram = &sram1; + /* + * uart1 is used as the default uart for zephyr,console and zephyr,shell, + * because USB-OTG is until now not supported and USB-CDC is not available + * for ESP32-S2. + * See issue #29394 - ESP32 development overview + * To use uart1 a FTDI-USB-RS232 or similar needs to be connected to the RX/TX pins. + * See feather_connector.dtsi + */ + zephyr,console = &uart1; + zephyr,shell-uart = &uart1; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; + + aliases { + led0 = &led0; + i2c-0 = &i2c0; + sw0 = &user_button; + led-strip = &led_strip; + watchdog0 = &wdt0; + }; + + leds { + compatible = "gpio-leds"; + status = "okay"; + + led0: led_0 { + label = "Red-LED"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + status = "okay"; + + user_button: user_button { + label = "BOOT Button"; + gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + }; + }; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&uart1 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; + + neopixel_power_enable { + gpio-hog; + gpios = <21 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&timer0 { + status = "okay"; +}; + +&timer1 { + status = "okay"; +}; + +&timer2 { + status = "okay"; +}; + +&timer3 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&trng0 { + status = "okay"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim3_ws2812_led>; + pinctrl-names = "default"; + + line-idle-low; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* WS2812 */ + reg = <0>; + spi-max-frequency = <6400000>; + chain-length = <1>; + spi-cpha; + spi-one-frame = ; /* 11110000: 625ns high and 625ns low */ + spi-zero-frame = ; /* 11000000: 312.5ns high and 937.5ns low */ + color-mapping = , + , + ; + }; +}; + +&twai { + pinctrl-0 = <&twai_default>; + pinctrl-names = "default"; +}; + +&wdt0 { + status = "okay"; +}; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_defconfig b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_defconfig new file mode 100644 index 0000000000000..d8fbaa879257b --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_defconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts new file mode 100644 index 0000000000000..c57ebdc8b8b97 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.dts @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include "adafruit_feather_esp32s2_common.dtsi" +#include "feather_connector_tft.dtsi" + +/ { + model = "Adafruit Feather ESP32-S2 TFT"; + compatible = "espressif,esp32s2"; + + chosen { + zephyr,display = &st7789v_tft; + }; + + aliases { + backlight = &led1; + }; + + leds { + compatible = "gpio-leds"; + status = "okay"; + + led1: led_1 { + label = "TFT Backlight"; + gpios = <&gpio1 45 GPIO_ACTIVE_HIGH>; + }; + }; + + /* + * On-board regulator powers I2C pull-ups and external devices connected + * via the STEMMA QT connector. + */ + i2c_reg: i2c_reg { + label = "I2C Power"; + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + startup-delay-us = <10>; + }; + + mipi_dbi { + compatible = "zephyr,mipi-dbi-spi"; + spi-dev = <&spi2>; + dc-gpios = <&gpio1 39 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 40 GPIO_ACTIVE_LOW>; + write-only; + #address-cells = <1>; + #size-cells = <0>; + + st7789v_tft: st7789v_tft@0 { + compatible = "sitronix,st7789v"; + status = "disabled"; + + /* Also powered by i2c_reg */ + power-domains = <&i2c_reg>; + + mipi-max-frequency = ; + reg = <0>; + width = <135>; + height = <240>; + x-offset = <52>; + y-offset = <40>; + vcom = <0x20>; + gctrl = <0x35>; + vrhs = <0x0b>; + vdvs = <0x20>; + mdac = <0x08>; + gamma = <0x01>; + colmod = <0x55>; + lcm = <0x2c>; + porch-param = [0c 0c 00 33 33]; + cmd2en-param = [5a 69 02 01]; + pwctrl1-param = [a4 a1]; + pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + ram-param = [00 F0]; + rgb-param = [40 02 14]; + mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; + }; + }; +}; + +&gpio0 { + status = "okay"; + + neopixel_power_enable { + gpio-hog; + gpios = <34 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&pinctrl { + uart1_default: uart1_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + drive-open-drain; + output-high; + }; + }; +}; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.yaml b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.yaml new file mode 100644 index 0000000000000..99ca5778e7a03 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft.yaml @@ -0,0 +1,21 @@ +identifier: adafruit_feather_esp32s2_tft +name: Adafruit ESP32-S2 TFT Feather +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - spi + - counter + - watchdog + - entropy + - pwm + - dma + - display +vendor: adafruit +testing: + ignore_tags: + - bluetooth diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_defconfig b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_defconfig new file mode 100644 index 0000000000000..d8fbaa879257b --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_defconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts new file mode 100644 index 0000000000000..fbb4b0993ae1c --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.dts @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include "adafruit_feather_esp32s2_common.dtsi" +#include "feather_connector.dtsi" + +/ { + model = "Adafruit Feather ESP32-S2 TFT Reverse"; + compatible = "espressif,esp32s2"; + + chosen { + zephyr,display = &st7789v_tft; + }; + + aliases { + backlight = &led1; + }; + + leds { + compatible = "gpio-leds"; + status = "okay"; + + led1: led_1 { + label = "TFT Backlight"; + gpios = <&gpio1 45 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + status = "okay"; + + d1_button: d1_button { + label = "D1 Button"; + gpios = <&gpio0 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + }; + + d2_button: d2_button { + label = "D3 Button"; + gpios = <&gpio0 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + }; + }; + + i2c_reg: i2c_reg { + label = "TFT I2C Power"; + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + startup-delay-us = <10>; + }; + + mipi_dbi { + compatible = "zephyr,mipi-dbi-spi"; + spi-dev = <&spi2>; + dc-gpios = <&gpio1 40 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 41 GPIO_ACTIVE_LOW>; + write-only; + #address-cells = <1>; + #size-cells = <0>; + + st7789v_tft: st7789v_tft@0 { + compatible = "sitronix,st7789v"; + status = "disabled"; + + /* Also powered by i2c_reg */ + power-domains = <&i2c_reg>; + + mipi-max-frequency = ; + reg = <0>; + width = <135>; + height = <240>; + x-offset = <52>; + y-offset = <40>; + vcom = <0x20>; + gctrl = <0x35>; + vrhs = <0x0b>; + vdvs = <0x20>; + mdac = <0x08>; + gamma = <0x01>; + colmod = <0x55>; + lcm = <0x2c>; + porch-param = [0c 0c 00 33 33]; + cmd2en-param = [5a 69 02 01]; + pwctrl1-param = [a4 a1]; + pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + ram-param = [00 F0]; + rgb-param = [40 02 14]; + mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; + }; + }; +}; + +&pinctrl { + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + + group2 { + pinmux = ; + output-low; + }; + }; +}; + +&i2c0 { + max17048: max17048@36 { + compatible = "maxim,max17048"; + status = "disabled"; + reg = <0x36 >; + power-domains = <&i2c_reg>; + }; +}; diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.yaml b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.yaml new file mode 100644 index 0000000000000..f5c673e211bef --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse.yaml @@ -0,0 +1,22 @@ +identifier: adafruit_feather_esp32s2_tft_reverse/esp32s2 +name: Adafruit ESP32-S2 TFT Feather Reverse +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - spi + - counter + - watchdog + - entropy + - pwm + - dma + - display + - fuel_gauge +vendor: adafruit +testing: + ignore_tags: + - bluetooth diff --git a/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse_defconfig b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse_defconfig new file mode 100644 index 0000000000000..d8fbaa879257b --- /dev/null +++ b/boards/adafruit/feather_esp32s2/adafruit_feather_esp32s2_tft_reverse_defconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32s2/board.c b/boards/adafruit/feather_esp32s2/board.c new file mode 100644 index 0000000000000..e7f65a4ba537a --- /dev/null +++ b/boards/adafruit/feather_esp32s2/board.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Leon Rinkel + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + * + * Automatically turns on backlight if display is configured, i.e. display DT + * node has status okay. + */ + +#include +#include +#include + +#define DISPLAY_NODE DT_CHOSEN(zephyr_display) + +#if DT_NODE_HAS_STATUS(DISPLAY_NODE, okay) +static const struct gpio_dt_spec backlight = GPIO_DT_SPEC_GET(DT_ALIAS(backlight), gpios); +#endif + +void board_late_init_hook(void) +{ +#if DT_NODE_HAS_STATUS(DISPLAY_NODE, okay) + if (gpio_is_ready_dt(&backlight)) { + gpio_pin_configure_dt(&backlight, GPIO_OUTPUT_ACTIVE); + } +#endif +} diff --git a/boards/adafruit/feather_esp32s2/board.cmake b/boards/adafruit/feather_esp32s2/board.cmake new file mode 100644 index 0000000000000..2f04d1fe8861e --- /dev/null +++ b/boards/adafruit/feather_esp32s2/board.cmake @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adafruit/feather_esp32s2/board.yml b/boards/adafruit/feather_esp32s2/board.yml new file mode 100644 index 0000000000000..fda3bf5e8556b --- /dev/null +++ b/boards/adafruit/feather_esp32s2/board.yml @@ -0,0 +1,22 @@ +boards: +- name: adafruit_feather_esp32s2 + full_name: Adafruit Feather ESP32S2 + vendor: adafruit + socs: + - name: esp32s2 + revision: + format: "letter" + default: "C" + revisions: + - name: "B" + - name: "C" +- name: adafruit_feather_esp32s2_tft + full_name: Adafruit Feather ESP32S2 TFT + vendor: adafruit + socs: + - name: esp32s2 +- name: adafruit_feather_esp32s2_tft_reverse + full_name: Adafruit Feather ESP32S2 TFT Reverse + vendor: adafruit + socs: + - name: esp32s2 diff --git a/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2.rst b/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2.rst new file mode 100644 index 0000000000000..a5fb76324d985 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2.rst @@ -0,0 +1,358 @@ +.. zephyr:board:: adafruit_feather_esp32s2 + +Overview +******** + +The Adafruit Feather ESP32-S2 boards are ESP32-S2 development boards in the +Feather standard layout, sharing peripheral placement with other devices labeled +as Feathers or FeatherWings. The board is equipped with an ESP32-S2 mini module, +a LiPo battery charger, a fuel gauge, a USB-C and `SparkFun Qwiic`_-compatible +`STEMMA QT`_ connector for the I2C bus. + +Hardware +******** + +- ESP32-S2 mini module, featuring the 240MHz Tensilica processor +- 320KB SRAM, 4MB flash + 2MB PSRAM +- USB-C directly connected to the ESP32-S2 for USB +- LiPo connector and built-in battery charging when powered via USB-C +- LC709203 or MAX17048 fuel gauge for battery voltage and state-of-charge reporting +- Built-in NeoPixel indicator RGB LED +- STEMMA QT connector for I2C devices, with switchable power for low-power mode + +.. note:: + + - The `Adafruit ESP32-S2 Feather with BME280 Sensor`_ is the same board as the + `Adafruit ESP32-S2 Feather`_ but with an already equipped BME280 Sensor, but is not + stated as a separate board, instead the BME280 needs to be added via a devicetree + overlay. All boards, except the `Adafruit ESP32-S2 Feather with BME280 Sensor`_ have a + space for it, but will not be shipped with. + - As of May 31, 2023 - Adafruit has changed the battery monitor chip from the + now-discontinued LC709203 to the MAX17048. Check the back silkscreen of your Feather to + see which chip you have. + - For the MAX17048 a driver in zephyr exists and is supported, but needs to be added via + a devicetree overlay. + - For the LC709203 a driver does'nt exists yet and the fuel gauge for boards with this IC + is not available. + - For the `Adafruit ESP32-S2 Feather`_ there are two different Revisions ``rev B`` and + ``rev C``. The ``rev C`` board has revised the power circuitry for the NeoPixel and I2C + QT port. Instead of a transistor the ``rev C`` has a LDO regulator. To enable the + NeoPixel and I2C QT port on ``rev B`` boards ``GPIO7`` (``i2c_reg``) needs to be set to + LOW and on ``rev C`` boards it needs to be set HIGH. + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +.. note:: + USB-OTG is until now not supported see `ESP32 development overview`_. To see a serial output + a FTDI-USB-RS232 or similar needs to be connected to the RX/TX pins on the feather connector. + +Connections and IOs +=================== + +The `Adafruit ESP32-S2 Feather`_ User Guide has detailed information about the board including +pinouts and the schematic. + +- `Adafruit ESP32-S2 Feather Pinouts`_ +- `Adafruit ESP32-S2 Feather Schematic`_ + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Prerequisites +============= + +Espressif HAL requires WiFi binary blobs in order work. Run the command below +to retrieve those files. + +.. code-block:: console + + west update + west blobs fetch hal_espressif + +Building & Flashing +******************* + +Simple boot +=========== + +The board could be loaded using the single binary image, without 2nd stage +bootloader. It is the default option when building the application without +additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +================== + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be built (and flashed) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +======== + +The sysbuild makes possible to build and flash all necessary images needed to +bootstrap the board with the ESP32 SoC. + +To build the sample application using sysbuild use the command: + +**Rev B** + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@B + :goals: build + :west-args: --sysbuild + :compact: + +**Rev C** + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@C + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` documentation. + +Manual build +============ + +During the development cycle, it is intended to build & flash as quickly possible. +For that reason, images can be built one at a time using traditional build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flash at least once. + +Build and flash applications as usual: + +**Rev B** + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@B + :goals: build + +**Rev C** + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@C + :goals: build + +The usual ``flash`` target will work. Here is an example for the :zephyr:code-sample:`hello_world` +application. + +To enter ROM bootloader mode, hold down ``boot-button`` while clicking reset button. +When in the ROM bootloader, you can upload code and query the chip using ``west flash``. + + +**Rev B** + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@B + :goals: flash + +**Rev C** + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@C + :goals: flash + +After the flashing you will receive most likely this Error: + +.. code-block:: console + + WARNING: ESP32-S2FNR2 (revision v0.0) chip was placed into download mode using GPIO0. + esptool.py can not exit the download mode over USB. To run the app, reset the chip manually. + To suppress this note, set --after option to 'no_reset'. + FATAL ERROR: command exited with status 1: ... + +As stated in the Warning-Message ``esptool`` can't reset the board by itself and this message +can be ignored and the board needs to be reseted via the Reset-Button manually. + +Open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has been manually reseted and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! adafruit_feather_esp32s2 + +Debugging +********* + +ESP32-S2 support on OpenOCD is available at `OpenOCD`_. + +ESP32-S2 has a built-in JTAG circuitry and can be debugged without any +additional chip. Only an USB cable connected to the D+/D- pins is necessary. + +Further documentation can be obtained from the SoC vendor +in `JTAG debugging for ESP32-S2`_. + +You can debug an application in the usual way. Here is an example for +the :zephyr:code-sample:`hello_world` application. + +**Rev B** + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@B + :goals: debug + +**Rev C** + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2@C + :goals: debug + +Testing the On-Board-LED +************************ + +There is a sample available to verify that the LEDs on the board are +functioning correctly with Zephyr: + +**Rev B** + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: adafruit_feather_esp32s2@B + :goals: build flash + +**Rev C** + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: adafruit_feather_esp32s2@C + :goals: build flash + +Testing the NeoPixel +******************** + +There is a sample available to verify that the NeoPixel on the board are +functioning correctly with Zephyr: + +**Rev B** + + .. zephyr-app-commands:: + :zephyr-app: samples/drivers/led/led_strip + :board: adafruit_feather_esp32s2@B + :goals: build flash + +**Rev C** + + .. zephyr-app-commands:: + :zephyr-app: samples/drivers/led/led_strip + :board: adafruit_feather_esp32s2@C + :goals: build flash + +Testing the Fuel Gauge (MAX17048) +********************************* + +There is a sample available to verify that the MAX17048 fuel gauge on the board are +functioning correctly with Zephyr: + +.. note:: + As of May 31, 2023 Adafruit changed the battery monitor chip from the now-discontinued LC709203 + to the MAX17048. + +.. zephyr-app-commands:: + :zephyr-app: samples/fuel_gauge/max17048/ + :board: adafruit_feather_esp32s2@C + :goals: build flash + +Testing Wi-Fi +************* + +There is a sample available to verify that the Wi-Fi on the board are +functioning correctly with Zephyr: + +.. note:: + The Prerequisites must be met before testing Wi-Fi. + +**Rev B** + + .. zephyr-app-commands:: + :zephyr-app: samples/net/wifi/shell + :board: adafruit_feather_esp32s2@B + :goals: build flash + +**Rev C** + + .. zephyr-app-commands:: + :zephyr-app: samples/net/wifi/shell + :board: adafruit_feather_esp32s2@C + :goals: build flash + +References +********** + +.. target-notes:: + +.. _`Adafruit ESP32-S2 Feather`: https://www.adafruit.com/product/5000 +.. _`Adafruit ESP32-S2 Feather with BME280 Sensor`: https://www.adafruit.com/product/5303 +.. _`OpenOCD`: https://github.com/openocd-org/openocd +.. _`ESP32 development overview`: https://github.com/zephyrproject-rtos/zephyr/issues/29394#issuecomment-2635037831 +.. _`Adafruit ESP32-S2 Feather Pinouts`: https://learn.adafruit.com/adafruit-esp32-s2-feather/pinouts +.. _`Adafruit ESP32-S2 Feather Schematic`: https://learn.adafruit.com/adafruit-esp32-s2-feather/downloads +.. _`SparkFun Qwiic`: https://www.sparkfun.com/qwiic +.. _`STEMMA QT`: https://learn.adafruit.com/introducing-adafruit-stemma-qt +.. _`JTAG debugging for ESP32-S2`: https://docs.espressif.com/projects/esp-idf/en/stable/esp32s2/api-guides/jtag-debugging/index.html diff --git a/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2_tft.rst b/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2_tft.rst new file mode 100644 index 0000000000000..6f44363ca4b59 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2_tft.rst @@ -0,0 +1,296 @@ +.. zephyr:board:: adafruit_feather_esp32s2_tft + +Overview +******** + +The Adafruit Feather ESP32-S2 boards are ESP32-S2 development boards in the +Feather standard layout, sharing peripheral placement with other devices labeled +as Feathers or FeatherWings. The board is equipped with an ESP32-S2 mini module, +a LiPo battery charger, a fuel gauge, a USB-C and `SparkFun Qwiic`_-compatible +`STEMMA QT`_ connector for the I2C bus. + +Hardware +******** + +- ESP32-S2 mini module, featuring the 240MHz Tensilica processor +- 320KB SRAM, 4MB flash + 2MB PSRAM +- USB-C directly connected to the ESP32-S2 for USB +- LiPo connector and built-in battery charging when powered via USB-C +- LC709203 or MAX17048 fuel gauge for battery voltage and state-of-charge reporting +- Charging indicator LED, user LED, reset and boot buttons. +- Built-in NeoPixel indicator RGB LED +- STEMMA QT connector for I2C devices, with switchable power for low-power mode +- 240x135 pixel IPS TFT color display with 1.14" diagonal and ST7789 chipset + +.. note:: + + - The board has a space for a BME280, but will not be shipped with. + - As of May 31, 2023 - Adafruit has changed the battery monitor chip from the + now-discontinued LC709203 to the MAX17048. Check the back silkscreen of your Feather to + see which chip you have. + - For the MAX17048 a driver in zephyr exists and is supported, but needs to be added via + a devicetree overlay. + - For the LC709203 a driver does'nt exists yet and the fuel gauge for boards with this IC + is not available. + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +.. note:: + USB-OTG is until now not supported see `ESP32 development overview`_. To see a serial output + a FTDI-USB-RS232 or similar needs to be connected to the RX/TX pins on the feather connector. + +Connections and IOs +=================== + +The `Adafruit ESP32-S2 TFT Feather`_ User Guide has detailed information about the board including +pinouts and the schematic. + +- `Adafruit ESP32-S2 TFT Feather Pinouts`_ +- `Adafruit ESP32-S2 TFT Feather Schematic`_ + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Prerequisites +============= + +Espressif HAL requires WiFi binary blobs in order work. Run the command below +to retrieve those files. + +.. code-block:: console + + west update + west blobs fetch hal_espressif + +Building & Flashing +******************* + +Simple boot +=========== + +The board could be loaded using the single binary image, without 2nd stage +bootloader. It is the default option when building the application without +additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +================== + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be built (and flashed) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +======== + +The sysbuild makes possible to build and flash all necessary images needed to +bootstrap the board with the ESP32 SoC. + +To build the sample application using sysbuild use the command: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` documentation. + +Manual build +============ + +During the development cycle, it is intended to build & flash as quickly possible. +For that reason, images can be built one at a time using traditional build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flash at least once. + +Build and flash applications as usual: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft + :goals: build + +The usual ``flash`` target will work. Here is an example for the :zephyr:code-sample:`hello_world` +application. + +To enter ROM bootloader mode, hold down ``boot-button`` while clicking reset button. +When in the ROM bootloader, you can upload code and query the chip using ``west flash``. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft + :goals: flash + +After the flashing you will receive most likely this Error: + +.. code-block:: console + + WARNING: ESP32-S2FNR2 (revision v0.0) chip was placed into download mode using GPIO0. + esptool.py can not exit the download mode over USB. To run the app, reset the chip manually. + To suppress this note, set --after option to 'no_reset'. + FATAL ERROR: command exited with status 1: ... + +As stated in the Warning-Message ``esptool`` can't reset the board by itself and this message +can be ignored and the board needs to be reseted via the Reset-Button manually. + +Open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has been manually reseted and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! adafruit_feather_esp32s2_tft + +Debugging +********* + +ESP32-S2 support on OpenOCD is available at `OpenOCD`_. + +ESP32-S2 has a built-in JTAG circuitry and can be debugged without any +additional chip. Only an USB cable connected to the D+/D- pins is necessary. + +Further documentation can be obtained from the SoC vendor +in `JTAG debugging for ESP32-S2`_. + +You can debug an application in the usual way. Here is an example for +the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft + :goals: debug + +Testing the On-Board-LED +************************ + +There is a sample available to verify that the LEDs on the board are +functioning correctly with Zephyr: + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: adafruit_feather_esp32s2_tft + :goals: build flash + +Testing the NeoPixel +******************** + +There is a sample available to verify that the NeoPixel on the board are +functioning correctly with Zephyr: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/led/led_strip + :board: adafruit_feather_esp32s2_tft + :goals: build flash + +Testing the TFT +*************** + +.. note:: + To activate the backlight of the display ``GPIO45`` (``backlight``) needs to be set to HIGH. + This will be done automatically via ``board_late_init_hook()``. + +.. zephyr-app-commands:: + :zephyr-app: samples/subsys/display/lvgl + :board: adafruit_feather_esp32s2_tft + :goals: build flash + +Testing the Fuel Gauge (MAX17048) +********************************* + +There is a sample available to verify that the MAX17048 fuel gauge on the board are +functioning correctly with Zephyr: + +.. note:: + As of May 31, 2023 Adafruit changed the battery monitor chip from the now-discontinued LC709203 + to the MAX17048. + +.. zephyr-app-commands:: + :zephyr-app: samples/fuel_gauge/max17048/ + :board: adafruit_feather_esp32s2_tft + :goals: build flash + +Testing Wi-Fi +************* + +There is a sample available to verify that the Wi-Fi on the board are +functioning correctly with Zephyr: + +.. note:: + The Prerequisites must be met before testing Wi-Fi. + +.. zephyr-app-commands:: + :zephyr-app: samples/net/wifi/shell + :board: adafruit_feather_esp32s2_tft + :goals: build flash + +References +********** + +.. target-notes:: + +.. _`Adafruit ESP32-S2 TFT Feather`: https://www.adafruit.com/product/5300 +.. _`OpenOCD`: https://github.com/openocd-org/openocd +.. _`ESP32 development overview`: https://github.com/zephyrproject-rtos/zephyr/issues/29394#issuecomment-2635037831 +.. _`Adafruit ESP32-S2 TFT Feather Pinouts`: https://learn.adafruit.com/adafruit-esp32-s2-tft-feather/pinouts +.. _`Adafruit ESP32-S2 TFT Feather Schematic`: https://learn.adafruit.com/adafruit-esp32-s2-tft-feather/downloads +.. _`SparkFun Qwiic`: https://www.sparkfun.com/qwiic +.. _`STEMMA QT`: https://learn.adafruit.com/introducing-adafruit-stemma-qt +.. _`JTAG debugging for ESP32-S2`: https://docs.espressif.com/projects/esp-idf/en/stable/esp32s2/api-guides/jtag-debugging/index.html diff --git a/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2_tft_reverse.rst b/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2_tft_reverse.rst new file mode 100644 index 0000000000000..fcbb635220591 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/doc/adafruit_feather_esp32s2_tft_reverse.rst @@ -0,0 +1,293 @@ +.. zephyr:board:: adafruit_feather_esp32s2_tft_reverse + +Overview +******** + +The Adafruit Feather ESP32-S2 boards are ESP32-S2 development boards in the +Feather standard layout, sharing peripheral placement with other devices labeled +as Feathers or FeatherWings. The board is equipped with an ESP32-S2 mini module, +a LiPo battery charger, a fuel gauge, a USB-C and `SparkFun Qwiic`_-compatible +`STEMMA QT`_ connector for the I2C bus. + +Hardware +******** + +- ESP32-S2 mini module, featuring the 240MHz Tensilica processor +- 320KB SRAM, 4MB flash + 2MB PSRAM +- USB-C directly connected to the ESP32-S2 for USB +- LiPo connector and built-in battery charging when powered via USB-C +- LC709203 or MAX17048 fuel gauge for battery voltage and state-of-charge reporting +- Charging indicator LED, user LED, reset and boot buttons and has 2 additional buttons. +- Built-in NeoPixel indicator RGB LED +- 240x135 pixel IPS TFT color display with 1.14" diagonal and ST7789 chipset. + +.. note:: + + - The board has a space for a BME280, but will not be shipped with. + - For the MAX17048 a driver in zephyr exists and is supported, but needs to be added via + a devicetree overlay. + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +.. note:: + USB-OTG is until now not supported see `ESP32 development overview`_. To see a serial output + a FTDI-USB-RS232 or similar needs to be connected to the RX/TX pins on the feather connector. + +Connections and IOs +=================== + +The `Adafruit ESP32-S2 Reverse TFT Feather`_ User Guide has detailed information about the board +including pinouts and the schematic. + +- `Adafruit ESP32-S2 Reverse TFT Feather Pinouts`_ +- `Adafruit ESP32-S2 Reverse TFT Feather Schematic`_ + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Prerequisites +============= + +Espressif HAL requires WiFi binary blobs in order work. Run the command below +to retrieve those files. + +.. code-block:: console + + west update + west blobs fetch hal_espressif + +Building & Flashing +******************* + +Simple boot +=========== + +The board could be loaded using the single binary image, without 2nd stage +bootloader. It is the default option when building the application without +additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +================== + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be built (and flashed) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +======== + +The sysbuild makes possible to build and flash all necessary images needed to +bootstrap the board with the ESP32 SoC. + +To build the sample application using sysbuild use the command: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft_reverse + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` documentation. + +Manual build +============ + +During the development cycle, it is intended to build & flash as quickly possible. +For that reason, images can be built one at a time using traditional build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flash at least once. + +Build and flash applications as usual: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft_reverse + :goals: build + +The usual ``flash`` target will work. Here is an example for the :zephyr:code-sample:`hello_world` +application. + +To enter ROM bootloader mode, hold down ``boot-button`` while clicking reset button. +When in the ROM bootloader, you can upload code and query the chip using ``west flash``. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft_reverse + :goals: flash + +After the flashing you will receive most likely this Error: + +.. code-block:: console + + WARNING: ESP32-S2FNR2 (revision v0.0) chip was placed into download mode using GPIO0. + esptool.py can not exit the download mode over USB. To run the app, reset the chip manually. + To suppress this note, set --after option to 'no_reset'. + FATAL ERROR: command exited with status 1: ... + +As stated in the Warning-Message ``esptool`` can't reset the board by itself and this message +can be ignored and the board needs to be reseted via the Reset-Button manually. + +Open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has been manually reseted and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! adafruit_feather_esp32s2_tft_reverse + +Debugging +********* + +ESP32-S2 support on OpenOCD is available at `OpenOCD`_. + +ESP32-S2 has a built-in JTAG circuitry and can be debugged without any +additional chip. Only an USB cable connected to the D+/D- pins is necessary. + +Further documentation can be obtained from the SoC vendor +in `JTAG debugging for ESP32-S2`_. + +You can debug an application in the usual way. Here is an example for +the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s2_tft_reverse + :goals: debug + +Testing the On-Board-LED +************************ + +There is a sample available to verify that the LEDs on the board are +functioning correctly with Zephyr: + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: adafruit_feather_esp32s2_tft_reverse + :goals: build flash + +Testing the NeoPixel +******************** + +There is a sample available to verify that the NeoPixel on the board are +functioning correctly with Zephyr: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/led/led_strip + :board: adafruit_feather_esp32s2_tft_reverse + :goals: build flash + +Testing the TFT +*************** + +There is a sample available to verify that the TFT on the board are +functioning correctly with Zephyr: + +.. note:: + To activated the backlight of the display ``GPIO45`` (``backlight``) needs to be set to HIGH. + This will be done automatically via ``board_late_init_hook()``. + +.. zephyr-app-commands:: + :zephyr-app: samples/subsys/display/lvgl + :board: adafruit_feather_esp32s2_tft_reverse + :goals: build flash + +Testing the Fuel Gauge (MAX17048) +********************************* + +There is a sample available to verify that the MAX17048 fuel gauge on the board are +functioning correctly with Zephyr: + +.. note:: + As of May 31, 2023 Adafruit changed the battery monitor chip from the now-discontinued LC709203 + to the MAX17048. + +.. zephyr-app-commands:: + :zephyr-app: samples/fuel_gauge/max17048/ + :board: adafruit_feather_esp32s2_tft_reverse + :goals: build flash + +Testing Wi-Fi +************* + +There is a sample available to verify that the Wi-Fi on the board are +functioning correctly with Zephyr: + +.. note:: + The Prerequisites must be met before testing Wi-Fi. + +.. zephyr-app-commands:: + :zephyr-app: samples/net/wifi/shell + :board: adafruit_feather_esp32s2_tft_reverse + :goals: build flash + +References +********** + +.. target-notes:: + +.. _`Adafruit ESP32-S2 Reverse TFT Feather`: https://www.adafruit.com/product/5345 +.. _`OpenOCD`: https://github.com/openocd-org/openocd +.. _`ESP32 development overview`: https://github.com/zephyrproject-rtos/zephyr/issues/29394#issuecomment-2635037831 +.. _`Adafruit ESP32-S2 Reverse TFT Feather Pinouts`: https://learn.adafruit.com/esp32-s2-reverse-tft-feather/pinouts +.. _`Adafruit ESP32-S2 Reverse TFT Feather Schematic`: https://learn.adafruit.com/esp32-s2-reverse-tft-feather/downloads +.. _`SparkFun Qwiic`: https://www.sparkfun.com/qwiic +.. _`STEMMA QT`: https://learn.adafruit.com/introducing-adafruit-stemma-qt +.. _`JTAG debugging for ESP32-S2`: https://docs.espressif.com/projects/esp-idf/en/stable/esp32s2/api-guides/jtag-debugging/index.html diff --git a/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2.webp b/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2.webp new file mode 100644 index 0000000000000..b63d6c73977c6 Binary files /dev/null and b/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2.webp differ diff --git a/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2_tft.webp b/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2_tft.webp new file mode 100644 index 0000000000000..a1b9d091218e6 Binary files /dev/null and b/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2_tft.webp differ diff --git a/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2_tft_reverse.webp b/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2_tft_reverse.webp new file mode 100644 index 0000000000000..8b607c89f858f Binary files /dev/null and b/boards/adafruit/feather_esp32s2/doc/img/adafruit_feather_esp32s2_tft_reverse.webp differ diff --git a/boards/adafruit/feather_esp32s2/feather_connector.dtsi b/boards/adafruit/feather_esp32s2/feather_connector.dtsi new file mode 100644 index 0000000000000..8414fbbfb106c --- /dev/null +++ b/boards/adafruit/feather_esp32s2/feather_connector.dtsi @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 Richard Osterloh + * Copyright (c) 2024 Leon Rinkel + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + feather_header: connector { + compatible = "adafruit-feather-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = + <0 0 &gpio0 18 0>, /* A0 */ + <1 0 &gpio0 17 0>, /* A1 */ + <2 0 &gpio0 16 0>, /* A2 */ + <3 0 &gpio0 15 0>, /* A3 */ + <4 0 &gpio0 14 0>, /* A4 */ + <5 0 &gpio0 8 0>, /* A5 */ + <6 0 &gpio1 36 0>, /* SCK */ + <7 0 &gpio1 35 0>, /* MOSI */ + <8 0 &gpio1 37 0>, /* MISO */ + <9 0 &gpio1 38 0>, /* RX */ + <10 0 &gpio1 39 0>, /* TX */ + <11 0 &gpio1 43 0>, /* DB */ + <12 0 &gpio1 3 0>, /* SDA */ + <13 0 &gpio1 4 0>, /* SCL */ + <14 0 &gpio0 5 0>, /* D5 */ + <15 0 &gpio0 6 0>, /* D6 */ + <16 0 &gpio0 9 0>, /* D9 */ + <17 0 &gpio0 10 0>, /* D10 */ + <18 0 &gpio0 11 0>, /* D11 */ + <19 0 &gpio0 12 0>, /* D12 */ + <20 0 &gpio0 13 0>; /* D13 */ + }; +}; + +feather_serial: &uart1 {}; +feather_i2c: &i2c0 {}; +feather_spi: &spi2 {}; diff --git a/boards/adafruit/feather_esp32s2/feather_connector_tft.dtsi b/boards/adafruit/feather_esp32s2/feather_connector_tft.dtsi new file mode 100644 index 0000000000000..3a2eb8c3e0da8 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/feather_connector_tft.dtsi @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 Richard Osterloh + * Copyright (c) 2024 Leon Rinkel + * Copyright (c) 2025 Philipp Steiner + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + feather_header: connector { + compatible = "adafruit-feather-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = + <0 0 &gpio0 18 0>, /* A0 */ + <1 0 &gpio0 17 0>, /* A1 */ + <2 0 &gpio0 16 0>, /* A2 */ + <3 0 &gpio0 15 0>, /* A3 */ + <4 0 &gpio0 14 0>, /* A4 */ + <5 0 &gpio0 8 0>, /* A5 */ + <6 0 &gpio1 36 0>, /* SCK */ + <7 0 &gpio1 35 0>, /* MOSI */ + <8 0 &gpio1 37 0>, /* MISO */ + <9 0 &gpio0 2 0>, /* RX */ + <10 0 &gpio0 1 0>, /* TX */ + <11 0 &gpio1 43 0>, /* DB */ + <12 0 &gpio1 42 0>, /* SDA */ + <13 0 &gpio1 41 0>, /* SCL */ + <14 0 &gpio0 5 0>, /* D5 */ + <15 0 &gpio0 6 0>, /* D6 */ + <16 0 &gpio0 9 0>, /* D9 */ + <17 0 &gpio0 10 0>, /* D10 */ + <18 0 &gpio0 11 0>, /* D11 */ + <19 0 &gpio0 12 0>, /* D12 */ + <20 0 &gpio0 13 0>; /* D13 */ + }; +}; + +feather_serial: &uart1 {}; +feather_i2c: &i2c0 {}; +feather_spi: &spi2 {}; diff --git a/boards/adafruit/feather_esp32s2/support/openocd.cfg b/boards/adafruit/feather_esp32s2/support/openocd.cfg new file mode 100644 index 0000000000000..2f740b4a36ab1 --- /dev/null +++ b/boards/adafruit/feather_esp32s2/support/openocd.cfg @@ -0,0 +1,7 @@ +set ESP_RTOS none +set ESP32_ONLYCPU 1 + +# Source the JTAG interface configuration file +source [find interface/esp_usb_jtag.cfg] +# Source the ESP32-S3 configuration file +source [find target/esp32s3.cfg] diff --git a/boards/adafruit/feather_esp32s3/Kconfig b/boards/adafruit/feather_esp32s3/Kconfig new file mode 100644 index 0000000000000..e56e7f846c47e --- /dev/null +++ b/boards/adafruit/feather_esp32s3/Kconfig @@ -0,0 +1,10 @@ +# Adafruit Feather ESP32-S3 board configuration + +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2024 Leon Rinkel +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BOARD_ADAFRUIT_FEATHER_ESP32S3_ESP32S3_PROCPU + default 256 if BOARD_ADAFRUIT_FEATHER_ESP32S3_ESP32S3_APPCPU diff --git a/boards/adafruit/feather_esp32s3/Kconfig.adafruit_feather_esp32s3 b/boards/adafruit/feather_esp32s3/Kconfig.adafruit_feather_esp32s3 new file mode 100644 index 0000000000000..a96fe92930821 --- /dev/null +++ b/boards/adafruit/feather_esp32s3/Kconfig.adafruit_feather_esp32s3 @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2024 Leon Rinkel +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_FEATHER_ESP32S3 + select SOC_ESP32S3_WROOM_N8 + select SOC_ESP32S3_PROCPU if BOARD_ADAFRUIT_FEATHER_ESP32S3_ESP32S3_PROCPU + select SOC_ESP32S3_APPCPU if BOARD_ADAFRUIT_FEATHER_ESP32S3_ESP32S3_APPCPU diff --git a/boards/adafruit/feather_esp32s3/Kconfig.sysbuild b/boards/adafruit/feather_esp32s3/Kconfig.sysbuild new file mode 100644 index 0000000000000..8d3acb9e11d7c --- /dev/null +++ b/boards/adafruit/feather_esp32s3/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3-pinctrl.dtsi b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3-pinctrl.dtsi new file mode 100644 index 0000000000000..dc41eaae5412e --- /dev/null +++ b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3-pinctrl.dtsi @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart1_default: uart1_default { + group1 { + pinmux = ; + output-high; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + drive-open-drain; + output-high; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + group2 { + pinmux = ; + output-low; + }; + }; + + spim3_default: spim3_default { + group1 { + pinmux = ; + }; + }; + + twai_default: twai_default { + group1 { + pinmux = , + ; + }; + }; +}; diff --git a/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu.dts b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu.dts new file mode 100644 index 0000000000000..8b9f9953792ec --- /dev/null +++ b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu.dts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include +#include "adafruit_feather_esp32s3-pinctrl.dtsi" + +/ { + model = "Adafruit Feather ESP32S3 APPCPU"; + compatible = "adafruit,feather_esp32s3", "espressif,esp32s3"; + + chosen { + zephyr,sram = &sram1; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_appcpu_partition; + }; +}; + +&trng0 { + status = "okay"; +}; + +&ipm0 { + status = "okay"; +}; diff --git a/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu.yaml b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu.yaml new file mode 100644 index 0000000000000..329bcd7fa92ce --- /dev/null +++ b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu.yaml @@ -0,0 +1,27 @@ +identifier: adafruit_feather_esp32s3/esp32s3/appcpu +name: Adafruit Feather ESP32-S3 APPCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - uart +testing: + ignore_tags: + - net + - bluetooth + - flash + - cpp + - posix + - watchdog + - logging + - kernel + - pm + - gpio + - crypto + - eeprom + - heap + - cmsis_rtos + - jwt + - zdsp +vendor: adafruit diff --git a/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu_defconfig b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu_defconfig new file mode 100644 index 0000000000000..9abf2ff0430ab --- /dev/null +++ b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_appcpu_defconfig @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu.dts b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu.dts new file mode 100644 index 0000000000000..b745820ddaa09 --- /dev/null +++ b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu.dts @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include +#include +#include +#include +#include "feather_connector.dtsi" +#include "adafruit_feather_esp32s3-pinctrl.dtsi" + +/ { + model = "Adafruit Feather ESP32S3 PROCPU"; + compatible = "adafruit,feather_esp32s3", "espressif,esp32s3"; + + aliases { + i2c-0 = &i2c0; + watchdog0 = &wdt0; + }; + + chosen { + zephyr,sram = &sram1; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + uart-0 = &uart0; + sw0 = &button0; + led0 = &led0; + led-strip = &led_strip; + }; + + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "BOOT Button"; + zephyr,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + }; + + /* + * The neopixel on this board has its positive side hooked up to a GPIO + * pin rather than a positive voltage rail to save on power. + */ + neopixel_pwr: neopixel_pwr { + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + }; + + /* + * On-board regulator powers I2C pull-ups and external devices connected + * via the STEMMA QT connector. + */ + i2c_reg: i2c_reg { + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + }; +}; + +&usb_serial { + status = "disabled"; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&uart1 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&touch { + debounce-interval-ms = <30>; + href-microvolt = <2700000>; + lref-microvolt = <500000>; + href-atten-microvolt = <1000000>; + filter-mode = ; + filter-debounce-cnt = <1>; + filter-noise-thr = ; + filter-jitter-step = <4>; + filter-smooth-level = ; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + + max17048: max17048@36 { + compatible = "maxim,max17048"; + status = "okay"; + reg = <0x36>; + + /* + * The MAX17048 itself is directly powered by the battery, not + * through the on-board regulator. However using this device + * requires I2C pull-ups powered by the regulator. + */ + power-domains = <&i2c_reg>; + }; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim3_default>; + pinctrl-names = "default"; + + /* Workaround to support WS2812 driver */ + line-idle-low; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + power-domains = <&neopixel_pwr>; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <6400000>; + + /* WS2812 */ + chain-length = <1>; + spi-cpha; + spi-one-frame = <0xf0>; /* 625 ns high and 625 ns low */ + spi-zero-frame = <0xc0>; /* 312.5 ns high and 937.5 ns low */ + color-mapping = ; + }; +}; + +&twai { + pinctrl-0 = <&twai_default>; + pinctrl-names = "default"; +}; + +&timer0 { + status = "disabled"; +}; + +&timer1 { + status = "disabled"; +}; + +&timer2 { + status = "disabled"; +}; + +&timer3 { + status = "disabled"; +}; + +&wdt0 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; + +&esp32_bt_hci { + status = "okay"; +}; diff --git a/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu.yaml b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu.yaml new file mode 100644 index 0000000000000..6ca1ba6ae3c1c --- /dev/null +++ b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu.yaml @@ -0,0 +1,22 @@ +identifier: adafruit_feather_esp32s3/esp32s3/procpu +name: Adafruit Feather ESP32-S3 PROCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - spi + - can + - counter + - watchdog + - entropy + - pwm + - dma + - input + - feather_serial + - feather_i2c + - feather_spi +vendor: adafruit diff --git a/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu_defconfig b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu_defconfig new file mode 100644 index 0000000000000..d789bab1824a6 --- /dev/null +++ b/boards/adafruit/feather_esp32s3/adafruit_feather_esp32s3_procpu_defconfig @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MAIN_STACK_SIZE=2048 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32s3/board.cmake b/boards/adafruit/feather_esp32s3/board.cmake new file mode 100644 index 0000000000000..2f04d1fe8861e --- /dev/null +++ b/boards/adafruit/feather_esp32s3/board.cmake @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adafruit/feather_esp32s3/board.yml b/boards/adafruit/feather_esp32s3/board.yml new file mode 100644 index 0000000000000..89db0bb116cc7 --- /dev/null +++ b/boards/adafruit/feather_esp32s3/board.yml @@ -0,0 +1,6 @@ +board: + name: adafruit_feather_esp32s3 + full_name: Adafruit Feather ESP32S3 + vendor: adafruit + socs: + - name: esp32s3 diff --git a/boards/adafruit/feather_esp32s3/doc/img/adafruit_feather_esp32s3.webp b/boards/adafruit/feather_esp32s3/doc/img/adafruit_feather_esp32s3.webp new file mode 100644 index 0000000000000..5d6575dca1170 Binary files /dev/null and b/boards/adafruit/feather_esp32s3/doc/img/adafruit_feather_esp32s3.webp differ diff --git a/boards/adafruit/feather_esp32s3/doc/index.rst b/boards/adafruit/feather_esp32s3/doc/index.rst new file mode 100644 index 0000000000000..17332ba68fab6 --- /dev/null +++ b/boards/adafruit/feather_esp32s3/doc/index.rst @@ -0,0 +1,281 @@ +.. zephyr:board:: adafruit_feather_esp32s3 + +Overview +******** + +The Adafruit Feather ESP32-S3 is an ESP32-S3 development board in the Feather +standard layout, sharing peripheral placement with other devices labeled as +Feathers or FeatherWings. The board is equipped with an ESP32-S3 mini module, a +LiPo battery charger, a fuel gauge, a USB-C and Qwiic/STEMMA-QT connector. For +more information, check `Adafruit Feather ESP32-S3`_. + +Hardware +******** + +- ESP32-S3 mini module, featuring the dual core 32-bit Xtensa Microprocessor + (Tensilica LX7), running at up to 240MHz +- 512KB SRAM and either 8MB flash or 4MB flash + 2MB PSRAM, depending on the + module variant +- USB-C directly connected to the ESP32-S3 for USB/UART and JTAG debugging +- LiPo connector and built-in battery charging when powered via USB-C +- MAX17048 fuel gauge for battery voltage and state-of-charge reporting +- Charging indicator LED, user LED, reset and boot buttons +- Built-in NeoPixel indicator RGB LED +- STEMMA QT connector for I2C devices, with switchable power for low-power mode + +Asymmetric Multiprocessing (AMP) +================================ + +The ESP32-S3 SoC allows 2 different applications to be executed in asymmetric +multiprocessing. Due to its dual-core architecture, each core can be enabled to +execute customized tasks in stand-alone mode and/or exchanging data over OpenAMP +framework. See :zephyr:code-sample-category:`ipc` folder as code reference. + +For more information, check the datasheet at `ESP32-S3 Datasheet`_. + +Supported Features +================== + +The current ``adafruit_feather_esp32s3`` board supports the following hardware +features: + ++------------+------------+-------------------------------------+ +| Interface | Controller | Driver/Component | ++============+============+=====================================+ +| UART | on-chip | serial port | ++------------+------------+-------------------------------------+ +| GPIO | on-chip | gpio | ++------------+------------+-------------------------------------+ +| PINMUX | on-chip | pinmux | ++------------+------------+-------------------------------------+ +| USB-JTAG | on-chip | hardware interface | ++------------+------------+-------------------------------------+ +| SPI Master | on-chip | spi | ++------------+------------+-------------------------------------+ +| TWAI/CAN | on-chip | can | ++------------+------------+-------------------------------------+ +| ADC | on-chip | adc | ++------------+------------+-------------------------------------+ +| Timers | on-chip | counter | ++------------+------------+-------------------------------------+ +| Watchdog | on-chip | watchdog | ++------------+------------+-------------------------------------+ +| TRNG | on-chip | entropy | ++------------+------------+-------------------------------------+ +| LEDC | on-chip | pwm | ++------------+------------+-------------------------------------+ +| MCPWM | on-chip | pwm | ++------------+------------+-------------------------------------+ +| PCNT | on-chip | qdec | ++------------+------------+-------------------------------------+ +| GDMA | on-chip | dma | ++------------+------------+-------------------------------------+ +| USB-CDC | on-chip | serial | ++------------+------------+-------------------------------------+ +| Wi-Fi | on-chip | | ++------------+------------+-------------------------------------+ +| Bluetooth | on-chip | | ++------------+------------+-------------------------------------+ + +Connections and IOs +=================== + +The `Adafruit Feather ESP32-S3 User Guide`_ has detailed information about the +board including `pinouts`_ and the `schematic`_. + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Prerequisites +============= + +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the +command below to retrieve those files. + +.. code-block:: console + + west blobs fetch hal_espressif + +.. note:: + + It is recommended running the command above after :file:`west update`. + +Building & Flashing +=================== + +Simple boot +----------- + +The board could be loaded using the single binary image, without 2nd stage +bootloader. It is the default option when building the application without +additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +------------------ + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be build (and flash) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +-------- + +The sysbuild makes possible to build and flash all necessary images needed to +bootstrap the board with the ESP32-S3 SoC. + +To build the sample application using sysbuild use the command: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3/esp32s3/procpu + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32-S3 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │   └── zephyr + │   ├── zephyr.elf + │   └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` +documentation. + +Manual build +------------ + +During the development cycle, it is intended to build & flash as quickly +possible. For that reason, images can be build one at a time using traditional +build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flash at least once. + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3/esp32s3/procpu + :goals: build + +The usual ``flash`` target will work with the ``adafruit_feather_esp32s3`` board +. Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3/esp32s3/procpu + :goals: flash + +Open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has automatically reset and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! adafruit_feather_esp32s3 + +Debugging +========= + +ESP32-S3 support on OpenOCD is available upstream as of version 0.12.0. Download +and install OpenOCD from `OpenOCD`_. + +ESP32-S3 has a built-in JTAG circuitry and can be debugged without any +additional chip. Only an USB cable connected to the D+/D- pins is necessary. + +Further documentation can be obtained from the SoC vendor in `JTAG debugging +for ESP32-S3`_. + +Here is an example for building the :zephyr:code-sample:`hello_world` +application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3/esp32s3/procpu + :goals: build flash + +You can debug an application in the usual way. Here is an example for the +:zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3/esp32s3/procpu + :goals: debug + +References +********** + +.. target-notes:: + +.. _`Adafruit Feather ESP32-S3`: + https://www.adafruit.com/product/5323 + +.. _`OpenOCD`: + https://github.com/openocd-org/openocd + +.. _`JTAG debugging for ESP32-S3`: + https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-debugging/ + +.. _Adafruit Feather ESP32-S3 User Guide: + https://learn.adafruit.com/adafruit-esp32-s3-feather + +.. _pinouts: + https://learn.adafruit.com/adafruit-esp32-s3-feather/pinouts + +.. _schematic: + https://learn.adafruit.com/adafruit-esp32-s3-feather/downloads + +.. _ESP32-S3 Datasheet: + https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf + +.. _ESP32 Technical Reference Manual: + https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf diff --git a/boards/adafruit/feather_esp32s3/feather_connector.dtsi b/boards/adafruit/feather_esp32s3/feather_connector.dtsi new file mode 100644 index 0000000000000..49671be660cdf --- /dev/null +++ b/boards/adafruit/feather_esp32s3/feather_connector.dtsi @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 Richard Osterloh + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + feather_header: connector { + compatible = "adafruit-feather-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio0 18 0>, /* A0 */ + <1 0 &gpio0 17 0>, /* A1 */ + <2 0 &gpio0 16 0>, /* A2 */ + <3 0 &gpio0 15 0>, /* A3 */ + <4 0 &gpio0 14 0>, /* A4 */ + <5 0 &gpio0 8 0>, /* A5 */ + <6 0 &gpio1 36 0>, /* SCK */ + <7 0 &gpio1 35 0>, /* MOSI */ + <8 0 &gpio1 37 0>, /* MISO */ + <9 0 &gpio1 38 0>, /* RX */ + <10 0 &gpio1 39 0>, /* TX */ + <11 0 &gpio1 44 0>, /* DB */ + <12 0 &gpio0 3 0>, /* SDA */ + <13 0 &gpio0 4 0>, /* SCL */ + <14 0 &gpio0 5 0>, /* D5 */ + <15 0 &gpio0 6 0>, /* D6 */ + <16 0 &gpio0 9 0>, /* D9 */ + <17 0 &gpio0 10 0>, /* D10 */ + <18 0 &gpio0 11 0>, /* D11 */ + <19 0 &gpio0 12 0>, /* D12 */ + <20 0 &gpio0 13 0>; /* D13 */ + }; +}; + +feather_serial: &uart1 {}; +feather_i2c: &i2c0 {}; +feather_spi: &spi2 {}; diff --git a/boards/adafruit/feather_esp32s3/support/openocd.cfg b/boards/adafruit/feather_esp32s3/support/openocd.cfg new file mode 100644 index 0000000000000..2f740b4a36ab1 --- /dev/null +++ b/boards/adafruit/feather_esp32s3/support/openocd.cfg @@ -0,0 +1,7 @@ +set ESP_RTOS none +set ESP32_ONLYCPU 1 + +# Source the JTAG interface configuration file +source [find interface/esp_usb_jtag.cfg] +# Source the ESP32-S3 configuration file +source [find target/esp32s3.cfg] diff --git a/boards/adafruit/feather_esp32s3_tft/CMakeLists.txt b/boards/adafruit/feather_esp32s3_tft/CMakeLists.txt new file mode 100644 index 0000000000000..218a0602483ab --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/CMakeLists.txt @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_library() +zephyr_library_sources(board.c) diff --git a/boards/adafruit/feather_esp32s3_tft/Kconfig b/boards/adafruit/feather_esp32s3_tft/Kconfig new file mode 100644 index 0000000000000..86f1012ae0d95 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/Kconfig @@ -0,0 +1,10 @@ +# Adafruit Feather ESP32S3 board configuration + +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2024 Leon Rinkel +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT_ESP32S3_PROCPU + default 256 if BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT_ESP32S3_APPCPU diff --git a/boards/adafruit/feather_esp32s3_tft/Kconfig.adafruit_feather_esp32s3_tft b/boards/adafruit/feather_esp32s3_tft/Kconfig.adafruit_feather_esp32s3_tft new file mode 100644 index 0000000000000..cd78387ff8876 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/Kconfig.adafruit_feather_esp32s3_tft @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2024 Leon Rinkel +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT + select SOC_ESP32S3_WROOM_N8 + select SOC_ESP32S3_PROCPU if BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT_ESP32S3_PROCPU + select SOC_ESP32S3_APPCPU if BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT_ESP32S3_APPCPU diff --git a/boards/adafruit/feather_esp32s3_tft/Kconfig.defconfig b/boards/adafruit/feather_esp32s3_tft/Kconfig.defconfig new file mode 100644 index 0000000000000..2c3e9c9cfa768 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/Kconfig.defconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2024 Leon Rinkel +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT_ESP32S3_PROCPU + +if DISPLAY + +config BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT + select BOARD_LATE_INIT_HOOK + +choice ST7789V_PIXEL_FORMAT + default ST7789V_RGB565 +endchoice + +if LVGL + +config LV_Z_BITS_PER_PIXEL + default 16 + +choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_16 +endchoice + +config LV_COLOR_16_SWAP + default y + +endif # LVGL + +endif # DISPLAY + +endif # BOARD_ADAFRUIT_FEATHER_ESP32S3_TFT_PROCPU diff --git a/boards/adafruit/feather_esp32s3_tft/Kconfig.sysbuild b/boards/adafruit/feather_esp32s3_tft/Kconfig.sysbuild new file mode 100644 index 0000000000000..8d3acb9e11d7c --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft-pinctrl.dtsi b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft-pinctrl.dtsi new file mode 100644 index 0000000000000..0cf040eeb87d1 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft-pinctrl.dtsi @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart1_default: uart1_default { + group1 { + pinmux = ; + output-high; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + drive-open-drain; + output-high; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + group2 { + pinmux = ; + output-low; + }; + }; + + spim3_default: spim3_default { + group1 { + pinmux = ; + }; + }; + + twai_default: twai_default { + group1 { + pinmux = , + ; + }; + }; +}; diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu.dts b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu.dts new file mode 100644 index 0000000000000..f4662f4b0a3ee --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu.dts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include +#include "adafruit_feather_esp32s3_tft-pinctrl.dtsi" + +/ { + model = "Adafruit Feather ESP32S3 TFT APPCPU"; + compatible = "adafruit,feather_esp32s3_tft", "espressif,esp32s3"; + + chosen { + zephyr,sram = &sram1; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_appcpu_partition; + }; +}; + +&trng0 { + status = "okay"; +}; + +&ipm0 { + status = "okay"; +}; diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu.yaml b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu.yaml new file mode 100644 index 0000000000000..baed9f8ff70d1 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu.yaml @@ -0,0 +1,27 @@ +identifier: adafruit_feather_esp32s3_tft/esp32s3/appcpu +name: Adafruit Feather ESP32-S3 TFT APPCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - uart +testing: + ignore_tags: + - net + - bluetooth + - flash + - cpp + - posix + - watchdog + - logging + - kernel + - pm + - gpio + - crypto + - eeprom + - heap + - cmsis_rtos + - jwt + - zdsp +vendor: adafruit diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu_defconfig b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu_defconfig new file mode 100644 index 0000000000000..9abf2ff0430ab --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_appcpu_defconfig @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts new file mode 100644 index 0000000000000..b09b6262aa1e9 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.dts @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include +#include +#include +#include +#include +#include "feather_connector.dtsi" +#include "adafruit_feather_esp32s3_tft-pinctrl.dtsi" + +/ { + model = "Adafruit Feather ESP32S3 TFT PROCPU"; + compatible = "adafruit,feather_esp32s3_tft", "espressif,esp32s3"; + + aliases { + i2c-0 = &i2c0; + watchdog0 = &wdt0; + }; + + chosen { + zephyr,sram = &sram1; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + zephyr,display = &st7789v_tft; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + uart-0 = &uart0; + sw0 = &button0; + led0 = &led0; + led-strip = &led_strip; + backlight = &led1; + }; + + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "BOOT Button"; + zephyr,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + led1: led_1 { + gpios = <&gpio1 45 GPIO_ACTIVE_HIGH>; + }; + }; + + /* + * The neopixel on this board has its positive side hooked up to a GPIO + * pin rather than a positive voltage rail to save on power. + */ + neopixel_pwr: neopixel_pwr { + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio1 34 GPIO_ACTIVE_HIGH>; + }; + + /* + * On-board regulator powers I2C pull-ups and external devices connected + * via the STEMMA QT connector. + */ + i2c_reg: i2c_reg { + compatible = "power-domain-gpio"; + #power-domain-cells = <0>; + enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + }; + + mipi_dbi { + compatible = "zephyr,mipi-dbi-spi"; + spi-dev = <&spi2>; + dc-gpios = <&gpio1 39 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 40 GPIO_ACTIVE_LOW>; + write-only; + #address-cells = <1>; + #size-cells = <0>; + + st7789v_tft: st7789v_tft@0 { + compatible = "sitronix,st7789v"; + status = "disabled"; + + /* Also powered by i2c_reg */ + power-domains = <&i2c_reg>; + + mipi-max-frequency = ; + reg = <0>; + width = <135>; + height = <240>; + x-offset = <52>; + y-offset = <40>; + vcom = <0x20>; + gctrl = <0x35>; + vrhs = <0x0b>; + vdvs = <0x20>; + mdac = <0x08>; + gamma = <0x01>; + colmod = <0x55>; + lcm = <0x2c>; + porch-param = [0c 0c 00 33 33]; + cmd2en-param = [5a 69 02 01]; + pwctrl1-param = [a4 a1]; + pvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + nvgam-param = [70 2C 2E 15 10 09 48 33 53 0B 19 18 20 25]; + ram-param = [00 F0]; + rgb-param = [40 02 14]; + mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; + }; + }; +}; + +&usb_serial { + status = "disabled"; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&uart1 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&touch { + debounce-interval-ms = <30>; + href-microvolt = <2700000>; + lref-microvolt = <500000>; + href-atten-microvolt = <1000000>; + filter-mode = ; + filter-debounce-cnt = <1>; + filter-noise-thr = ; + filter-jitter-step = <4>; + filter-smooth-level = ; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + + max17048: max17048@36 { + compatible = "maxim,max17048"; + status = "okay"; + reg = <0x36>; + + /* + * The MAX17048 itself is directly powered by the battery, not + * through the on-board regulator. However using this device + * requires I2C pull-ups powered by the regulator. + */ + power-domains = <&i2c_reg>; + }; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim3_default>; + pinctrl-names = "default"; + + /* Workaround to support WS2812 driver */ + line-idle-low; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + power-domains = <&neopixel_pwr>; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <6400000>; + + /* WS2812 */ + chain-length = <1>; + spi-cpha; + spi-one-frame = <0xf0>; /* 625 ns high and 625 ns low */ + spi-zero-frame = <0xc0>; /* 312.5 ns high and 937.5 ns low */ + color-mapping = ; + }; +}; + +&twai { + pinctrl-0 = <&twai_default>; + pinctrl-names = "default"; +}; + +&timer0 { + status = "disabled"; +}; + +&timer1 { + status = "disabled"; +}; + +&timer2 { + status = "disabled"; +}; + +&timer3 { + status = "disabled"; +}; + +&wdt0 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; + +&esp32_bt_hci { + status = "okay"; +}; diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.yaml b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.yaml new file mode 100644 index 0000000000000..bed1ac8ba70fc --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu.yaml @@ -0,0 +1,23 @@ +identifier: adafruit_feather_esp32s3_tft/esp32s3/procpu +name: Adafruit Feather ESP32-S3 TFT PROCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - spi + - can + - counter + - watchdog + - entropy + - pwm + - dma + - input + - feather_serial + - feather_i2c + - feather_spi + - display +vendor: adafruit diff --git a/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu_defconfig b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu_defconfig new file mode 100644 index 0000000000000..d789bab1824a6 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/adafruit_feather_esp32s3_tft_procpu_defconfig @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MAIN_STACK_SIZE=2048 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/feather_esp32s3_tft/board.c b/boards/adafruit/feather_esp32s3_tft/board.c new file mode 100644 index 0000000000000..88aa3b0b35447 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/board.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + * + * Automatically turns on backlight if display is configured, i.e. display DT + * node has status okay. + */ + +#include +#include +#include + +#define DISPLAY_NODE DT_CHOSEN(zephyr_display) + +#if DT_NODE_HAS_STATUS(DISPLAY_NODE, okay) +static const struct gpio_dt_spec backlight = GPIO_DT_SPEC_GET(DT_ALIAS(backlight), gpios); +#endif + +void board_late_init_hook(void) +{ +#if DT_NODE_HAS_STATUS(DISPLAY_NODE, okay) + if (gpio_is_ready_dt(&backlight)) { + gpio_pin_configure_dt(&backlight, GPIO_OUTPUT_ACTIVE); + } +#endif +} diff --git a/boards/adafruit/feather_esp32s3_tft/board.cmake b/boards/adafruit/feather_esp32s3_tft/board.cmake new file mode 100644 index 0000000000000..2f04d1fe8861e --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/board.cmake @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adafruit/feather_esp32s3_tft/board.yml b/boards/adafruit/feather_esp32s3_tft/board.yml new file mode 100644 index 0000000000000..86f7b9293c892 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/board.yml @@ -0,0 +1,6 @@ +board: + name: adafruit_feather_esp32s3_tft + full_name: Adafruit Feather ESP32S3 TFT + vendor: adafruit + socs: + - name: esp32s3 diff --git a/boards/adafruit/feather_esp32s3_tft/doc/img/adafruit_feather_esp32s3_tft.webp b/boards/adafruit/feather_esp32s3_tft/doc/img/adafruit_feather_esp32s3_tft.webp new file mode 100644 index 0000000000000..796170908e7e3 Binary files /dev/null and b/boards/adafruit/feather_esp32s3_tft/doc/img/adafruit_feather_esp32s3_tft.webp differ diff --git a/boards/adafruit/feather_esp32s3_tft/doc/index.rst b/boards/adafruit/feather_esp32s3_tft/doc/index.rst new file mode 100644 index 0000000000000..f46daa99688af --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/doc/index.rst @@ -0,0 +1,284 @@ +.. zephyr:board:: adafruit_feather_esp32s3_tft + +Overview +******** + +The Adafruit Feather ESP32-S3 TFT is an ESP32-S3 development board in the +Feather standard layout, sharing peripheral placement with other devices labeled +as Feathers or FeatherWings. The board is equipped with an ESP32-S3 mini module, +a LiPo battery charger, a fuel gauge, a USB-C and Qwiic/STEMMA-QT connector. +Compared to the base model, this TFT variant additionally comes with a 240x135 +pixel IPS TFT color display. For more information, check +`Adafruit Feather ESP32-S3 TFT`_. + +Hardware +******** + +- ESP32-S3 mini module, featuring the dual core 32-bit Xtensa Microprocessor + (Tensilica LX7), running at up to 240MHz +- 512KB SRAM and either 8MB flash or 4MB flash + 2MB PSRAM, depending on the + module variant +- USB-C directly connected to the ESP32-S3 for USB/UART and JTAG debugging +- LiPo connector and built-in battery charging when powered via USB-C +- MAX17048 fuel gauge for battery voltage and state-of-charge reporting +- Charging indicator LED, user LED, reset and boot buttons +- Built-in NeoPixel indicator RGB LED +- STEMMA QT connector for I2C devices, with switchable power for low-power mode +- 240x135 pixel IPS TFT color display with 1.14" diagonal and ST7789 chipset + +Asymmetric Multiprocessing (AMP) +================================ + +The ESP32-S3 SoC allows 2 different applications to be executed in asymmetric +multiprocessing. Due to its dual-core architecture, each core can be enabled to +execute customized tasks in stand-alone mode and/or exchanging data over OpenAMP +framework. See :zephyr:code-sample-category:`ipc` folder as code reference. + +For more information, check the datasheet at `ESP32-S3 Datasheet`_. + +Supported Features +================== + +The current ``adafruit_feather_esp32s3_tft`` board supports the following +hardware features: + ++------------+------------+-------------------------------------+ +| Interface | Controller | Driver/Component | ++============+============+=====================================+ +| UART | on-chip | serial port | ++------------+------------+-------------------------------------+ +| GPIO | on-chip | gpio | ++------------+------------+-------------------------------------+ +| PINMUX | on-chip | pinmux | ++------------+------------+-------------------------------------+ +| USB-JTAG | on-chip | hardware interface | ++------------+------------+-------------------------------------+ +| SPI Master | on-chip | spi | ++------------+------------+-------------------------------------+ +| TWAI/CAN | on-chip | can | ++------------+------------+-------------------------------------+ +| ADC | on-chip | adc | ++------------+------------+-------------------------------------+ +| Timers | on-chip | counter | ++------------+------------+-------------------------------------+ +| Watchdog | on-chip | watchdog | ++------------+------------+-------------------------------------+ +| TRNG | on-chip | entropy | ++------------+------------+-------------------------------------+ +| LEDC | on-chip | pwm | ++------------+------------+-------------------------------------+ +| MCPWM | on-chip | pwm | ++------------+------------+-------------------------------------+ +| PCNT | on-chip | qdec | ++------------+------------+-------------------------------------+ +| GDMA | on-chip | dma | ++------------+------------+-------------------------------------+ +| USB-CDC | on-chip | serial | ++------------+------------+-------------------------------------+ +| Wi-Fi | on-chip | | ++------------+------------+-------------------------------------+ +| Bluetooth | on-chip | | ++------------+------------+-------------------------------------+ + +Connections and IOs +=================== + +The `Adafruit Feather ESP32-S3 TFT User Guide`_ has detailed information about +the board including `pinouts`_ and the `schematic`_. + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Prerequisites +============= + +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the +command below to retrieve those files. + +.. code-block:: console + + west blobs fetch hal_espressif + +.. note:: + + It is recommended running the command above after :file:`west update`. + +Building & Flashing +=================== + +Simple boot +----------- + +The board could be loaded using the single binary image, without 2nd stage +bootloader. It is the default option when building the application without +additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +------------------ + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be build (and flash) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +-------- + +The sysbuild makes possible to build and flash all necessary images needed to +bootstrap the board with the ESP32-S3 SoC. + +To build the sample application using sysbuild use the command: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3_tft/esp32s3/procpu + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32-S3 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │   └── zephyr + │   ├── zephyr.elf + │   └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` +documentation. + +Manual build +------------ + +During the development cycle, it is intended to build & flash as quickly +possible. For that reason, images can be build one at a time using traditional +build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flash at least once. + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3_tft/esp32s3/procpu + :goals: build + +The usual ``flash`` target will work with the ``adafruit_feather_esp32s3_tft`` +board. Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3_tft/esp32s3/procpu + :goals: flash + +Open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has automatically reset and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! adafruit_feather_esp32s3_tft + +Debugging +========= + +ESP32-S3 support on OpenOCD is available upstream as of version 0.12.0. Download +and install OpenOCD from `OpenOCD`_. + +ESP32-S3 has a built-in JTAG circuitry and can be debugged without any +additional chip. Only an USB cable connected to the D+/D- pins is necessary. + +Further documentation can be obtained from the SoC vendor in `JTAG debugging +for ESP32-S3`_. + +Here is an example for building the :zephyr:code-sample:`hello_world` +application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3_tft/esp32s3/procpu + :goals: build flash + +You can debug an application in the usual way. Here is an example for the +:zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: adafruit_feather_esp32s3_tft/esp32s3/procpu + :goals: debug + +References +********** + +.. target-notes:: + +.. _`Adafruit Feather ESP32-S3 TFT`: + https://www.adafruit.com/product/5483 + +.. _`OpenOCD`: + https://github.com/openocd-org/openocd + +.. _`JTAG debugging for ESP32-S3`: + https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-debugging/ + +.. _Adafruit Feather ESP32-S3 TFT User Guide: + https://learn.adafruit.com/adafruit-esp32-s3-tft-feather + +.. _pinouts: + https://learn.adafruit.com/adafruit-esp32-s3-tft-feather/pinouts + +.. _schematic: + https://learn.adafruit.com/adafruit-esp32-s3-tft-feather/downloads + +.. _ESP32-S3 Datasheet: + https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf + +.. _ESP32 Technical Reference Manual: + https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf diff --git a/boards/adafruit/feather_esp32s3_tft/feather_connector.dtsi b/boards/adafruit/feather_esp32s3_tft/feather_connector.dtsi new file mode 100644 index 0000000000000..9a4dd731e8ca9 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/feather_connector.dtsi @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 Richard Osterloh + * Copyright (c) 2024 Leon Rinkel + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + feather_header: connector { + compatible = "adafruit-feather-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio0 18 0>, /* A0 */ + <1 0 &gpio0 17 0>, /* A1 */ + <2 0 &gpio0 16 0>, /* A2 */ + <3 0 &gpio0 15 0>, /* A3 */ + <4 0 &gpio0 14 0>, /* A4 */ + <5 0 &gpio0 8 0>, /* A5 */ + <6 0 &gpio1 36 0>, /* SCK */ + <7 0 &gpio1 35 0>, /* MOSI */ + <8 0 &gpio1 37 0>, /* MISO */ + <9 0 &gpio0 2 0>, /* RX */ + <10 0 &gpio0 1 0>, /* TX */ + <11 0 &gpio1 44 0>, /* DB */ + <12 0 &gpio1 42 0>, /* SDA */ + <13 0 &gpio1 41 0>, /* SCL */ + <14 0 &gpio0 5 0>, /* D5 */ + <15 0 &gpio0 6 0>, /* D6 */ + <16 0 &gpio0 9 0>, /* D9 */ + <17 0 &gpio0 10 0>, /* D10 */ + <18 0 &gpio0 11 0>, /* D11 */ + <19 0 &gpio0 12 0>, /* D12 */ + <20 0 &gpio0 13 0>; /* D13 */ + }; +}; + +feather_serial: &uart1 {}; +feather_i2c: &i2c0 {}; +feather_spi: &spi2 {}; diff --git a/boards/adafruit/feather_esp32s3_tft/support/openocd.cfg b/boards/adafruit/feather_esp32s3_tft/support/openocd.cfg new file mode 100644 index 0000000000000..2f740b4a36ab1 --- /dev/null +++ b/boards/adafruit/feather_esp32s3_tft/support/openocd.cfg @@ -0,0 +1,7 @@ +set ESP_RTOS none +set ESP32_ONLYCPU 1 + +# Source the JTAG interface configuration file +source [find interface/esp_usb_jtag.cfg] +# Source the ESP32-S3 configuration file +source [find target/esp32s3.cfg] diff --git a/boards/adafruit/feather_m0_basic_proto/doc/index.rst b/boards/adafruit/feather_m0_basic_proto/doc/index.rst index 20d1cd4750aba..69abd4bb9accd 100644 --- a/boards/adafruit/feather_m0_basic_proto/doc/index.rst +++ b/boards/adafruit/feather_m0_basic_proto/doc/index.rst @@ -23,35 +23,7 @@ Hardware Supported Features ================== -The adafruit_feather_m0_basic_proto board configuration supports the -following hardware features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| NVIC | on-chip | Nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| Flash | on-chip | Can be used with LittleFS to store files | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | Systick | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial port | -+-----------+------------+------------------------------------------+ -| I2C | on-chip | Inter-Integrated Circuit | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface port | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig file -:zephyr_file:`boards/adafruit/feather_m0_basic_proto/adafruit_feather_m0_basic_proto_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -96,6 +68,8 @@ serial port that echos characters back to the host PC. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Adafruit Feather M0 Basic Proto ships with a BOSSA compatible SAM-BA bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/adafruit/feather_m0_lora/doc/index.rst b/boards/adafruit/feather_m0_lora/doc/index.rst index 7a3e9fc78bf5a..1e85f48b1f547 100644 --- a/boards/adafruit/feather_m0_lora/doc/index.rst +++ b/boards/adafruit/feather_m0_lora/doc/index.rst @@ -24,37 +24,7 @@ Hardware Supported Features ================== -The adafruit_feather_m0_lora board configuration supports the -following hardware features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| NVIC | on-chip | Nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| Flash | on-chip | Can be used with LittleFS to store files | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | Systick | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial port | -+-----------+------------+------------------------------------------+ -| I2C | on-chip | Inter-Integrated Circuit | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface port | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ -| RADIO | SPI | LoRa radio | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig file -:zephyr_file:`boards/adafruit/feather_m0_lora/adafruit_feather_m0_lora_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -105,6 +75,8 @@ version, 433MHz or 900MHz is supported. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Adafruit Feather M0 with LoRa ships with a BOSSA compatible SAM-BA bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/adafruit/feather_m4_express/doc/index.rst b/boards/adafruit/feather_m4_express/doc/index.rst index a4178626eeec0..a44c75808aa6c 100644 --- a/boards/adafruit/feather_m4_express/doc/index.rst +++ b/boards/adafruit/feather_m4_express/doc/index.rst @@ -23,39 +23,7 @@ Hardware Supported Features ================== -The ``adafruit_feather_m4_express`` board target supports the following -hardware features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| SYSTICK | on-chip | systick | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial ports | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface ports | -+-----------+------------+------------------------------------------+ -| TRNG | on-chip | True Random Number Generator | -+-----------+------------+------------------------------------------+ -| HWINFO | on-chip | Unique 128 bit serial number | -+-----------+------------+------------------------------------------+ -| RTC | on-chip | Real-Time Counter | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog Timer | -+-----------+------------+------------------------------------------+ -| PWM | on-chip | PWM | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig file -:zephyr_file:`boards/adafruit/feather_m4_express/adafruit_feather_m4_express_defconfig`. +.. zephyr:board-supported-hw:: Zephyr can use the default Cortex-M SYSTICK timer or the SAM0 specific RTC. To use the RTC, set :code:`CONFIG_CORTEX_M_SYSTICK=n` and set @@ -105,6 +73,8 @@ serial port that echos characters back to the host PC. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Feather ships with a the BOSSA compatible UF2 bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/adafruit/feather_nrf52840/doc/index.rst b/boards/adafruit/feather_nrf52840/doc/index.rst index 6f2477e673ffe..b136a30ba49f6 100644 --- a/boards/adafruit/feather_nrf52840/doc/index.rst +++ b/boards/adafruit/feather_nrf52840/doc/index.rst @@ -58,43 +58,7 @@ Hardware Supported Features ================== -The Adafruit Feather nRF52840 board configuration supports the -following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| SPI | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -129,6 +93,8 @@ Push buttons Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adafruit/feather_stm32f405/doc/index.rst b/boards/adafruit/feather_stm32f405/doc/index.rst index 0cc6c327760f3..656f96f8a8f9e 100644 --- a/boards/adafruit/feather_stm32f405/doc/index.rst +++ b/boards/adafruit/feather_stm32f405/doc/index.rst @@ -26,29 +26,7 @@ Hardware Supported Features ================== -The Adafruit Feather STM32F405 board configuration supports the -following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+----------------------+ -| UART | on-chip | serial port | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C | on-chip | i2c | -+-----------+------------+----------------------+ -| SPI | on-chip | spi | -+-----------+------------+----------------------+ -| USB | on-chip | USB device | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -86,6 +64,8 @@ dedicated to the 2 MB SPI Flash chip. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + DFU-Util programming is supported through Zephyr by default. Set up of the built in DFU-Util bootloader is possible by following the `instructions on the Learn website`_. diff --git a/boards/adafruit/grand_central_m4_express/doc/index.rst b/boards/adafruit/grand_central_m4_express/doc/index.rst index 4bab888996724..d85b2e922e024 100644 --- a/boards/adafruit/grand_central_m4_express/doc/index.rst +++ b/boards/adafruit/grand_central_m4_express/doc/index.rst @@ -21,37 +21,7 @@ Hardware Supported Features ================== -The adafruit_grand_central_m4_express board configuration supports the following -hardware features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| NVIC | on-chip | Nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | SysTick | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports, User LED | -+-----------+------------+------------------------------------------+ -| UART | on-chip | Serial ports, Console | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | SPI ports, microSDHC slot | -+-----------+------------+------------------------------------------+ -| TRNG | on-chip | True Random Number Generator | -+-----------+------------+------------------------------------------+ -| RTC | on-chip | Real-Time Counter | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog Timer | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig file -:zephyr_file:`boards/adafruit/grand_central_m4_express/adafruit_grand_central_m4_express_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -95,6 +65,8 @@ serial port that echos characters back to the host PC. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Grand Central ships with a BOSSA compatible UF2 bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/adafruit/itsybitsy/board.cmake b/boards/adafruit/itsybitsy/board.cmake index 6366e4775eccb..54b79bdf74b49 100644 --- a/boards/adafruit/itsybitsy/board.cmake +++ b/boards/adafruit/itsybitsy/board.cmake @@ -3,6 +3,7 @@ include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake) board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/adafruit/itsybitsy/doc/index.rst b/boards/adafruit/itsybitsy/doc/index.rst index 3fbcb918adb40..3dac6fea3b86c 100644 --- a/boards/adafruit/itsybitsy/doc/index.rst +++ b/boards/adafruit/itsybitsy/doc/index.rst @@ -40,45 +40,7 @@ Hardware Supported Features ================== -The Adafruit ItsyBitsy nRF52840 board configuration supports the -following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| QSPI(M) | on-chip | nor | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| SPI | on-chip | spi | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -124,6 +86,9 @@ your board. The button and LED definitions can be found in Programming and Debugging ************************* + +.. zephyr:board-supported-runners:: + The ItsyBitsy ships with the BOSSA compatible UF2 bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/adafruit/itsybitsy_m4_express/doc/index.rst b/boards/adafruit/itsybitsy_m4_express/doc/index.rst index 31e19cb8a992c..19b5cdf290660 100644 --- a/boards/adafruit/itsybitsy_m4_express/doc/index.rst +++ b/boards/adafruit/itsybitsy_m4_express/doc/index.rst @@ -22,41 +22,7 @@ Hardware Supported Features ================== -The adafruit_itsybitsy_m4_express board configuration supports the following -hardware features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| NVIC | on-chip | Nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial ports | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface ports | -+-----------+------------+------------------------------------------+ -| TRNG | on-chip | True Random Number Generator | -+-----------+------------+------------------------------------------+ -| HWINFO | on-chip | Unique 128 bit serial number | -+-----------+------------+------------------------------------------+ -| RTC | on-chip | Real-Time Counter | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog Timer | -+-----------+------------+------------------------------------------+ -| PWM | on-chip | PWM | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig file -:zephyr_file:`boards/adafruit/itsybitsy_m4_express/adafruit_itsybitsy_m4_express_defconfig`. +.. zephyr:board-supported-hw:: Zephyr can use the default Cortex-M SYSTICK timer or the SAM0 specific RTC. To use the RTC, set :code:`CONFIG_CORTEX_M_SYSTICK=n` and set @@ -106,6 +72,8 @@ serial port that echos characters back to the host PC. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The ItsyBitsy ships with a the BOSSA compatible UF2 bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/adafruit/kb2040/doc/index.rst b/boards/adafruit/kb2040/doc/index.rst index f1b5d998dc83a..0db8c71653e15 100644 --- a/boards/adafruit/kb2040/doc/index.rst +++ b/boards/adafruit/kb2040/doc/index.rst @@ -27,54 +27,7 @@ Hardware Supported Features ================== -The adafruit_kb2040 board configuration supports the following -hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - NVIC - - N/A - - :dtcompatible:`arm,v6m-nvic` - * - UART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`raspberrypi,pico-uart` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`raspberrypi,pico-gpio` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`raspberrypi,pico-adc` - * - I2C - - :kconfig:option:`CONFIG_I2C` - - :dtcompatible:`snps,designware-i2c` - * - SPI - - :kconfig:option:`CONFIG_SPI` - - :dtcompatible:`raspberrypi,pico-spi` - * - USB Device - - :kconfig:option:`CONFIG_USB_DEVICE_STACK` - - :dtcompatible:`raspberrypi,pico-usbd` - * - HWINFO - - :kconfig:option:`CONFIG_HWINFO` - - N/A - * - Watchdog Timer (WDT) - - :kconfig:option:`CONFIG_WATCHDOG` - - :dtcompatible:`raspberrypi,pico-watchdog` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`raspberrypi,pico-pwm` - * - Flash - - :kconfig:option:`CONFIG_FLASH` - - :dtcompatible:`raspberrypi,pico-flash` - * - Clock controller - - :kconfig:option:`CONFIG_CLOCK_CONTROL` - - :dtcompatible:`raspberrypi,pico-clock-controller` - * - UART (PIO) - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`raspberrypi,pico-uart-pio` +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -99,6 +52,8 @@ Default Zephyr Peripheral Mapping: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adafruit/macropad_rp2040/doc/index.rst b/boards/adafruit/macropad_rp2040/doc/index.rst index 7f2e78418cd8e..74f9e14fa1d5b 100644 --- a/boards/adafruit/macropad_rp2040/doc/index.rst +++ b/boards/adafruit/macropad_rp2040/doc/index.rst @@ -30,63 +30,13 @@ Hardware Supported Features ****************** -The ``adafruit_macropad_rp2040`` board target supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - NVIC - - N/A - - :dtcompatible:`arm,v6m-nvic` - * - UART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`raspberrypi,pico-uart` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`raspberrypi,pico-gpio` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`raspberrypi,pico-adc` - * - I2C - - :kconfig:option:`CONFIG_I2C` - - :dtcompatible:`snps,designware-i2c` - * - SPI - - :kconfig:option:`CONFIG_SPI` - - :dtcompatible:`raspberrypi,pico-spi` - * - USB Device - - :kconfig:option:`CONFIG_USB_DEVICE_STACK` - - :dtcompatible:`raspberrypi,pico-usbd` - * - HWINFO - - :kconfig:option:`CONFIG_HWINFO` - - N/A - * - Watchdog Timer (WDT) - - :kconfig:option:`CONFIG_WATCHDOG` - - :dtcompatible:`raspberrypi,pico-watchdog` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`raspberrypi,pico-pwm` - * - Flash - - :kconfig:option:`CONFIG_FLASH` - - :dtcompatible:`raspberrypi,pico-flash-controller` - * - UART (PIO) - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`raspberrypi,pico-uart-pio` - * - Display - - :kconfig:option:`CONFIG_DISPLAY` - - :dtcompatible:`sinowealth,sh1106` - * - LED Strip (12 pixels) - - :kconfig:option:`CONFIG_LED_STRIP` - - :dtcompatible:`worldsemi,ws2812-rpi_pico-pio` - * - Rotary Encoder - - :kconfig:option:`CONFIG_INPUT` - - :dtcompatible:`gpio-qdec` +.. zephyr:board-supported-hw:: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``adafruit_macropad_rp2040`` board target can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/adafruit/nrf52_adafruit_feather/board.cmake b/boards/adafruit/nrf52_adafruit_feather/board.cmake index 4ddbcf66fbee9..ca39352246427 100644 --- a/boards/adafruit/nrf52_adafruit_feather/board.cmake +++ b/boards/adafruit/nrf52_adafruit_feather/board.cmake @@ -2,6 +2,7 @@ board_runner_args(jlink "--device=nRF52832_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52832" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/adafruit/nrf52_adafruit_feather/doc/index.rst b/boards/adafruit/nrf52_adafruit_feather/doc/index.rst index c84bc73f62bd3..4e318acd79350 100644 --- a/boards/adafruit/nrf52_adafruit_feather/doc/index.rst +++ b/boards/adafruit/nrf52_adafruit_feather/doc/index.rst @@ -35,29 +35,7 @@ Hardware Supported Features ================== -The nRF52 Adafruit Feather board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| UART | on-chip | serial port | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ -| RTT | on-chip | console | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -80,6 +58,8 @@ Push buttons Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The ``nrf52_adafruit_feather`` board is available in two different versions: - `Adafruit Feather nRF52 Pro with myNewt Bootloader`_ diff --git a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_psram.overlay b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_psram.overlay index ac1ec4af1b19c..58eaee33a2b54 100644 --- a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_psram.overlay +++ b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_psram.overlay @@ -27,8 +27,7 @@ /* 2MB psram */ &psram0 { - reg = <0x3c000000 DT_SIZE_M(2)>; - status = "okay"; + size = ; }; #include diff --git a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu.dts b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu.dts index ac757645e5b57..5d8b14a96a61f 100644 --- a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu.dts +++ b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu.dts @@ -42,6 +42,15 @@ zephyr,code = ; }; }; + + stemma_connector: stemma_connector { + compatible = "stemma-qt-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio1 7 0>, + <1 0 &gpio1 8 0>; + }; }; &usb_serial { diff --git a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu_psram.overlay b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu_psram.overlay index 5ab0be63c3ffb..cd9ca5f1dcf0f 100644 --- a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu_psram.overlay +++ b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu_psram.overlay @@ -27,8 +27,7 @@ /* 2MB psram */ &psram0 { - reg = <0x3c000000 DT_SIZE_M(2)>; - status = "okay"; + size = ; }; #include diff --git a/boards/adafruit/qt_py_esp32s3/doc/index.rst b/boards/adafruit/qt_py_esp32s3/doc/index.rst index 1c1f6e04eeeca..8ad715a673c0d 100644 --- a/boards/adafruit/qt_py_esp32s3/doc/index.rst +++ b/boards/adafruit/qt_py_esp32s3/doc/index.rst @@ -32,47 +32,7 @@ numerous peripherals. Supported Features ================== -Current Zephyr's Adafruit QT Py ESP32-S3 board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+------------+------------+-------------------------------------+ -| I2S | on-chip | i2s | -+------------+------------+-------------------------------------+ -| TWAI/CAN | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| GDMA | on-chip | dma | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Prerequisites ------------- @@ -91,6 +51,8 @@ command below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts index 3f87e4188b228..a6eaf30bbe6c9 100644 --- a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts +++ b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts @@ -27,6 +27,15 @@ watchdog0 = &wdt0; led-strip = &ws2812; }; + + stemma_connector: stemma_connector { + compatible = "stemma-qt-connector"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio0 23 0>, + <1 0 &gpio0 22 0>; + }; }; &flash0 { diff --git a/boards/adafruit/qt_py_rp2040/doc/index.rst b/boards/adafruit/qt_py_rp2040/doc/index.rst index 0db8b4e403480..253ab615ac298 100644 --- a/boards/adafruit/qt_py_rp2040/doc/index.rst +++ b/boards/adafruit/qt_py_rp2040/doc/index.rst @@ -27,51 +27,7 @@ Hardware Supported Features ================== -The adafruit_qt_py_rp2040 board configuration supports the following -hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - NVIC - - N/A - - :dtcompatible:`arm,v6m-nvic` - * - UART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`raspberrypi,pico-uart` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`raspberrypi,pico-gpio` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`raspberrypi,pico-adc` - * - I2C - - :kconfig:option:`CONFIG_I2C` - - :dtcompatible:`snps,designware-i2c` - * - SPI - - :kconfig:option:`CONFIG_SPI` - - :dtcompatible:`raspberrypi,pico-spi` - * - USB Device - - :kconfig:option:`CONFIG_USB_DEVICE_STACK` - - :dtcompatible:`raspberrypi,pico-usbd` - * - HWINFO - - :kconfig:option:`CONFIG_HWINFO` - - N/A - * - Watchdog Timer (WDT) - - :kconfig:option:`CONFIG_WATCHDOG` - - :dtcompatible:`raspberrypi,pico-watchdog` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`raspberrypi,pico-pwm` - * - Flash - - :kconfig:option:`CONFIG_FLASH` - - :dtcompatible:`raspberrypi,pico-flash` - * - UART (PIO) - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`raspberrypi,pico-uart-pio` +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -98,6 +54,8 @@ Default Zephyr Peripheral Mapping: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adafruit/trinket_m0/doc/index.rst b/boards/adafruit/trinket_m0/doc/index.rst index 224f9aa4c6ded..ceaa0fd0ca2b3 100644 --- a/boards/adafruit/trinket_m0/doc/index.rst +++ b/boards/adafruit/trinket_m0/doc/index.rst @@ -21,35 +21,7 @@ Hardware Supported Features ================== -The adafruit_trinket_m0 board configuration supports the following hardware -features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| Flash | on-chip | Can be used with LittleFS to store files | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| PWM | on-chip | Pulse Width Modulation | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial ports | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface ports | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig file -:zephyr_file:`boards/adafruit/trinket_m0/adafruit_trinket_m0_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -98,6 +70,8 @@ serial port that echos characters back to the host PC. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Trinket M0 ships the BOSSA compatible UF2 bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/adi/ad_swiot1l_sl/Kconfig.ad_swiot1l_sl b/boards/adi/ad_swiot1l_sl/Kconfig.ad_swiot1l_sl new file mode 100644 index 0000000000000..b8b2e0fed8164 --- /dev/null +++ b/boards/adi/ad_swiot1l_sl/Kconfig.ad_swiot1l_sl @@ -0,0 +1,7 @@ +# AD-SWIOT1L-SL board configuration + +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_AD_SWIOT1L_SL + select SOC_MAX32650 diff --git a/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl.dts b/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl.dts new file mode 100644 index 0000000000000..d46ad87c1cf9e --- /dev/null +++ b/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl.dts @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include + +/ { + model = "Analog Devices AD-SWIOT1L-SL"; + compatible = "adi,ad_swiot1l_sl"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio2 15 GPIO_ACTIVE_HIGH>; + label = "Red LED"; + }; + + led2: led_2 { + gpios = <&gpio2 14 GPIO_ACTIVE_HIGH>; + label = "Green LED"; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led1; + led1 = &led2; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_p2_12 &uart0_rx_p2_11>; + pinctrl-names = "default"; + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + status = "okay"; +}; + +&clk_ipo { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; diff --git a/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl.yaml b/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl.yaml new file mode 100644 index 0000000000000..495481a989db0 --- /dev/null +++ b/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl.yaml @@ -0,0 +1,13 @@ +identifier: ad_swiot1l_sl +name: ad_swiot1l_sl +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - gpio + - serial +ram: 1024 +flash: 3072 diff --git a/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl_defconfig b/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl_defconfig new file mode 100644 index 0000000000000..9428e5334a08f --- /dev/null +++ b/boards/adi/ad_swiot1l_sl/ad_swiot1l_sl_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable GPIO +CONFIG_GPIO=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable UART +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/boards/adi/ad_swiot1l_sl/board.cmake b/boards/adi/ad_swiot1l_sl/board.cmake new file mode 100644 index 0000000000000..716d812146114 --- /dev/null +++ b/boards/adi/ad_swiot1l_sl/board.cmake @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=MAX32650" "--reset-after-load") + +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/adi/ad_swiot1l_sl/board.yml b/boards/adi/ad_swiot1l_sl/board.yml new file mode 100644 index 0000000000000..f458ef3b9e896 --- /dev/null +++ b/boards/adi/ad_swiot1l_sl/board.yml @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board: + name: ad_swiot1l_sl + full_name: AD-SWIOT1L-SL + vendor: adi + socs: + - name: max32650 diff --git a/boards/adi/ad_swiot1l_sl/doc/img/ad_swiot1l_sl.webp b/boards/adi/ad_swiot1l_sl/doc/img/ad_swiot1l_sl.webp new file mode 100644 index 0000000000000..6b734dc80b45a Binary files /dev/null and b/boards/adi/ad_swiot1l_sl/doc/img/ad_swiot1l_sl.webp differ diff --git a/boards/adi/ad_swiot1l_sl/doc/index.rst b/boards/adi/ad_swiot1l_sl/doc/index.rst new file mode 100644 index 0000000000000..42ef89a467ff5 --- /dev/null +++ b/boards/adi/ad_swiot1l_sl/doc/index.rst @@ -0,0 +1,107 @@ +.. zephyr:board:: ad_swiot1l_sl + +Overview +******** +The AD-SWIOT1L-SL is a complete hardware and software platform for prototyping intelligent, +secure, network-capable field devices, with applications in factory automation, process +control, and intelligent buildings. + +The Zephyr port is running on the MAX32650 MCU. + +Hardware +******** + +- MAX32650 MCU: + + - Ultra-Efficient Microcontroller for Battery-Powered Applications + + - 120MHz Arm Cortex-M4 Processor with FPU + - SmartDMA Provides Background Memory Transfers with Programmable Data Processing + - 120MHz High-Speed and 50MHz Low-Power Oscillators + - 7.3728MHz Low-Power Oscillators + - 32.768kHz and RTC Clock (Requires External Crystal) + - 8kHz, Always-On, Ultra-Low-Power Oscillator + - 3MB Internal Flash, 1MB Internal SRAM + - 104μW/MHz Executing from Cache at 1.1V + - Five Low-Power Modes: Active, Sleep, Background, Deep Sleep, and Backup + - 1.8V and 3.3V I/O with No Level Translators + + - Scalable Cached External Memory Interfaces: + + - 120MB/s HyperBus/Xccela DDR Interface + - SPIXF/SPIXR for External Flash/RAM Expansion + - 240Mbps SDHC/eMMC/SDIO/microSD Interface + + - Optimal Peripheral Mix Provides Platform Scalability + + - 16-Channel DMA + - Three SPI Master (60MHz)/Slave (48MHz) + - One QuadSPI Master (60MHz)/Slave (48MHz) + - Up to Three 4Mbaud UARTs with Flow Control + - Two 1MHz I2C Master/Slave + - I2S Slave + - Four-Channel, 7.8ksps, 10-Bit Delta-Sigma ADC + - USB 2.0 Hi-Speed Device Interface with PHY + - 16 Pulse Train Generators + - Six 32-Bit Timers with 8mA High Drive + - 1-Wire® Master + + - Trust Protection Unit (TPU) for IP/Data Security + + - Modular Arithmetic Accelerator (MAA), True Random Number Generator (TRNG) + - Secure Nonvolatile Key Storage, SHA-256, AES-128/192/256 + - Memory Decryption Integrity Unit, Secure Boot ROM + +- External devices connected to the AD-SWIOT1L-SL: + + - On-Board HyperRAM + - On-Board QSPI Flash + - MAXQ1065 Ultralow Power Cryptographic Controller with ChipDNA + - ADIN1110 Robust, Industrial, Low Power 10BASE-T1L Ethernet MAC-PHY + - 2-Pin external power supply terminal block (24V DC) + - ADP1032 high performance, isolated micropower management unit (PMU) + - SWD 10-Pin Header + - On-Board 3.3V, 1.8V, and 1.1V voltage regulators + - AD74413R Quad-channel, Software Configurable I/O + - MAX14906 Quad-channel, Industrial Digital I/O + - Two general-purpose LEDs + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== +The MAX32650 MCU can be flashed by connecting an external debug probe to the +SWD port. SWD debug can be accessed through the Cortex 10-pin connector, J3. +Logic levels are fixed to VDDIO (1.8V). + +Once the debug probe is connected to your host computer, then you can simply run the +``west flash`` command to write a firmware image into flash. + +.. note:: + + This board uses OpenOCD as the default debug interface. You can also use + a Segger J-Link with Segger's native tooling by overriding the runner, + appending ``--runner jlink`` to your ``west`` command(s). The J-Link should + be connected to the standard 2*5 pin debug connector (J3) using an + appropriate adapter board and cable + +Debugging +========= +Please refer to the `Flashing`_ section and run the ``west debug`` command +instead of ``west flash``. + +References +********** + +- `AD-SWIOT1L-SL web page`_ + +.. _AD-SWIOT1L-SL web page: + https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/AD-SWIOT1L-SL.html diff --git a/boards/adi/apard32690/doc/index.rst b/boards/adi/apard32690/doc/index.rst index edd879bd3ddc3..318d34b361e9f 100644 --- a/boards/adi/apard32690/doc/index.rst +++ b/boards/adi/apard32690/doc/index.rst @@ -87,32 +87,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on APARD32690. - -+-----------+------------+------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+------------------------------------+ -| ADIN1110 | spi | ADIN1110 10BASE-T1L mac/phy | -+-----------+------------+------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+------------------------------------+ -| W1 | on-chip | one wire master | -+-----------+------------+------------------------------------+ - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -182,6 +157,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/eval_adin1110ebz/doc/index.rst b/boards/adi/eval_adin1110ebz/doc/index.rst index 4f38e78faf0f5..ed1db60a4ee07 100644 --- a/boards/adi/eval_adin1110ebz/doc/index.rst +++ b/boards/adi/eval_adin1110ebz/doc/index.rst @@ -38,43 +38,7 @@ https://wiki.analog.com/resources/eval/user-guides/eval-adin1110ebz-user-guide Supported Features ================== -The ADI adi_eval_adin1110ebz board configuration supports the -following hardware features: - -+--------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+==============+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+--------------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+--------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+--------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+--------------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+--------------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+--------------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+--------------+------------+-------------------------------------+ -| WATCHDOG | on-chip | independent watchdog | -+--------------+------------+-------------------------------------+ -| ADIN1110 | spi | adin1110 10BASE-T1L mac/phy | -+--------------+------------+-------------------------------------+ -| FT232 | uart | usb-uart | -+--------------+------------+-------------------------------------+ -| ADT7422 | i2c | temperature sensor | -+--------------+------------+-------------------------------------+ -| ISS66WVE4M16 | fmc | 8MB PSRAM | -+--------------+------------+-------------------------------------+ - - -The default configuration can be found in the defconfig file: - - :zephyr_file:`boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -119,6 +83,8 @@ to a FT232, so available through Micro USB connector. Default settings are 11520 Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/eval_adin2111ebz/doc/index.rst b/boards/adi/eval_adin2111ebz/doc/index.rst index 7579c85b0cd2c..9c65a86ce369a 100644 --- a/boards/adi/eval_adin2111ebz/doc/index.rst +++ b/boards/adi/eval_adin2111ebz/doc/index.rst @@ -46,39 +46,7 @@ https://wiki.analog.com/resources/eval/user-guides/eval-adin2111ebz-user-guide Supported Features ================== -The ADI adi_eval_adin2111ebz board configuration supports the -following hardware features: - -+--------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+==============+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+--------------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+--------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+--------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+--------------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+--------------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+--------------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+--------------+------------+-------------------------------------+ -| WATCHDOG | on-chip | independent watchdog | -+--------------+------------+-------------------------------------+ -| ADIN2111 | spi | adin2111 10BASE-T1L mac/phy | -+--------------+------------+-------------------------------------+ -| FT232 | uart | usb-uart | -+--------------+------------+-------------------------------------+ - - -The default configuration can be found in the defconfig file: - - :zephyr_file:`boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -120,6 +88,8 @@ Same UART1 TX and RX cmos signals are available before the FT232, at P9 connecto Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32650evkit/Kconfig.max32650evkit b/boards/adi/max32650evkit/Kconfig.max32650evkit new file mode 100644 index 0000000000000..accb9f0e0f31b --- /dev/null +++ b/boards/adi/max32650evkit/Kconfig.max32650evkit @@ -0,0 +1,7 @@ +# MAX32650EVKIT boards configuration + +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MAX32650EVKIT + select SOC_MAX32650 diff --git a/boards/adi/max32650evkit/board.cmake b/boards/adi/max32650evkit/board.cmake new file mode 100644 index 0000000000000..716d812146114 --- /dev/null +++ b/boards/adi/max32650evkit/board.cmake @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=MAX32650" "--reset-after-load") + +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/adi/max32650evkit/board.yml b/boards/adi/max32650evkit/board.yml new file mode 100644 index 0000000000000..24e70315fb5e4 --- /dev/null +++ b/boards/adi/max32650evkit/board.yml @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board: + name: max32650evkit + full_name: MAX32650EVKIT + vendor: adi + socs: + - name: max32650 diff --git a/boards/adi/max32650evkit/doc/img/max32650evkit.webp b/boards/adi/max32650evkit/doc/img/max32650evkit.webp new file mode 100644 index 0000000000000..1300e5e44b910 Binary files /dev/null and b/boards/adi/max32650evkit/doc/img/max32650evkit.webp differ diff --git a/boards/adi/max32650evkit/doc/index.rst b/boards/adi/max32650evkit/doc/index.rst new file mode 100644 index 0000000000000..d66d875a782c7 --- /dev/null +++ b/boards/adi/max32650evkit/doc/index.rst @@ -0,0 +1,103 @@ +.. zephyr:board:: max32650evkit + +Overview +******** +The MAX32650 evaluation kit (EV kit) provides a platform for evaluating the +capabilities of the MAX32650 ultra-low power memory-scalable microcontroller +designed specifically for high performance battery powered applications. + +The Zephyr port is running on the MAX32650 MCU. + +Hardware +******** + +- MAX32650 MCU: + + - Ultra Efficient Microcontroller for Battery-Powered Applications + + - 120MHz Arm Cortex-M4 with FPU + - SmartDMA Provides Background Memory Transfers with Programmable Data Processing + - 120MHz High-Speed and 50MHz Low-Power Oscillators + - 7.3728MHz Low Power Oscillators + - 32.768kHz and RTC Clock (Requires External Crystal) + - 8kHz, Always-on, Ultra-Low-Power Oscillator + - 3MB Internal Flash, 1MB Internal SRAM + - 104µW/MHz Executing from Cache at 1.1V + - Five Low-Power Modes: Active, Sleep, Background, Deep-Sleep, and Backup + - 1.8V and 3.3V I/O with No Level Translators + - Programming and Debugging + + - Scalable Cached External Memory Interfaces + + - 120MB/s HyperBus/Xccela DDR Interface + - SPIXF/SPIXR for External Flash/RAM Expansion + - 240Mbps SDHC/eMMC/SDIO/microSD Interface + + - Optimal Peripheral Mix Provides Platform Scalability + + - 16-Channel DMA + - Three SPI Master (60MHz)/Slave (48MHz) + - One QuadSPI Master (60MHz)/Slave (48MHz) + - Up to Three 4Mbaud UARTs with Flow Control + - Two 1MHz I2C Master/Slave + - I2S Slave + - Four-Channel, 7.8ksps, 10-bit Delta-Sigma ADC + - USB 2.0 Hi-Speed Device Interface with PHY + - 16 Pulse Train Generators + - Six 32-bit Timers with 8mA Hi-Drive + - 1-Wire® Master + + - Trust Protection Unit (TPU) for IP/Data and Security + + - Modular Arithmetic Accelerator (MAA), True Random Number Generator (TRNG) + - Secure Nonvolatile Key Storage, SHA-256, AES-128/192/256 + - Memory Decryption Integrity Unit, Secure Boot ROM + +- External devices connected to the MAX32650EVKIT: + + - 3.5in 320 x 240 Color TFT Display + - 64MB HyperRAM + - 64MB XIP Flash + - 1MB XIP RAM + - USB 2.0 Micro B + - Two General-Purpose LEDs and Two GeneralPurpose Pushbutton Switches + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== +The MAX32650 MCU can be flashed by connecting an external debug probe to the +SWD port. SWD debug can be accessed through the Cortex 10-pin connector, J3. +Logic levels are fixed to VDDIO (1.8V). + +Once the debug probe is connected to your host computer, then you can simply run the +``west flash`` command to write a firmware image into flash. + +.. note:: + + This board uses OpenOCD as the default debug interface. You can also use + a Segger J-Link with Segger's native tooling by overriding the runner, + appending ``--runner jlink`` to your ``west`` command(s). The J-Link should + be connected to the standard 2*5 pin debug connector (J3) using an + appropriate adapter board and cable + +Debugging +========= +Please refer to the `Flashing`_ section and run the ``west debug`` command +instead of ``west flash``. + +References +********** + +- `MAX32650EVKIT web page`_ + +.. _MAX32650EVKIT web page: + https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/max32650-evkit.html diff --git a/boards/adi/max32650evkit/max32650evkit.dts b/boards/adi/max32650evkit/max32650evkit.dts new file mode 100644 index 0000000000000..2292bfd8b8ac4 --- /dev/null +++ b/boards/adi/max32650evkit/max32650evkit.dts @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include + +/ { + model = "Analog Devices MAX32650EVKIT"; + compatible = "adi,max32650evkit"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio2 25 GPIO_ACTIVE_HIGH>; + label = "Red LED"; + }; + + led2: led_2 { + gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>; + label = "Green LED"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + pb1: pb1 { + gpios = <&gpio2 28 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW2"; + zephyr,code = ; + }; + + pb2: pb2 { + gpios = <&gpio2 30 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW3"; + zephyr,code = ; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led1; + led1 = &led2; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_p2_12 &uart0_rx_p2_11>; + pinctrl-names = "default"; + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + status = "okay"; +}; + +&clk_ipo { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; diff --git a/boards/adi/max32650evkit/max32650evkit.yaml b/boards/adi/max32650evkit/max32650evkit.yaml new file mode 100644 index 0000000000000..8e3ced3c43711 --- /dev/null +++ b/boards/adi/max32650evkit/max32650evkit.yaml @@ -0,0 +1,13 @@ +identifier: max32650evkit +name: max32650evkit +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - gpio + - serial +ram: 1024 +flash: 3072 diff --git a/boards/adi/max32650evkit/max32650evkit_defconfig b/boards/adi/max32650evkit/max32650evkit_defconfig new file mode 100644 index 0000000000000..9428e5334a08f --- /dev/null +++ b/boards/adi/max32650evkit/max32650evkit_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable GPIO +CONFIG_GPIO=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable UART +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/boards/adi/max32650fthr/Kconfig.max32650fthr b/boards/adi/max32650fthr/Kconfig.max32650fthr new file mode 100644 index 0000000000000..cf8acafe85d82 --- /dev/null +++ b/boards/adi/max32650fthr/Kconfig.max32650fthr @@ -0,0 +1,7 @@ +# MAX32650FTHR board configuration + +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MAX32650FTHR + select SOC_MAX32650 diff --git a/boards/adi/max32650fthr/board.cmake b/boards/adi/max32650fthr/board.cmake new file mode 100644 index 0000000000000..716d812146114 --- /dev/null +++ b/boards/adi/max32650fthr/board.cmake @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=MAX32650" "--reset-after-load") + +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/adi/max32650fthr/board.yml b/boards/adi/max32650fthr/board.yml new file mode 100644 index 0000000000000..46dee2be23394 --- /dev/null +++ b/boards/adi/max32650fthr/board.yml @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board: + name: max32650fthr + full_name: MAX32650FTHR + vendor: adi + socs: + - name: max32650 diff --git a/boards/adi/max32650fthr/doc/img/max32650fthr.webp b/boards/adi/max32650fthr/doc/img/max32650fthr.webp new file mode 100644 index 0000000000000..065de009e8cfa Binary files /dev/null and b/boards/adi/max32650fthr/doc/img/max32650fthr.webp differ diff --git a/boards/adi/max32650fthr/doc/index.rst b/boards/adi/max32650fthr/doc/index.rst new file mode 100644 index 0000000000000..de4a139081d9b --- /dev/null +++ b/boards/adi/max32650fthr/doc/index.rst @@ -0,0 +1,102 @@ +.. zephyr:board:: max32650fthr + +Overview +******** +The MAX32650FTHR evaluation kit provides a platform for evaluating the capabilities +of the MAX32650 ultra-low-power memory-scalable microcontroller designed specifically +for high-performance, battery-powered applications. + +The Zephyr port is running on the MAX32650 MCU. + +Hardware +******** + +- MAX32650 MCU: + + - Ultra Efficient Microcontroller for Battery-Powered Applications + + - 120MHz Arm Cortex-M4 with FPU + - SmartDMA Provides Background Memory Transfers with Programmable Data Processing + - 120MHz High-Speed and 50MHz Low-Power Oscillators + - 7.3728MHz Low Power Oscillators + - 32.768kHz and RTC Clock (Requires External Crystal) + - 8kHz, Always-on, Ultra-Low-Power Oscillator + - 3MB Internal Flash, 1MB Internal SRAM + - 104µW/MHz Executing from Cache at 1.1V + - Five Low-Power Modes: Active, Sleep, Background, Deep-Sleep, and Backup + - 1.8V and 3.3V I/O with No Level Translators + - Programming and Debugging + + - Scalable Cached External Memory Interfaces + + - 120MB/s HyperBus/Xccela DDR Interface + - SPIXF/SPIXR for External Flash/RAM Expansion + - 240Mbps SDHC/eMMC/SDIO/microSD Interface + + - Optimal Peripheral Mix Provides Platform Scalability + + - 16-Channel DMA + - Three SPI Master (60MHz)/Slave (48MHz) + - One QuadSPI Master (60MHz)/Slave (48MHz) + - Up to Three 4Mbaud UARTs with Flow Control + - Two 1MHz I2C Master/Slave + - I2S Slave + - Four-Channel, 7.8ksps, 10-bit Delta-Sigma ADC + - USB 2.0 Hi-Speed Device Interface with PHY + - 16 Pulse Train Generators + - Six 32-bit Timers with 8mA Hi-Drive + - 1-Wire® Master + + - Trust Protection Unit (TPU) for IP/Data and Security + + - Modular Arithmetic Accelerator (MAA), True Random Number Generator (TRNG) + - Secure Nonvolatile Key Storage, SHA-256, AES-128/192/256 + - Memory Decryption Integrity Unit, Secure Boot ROM + +- External devices connected to the MAX32650FTHR: + + - Battery Connector and Charging Circuit + - Micro-SD Card Interface + - USB 2.0 Full-Speed Device Interface + - MAX11261 6-Channel, 24-Bit, 16ksps, ADC + - Adafruit® Feather Board Compatible + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== +The MAX32650 MCU can be flashed by connecting an external debug probe to the +SWD port. SWD debug can be accessed through the Cortex 10-pin connector, J5. +Logic levels are fixed to VDDIO (1.8V). + +Once the debug probe is connected to your host computer, then you can simply run the +``west flash`` command to write a firmware image into flash. + +.. note:: + + This board uses OpenOCD as the default debug interface. You can also use + a Segger J-Link with Segger's native tooling by overriding the runner, + appending ``--runner jlink`` to your ``west`` command(s). The J-Link should + be connected to the standard 2*5 pin debug connector (J5) using an + appropriate adapter board and cable + +Debugging +========= +Please refer to the `Flashing`_ section and run the ``west debug`` command +instead of ``west flash``. + +References +********** + +- `MAX32650FTHR web page`_ + +.. _MAX32650FTHR web page: + https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/max32650fthr.html diff --git a/boards/adi/max32650fthr/max32650fthr.dts b/boards/adi/max32650fthr/max32650fthr.dts new file mode 100644 index 0000000000000..b471e2523ce0f --- /dev/null +++ b/boards/adi/max32650fthr/max32650fthr.dts @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include + +/ { + model = "Analog Devices MAX32650FTHR"; + compatible = "adi,max32650fthr"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + label = "Red LED"; + }; + + led2: led_2 { + gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>; + label = "Green LED"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + pb1: pb1 { + gpios = <&gpio1 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW2"; + zephyr,code = ; + }; + + pb2: pb2 { + gpios = <&gpio1 21 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW3"; + zephyr,code = ; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led1; + led1 = &led2; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_p2_12 &uart0_rx_p2_11>; + pinctrl-names = "default"; + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + status = "okay"; +}; + +&clk_ipo { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; diff --git a/boards/adi/max32650fthr/max32650fthr.yaml b/boards/adi/max32650fthr/max32650fthr.yaml new file mode 100644 index 0000000000000..f967621e7020c --- /dev/null +++ b/boards/adi/max32650fthr/max32650fthr.yaml @@ -0,0 +1,13 @@ +identifier: max32650fthr +name: max32650fthr +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - gpio + - serial +ram: 1024 +flash: 3072 diff --git a/boards/adi/max32650fthr/max32650fthr_defconfig b/boards/adi/max32650fthr/max32650fthr_defconfig new file mode 100644 index 0000000000000..9428e5334a08f --- /dev/null +++ b/boards/adi/max32650fthr/max32650fthr_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable GPIO +CONFIG_GPIO=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable UART +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/boards/adi/max32655evkit/doc/index.rst b/boards/adi/max32655evkit/doc/index.rst index 1dce1fbad6ecc..9c72155a4d90f 100644 --- a/boards/adi/max32655evkit/doc/index.rst +++ b/boards/adi/max32655evkit/doc/index.rst @@ -69,41 +69,7 @@ Hardware Supported Features ================== -Below are the interfaces supported by Zephyr on MAX32655EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -161,6 +127,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32655fthr/doc/index.rst b/boards/adi/max32655fthr/doc/index.rst index bc3f191c19b13..648133f2142f1 100644 --- a/boards/adi/max32655fthr/doc/index.rst +++ b/boards/adi/max32655fthr/doc/index.rst @@ -82,39 +82,7 @@ Hardware Supported Features ================== -Below are the interfaces supported by Zephyr on MAX32655FTHR. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Push Buttons ************ @@ -184,6 +152,8 @@ used as a user LED. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32660evsys/Kconfig.max32660evsys b/boards/adi/max32660evsys/Kconfig.max32660evsys new file mode 100644 index 0000000000000..2e93639776153 --- /dev/null +++ b/boards/adi/max32660evsys/Kconfig.max32660evsys @@ -0,0 +1,7 @@ +# MAX32660EVSYS boards configuration + +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MAX32660EVSYS + select SOC_MAX32660 diff --git a/boards/adi/max32660evsys/board.cmake b/boards/adi/max32660evsys/board.cmake new file mode 100644 index 0000000000000..617eecca8f8ea --- /dev/null +++ b/boards/adi/max32660evsys/board.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adi/max32660evsys/board.yml b/boards/adi/max32660evsys/board.yml new file mode 100644 index 0000000000000..5e7e264b04c83 --- /dev/null +++ b/boards/adi/max32660evsys/board.yml @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board: + name: max32660evsys + full_name: MAX32660EVSYS + vendor: adi + socs: + - name: max32660 diff --git a/boards/adi/max32660evsys/doc/img/max32660evsys.webp b/boards/adi/max32660evsys/doc/img/max32660evsys.webp new file mode 100644 index 0000000000000..b3043a033a249 Binary files /dev/null and b/boards/adi/max32660evsys/doc/img/max32660evsys.webp differ diff --git a/boards/adi/max32660evsys/doc/index.rst b/boards/adi/max32660evsys/doc/index.rst new file mode 100644 index 0000000000000..c556fcbfeb9a9 --- /dev/null +++ b/boards/adi/max32660evsys/doc/index.rst @@ -0,0 +1,111 @@ +.. zephyr:board:: max32660evsys + +Overview +******** +The MAX32660 evaluation system offers a compact development platform that +provides access to all the features of the MAX32660 in a tiny, easy to +use board. A MAX32625PICO-based debug adapter comes attached to the main +board. It can be snapped free when programming is complete. The debug +module supports an optional 10-pin Arm® Cortex® debug connector for DAPLink +functionality. Combined measurements are 0.65in x 2.2in, while the main board +alone measures 0.65in x 0.95in. External connections terminate in a dual-row +header footprint compatible with both thru-hole and SMT applications. This +board provides a powerful processing subsystem in a very small space that +can be easily integrated into a variety of applications. + +The Zephyr port is running on the MAX32660 MCU. + +Hardware +******** + +- MAX32660 MCU: + + - High-Efficiency Microcontroller for Wearable Devices + + - Internal Oscillator Operates Up to 96MHz + - 256KB Flash Memory + - 96KB SRAM, Optionally Preserved in Lowest Power Backup Mode + - 16KB Instruction Cache + - Memory Protection Unit (MPU) + - Low 1.1V VCORE Supply Voltage + - 3.6V GPIO Operating Range + - Internal LDO Provides Operation from Single Supply + - Wide Operating Temperature: -40°C to +105°C + + - Power Management Maximizes Uptime for Battery Applications + + - 85µA/MHz Active Executing from Flash + - 2µA Full Memory Retention Power in Backup Mode at VDD = 1.8V + - 450nA Ultra-Low Power RTC at VDD=1.8V + - Internal 80kHz Ring Oscillator + + - Optimal Peripheral Mix Provides Platform Scalability + + - Up to 14 General-Purpose I/O Pins + - Up to Two SPI + - I2S + - Up to Two UARTs + - Up to Two I2C, 3.4Mbps High Speed + - Four-Channel Standard DMA Controller + - Three 32-Bit Timers + - Watchdog Timer + - CMOS-Level 32.768kHz RTC Output + +- Benefits and Features of MAX32660-EVSYS: + + - DIP Breakout Board + + - 100mil Pitch Dual Inline Pin Headers + - Breadboard Compatible + + - Integrated Peripherals + + - Red Indicator LED + - User Pushbutton + + - MAX32625PICO-Based Debug Adapter + + - CMSIS-DAP SWD Debugger + - Virtual UART Console + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== + +An Arm® debug access port (DAP) provides an external interface for debugging during application +development. The DAP is a standard Arm CoreSight® serial wire debug port, uses a two-pin serial +interface (SWDCLK and SWDIO), and is accessed through 10-pin header (J4). + +Once the debug probe is connected to your host computer, then you can simply run the +``west flash`` command to write a firmware image into flash. + +.. note:: + + This board uses OpenOCD as the default debug interface. You can also use + a Segger J-Link with Segger's native tooling by overriding the runner, + appending ``--runner jlink`` to your ``west`` command(s). The J-Link should + be connected to the standard 2*5 pin debug connector (J3) using an + appropriate adapter board and cable. + +Debugging +========= + +Please refer to the `Flashing`_ section and run the ``west debug`` command +instead of ``west flash``. + +References +********** + +- `MAX32660EVSYS web page`_ + +.. _MAX32660EVSYS web page: + https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/max32660-evsys.html diff --git a/boards/adi/max32660evsys/max32660evsys.dts b/boards/adi/max32660evsys/max32660evsys.dts new file mode 100644 index 0000000000000..f06645f94a1e8 --- /dev/null +++ b/boards/adi/max32660evsys/max32660evsys.dts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include + +/ { + model = "Analog Devices MAX32660EVSYS"; + compatible = "adi,max32660evsys"; + + chosen { + zephyr,console = &uart1; + zephyr,shell-uart = &uart1; + zephyr,sram = &sram2; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + label = "Red LED"; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led1; + }; + +}; + +&uart1 { + pinctrl-0 = <&uart1_tx_p0_10 &uart1_rx_p0_11>; + pinctrl-names = "default"; + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + status = "okay"; +}; + +&clk_ipo { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; diff --git a/boards/adi/max32660evsys/max32660evsys.yaml b/boards/adi/max32660evsys/max32660evsys.yaml new file mode 100644 index 0000000000000..da963ef091c68 --- /dev/null +++ b/boards/adi/max32660evsys/max32660evsys.yaml @@ -0,0 +1,13 @@ +identifier: max32660evsys +name: max32660evsys +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - gpio + - serial +ram: 96 +flash: 256 diff --git a/boards/adi/max32660evsys/max32660evsys_defconfig b/boards/adi/max32660evsys/max32660evsys_defconfig new file mode 100644 index 0000000000000..9428e5334a08f --- /dev/null +++ b/boards/adi/max32660evsys/max32660evsys_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable GPIO +CONFIG_GPIO=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable UART +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y diff --git a/boards/adi/max32662evkit/doc/index.rst b/boards/adi/max32662evkit/doc/index.rst index 249c6b4aeaf48..cc3d42c03a98f 100644 --- a/boards/adi/max32662evkit/doc/index.rst +++ b/boards/adi/max32662evkit/doc/index.rst @@ -75,39 +75,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32662EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -201,6 +169,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32662evkit/max32662evkit.dts b/boards/adi/max32662evkit/max32662evkit.dts index 5f204b91bef5e..e8cdc4ddb947b 100644 --- a/boards/adi/max32662evkit/max32662evkit.dts +++ b/boards/adi/max32662evkit/max32662evkit.dts @@ -149,5 +149,5 @@ status = "okay"; pinctrl-0 = <&spi1a_mosi_p0_8 &spi1a_sck_p0_17>; pinctrl-names = "default"; - cs-gpios = <&gpio0 18 (GPIO_ACTIVE_LOW | MAX32_VSEL_VDDIOH)>; + cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; }; diff --git a/boards/adi/max32666evkit/doc/index.rst b/boards/adi/max32666evkit/doc/index.rst index 96b43693653f1..1569615621db3 100644 --- a/boards/adi/max32666evkit/doc/index.rst +++ b/boards/adi/max32666evkit/doc/index.rst @@ -86,40 +86,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32666EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -288,6 +255,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32666fthr/doc/index.rst b/boards/adi/max32666fthr/doc/index.rst index b65325f380e9b..5136bf589866f 100644 --- a/boards/adi/max32666fthr/doc/index.rst +++ b/boards/adi/max32666fthr/doc/index.rst @@ -91,41 +91,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32666FTHR. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -208,6 +174,8 @@ JH4 Pinout Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.dts b/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.dts index 02b45bda3db55..5aa45a1c5ce2a 100644 --- a/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.dts +++ b/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.dts @@ -55,6 +55,7 @@ led2 = &led3; sw0 = &pb1; watchdog0 = &wdt0; + sdhc0 = &sdhc0; }; /* Used for accessing other pins */ @@ -134,3 +135,56 @@ pinctrl-0 = <&owm_io_p0_12>; pinctrl-names = "default"; }; + +&sdhc0 { + pinctrl-0 = <&sdhc_dat3_p1_0 &sdhc_cmd_p1_1 &sdhc_dat0_p1_2 &sdhc_clk_p1_3 + &sdhc_dat1_p1_4 &sdhc_dat2_p1_5 &sdhc_wp_p1_6 &sdhc_cdn_p1_7>; + pinctrl-names = "default"; +}; + +&sdhc_dat3_p1_0 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc_cmd_p1_1 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc_dat0_p1_2 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc_clk_p1_3 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc_dat1_p1_4 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc_dat2_p1_5 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc_wp_p1_6 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc_cdn_p1_7 { + power-source = ; + drive-strength = <1>; +}; + +&sdhc0 { + status = "okay"; + mmc { + status = "okay"; + }; +}; diff --git a/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.yaml b/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.yaml index 71024815819aa..9b924a56a6d0c 100644 --- a/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.yaml +++ b/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.yaml @@ -20,5 +20,6 @@ supported: - pwm - w1 - flash + - sdhc ram: 560 flash: 1024 diff --git a/boards/adi/max32670evkit/doc/index.rst b/boards/adi/max32670evkit/doc/index.rst index 3fefd9e4119b2..4f5b57da3a675 100644 --- a/boards/adi/max32670evkit/doc/index.rst +++ b/boards/adi/max32670evkit/doc/index.rst @@ -84,37 +84,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32670EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -178,6 +148,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32672evkit/doc/index.rst b/boards/adi/max32672evkit/doc/index.rst index b4b63a8550a72..745adcd8a7208 100644 --- a/boards/adi/max32672evkit/doc/index.rst +++ b/boards/adi/max32672evkit/doc/index.rst @@ -77,40 +77,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32672EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -312,11 +279,9 @@ The I2C ports can independently pulled up to V_AUX (3.3V default) through JP4 (I Programming and Debugging ************************* -The IC can be reset by pushbutton SW1. - +.. zephyr:board-supported-runners:: -Programming and Debugging -************************* +The IC can be reset by pushbutton SW1. Flashing ======== diff --git a/boards/adi/max32672evkit/max32672evkit.dts b/boards/adi/max32672evkit/max32672evkit.dts index 581a9723c1dbe..737b2e3337099 100644 --- a/boards/adi/max32672evkit/max32672evkit.dts +++ b/boards/adi/max32672evkit/max32672evkit.dts @@ -154,7 +154,7 @@ status = "okay"; pinctrl-0 = <&spi0a_mosi_p0_3 &spi0a_miso_p0_2 &spi0a_sck_p0_4>; pinctrl-names = "default"; - cs-gpios = <&gpio0 5 (GPIO_ACTIVE_LOW | MAX32_VSEL_VDDIOH)>; + cs-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; }; &rtc_counter { diff --git a/boards/adi/max32672fthr/doc/index.rst b/boards/adi/max32672fthr/doc/index.rst index e4d387728f4e0..c772136a8bda0 100644 --- a/boards/adi/max32672fthr/doc/index.rst +++ b/boards/adi/max32672fthr/doc/index.rst @@ -83,40 +83,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32672FTHR. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -197,6 +164,8 @@ J7 Pinout Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32675evkit/doc/index.rst b/boards/adi/max32675evkit/doc/index.rst index 4028d8bc8e43c..6c66e204e0cdb 100644 --- a/boards/adi/max32675evkit/doc/index.rst +++ b/boards/adi/max32675evkit/doc/index.rst @@ -68,33 +68,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32675EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -370,6 +344,8 @@ respectively. If the pushbutton is pressed, the attached port pin is pulled low. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32680evkit/doc/index.rst b/boards/adi/max32680evkit/doc/index.rst index 10def1215cb8f..a3c7d909efdba 100644 --- a/boards/adi/max32680evkit/doc/index.rst +++ b/boards/adi/max32680evkit/doc/index.rst @@ -87,39 +87,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32680EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -136,9 +104,9 @@ Connections and IOs | | | | | +-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+ | JP2 | REF0P | +-----------+ | +-------------------------------------------------------------------------------+ | -| | | | 2-1 | | | Connects the external high-precision voltage refernce to REF0P. | | +| | | | 2-1 | | | Connects the external high-precision voltage reference to REF0P. | | | | | +-----------+ | +-------------------------------------------------------------------------------+ | -| | | | 2-3 | | | Connects the internal voltage refernce to REF0P. | | +| | | | 2-3 | | | Connects the internal voltage reference to REF0P. | | | | | +-----------+ | +-------------------------------------------------------------------------------+ | | | | | | +-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+ @@ -164,9 +132,9 @@ Connections and IOs | | | | | +-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+ | JP6 | REF1P | +-----------+ | +-------------------------------------------------------------------------------+ | -| | | | 2-1 | | | Connects the external high-precision voltage refernce to REF1P. | | +| | | | 2-1 | | | Connects the external high-precision voltage reference to REF1P. | | | | | +-----------+ | +-------------------------------------------------------------------------------+ | -| | | | 2-3 | | | Connects the internal voltage refernce to REF1P. | | +| | | | 2-3 | | | Connects the internal voltage reference to REF1P. | | | | | +-----------+ | +-------------------------------------------------------------------------------+ | | | | | | +-----------+---------------+---------------+--------------------------------------------------------------------------------------------------+ @@ -319,6 +287,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32680evkit/max32680evkit_max32680_m4.dts b/boards/adi/max32680evkit/max32680evkit_max32680_m4.dts index 4547da3459df6..d3459098a11af 100644 --- a/boards/adi/max32680evkit/max32680evkit_max32680_m4.dts +++ b/boards/adi/max32680evkit/max32680evkit_max32680_m4.dts @@ -163,7 +163,7 @@ status = "okay"; pinctrl-0 = <&spi0a_mosi_p0_5 &spi0a_miso_p0_6 &spi0a_sck_p0_7>; pinctrl-names = "default"; - cs-gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | MAX32_VSEL_VDDIOH)>; + cs-gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>; }; &w1 { diff --git a/boards/adi/max32690evkit/doc/index.rst b/boards/adi/max32690evkit/doc/index.rst index ab484d1e32e81..796bbeb18398f 100644 --- a/boards/adi/max32690evkit/doc/index.rst +++ b/boards/adi/max32690evkit/doc/index.rst @@ -91,42 +91,7 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32690EVKIT. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -276,6 +241,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max32690evkit/max32690evkit_max32690_m4.dts b/boards/adi/max32690evkit/max32690evkit_max32690_m4.dts index d04a91852cdfb..132f29f304174 100644 --- a/boards/adi/max32690evkit/max32690evkit_max32690_m4.dts +++ b/boards/adi/max32690evkit/max32690evkit_max32690_m4.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Analog Devices, Inc. + * Copyright (c) 2023-2025 Analog Devices, Inc. * * SPDX-License-Identifier: Apache-2.0 */ @@ -167,3 +167,7 @@ &rtc_counter { status = "okay"; }; + +zephyr_udc0: &usbhs { + status = "okay"; +}; diff --git a/boards/adi/max32690evkit/max32690evkit_max32690_m4.yaml b/boards/adi/max32690evkit/max32690evkit_max32690_m4.yaml index 150225890e2a8..8278d3fe168b0 100644 --- a/boards/adi/max32690evkit/max32690evkit_max32690_m4.yaml +++ b/boards/adi/max32690evkit/max32690evkit_max32690_m4.yaml @@ -20,5 +20,6 @@ supported: - pwm - w1 - flash + - usbd ram: 1024 flash: 3072 diff --git a/boards/adi/max32690fthr/doc/index.rst b/boards/adi/max32690fthr/doc/index.rst index ad133537417d2..ffbc67d93207b 100644 --- a/boards/adi/max32690fthr/doc/index.rst +++ b/boards/adi/max32690fthr/doc/index.rst @@ -63,31 +63,13 @@ Hardware Supported Features ================== -Below interfaces are supported by Zephyr on MAX32690FTHR. - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max78000evkit/doc/img/max78000evkit_img1.webp b/boards/adi/max78000evkit/doc/img/max78000evkit.webp similarity index 100% rename from boards/adi/max78000evkit/doc/img/max78000evkit_img1.webp rename to boards/adi/max78000evkit/doc/img/max78000evkit.webp diff --git a/boards/adi/max78000evkit/doc/index.rst b/boards/adi/max78000evkit/doc/index.rst index fb9c2fc8bcd8a..18986d881cf7e 100644 --- a/boards/adi/max78000evkit/doc/index.rst +++ b/boards/adi/max78000evkit/doc/index.rst @@ -11,10 +11,6 @@ to SPI bridge provides rapid access to onboard memory, allowing large networks o The Zephyr port is running on the MAX78000 MCU. -.. image:: img/max78000evkit_img1.webp - :align: center - :alt: MAX78000 EVKIT - Hardware ******** @@ -59,43 +55,7 @@ Hardware Supported Features ================== -The ``max78000evkit/max78000/m4`` board target supports the following interfaces: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| RTC | on-chip | real time clock | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+--------------------------------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -275,6 +235,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max78000evkit/max78000evkit_max78000_m4.yaml b/boards/adi/max78000evkit/max78000evkit_max78000_m4.yaml index f974a60c9959b..5f7f522504112 100644 --- a/boards/adi/max78000evkit/max78000evkit_max78000_m4.yaml +++ b/boards/adi/max78000evkit/max78000evkit_max78000_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - counter diff --git a/boards/adi/max78000fthr/doc/img/max78000fthr_img1.webp b/boards/adi/max78000fthr/doc/img/max78000fthr.webp similarity index 100% rename from boards/adi/max78000fthr/doc/img/max78000fthr_img1.webp rename to boards/adi/max78000fthr/doc/img/max78000fthr.webp diff --git a/boards/adi/max78000fthr/doc/index.rst b/boards/adi/max78000fthr/doc/index.rst index fee925ffae88f..1960a00257ed9 100644 --- a/boards/adi/max78000fthr/doc/index.rst +++ b/boards/adi/max78000fthr/doc/index.rst @@ -12,10 +12,6 @@ platform for quick proof-of-concepts and early software development to enhance t The Zephyr port is running on the MAX78000 MCU. -.. image:: img/max78000fthr_img1.webp - :align: center - :alt: MAX78000 FTHR - Hardware ******** @@ -60,43 +56,7 @@ Hardware Supported Features ================== -The ``max78000fthr/max78000/m4`` board target supports the following interfaces: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| RTC | on-chip | real time clock | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+--------------------------------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -178,6 +138,8 @@ J4 Pinout Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/max78000fthr/max78000fthr_max78000_m4.yaml b/boards/adi/max78000fthr/max78000fthr_max78000_m4.yaml index f649928b1bacf..116fa9051c584 100644 --- a/boards/adi/max78000fthr/max78000fthr_max78000_m4.yaml +++ b/boards/adi/max78000fthr/max78000fthr_max78000_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - counter diff --git a/boards/adi/max78002evkit/doc/index.rst b/boards/adi/max78002evkit/doc/index.rst index 9a9d11a930759..ffb55415bf43d 100644 --- a/boards/adi/max78002evkit/doc/index.rst +++ b/boards/adi/max78002evkit/doc/index.rst @@ -81,41 +81,7 @@ Hardware Supported Features ================== -The ``max78002evkit/max78002/m4`` board target supports the following interfaces: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock and reset control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma controller | -+-----------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| Timer | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| W1 | on-chip | one wire master | -+-----------+------------+-------------------------------------+ -| Flash | on-chip | flash | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -442,6 +408,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/adi/sdp_k1/doc/index.rst b/boards/adi/sdp_k1/doc/index.rst index 680852f53dd91..d684c53374c9e 100644 --- a/boards/adi/sdp_k1/doc/index.rst +++ b/boards/adi/sdp_k1/doc/index.rst @@ -65,23 +65,7 @@ More information about STM32F469NI can be found here: Supported Features ================== -The Zephyr stm32f469i_disco board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on Zephyr porting. - -The default configuration can be found in -:zephyr_file:`boards/adi/sdp_k1/adi_sdp_k1_defconfig` +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -119,6 +103,8 @@ Default Zephyr Peripheral Mapping: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The ADI SDP-K1 be programmed over USB using the DAPLink firmware running on an embedded NXP Freescale microcontroller or a 10-pin ``DEBUG`` header connected to a STLINK debugger. diff --git a/boards/alientek/pandora_stm32l475/doc/index.rst b/boards/alientek/pandora_stm32l475/doc/index.rst index d976ee7740f17..671570b64099b 100644 --- a/boards/alientek/pandora_stm32l475/doc/index.rst +++ b/boards/alientek/pandora_stm32l475/doc/index.rst @@ -85,44 +85,7 @@ The STM32L475VE SoC provides the following hardware features: Supported Features ================== -The Zephyr stm32l475ve_pandora board configuration supports the following hardware features: - -+-----------+------------+----------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==============================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+----------------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+----------------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+----------------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------------------------------+ -| I2C | on-chip | I2C-AHT10(Temperature and humidity sensor) | -| | | I2C-ICM2068(light environment sensor) | -+-----------+------------+----------------------------------------------+ -| I2S | on-chip | I2S-ES8388(Audio Decoder) | -+-----------+------------+----------------------------------------------+ -| USB | on-chip | I2S-OTG | -+-----------+------------+----------------------------------------------+ -| SDIO | on-chip | SDIO-AP6181(WIFI) | -+-----------+------------+----------------------------------------------+ -| SPI | on-chip | LCD-TFT | -+-----------+------------+----------------------------------------------+ -| QSPI NOR | on-chip | flash | -+-----------+------------+----------------------------------------------+ -| IR-RX/TX | on-board | Infrared Receiver(38Khz)/Transmitter | -+-----------+------------+----------------------------------------------+ -| STLINK-V2 | on-board | STLINK-V2 Debugger | -+-----------+------------+----------------------------------------------+ - -Other hardware features are not yet supported on this Zephyr port. - -The default configuration can be found in the defconfig file: - - :zephyr_file:`boards/alientek/pandora_stm32l475/pandora_stm32l475_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -158,6 +121,8 @@ Default settings are 115200 8N1. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/altr/max10/doc/index.rst b/boards/altr/max10/doc/index.rst index 0c16aa329e8e6..1e5064b0f0d7f 100644 --- a/boards/altr/max10/doc/index.rst +++ b/boards/altr/max10/doc/index.rst @@ -130,6 +130,8 @@ in the SDK: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/ambiq/apollo3_evb/apollo3_evb-pinctrl.dtsi b/boards/ambiq/apollo3_evb/apollo3_evb-pinctrl.dtsi index 26cf5e58063ea..39db2783c37a9 100644 --- a/boards/ambiq/apollo3_evb/apollo3_evb-pinctrl.dtsi +++ b/boards/ambiq/apollo3_evb/apollo3_evb-pinctrl.dtsi @@ -125,7 +125,7 @@ pinmux = ; drive-push-pull; drive-strength = "0.5"; - ambiq,iom-nce-module = <0>; + ambiq,nce-src = <0>; ambiq,iom-num = <6>; }; }; diff --git a/boards/ambiq/apollo3_evb/apollo3_evb.dts b/boards/ambiq/apollo3_evb/apollo3_evb.dts index bea88a5c3b91b..b6cf18bc1c6ad 100644 --- a/boards/ambiq/apollo3_evb/apollo3_evb.dts +++ b/boards/ambiq/apollo3_evb/apollo3_evb.dts @@ -139,21 +139,25 @@ status = "okay"; }; -&spi0 { - pinctrl-0 = <&spi0_default>; - pinctrl-names = "default"; - cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; - clock-frequency = ; - status = "okay"; +&iom0 { + spi0: spi { + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; + cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; + clock-frequency = ; + status = "okay"; + }; }; -&i2c3 { - pinctrl-0 = <&i2c3_default>; - pinctrl-names = "default"; - clock-frequency = ; - scl-gpios = <&gpio32_63 10 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - sda-gpios = <&gpio32_63 11 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - status = "okay"; +&iom3 { + i2c3: i2c { + pinctrl-0 = <&i2c3_default>; + pinctrl-names = "default"; + clock-frequency = ; + scl-gpios = <&gpio32_63 10 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + sda-gpios = <&gpio32_63 11 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + status = "okay"; + }; }; &counter0 { diff --git a/boards/ambiq/apollo3_evb/apollo3_evb_connector.dtsi b/boards/ambiq/apollo3_evb/apollo3_evb_connector.dtsi index 77e22c5bbb50c..7a6ad127efa21 100644 --- a/boards/ambiq/apollo3_evb/apollo3_evb_connector.dtsi +++ b/boards/ambiq/apollo3_evb/apollo3_evb_connector.dtsi @@ -63,5 +63,5 @@ }; }; -ambiq_spi0: &spi0 {}; -ambiq_i2c3: &i2c3 {}; +ambiq_spi0: &iom0 {}; +ambiq_i2c3: &iom3 {}; diff --git a/boards/ambiq/apollo3_evb/doc/index.rst b/boards/ambiq/apollo3_evb/doc/index.rst index 429d973d37810..c8d56b0443b48 100644 --- a/boards/ambiq/apollo3_evb/doc/index.rst +++ b/boards/ambiq/apollo3_evb/doc/index.rst @@ -21,34 +21,13 @@ For more information about the Apollo3 Blue SoC and Apollo3 Blue EVB board: Supported Features ================== -The Apollo3 Blue EVB board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| MPU | on-chip | memory protection unit | -+-----------+------------+-------------------------------------+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| STIMER | on-chip | stimer | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| RADIO | on-chip | bluetooth | -+-----------+------------+-------------------------------------+ - -The default configuration can be found in the defconfig file: -``boards/arm/apollo3_evb/apollo3_evb_defconfig``. +.. zephyr:board-supported-hw:: Programming and Debugging ========================= +.. zephyr:board-supported-runners:: + Flashing an application ----------------------- diff --git a/boards/ambiq/apollo3p_evb/apollo3p_evb-pinctrl.dtsi b/boards/ambiq/apollo3p_evb/apollo3p_evb-pinctrl.dtsi index 3eea582a37248..f8821a4c2f83b 100644 --- a/boards/ambiq/apollo3p_evb/apollo3p_evb-pinctrl.dtsi +++ b/boards/ambiq/apollo3p_evb/apollo3p_evb-pinctrl.dtsi @@ -126,7 +126,7 @@ drive-push-pull; drive-strength = "0.5"; ambiq,iom-mspi = <0>; - ambiq,iom-nce-module = <0>; + ambiq,nce-src = <0>; ambiq,iom-num = <0>; }; }; @@ -147,7 +147,7 @@ drive-push-pull; drive-strength = "0.5"; ambiq,iom-mspi = <0>; - ambiq,iom-nce-module = <0>; + ambiq,nce-src = <0>; ambiq,iom-num = <1>; }; }; @@ -164,7 +164,7 @@ drive-push-pull; drive-strength = "0.5"; ambiq,iom-mspi = <0>; - ambiq,iom-nce-module = <0>; + ambiq,nce-src = <0>; ambiq,iom-num = <2>; }; }; diff --git a/boards/ambiq/apollo3p_evb/apollo3p_evb.dts b/boards/ambiq/apollo3p_evb/apollo3p_evb.dts index 56b9ec15fec9f..a40767bd37118 100644 --- a/boards/ambiq/apollo3p_evb/apollo3p_evb.dts +++ b/boards/ambiq/apollo3p_evb/apollo3p_evb.dts @@ -117,21 +117,25 @@ status = "okay"; }; -&spi0 { - pinctrl-0 = <&spi0_default>; - pinctrl-names = "default"; - cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; - clock-frequency = ; - status = "okay"; +&iom0 { + spi0: spi { + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; + cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; + clock-frequency = ; + status = "okay"; + }; }; -&i2c3 { - pinctrl-0 = <&i2c3_default>; - pinctrl-names = "default"; - clock-frequency = ; - scl-gpios = <&gpio32_63 10 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - sda-gpios = <&gpio32_63 11 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - status = "okay"; +&iom3 { + i2c3: i2c { + pinctrl-0 = <&i2c3_default>; + pinctrl-names = "default"; + clock-frequency = ; + scl-gpios = <&gpio32_63 10 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + sda-gpios = <&gpio32_63 11 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + status = "okay"; + }; }; &counter0 { diff --git a/boards/ambiq/apollo3p_evb/apollo3p_evb_connector.dtsi b/boards/ambiq/apollo3p_evb/apollo3p_evb_connector.dtsi index fc85edb4a6328..73b8d42e107d8 100644 --- a/boards/ambiq/apollo3p_evb/apollo3p_evb_connector.dtsi +++ b/boards/ambiq/apollo3p_evb/apollo3p_evb_connector.dtsi @@ -88,5 +88,5 @@ }; }; -ambiq_spi0: &spi0 {}; -ambiq_i2c3: &i2c3 {}; +ambiq_spi0: &iom0 {}; +ambiq_i2c3: &iom3 {}; diff --git a/boards/ambiq/apollo3p_evb/doc/index.rst b/boards/ambiq/apollo3p_evb/doc/index.rst index a5f848c4f2c2d..1aa477d785d3c 100644 --- a/boards/ambiq/apollo3p_evb/doc/index.rst +++ b/boards/ambiq/apollo3p_evb/doc/index.rst @@ -21,34 +21,13 @@ For more information about the Apollo3 Blue Plus SoC and Apollo3 Blue Plus EVB b Supported Features ================== -The Apollo3 Blue Plus EVB board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| MPU | on-chip | memory protection unit | -+-----------+------------+-------------------------------------+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| STIMER | on-chip | stimer | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| RADIO | on-chip | bluetooth | -+-----------+------------+-------------------------------------+ - -The default configuration can be found in the defconfig file: -``boards/arm/apollo3p_evb/apollo3p_evb_defconfig``. +.. zephyr:board-supported-hw:: Programming and Debugging ========================= +.. zephyr:board-supported-runners:: + Flashing an application ----------------------- diff --git a/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig b/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig index 63595ffddbd57..2bcd67ff17ca2 100644 --- a/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig +++ b/boards/ambiq/apollo4p_blue_kxr_evb/Kconfig.defconfig @@ -19,6 +19,9 @@ config MAIN_STACK_SIZE config BT_BUF_ACL_TX_COUNT default 14 +config BT_BUF_EVT_RX_COUNT + default 15 + config BT_BUF_CMD_TX_SIZE default $(UINT8_MAX) diff --git a/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb-pinctrl.dtsi b/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb-pinctrl.dtsi index f8c20b0fad982..2cf596eadcd9f 100644 --- a/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb-pinctrl.dtsi +++ b/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb-pinctrl.dtsi @@ -128,7 +128,7 @@ pinmux = ; drive-push-pull; drive-strength = "0.5"; - ambiq,iom-nce-module = <32>; + ambiq,nce-src = <32>; }; }; mspi1_default: mspi1_default{ @@ -141,7 +141,7 @@ pinmux = ; drive-push-pull; drive-strength = "0.5"; - ambiq,iom-nce-module = <34>; + ambiq,nce-src = <34>; }; }; mspi2_default: mspi2_default{ @@ -154,7 +154,7 @@ pinmux = ; drive-push-pull; drive-strength = "0.5"; - ambiq,iom-nce-module = <36>; + ambiq,nce-src = <36>; }; }; diff --git a/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb.dts b/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb.dts index 1a94e0e25cadd..a4e8fdd6b439c 100644 --- a/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb.dts +++ b/boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb.dts @@ -89,27 +89,33 @@ status = "okay"; }; -&i2c0 { - pinctrl-0 = <&i2c0_default>; - pinctrl-names = "default"; - clock-frequency = ; - scl-gpios = <&gpio0_31 5 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - sda-gpios = <&gpio0_31 6 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - status = "okay"; +&iom0 { + i2c0: i2c { + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + clock-frequency = ; + scl-gpios = <&gpio0_31 5 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + sda-gpios = <&gpio0_31 6 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + status = "okay"; + }; }; -&spi1 { - pinctrl-0 = <&spi1_default>; - pinctrl-names = "default"; - cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; - clock-frequency = ; - status = "okay"; +&iom1 { + spi1: spi { + pinctrl-0 = <&spi1_default>; + pinctrl-names = "default"; + cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; + clock-frequency = ; + status = "okay"; + }; }; -&spi4 { - pinctrl-0 = <&spi4_default>; - pinctrl-names = "default"; - status = "okay"; +&iom4 { + spi4: spi { + pinctrl-0 = <&spi4_default>; + pinctrl-names = "default"; + status = "okay"; + }; }; &mspi0 { diff --git a/boards/ambiq/apollo4p_blue_kxr_evb/doc/index.rst b/boards/ambiq/apollo4p_blue_kxr_evb/doc/index.rst index 81158fba6dbf9..b6e891ef53f3b 100644 --- a/boards/ambiq/apollo4p_blue_kxr_evb/doc/index.rst +++ b/boards/ambiq/apollo4p_blue_kxr_evb/doc/index.rst @@ -23,40 +23,13 @@ For more information about the Apollo4 Blue Plus SoC and Apollo4 Blue Plus KXR E Supported Features ================== -The Apollo4 Blue Plus KXR EVB board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| MPU | on-chip | memory protection unit | -+-----------+------------+-------------------------------------+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| STIMER | on-chip | stimer | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI(M) | on-chip | spi | -+-----------+------------+-------------------------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+-------------------------------------+ -| RADIO | on-chip | bluetooth | -+-----------+------------+-------------------------------------+ - -The default configuration can be found in -:zephyr_file:`boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb_defconfig` +.. zephyr:board-supported-hw:: Programming and Debugging ========================= +.. zephyr:board-supported-runners:: + Flashing an application ----------------------- diff --git a/boards/ambiq/apollo4p_evb/apollo4p_evb-pinctrl.dtsi b/boards/ambiq/apollo4p_evb/apollo4p_evb-pinctrl.dtsi index dbbb233485e9f..ccfdfd72974ef 100644 --- a/boards/ambiq/apollo4p_evb/apollo4p_evb-pinctrl.dtsi +++ b/boards/ambiq/apollo4p_evb/apollo4p_evb-pinctrl.dtsi @@ -142,7 +142,7 @@ pinmux = ; drive-push-pull; drive-strength = "0.5"; - ambiq,iom-nce-module = <32>; + ambiq,nce-src = <32>; }; }; mspi1_default: mspi1_default{ @@ -155,7 +155,7 @@ pinmux = ; drive-push-pull; drive-strength = "0.5"; - ambiq,iom-nce-module = <34>; + ambiq,nce-src = <34>; }; }; mspi2_default: mspi2_default{ @@ -168,7 +168,28 @@ pinmux = ; drive-push-pull; drive-strength = "0.5"; - ambiq,iom-nce-module = <36>; + ambiq,nce-src = <36>; + }; + }; + sdio0_default: sdio0_default { + group0 { + pinmux = , + , + , + , + , + ; + drive-strength = "1.0"; + }; + group1 { + pinmux = + , + , + , + ; + drive-strength = "1.0"; + bias-pull-up; + ambiq,pull-up-ohms = <12000>; }; }; }; diff --git a/boards/ambiq/apollo4p_evb/apollo4p_evb.dts b/boards/ambiq/apollo4p_evb/apollo4p_evb.dts index a37974d10b91e..cdac604591c0e 100644 --- a/boards/ambiq/apollo4p_evb/apollo4p_evb.dts +++ b/boards/ambiq/apollo4p_evb/apollo4p_evb.dts @@ -26,6 +26,7 @@ sw0 = &button0; sw1 = &button1; rtc = &rtc0; + sdhc0 = &sdio0; }; leds { @@ -94,21 +95,25 @@ status = "okay"; }; -&iom0_i2c { - pinctrl-0 = <&i2c0_default>; - pinctrl-names = "default"; - clock-frequency = ; - scl-gpios = <&gpio0_31 5 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - sda-gpios = <&gpio0_31 6 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; - status = "okay"; +&iom0 { + i2c0: i2c { + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + clock-frequency = ; + scl-gpios = <&gpio0_31 5 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + sda-gpios = <&gpio0_31 6 (GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; + status = "okay"; + }; }; -&iom1_spi { - pinctrl-0 = <&spi1_default>; - pinctrl-names = "default"; - cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; - clock-frequency = <1000000>; - status = "okay"; +&iom1 { + spi1: spi { + pinctrl-0 = <&spi1_default>; + pinctrl-names = "default"; + cs-gpios = <&gpio0_31 11 GPIO_ACTIVE_LOW>; + clock-frequency = <1000000>; + status = "okay"; + }; }; &mspi0 { @@ -150,6 +155,19 @@ clk-source = <3>; }; +&sdio0 { + pinctrl-0 = <&sdio0_default>; + pinctrl-names = "default"; + txdelay = <0>; + rxdelay = <0>; + status = "okay"; + mmc { + compatible = "zephyr,mmc-disk"; + disk-name = "SD2"; + status = "okay"; + }; +}; + zephyr_udc0: &usb { vddusb33-gpios = <&gpio96_127 7 (GPIO_PULL_UP)>; vddusb0p9-gpios = <&gpio96_127 5 (GPIO_PULL_UP)>; diff --git a/boards/ambiq/apollo4p_evb/apollo4p_evb_connector.dtsi b/boards/ambiq/apollo4p_evb/apollo4p_evb_connector.dtsi index e083db991e24d..690ed85437de7 100644 --- a/boards/ambiq/apollo4p_evb/apollo4p_evb_connector.dtsi +++ b/boards/ambiq/apollo4p_evb/apollo4p_evb_connector.dtsi @@ -118,4 +118,4 @@ }; }; -spi1: &iom1_spi {}; +ambiq_spi1: &iom1 {}; diff --git a/boards/ambiq/apollo4p_evb/doc/index.rst b/boards/ambiq/apollo4p_evb/doc/index.rst index d2cc43e5bb41a..ab8ccfd456a5b 100644 --- a/boards/ambiq/apollo4p_evb/doc/index.rst +++ b/boards/ambiq/apollo4p_evb/doc/index.rst @@ -22,36 +22,13 @@ For more information about the Apollo4 Plus SoC and Apollo4P EVB board: Supported Features ================== -The Apollo4P EVB board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| MPU | on-chip | memory protection unit | -+-----------+------------+-------------------------------------+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| STIMER | on-chip | stimer | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial | -+-----------+------------+-------------------------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| SPI(M) | on-chip | spi | -+-----------+------------+-------------------------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+-------------------------------------+ - -The default configuration can be found in -:zephyr_file:`boards/ambiq/apollo4p_evb/apollo4p_evb_defconfig` +.. zephyr:board-supported-hw:: Programming and Debugging ========================= +.. zephyr:board-supported-runners:: + Flashing an application ----------------------- diff --git a/boards/amd/acp_6_0_adsp/acp_6_0_acp_adsp.dts b/boards/amd/acp_6_0_adsp/acp_6_0_adsp.dts similarity index 100% rename from boards/amd/acp_6_0_adsp/acp_6_0_acp_adsp.dts rename to boards/amd/acp_6_0_adsp/acp_6_0_adsp.dts diff --git a/boards/amd/acp_6_0_adsp/doc/index.rst b/boards/amd/acp_6_0_adsp/doc/index.rst index fcc9221eafc27..2812516f28ef7 100644 --- a/boards/amd/acp_6_0_adsp/doc/index.rst +++ b/boards/amd/acp_6_0_adsp/doc/index.rst @@ -26,15 +26,7 @@ Hardware Supported Features ================== -The following hardware features are supported: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| I2S | on-chip | I2S controller | -+-----------+------------+-------------------------------------+ -| DMIC(PDM) | on-chip | PDM controller | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System Clock ============ @@ -77,6 +69,8 @@ The bottom three variables are specific to acp_6_0. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Building ======== diff --git a/boards/amd/kv260_r5/doc/index.rst b/boards/amd/kv260_r5/doc/index.rst index 9383dbd9df616..d939718e58aa4 100644 --- a/boards/amd/kv260_r5/doc/index.rst +++ b/boards/amd/kv260_r5/doc/index.rst @@ -19,20 +19,7 @@ Hardware Supported Features ================== -The following hardware features are supported: - -+--------------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+==============+============+======================+ -| GIC | on-chip | generic interrupt | -| | | controller | -+--------------+------------+----------------------+ -| TTC | on-chip | system timer | -+--------------+------------+----------------------+ -| UART | on-chip | serial port | -+--------------+------------+----------------------+ - -The kernel currently does not support other hardware features on this platform. +.. zephyr:board-supported-hw:: Devices ======== @@ -68,6 +55,8 @@ The following platform features are unsupported: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Currently the best way to run this sample is by loading it through remoteproc from the APU, running Linux, to the RPU, assuming the target board has a compatible Linux kernel. diff --git a/boards/amd/kv260_r5/kv260_r5.dts b/boards/amd/kv260_r5/kv260_r5.dts index 85fb1c2689179..53ec1923e5d0c 100644 --- a/boards/amd/kv260_r5/kv260_r5.dts +++ b/boards/amd/kv260_r5/kv260_r5.dts @@ -19,6 +19,17 @@ zephyr,shell-uart = &uart1; zephyr,ocm = &ocm; }; + + aliases { + eeprom-0 = &eeprom0; + eeprom-1 = &eeprom1; + }; + + i2c_ref_clk: i2c_ref_clk { + compatible = "fixed-clock"; + clock-frequency = <100000000>; + #clock-cells = <0>; + }; }; &uart1 { @@ -35,3 +46,29 @@ &psgpio { status = "okay"; }; + +&i2c1 { + status = "okay"; + clocks = <&i2c_ref_clk>; + clock-frequency = <400000>; + + eeprom0: eeprom@50 { + compatible = "st,24c64", "atmel,at24"; + reg = <0x50>; + size = ; + pagesize = <32>; + address-width = <16>; + timeout = <5>; + read-only; + }; + + eeprom1: eeprom@51 { + compatible = "st,24c64", "atmel,at24"; + reg = <0x51>; + size = ; + pagesize = <32>; + address-width = <16>; + timeout = <5>; + read-only; + }; +}; diff --git a/boards/amd/kv260_r5/kv260_r5.yaml b/boards/amd/kv260_r5/kv260_r5.yaml index 9cc92025e91e2..aa13a0350d58b 100644 --- a/boards/amd/kv260_r5/kv260_r5.yaml +++ b/boards/amd/kv260_r5/kv260_r5.yaml @@ -5,6 +5,10 @@ toolchain: - zephyr ram: 65536 flash: 32768 +supported: + - i2c + - eeprom + - gpio testing: ignore_tags: - net diff --git a/boards/amd/kv260_r5/kv260_r5_defconfig b/boards/amd/kv260_r5/kv260_r5_defconfig index 4b86de20d6b92..f1bfa8f670740 100644 --- a/boards/amd/kv260_r5/kv260_r5_defconfig +++ b/boards/amd/kv260_r5/kv260_r5_defconfig @@ -13,5 +13,9 @@ CONFIG_UART_CONSOLE=y # Enable serial port CONFIG_UART_XLNX_PS=y +# Enable I2C, EEPROM +CONFIG_I2C=y +CONFIG_EEPROM=y + CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 CONFIG_ARM_MPU=y diff --git a/boards/amd/versalnet_rpu/Kconfig.versalnet_rpu b/boards/amd/versalnet_rpu/Kconfig.versalnet_rpu new file mode 100644 index 0000000000000..192725829dbaa --- /dev/null +++ b/boards/amd/versalnet_rpu/Kconfig.versalnet_rpu @@ -0,0 +1,8 @@ +# +# Copyright (c) 2025 Advanced Micro Devices, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +config BOARD_VERSALNET_RPU + select SOC_AMD_VERSALNET_RPU diff --git a/boards/amd/versalnet_rpu/board.cmake b/boards/amd/versalnet_rpu/board.cmake new file mode 100644 index 0000000000000..a624cc396d3c9 --- /dev/null +++ b/boards/amd/versalnet_rpu/board.cmake @@ -0,0 +1,7 @@ +# +# Copyright (c) 2025 Advanced Micro Devices, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +include(${ZEPHYR_BASE}/boards/common/xsdb.board.cmake) diff --git a/boards/amd/versalnet_rpu/board.yml b/boards/amd/versalnet_rpu/board.yml new file mode 100644 index 0000000000000..6135a69a6ab13 --- /dev/null +++ b/boards/amd/versalnet_rpu/board.yml @@ -0,0 +1,6 @@ +board: + name: versalnet_rpu + full_name: Versal NET RPU development board + vendor: amd + socs: + - name: amd_versalnet_rpu diff --git a/boards/amd/versalnet_rpu/doc/index.rst b/boards/amd/versalnet_rpu/doc/index.rst new file mode 100644 index 0000000000000..35d3ea5f22df7 --- /dev/null +++ b/boards/amd/versalnet_rpu/doc/index.rst @@ -0,0 +1,75 @@ +.. zephyr:board:: versalnet_rpu + +Overview +******** +This configuration provides support for the RPU(R52), real-time processing unit on Xilinx +Versal Net SOC, it can operate as following: + +* Two independent R52 cores with their own TCMs (tightly coupled memories) +* Or as a single dual lock step unit with the TCM. + +This processing unit is based on an ARM Cortex-R52 CPU, it also enables the following devices: + +* ARM GIC v3 Interrupt Controller +* Global Timer Counter +* SBSA UART + +Hardware +******** +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Devices +======== +System Timer +------------ + +This board configuration uses a system timer tick frequency of 100 MHz. + +Serial Port +----------- + +This board configuration uses a single serial communication channel with the +on-chip UART0. + +Memories +-------- + +Although Flash, DDR and OCM memory regions are defined in the DTS file, +all the code plus data of the application will be loaded in the sram0 region, +which points to the DDR memory. The ocm0 memory area is currently available +for usage, although nothing is placed there by default. + +Known Problems or Limitations +============================== + +The following platform features are unsupported: + +* Only the first core of the R52 subsystem is supported. + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Build and flash in the usual way. Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: versalnet_rpu + :goals: build flash + +You should see the following message on the console: + +.. code-block:: console + + Hello World! + + +References +********** + +1. ARMv8-R Architecture Reference Manual (ARM DDI 0568A.c ID110520) +2. Cortex-R52 and Cortex-R52F Technical Reference Manual (ARM DDI r1p4 100026_0104_01_en) diff --git a/boards/amd/versalnet_rpu/support/xsdb.cfg b/boards/amd/versalnet_rpu/support/xsdb.cfg new file mode 100644 index 0000000000000..087ed4c85c113 --- /dev/null +++ b/boards/amd/versalnet_rpu/support/xsdb.cfg @@ -0,0 +1,44 @@ +# Copyright (c) 2025 Advanced Micro Devices, Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +proc load_image args { + set elf_file [lindex $args 0] + + if { [info exists ::env(HW_SERVER_URL)] } { + connect -url $::env(HW_SERVER_URL) + } else { + connect + } + + after 100 + targets -set -nocase -filter {name =~ "Versal*"} + after 100 + rst -system + after 100 + + if { [info exists ::env(PDI_FILE_PATH)] } { + device program $::env(PDI_FILE_PATH) + } else { + puts "Error: env variable PDI_FILE_PATH is not set" + exit + } + + after 100 + targets -set -nocase -filter {name =~ "DPC"} + after 100 + # Configure timestamp generator to run global timer gracefully + # Ideally these registers should be set from bootloader (cdo) + mwr -force 0xeb5b0000 0x1 + mwr -force 0xeb5b0020 100000000 + after 100 + + targets -set -nocase -filter {name =~ "*Cortex-R52 #0.0"} + rst -proc + after 100 + dow -force $elf_file + con + exit +} + +load_image {*}$argv diff --git a/boards/amd/versalnet_rpu/versalnet_rpu.dts b/boards/amd/versalnet_rpu/versalnet_rpu.dts new file mode 100644 index 0000000000000..73d034e20cb6a --- /dev/null +++ b/boards/amd/versalnet_rpu/versalnet_rpu.dts @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025, Advanced Micro Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + chosen { + zephyr,sram = &sram0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,ocm = &ocm; + }; +}; + +&cpu0 { + clock-frequency = <100000000>; +}; + +&soc { + sram0: memory@0 { + compatible = "mmio-sram"; + reg = <0x00000 DT_SIZE_M(2048)>; + }; +}; + +&ocm { + status = "okay"; +}; + +&uart1 { + status = "okay"; + current-speed = <115200>; + clock-frequency = <100000000>; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + clock-frequency = <100000000>; +}; diff --git a/boards/amd/versalnet_rpu/versalnet_rpu.yaml b/boards/amd/versalnet_rpu/versalnet_rpu.yaml new file mode 100644 index 0000000000000..eccdf0ae37b5d --- /dev/null +++ b/boards/amd/versalnet_rpu/versalnet_rpu.yaml @@ -0,0 +1,10 @@ +identifier: versalnet_rpu +name: AMD Development board for Versal NET RPU +arch: arm +toolchain: + - zephyr +testing: + ignore_tags: + - net + - bluetooth +vendor: amd diff --git a/boards/amd/versalnet_rpu/versalnet_rpu_defconfig b/boards/amd/versalnet_rpu/versalnet_rpu_defconfig new file mode 100644 index 0000000000000..4aec6a299f379 --- /dev/null +++ b/boards/amd/versalnet_rpu/versalnet_rpu_defconfig @@ -0,0 +1,9 @@ +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable serial port +CONFIG_UART_PL011=y diff --git a/boards/andestech/adp_xc7k_ae350/doc/index.rst b/boards/andestech/adp_xc7k_ae350/doc/index.rst index 3e290dd2f284b..42767445c55c7 100644 --- a/boards/andestech/adp_xc7k_ae350/doc/index.rst +++ b/boards/andestech/adp_xc7k_ae350/doc/index.rst @@ -1,7 +1,4 @@ -.. _adp_xc7k_ae350: - -Andes ADP-XC7K AE350 -#################### +.. zephyr:board:: adp_xc7k Overview ******** @@ -52,40 +49,7 @@ The ADP-XC7K AE350 platform provides following hardware components: Supported Features ================== -The ``adp_xc7k/ae350`` board configuration supports the following hardware features: - -+----------------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+================+============+======================+ -| PLIC | on-chip | interrupt_controller | -+----------------+------------+----------------------+ -| RISC-V Machine | on-chip | timer | -| Timer | | | -+----------------+------------+----------------------+ -| GPIO | on-chip | gpio | -+----------------+------------+----------------------+ -| UART | on-chip | serial | -+----------------+------------+----------------------+ -| COUNTER | on-chip | counter | -+----------------+------------+----------------------+ -| SPI | on-chip | spi | -+----------------+------------+----------------------+ -| I2C | on-chip | i2c | -+----------------+------------+----------------------+ -| EEPROM | on-chip | eeprom | -+----------------+------------+----------------------+ -| FLASH | on-chip | flash | -+----------------+------------+----------------------+ -| HWINFO | on-chip | syscon | -+----------------+------------+----------------------+ -| MAILBOX | on-chip | mbox | -+----------------+------------+----------------------+ -| DMA | on-chip | dma | -+----------------+------------+----------------------+ -| WATCHDOG | on-chip | wdt | -+----------------+------------+----------------------+ - -Other hardware features are not supported yet. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -206,6 +170,8 @@ settings are 115200 8N1. Programming and debugging ************************* +.. zephyr:board-supported-runners:: + For debugging zephyr applications or burning them into a flash, you will need to connect Andes ICE from host computer to ADP-XC7K board and execute the Andes ICE management software, ICEman, on this host computer. diff --git a/boards/antmicro/index.rst b/boards/antmicro/index.rst index 34beaee93d25d..d7393218659c9 100644 --- a/boards/antmicro/index.rst +++ b/boards/antmicro/index.rst @@ -1,7 +1,7 @@ .. _boards-antmicro: Antmicro -### +######## .. toctree:: :maxdepth: 1 diff --git a/boards/antmicro/myra_sip_baseboard/doc/index.rst b/boards/antmicro/myra_sip_baseboard/doc/index.rst index ee33397e453de..0eb273c524557 100644 --- a/boards/antmicro/myra_sip_baseboard/doc/index.rst +++ b/boards/antmicro/myra_sip_baseboard/doc/index.rst @@ -116,48 +116,7 @@ Other board's peripherals: Supported Features ------------------ -The Zephyr ``myra_sip_baseboard`` board target supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; serial | -| | | port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | independent watchdog | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac controller | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| EEPROM | on-chip | eeprom | -+-----------+------------+-------------------------------------+ -| NVS | on-chip | nvs | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | rtc | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| die-temp | on-chip | die temperature sensor | -+-----------+------------+-------------------------------------+ -| FDCAN1 | on-chip | can controller | -+-----------+------------+-------------------------------------+ -| RTC | on-chip | rtc | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on this Zephyr port. +.. zephyr:board-supported-hw:: Connections and IOs ------------------- @@ -213,6 +172,8 @@ settings are 115200 8N1. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``myra_sip_baseboard`` board target can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). Flashing diff --git a/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.dts b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.dts index e2d011fddf01a..fc815cd352b82 100644 --- a/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.dts +++ b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.dts @@ -55,6 +55,7 @@ volt-sensor0 = &vref; volt-sensor1 = &vbat; rtc = &rtc; + eeprom-0 = &mb85rs1mt; }; }; diff --git a/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.yaml b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.yaml index 5979e67fd174c..77fe8017c5d8a 100644 --- a/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.yaml +++ b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.yaml @@ -19,6 +19,7 @@ supported: - can - rtc - sensors + - eeprom testing: timeout_multiplier: 3 renode: diff --git a/boards/arduino/due/arduino_due-pinctrl.dtsi b/boards/arduino/due/arduino_due-pinctrl.dtsi index 08f369eed7dc2..410df4f7eea4a 100644 --- a/boards/arduino/due/arduino_due-pinctrl.dtsi +++ b/boards/arduino/due/arduino_due-pinctrl.dtsi @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include &pinctrl { twi0_default: twi0_default { @@ -53,10 +53,25 @@ }; }; + spi0_default: spi0_default { + group1 { + pinmux = , + , + ; + }; + }; + pwm0_default: pwm0_default { group1 { pinmux = , ; }; }; + + adc0_default: adc0_default { + group1 { + pinmux = , + ; + }; + }; }; diff --git a/boards/arduino/due/arduino_due.dts b/boards/arduino/due/arduino_due.dts index bbfc92b110c7c..0e9c4693abe41 100644 --- a/boards/arduino/due/arduino_due.dts +++ b/boards/arduino/due/arduino_due.dts @@ -4,6 +4,7 @@ #include #include "arduino_due-pinctrl.dtsi" +#include "arduino_r3_connector.dtsi" / { model = "Arduino Due with an Atmel SAM3X8E SoC"; @@ -57,6 +58,13 @@ pinctrl-names = "default"; }; +&spi0 { + status = "okay"; + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; + cs-gpios = <&pioa 28 GPIO_ACTIVE_LOW>; +}; + &uart { status = "okay"; current-speed = <115200>; diff --git a/boards/arduino/due/arduino_due.yaml b/boards/arduino/due/arduino_due.yaml index b8beeac60c925..12f9ba82ad431 100644 --- a/boards/arduino/due/arduino_due.yaml +++ b/boards/arduino/due/arduino_due.yaml @@ -8,6 +8,7 @@ toolchain: flash: 512 ram: 96 supported: + - adc - arduino_i2c - gpio - watchdog diff --git a/boards/arduino/due/arduino_r3_connector.dtsi b/boards/arduino/due/arduino_r3_connector.dtsi new file mode 100644 index 0000000000000..16fcfa2674fce --- /dev/null +++ b/boards/arduino/due/arduino_r3_connector.dtsi @@ -0,0 +1,36 @@ +/* + * Copyright 2025 Arduino SA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + arduino_header: connector { + compatible = "arduino-header-r3"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = < 0 0 &pioa 16 0>, /* A0 */ + < 1 0 &pioa 24 0>, /* A1 */ + < 2 0 &pioa 23 0>, /* A2 */ + < 3 0 &pioa 22 0>, /* A3 */ + < 4 0 &pioa 6 0>, /* A4 */ + < 5 0 &pioa 4 0>, /* A5 */ + < 6 0 &pioa 8 0>, /* D0 */ + < 7 0 &pioa 9 0>, /* D1 */ + < 8 0 &piob 25 0>, /* D2 */ + < 9 0 &pioc 28 0>, /* D3 */ + <10 0 &pioa 29 0>, /* D4 */ + <11 0 &pioc 25 0>, /* D5 */ + <12 0 &pioc 24 0>, /* D6 */ + <13 0 &pioc 23 0>, /* D7 */ + <14 0 &pioc 22 0>, /* D8 */ + <15 0 &pioc 21 0>, /* D9 */ + <16 0 &pioa 28 0>, /* D10 */ + <17 0 &piod 7 0>, /* D11 */ + <18 0 &piod 8 0>, /* D12 */ + <19 0 &piob 27 0>, /* D13 */ + <20 0 &pioa 17 0>, /* D20 */ + <21 0 &pioa 18 0>; /* D21 */ + }; +}; diff --git a/boards/arduino/due/doc/index.rst b/boards/arduino/due/doc/index.rst index e1eda346744cc..9bce2aa68e3bc 100644 --- a/boards/arduino/due/doc/index.rst +++ b/boards/arduino/due/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_due: - -Arduino Due -########### +.. zephyr:board:: arduino_due Overview ******** @@ -23,41 +20,17 @@ the processor. .. note:: This configuration is not supported by Arduino. -.. image:: img/arduino_due.jpg - :align: center - :alt: Arduino Due - Hardware ******** + Supported Features ================== -The arduino_due board configuration supports the following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+----------------------+ -| UART | on-chip | serial port | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C | on-chip | i2c | -+-----------+------------+----------------------+ -| Watchdog | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features are not currently supported by the Zephyr kernel. +.. zephyr:board-supported-hw:: + See `Arduino Due website`_ and `Atmel SAM3X8E Datasheet`_ for a complete list of Arduino Due board hardware features. -The default configuration can be found in the Kconfig -:zephyr_file:`boards/arduino/due/arduino_due_defconfig`. - .. note:: For I2C, pull-up resistors are required for using SCL1 and SDA1 (near IO13). @@ -131,6 +104,8 @@ default, is utilizing this controller. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts index 5d6e0dd7d883c..7505ba0f2df7a 100644 --- a/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts +++ b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.dts @@ -252,3 +252,9 @@ zephyr_udc0: &usbotg_fs { pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>; pinctrl-names = "default"; }; + +/* alias used by display shields */ +zephyr_mipi_dsi: &mipi_dsi {}; + +/* alias used by LCD display shields */ +zephyr_lcd_controller: <dc {}; diff --git a/boards/arduino/giga_r1/doc/index.rst b/boards/arduino/giga_r1/doc/index.rst index 696844a71fabb..508f6363151cd 100644 --- a/boards/arduino/giga_r1/doc/index.rst +++ b/boards/arduino/giga_r1/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_giga_r1_board: - -Arduino GIGA R1 WiFi -#################### +.. zephyr:board:: arduino_giga_r1 Overview ******** @@ -22,10 +19,6 @@ The board features: - Audio jack - ATECC608A secure element -.. image:: img/arduino_giga_r1.jpg - :align: center - :alt: Arduino GIGA R1 WiFi - More information about the board, including the datasheet, pinout and schematics, can be found at the `Arduino GIGA website`_. @@ -38,39 +31,7 @@ More information about STM32H747XIH6 can be found here: Supported Features ================== -The current Zephyr ``arduino_giga_r1_m7`` board configuration supports the -following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| RNG | on-chip | True Random number generator | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| IPM | on-chip | virtual mailbox based on HSEM | -+-----------+------------+-------------------------------------+ -| FMC | on-chip | memc (SDRAM) | -+-----------+------------+-------------------------------------+ -| QSPI | on-chip | QSPI flash | -+-----------+------------+-------------------------------------+ -| RADIO | Murata 1DX | WiFi and Bluetooth module | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on Zephyr port. +.. zephyr:board-supported-hw:: Fetch Binary Blobs ****************** @@ -102,6 +63,8 @@ two cores. This is done in 3 ways: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``arduino_giga_r1`` board should be built per core target, using either ``arduino_giga_r1/stm32h747xx/m7`` or ``arduino_giga_r1/stm32h747xx/m4`` as the target. diff --git a/boards/arduino/mkrzero/doc/index.rst b/boards/arduino/mkrzero/doc/index.rst index b6f92d9693025..3e52815213177 100644 --- a/boards/arduino/mkrzero/doc/index.rst +++ b/boards/arduino/mkrzero/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_mkrzero: - -Arduino MKR Zero -#################### +.. zephyr:board:: arduino_mkrzero Overview ******** @@ -9,10 +6,6 @@ Overview The Arduino MKR Zero built with smaller MKR form factor and powered by Atmel's SAMD21 MCU. This board come with microSD card holder that allows you to play with music files with no extra hardware. -.. image:: img/arduino_mkrzero.jpg - :align: center - :alt: Arduino MKR Zero - Hardware ******** @@ -27,46 +20,7 @@ Hardware Supported Features ================== -The arduino_mkrzero board configuration supports the following hardware -features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| ADC | on-chip | Analog to digital converter | -+-----------+------------+------------------------------------------+ -| COUNTER | on-chip | Pulse counter | -+-----------+------------+------------------------------------------+ -| DMA | on-chip | Direct memory access unit | -+-----------+------------+------------------------------------------+ -| Flash | on-chip | Can be used with LittleFS to store files | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| HWINFO | on-chip | Hardware info and serial number | -+-----------+------------+------------------------------------------+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| PWM | on-chip | Pulse Width Modulation | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface ports | -+-----------+------------+------------------------------------------+ -| I2C | on-chip | Inter-Integrated Circuit ports | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial ports | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ - - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/arduino/mkrzero/arduino_mkrzero_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -124,6 +78,8 @@ Arduino MKR Zero, the DAC is available on pin A0. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Arduino MKR Zero ships the BOSSA compatible bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/arduino/nano_33_ble/doc/index.rst b/boards/arduino/nano_33_ble/doc/index.rst index 2b5ede0ea114f..753209f349dea 100644 --- a/boards/arduino/nano_33_ble/doc/index.rst +++ b/boards/arduino/nano_33_ble/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_nano_33_ble: - -Arduino Nano 33 BLE (Sense) -################################# +.. zephyr:board:: arduino_nano_33_ble Overview ******** @@ -11,58 +8,13 @@ nRF52840 ARM Cortex-M4F CPU. Arduino sells 2 variants of the board, the plain `BLE`_ type and the `BLE Sense`_ type. The "Sense" variant is distinguished by the inclusion of more sensors, but otherwise both variants are the same. -.. image:: img/arduino_nano_33_ble_sense.jpg - :align: center - :alt: Arduino Nano 33 BLE (Sense variant) - -The Sense variant of the board - Hardware ******** Supported Features ================== -The package is configured to support the following hardware: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C0 | on-chip | i2c | -+-----------+------------+----------------------+ -| I2C1 | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| SPI | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. - -Notably, this includes the PDM (microphone) interface. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -77,6 +29,8 @@ as ``pull-up-gpios``. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + This board requires the Arduino variant of bossac. You will not be able to flash with the bossac included with the zephyr-sdk, or using shumatech's mainline build. diff --git a/boards/arduino/nano_33_iot/doc/index.rst b/boards/arduino/nano_33_iot/doc/index.rst index 419c02a5ceac3..14c76bc9e25e6 100644 --- a/boards/arduino/nano_33_iot/doc/index.rst +++ b/boards/arduino/nano_33_iot/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_nano_33_iot: - -Arduino Nano 33 IOT -################### +.. zephyr:board:: arduino_nano_33_iot Overview ******** @@ -9,10 +6,6 @@ Overview The Arduino Nano 33 IOT is a small form factor development board with USB, Wifi, Bluetooth, a 6 axis IMU, and secure element. -.. image:: img/nano_33_iot.jpg - :align: center - :alt: Arduino Nano 33 IOT - Hardware ******** @@ -28,43 +21,7 @@ Hardware Supported Features ================== -The arduino_nano_33_iot board configuration supports the following hardware -features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| ADC | on-chip | Analog to digital converter | -+-----------+------------+------------------------------------------+ -| COUNTER | on-chip | Pulse counter | -+-----------+------------+------------------------------------------+ -| DMA | on-chip | Direct memory access unit | -+-----------+------------+------------------------------------------+ -| Flash | on-chip | Can be used with LittleFS to store files | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| HWINFO | on-chip | Hardware info and serial number | -+-----------+------------+------------------------------------------+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| PWM | on-chip | Pulse Width Modulation | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface ports | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial ports | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/arduino/nano_33_iot/arduino_nano_33_iot_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -109,6 +66,8 @@ serial port that echos characters back to the host PC. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Nano 33 IOT ships the BOSSA compatible UF2 bootloader. The bootloader can be entered by quickly tapping the reset button twice. diff --git a/boards/arduino/nicla_sense_me/doc/index.rst b/boards/arduino/nicla_sense_me/doc/index.rst index 1bf984f23f4fb..826fb2f42013f 100644 --- a/boards/arduino/nicla_sense_me/doc/index.rst +++ b/boards/arduino/nicla_sense_me/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_nicla_sense_me: - -Arduino Nicla Sense ME -###################### +.. zephyr:board:: arduino_nicla_sense_me Overview ******** @@ -10,12 +7,6 @@ nrf52832 ARM Cortex-M4F CPU. The board houses 4 low power industrial grade senso that can measure rotation, acceleration, pressure, humidity, temperature, air quality and CO2 levels. -.. figure:: arduino_nicla_sense_me.jpg - :align: center - :alt: Arduino Nicla Sense ME - - Arduino Nicla Sense ME (Credit: Arduino) - Hardware ******** @@ -39,35 +30,7 @@ Hardware Supported Features ================== -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M/S) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth Low Energy | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -85,6 +48,8 @@ For more details please refer to the `datasheet`_, `full pinout`_ and the `schem Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``arduino_nicla_sense_me`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/arduino/nicla_vision/doc/index.rst b/boards/arduino/nicla_vision/doc/index.rst index 73b2d7cd7337e..f9cc62c6ee17e 100644 --- a/boards/arduino/nicla_vision/doc/index.rst +++ b/boards/arduino/nicla_vision/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_nicla_vision_board: - -Arduino Nicla Vision -#################### +.. zephyr:board:: arduino_nicla_vision Overview ******** @@ -38,53 +35,7 @@ More information about STM32H747GAII6 can be found here: Supported Features ================== -The current Zephyr ``arduino_nicla_vision/stm32h747xx/m7`` board configuration supports the -following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| RNG | on-chip | True Random number generator | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| DCMI | on-chip | Parallel Camera interface | -+-----------+------------+-------------------------------------+ -| IPM | on-chip | virtual mailbox based on HSEM | -+-----------+------------+-------------------------------------+ -| RADIO | Murata 1DX | WiFi and Bluetooth module | -+-----------+------------+-------------------------------------+ - -And the ``arduino_nicla_vision/stm32h747xx/m4`` has the following -support from Zephyr: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on Zephyr port. +.. zephyr:board-supported-hw:: Fetch Binary Blobs ****************** @@ -116,6 +67,8 @@ two cores. This is done in 3 ways: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``arduino_nicla_vision`` board should be built per core target, using either ``arduino_nicla_vision/stm32h747xx/m7`` or ``arduino_nicla_vision/stm32h747xx/m4`` as the target. diff --git a/boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts b/boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts index d1b63e91e52cf..9580656581fb2 100644 --- a/boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts +++ b/boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts @@ -107,6 +107,8 @@ zephyr_udc0: &usbotg_fs { ð_txd0_pg13 >; pinctrl-names = "default"; + phy-connection-type = "rmii"; + phy-handle = <ð_phy>; status = "okay"; }; @@ -115,9 +117,8 @@ zephyr_udc0: &usbotg_fs { pinctrl-names = "default"; status = "okay"; - ethernet-phy@0 { + eth_phy: ethernet-phy@0 { compatible = "ethernet-phy"; reg = <0x00>; - status = "okay"; }; }; diff --git a/boards/arduino/opta/doc/index.rst b/boards/arduino/opta/doc/index.rst index 8c6aa78848717..4b131659355d0 100644 --- a/boards/arduino/opta/doc/index.rst +++ b/boards/arduino/opta/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_opta_m4_board: - -Arduino OPTA -############ +.. zephyr:board:: arduino_opta Overview ******** @@ -31,10 +28,6 @@ Additionally, the device features: - 8 x analog inputs - 4 x isolated relay outputs -.. image:: img/arduino_opta.jpeg - :align: center - :alt: ARDUINO-OPTA - More information about the board can be found at the `ARDUINO-OPTA website`_. More information about STM32H747XIH6 can be found here: @@ -45,55 +38,7 @@ More information about STM32H747XIH6 can be found here: Supported Features ================== -The ``arduino_opta/stm32h747xx/m7`` board target -supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| RNG | on-chip | True Random number generator | -+-----------+------------+-------------------------------------+ -| IPM | on-chip | virtual mailbox based on HSEM | -+-----------+------------+-------------------------------------+ -| USB | on-board | usb-fs | -+-----------+------------+-------------------------------------+ -| ETHERNET | on-board | eth | -+-----------+------------+-------------------------------------+ -| RS485 | on-board | uart | -+-----------+------------+-------------------------------------+ - -The ``arduino_opta/stm32h747xx/m4`` board target -supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| RNG | on-chip | True Random number generator | -+-----------+------------+-------------------------------------+ -| IPM | on-chip | virtual mailbox based on HSEM | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on Zephyr porting. - -The default configuration per core can be found in the defconfig files: -:zephyr_file:`boards/arduino/opta/arduino_opta_stm32h747xx_m4_defconfig` and -:zephyr_file:`boards/arduino/opta/arduino_opta_stm32h747xx_m7_defconfig`. +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -153,6 +98,8 @@ two cores. This is done in 3 ways: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``arduino_opta`` use the regular Zephyr build commands. See :ref:`build_an_application` for more information about application builds. diff --git a/boards/arduino/opta/dts/bindings/gpio-power-switches.yaml b/boards/arduino/opta/dts/bindings/gpio-power-switches.yaml index 580288b2382ae..8036df3c65e45 100644 --- a/boards/arduino/opta/dts/bindings/gpio-power-switches.yaml +++ b/boards/arduino/opta/dts/bindings/gpio-power-switches.yaml @@ -2,9 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 description: | - This allows to define a group of relays (like in the original Opta) - or other kinds of power switches controlled by a GPIO. Each power - switch is defined in a child node of the gpio-power-switches node. + Group of relays (like in the original Opta) or other kinds of power switches controlled by a GPIO. + + Each power switch is defined in a child node of the gpio-power-switches node. compatible: "gpio-power-switches" diff --git a/boards/arduino/portenta_h7/Kconfig.defconfig b/boards/arduino/portenta_h7/Kconfig.defconfig index b2a4abd35e733..3a59127ffa711 100644 --- a/boards/arduino/portenta_h7/Kconfig.defconfig +++ b/boards/arduino/portenta_h7/Kconfig.defconfig @@ -5,6 +5,9 @@ if BOARD_ARDUINO_PORTENTA_H7 if NETWORKING +config REGULATOR + default y + config NET_L2_ETHERNET default y diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7-common.dtsi b/boards/arduino/portenta_h7/arduino_portenta_h7-common.dtsi index 7a61e830e5267..d7489b77d261f 100644 --- a/boards/arduino/portenta_h7/arduino_portenta_h7-common.dtsi +++ b/boards/arduino/portenta_h7/arduino_portenta_h7-common.dtsi @@ -209,17 +209,33 @@ }; }; +&rng { + status = "okay"; +}; + &mac { pinctrl-0 = < ð_ref_clk_pa1 - ð_mdio_pa2 ð_crs_dv_pa7 - ð_mdc_pc1 ð_rxd0_pc4 ð_rxd1_pc5 ð_tx_en_pg11 ð_txd1_pg12 ð_txd0_pg13 >; pinctrl-names = "default"; + phy-connection-type = "rmii"; + phy-handle = <ð_phy>; + status = "okay"; +}; + +&mdio { + status = "okay"; + pinctrl-0 = <ð_mdio_pa2 ð_mdc_pc1>; + pinctrl-names = "default"; + + eth_phy: ethernet-phy@0 { + compatible = "ethernet-phy"; + reg = <0x00>; + }; }; zephyr_udc0: &usbotg_hs { diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts index 3a3745c5a7d57..001d8509059e2 100644 --- a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts +++ b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.dts @@ -86,6 +86,54 @@ &i2c1 { status = "okay"; + + pf1550: pmic@8 { + status = "okay"; + reg = <0x8>; + compatible = "nxp,pf1550"; + + pmic_regulators: regulators { + status = "okay"; + compatible = "nxp,pf1550-regulator"; + pf1550_sw1: BUCK1 { + regulator-init-microvolt = <3000000>; + regulator-boot-on; + }; + pf1550_sw2: BUCK2 { + regulator-init-microvolt = <3300000>; + regulator-boot-on; + }; + pf1550_sw3: BUCK3 { + regulator-init-microvolt = <3300000>; + regulator-init-microamp = <2000000>; + regulator-boot-on; + }; + pf1550_ldo1: LDO1 { + regulator-init-microvolt = <1000000>; + regulator-boot-on; + }; + pf1550_ldo2: LDO2 { + regulator-init-microvolt = <1800000>; + regulator-boot-on; + }; + pf1550_ldo3: LDO3 { + regulator-init-microvolt = <1200000>; + regulator-boot-on; + }; + }; + + pmic_charger: charger { + status = "okay"; + compatible = "nxp,pf1550-charger"; + constant-charge-current-max-microamp = <100000>; + constant-charge-voltage-max-microvolt = <4200000>; + pf1550,int-gpios = <&gpiok 0 0>; + pf1550,led-behaviour = "manual-off"; + pf1550,system-voltage-min-threshold-microvolt = <3500000>; + pf1550,thermistor-monitoring-mode = "thermistor"; + pf1550,vbus-current-limit-microamp = <1500000>; + }; + }; }; /* Only one should be enabled */ diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.yaml b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.yaml deleted file mode 100644 index e4179c6e5b9c6..0000000000000 --- a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.yaml +++ /dev/null @@ -1,12 +0,0 @@ -identifier: arduino_portenta_h7/stm32h747xx/m7 -name: Arduino Portenta H7 (M7) -type: mcu -arch: arm -toolchain: - - zephyr - - gnuarmemb -ram: 512 -flash: 1024 -supported: - - gpio -vendor: arduino diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_1_0_0.yaml b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_1_0_0.yaml new file mode 100644 index 0000000000000..7dc36b141900d --- /dev/null +++ b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_1_0_0.yaml @@ -0,0 +1,18 @@ +identifier: arduino_portenta_h7@1.0.0/stm32h747xx/m7 +name: Arduino Portenta H7 (M7) rev. 1.0.0 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 512 +flash: 1024 +supported: + - gpio + - netif:eth + - i2c + - spi + - qspi + - memc + - usb_device +vendor: arduino diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_4_10_0.yaml b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_4_10_0.yaml new file mode 100644 index 0000000000000..456ae5871e3b0 --- /dev/null +++ b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_4_10_0.yaml @@ -0,0 +1,19 @@ +identifier: arduino_portenta_h7@4.10.0/stm32h747xx/m7 +name: Arduino Portenta H7 (M7) rev. 4.10.0 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 512 +flash: 1024 +supported: + - gpio + - netif:eth + - i2c + - spi + - qspi + - memc + - usb_cdc + - usb_device +vendor: arduino diff --git a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_defconfig b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_defconfig index acc978d70c986..a67b6f27c0017 100644 --- a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_defconfig +++ b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7_defconfig @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # Enable the internal SMPS regulator -CONFIG_POWER_SUPPLY_DIRECT_SMPS=y +CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_LDO=y # Enable GPIO CONFIG_GPIO=y diff --git a/boards/arduino/portenta_h7/doc/index.rst b/boards/arduino/portenta_h7/doc/index.rst index 2d1d167065e7a..85d3212a616b7 100644 --- a/boards/arduino/portenta_h7/doc/index.rst +++ b/boards/arduino/portenta_h7/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_portenta_h7_board: - -Arduino Portenta H7 -################### +.. zephyr:board:: arduino_portenta_h7 Overview ******** @@ -19,12 +16,6 @@ Additionally, the board features: - USB OTG FS - 3 color user LEDs -.. image:: img/arduino_portenta_h7.jpeg - :width: 500px - :align: center - :height: 325px - :alt: ARDUINO_PORTENTA_H7 - More information about the board can be found at the `ARDUINO_PORTENTA_H7 website`_. More information about STM32H747XIH6 can be found here: @@ -35,40 +26,7 @@ More information about STM32H747XIH6 can be found here: Supported Features ================== -The current Zephyr arduino_portenta_h7 board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| RNG | on-chip | True Random number generator | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| IPM | on-chip | virtual mailbox based on HSEM | -+-----------+------------+-------------------------------------+ -| EXTFLASH | on-chip | qspi | -+-----------+------------+-------------------------------------+ -| SDRAM | on-chip | sdram | -+-----------+------------+-------------------------------------+ -| USB | on-board | usb-hs | -+-----------+------------+-------------------------------------+ -| ETHERNET | on-board | eth | -+-----------+------------+-------------------------------------+ -| RADIO | Murata 1DX | WiFi and Bluetooth module | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on Zephyr porting. +.. zephyr:board-supported-hw:: The high precision low speed external (LSE) clock is only fully supported on boards with hardware revision 4.10 or greater. By default the internal source @@ -108,7 +66,9 @@ two cores. This is done in 3 ways: to avoid potential concurrent access issues. Building and Flashing -************************* +********************* + +.. zephyr:board-supported-runners:: Applications for the ``arduino_portenta_h7`` board should be built per core target, using either ``arduino_portenta_h7_m7`` or ``arduino_portenta_h7_m4`` as the target. diff --git a/boards/arduino/uno_r4/Kconfig.arduino_uno_r4 b/boards/arduino/uno_r4/Kconfig.arduino_uno_r4 new file mode 100644 index 0000000000000..67a9f951d67f1 --- /dev/null +++ b/boards/arduino/uno_r4/Kconfig.arduino_uno_r4 @@ -0,0 +1,5 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ARDUINO_UNO_R4 + select SOC_R7FA4M1AB3CFM diff --git a/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_minima b/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_minima deleted file mode 100644 index 2fae481238c0b..0000000000000 --- a/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_minima +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2023 TOKITA Hiroshi -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_ARDUINO_UNO_R4_MINIMA - select SOC_R7FA4M1AB3CFM diff --git a/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi b/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi deleted file mode 100644 index 840ead804a420..0000000000000 --- a/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024 TOKITA Hiroshi -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_ARDUINO_UNO_R4_WIFI - select SOC_R7FA4M1AB3CFM diff --git a/boards/arduino/uno_r4/arduino_uno_r4-pinctrl.dtsi b/boards/arduino/uno_r4/arduino_uno_r4-pinctrl.dtsi new file mode 100644 index 0000000000000..b54c4d8cfbb61 --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4-pinctrl.dtsi @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + sci2_default: sci2_default { + group1 { + /* tx */ + psels = ; + drive-strength = "medium"; + }; + group2 { + /* rx */ + psels = ; + }; + }; + + iic1_default: iic1_default { + group1 { + /* SCL1 SDA1 */ + psels = , + ; + drive-strength = "medium"; + }; + }; + + adc0_default: adc0_default { + group1 { + /* input */ + psels = , + , + , + ; + renesas,analog-enable; + }; + }; + + pwm7_default: pwm7_default { + group1 { + /* GTIOC7A GTIOC7B */ + psels = , + ; + }; + }; +}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4.dts b/boards/arduino/uno_r4/arduino_uno_r4.dts new file mode 100644 index 0000000000000..09ce3664f1d95 --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4.dts @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "arduino_uno_r4-pinctrl.dtsi" +#include +#include + +/ { + model = "Arduino Uno R4 Board"; + compatible = "renesas,ra4m1", "renesas,ra"; + + chosen { + zephyr,console = &uart2; + zephyr,shell-uart = &uart2; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,entropy = &trng; + zephyr,code-partition = &code_partition; + }; +}; + +&sci2 { + status = "okay"; + pinctrl-0 = <&sci2_default>; + pinctrl-names = "default"; + interrupts = <0 1>, <1 1>, <2 1>, <3 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + + uart2: uart { + current-speed = <115200>; + status = "okay"; + }; +}; + +&ioport1 { + status = "okay"; +}; + +&adc0 { + status = "okay"; + pinctrl-0 = <&adc0_default>; + pinctrl-names = "default"; +}; + +&port_irq0 { + interrupts = <27 12>; + status = "okay"; +}; + +&port_irq1 { + interrupts = <28 12>; + status = "okay"; +}; + +&trng { + status = "okay"; +}; + +&pwm7 { + pinctrl-0 = <&pwm7_default>; + pinctrl-names = "default"; + interrupts = <8 1>, <9 1>; + interrupt-names = "gtioca", "overflow"; + status = "okay"; +}; + +&iic1 { + pinctrl-0 = <&iic1_default>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = ; + interrupts = <10 1>, <11 1>, <12 1>, <13 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "bootloader"; + reg = <0x00000000 0x4000>; + read-only; + }; + + code_partition: partition@4000 { + label = "code"; + reg = <0x4000 0x3C000>; + read-only; + }; + }; +}; + +&hoco { + status = "okay"; + clock-frequency = <48000000>; +}; + +&pclkblock { + clocks = <&hoco>; +}; + +&iclk { + div = <1>; +}; + +&pclka { + div = <1>; +}; + +&pclkb { + div = <2>; +}; + +&pclkc { + div = <1>; +}; + +&pclkd { + div = <1>; +}; + +&fclk { + div = <2>; +}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi b/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi deleted file mode 100644 index f9fff37eaabfa..0000000000000 --- a/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2023 TOKITA Hiroshi - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include - -/ { - model = "Arduino Uno R4 Board"; - compatible = "renesas,r7fa4m1ab3cfm"; - - chosen { - zephyr,console = &uart2; - zephyr,shell-uart = &uart2; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - zephyr,code-partition = &code_partition; - }; -}; - -&sci2 { - status = "okay"; - pinctrl-0 = <&sci2_default>; - pinctrl-names = "default"; - uart2: uart { - current-speed = <115200>; - status = "okay"; - }; -}; - -&ioport1 { - status = "okay"; -}; - -&flash0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "bootloader"; - reg = <0x00000000 0x4000>; - read-only; - }; - - code_partition: partition@4000 { - label = "code"; - reg = <0x4000 0x3C000>; - read-only; - }; - }; -}; - -&fcu { - status = "okay"; -}; - -&hoco { - status = "okay"; - clock-frequency = <48000000>; -}; - -&pclkblock { - clocks = <&hoco>; -}; - -&iclk { - div = <1>; -}; - -&pclka { - div = <1>; -}; - -&pclkb { - div = <2>; -}; - -&pclkc { - div = <1>; -}; - -&pclkd { - div = <1>; -}; - -&fclk { - div = <2>; -}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_defconfig b/boards/arduino/uno_r4/arduino_uno_r4_defconfig new file mode 100644 index 0000000000000..17e5527427464 --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4_defconfig @@ -0,0 +1,15 @@ +# Copyright (c) 2023 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +CONFIG_USE_DT_CODE_PARTITION=y diff --git a/boards/arduino/uno_r4/arduino_uno_r4_minima-pinctrl.dtsi b/boards/arduino/uno_r4/arduino_uno_r4_minima-pinctrl.dtsi index 863d9e6030af4..63940405a7d86 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_minima-pinctrl.dtsi +++ b/boards/arduino/uno_r4/arduino_uno_r4_minima-pinctrl.dtsi @@ -4,18 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &pinctrl { - sci2_default: sci2_default { + spi1_default: spi1_default { group1 { - /* tx */ - psels = ; - drive-strength = "medium"; - }; - group2 { - /* rx */ - psels = ; + /* MOSI MISO RSPCK SSL */ + psels = , + , + , + ; }; }; }; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_minima.dts b/boards/arduino/uno_r4/arduino_uno_r4_minima.dts deleted file mode 100644 index d80ca6d4f1fcd..0000000000000 --- a/boards/arduino/uno_r4/arduino_uno_r4_minima.dts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2023 TOKITA Hiroshi - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include "arduino_uno_r4_common.dtsi" -#include "arduino_uno_r4_minima-pinctrl.dtsi" - -/ { - model = "Arduino Uno R4 Minima"; - - leds { - compatible = "gpio-leds"; - led: led { - gpios = <&ioport1 11 GPIO_ACTIVE_HIGH>; - }; - }; - - aliases { - led0 = &led; - }; - - arduino_header: connector { - compatible = "arduino-header-r3"; - #gpio-cells = <2>; - gpio-map-mask = <0xffffffff 0xffffffc0>; - gpio-map-pass-thru = <0 0x3f>; - gpio-map = <0 0 &ioport0 14 0>, /* A0 */ - <1 0 &ioport0 0 0>, /* A1 */ - <2 0 &ioport0 1 0>, /* A2 */ - <3 0 &ioport0 2 0>, /* A3 */ - <4 0 &ioport1 1 0>, /* A4 */ - <5 0 &ioport1 0 0>, /* A5 */ - <6 0 &ioport3 1 0>, /* D0 */ - <7 0 &ioport3 2 0>, /* D1 */ - <8 0 &ioport1 5 0>, /* D2 */ - <9 0 &ioport1 4 0>, /* D3 */ - <10 0 &ioport1 3 0>, /* D4 */ - <11 0 &ioport1 2 0>, /* D5 */ - <12 0 &ioport1 6 0>, /* D6 */ - <13 0 &ioport1 7 0>, /* D7 */ - <14 0 &ioport3 4 0>, /* D8 */ - <15 0 &ioport3 3 0>, /* D9 */ - <16 0 &ioport1 12 0>, /* D10 */ - <17 0 &ioport1 9 0>, /* D11 */ - <18 0 &ioport1 10 0>, /* D12 */ - <19 0 &ioport1 11 0>, /* D13 */ - <20 0 &ioport1 1 0>, /* D14 */ - <21 0 &ioport1 0 0>; /* D15 */ - }; -}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_minima.overlay b/boards/arduino/uno_r4/arduino_uno_r4_minima.overlay new file mode 100644 index 0000000000000..504b159737234 --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4_minima.overlay @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2023 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "arduino_uno_r4_minima-pinctrl.dtsi" + +#include +#include +#include + +/ { + model = "Arduino Uno R4 Minima"; + + leds { + compatible = "gpio-leds"; + led: led { + gpios = <&arduino_header ARDUINO_HEADER_R3_D13 GPIO_ACTIVE_HIGH>; + }; + }; + + pwm_leds { + compatible = "pwm-leds"; + status = "disabled"; + pwm_led: pwm_led { + pwms = <&arduino_pwm ARDUINO_HEADER_R3_D13 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "PWM_LED"; + }; + }; + + aliases { + led0 = &led; + pwm-led0 = &pwm_led; + }; + + arduino_header: connector { + compatible = "arduino-header-r3"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + }; + + arduino_adc: analog-connector { + compatible = "arduino,uno-adc"; + #io-channel-cells = <1>; + io-channel-map = , /* P009 = CH09 */ + , /* P000 = CH00 */ + , /* P001 = CH01 */ + , /* P002 = CH02 */ + , /* P101 = CH21 */ + ; /* P100 = CH22 */ + }; + + arduino_pwm: connector-pwm { + compatible = "arduino-header-pwm"; + #pwm-cells = <3>; + pwm-map = , /* P105 = GPT1_A */ + , /* P104 = GPT1_B */ + , /* P103 = GPT2 A */ + , /* P102 = GPT2_B */ + , /* P106 = GPT0_B */ + , /* P107 = GPT0_A */ + , /* P304 = GPT7_A */ + , /* P303 = GPT7_B */ + , /* P112 = GPT3_B */ + ; /* P111 = GPT3_A */ + pwm-map-mask = <0xffffffff 0x0 0x0>; + pwm-map-pass-thru = <0x0 0xffffffff 0xffffffff>; + }; +}; + +&spi1 { + pinctrl-0 = <&spi1_default>; + pinctrl-names = "default"; + interrupts = <28 1>, <29 1>, <30 1>, <31 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + status = "okay"; +}; + +arduino_i2c: &iic1 {}; +arduino_spi: &spi1 {}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_minima.yaml b/boards/arduino/uno_r4/arduino_uno_r4_minima.yaml index b106de02aa7a8..7e60cd09528f8 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_minima.yaml +++ b/boards/arduino/uno_r4/arduino_uno_r4_minima.yaml @@ -1,4 +1,4 @@ -identifier: arduino_uno_r4_minima +identifier: arduino_uno_r4@minima name: Arduino Uno R4 Minima type: mcu arch: arm @@ -7,5 +7,8 @@ toolchain: - gnuarmemb ram: 32 supported: + - adc - gpio + - pwm + - spi - uart diff --git a/boards/arduino/uno_r4/arduino_uno_r4_minima_defconfig b/boards/arduino/uno_r4/arduino_uno_r4_minima_defconfig deleted file mode 100644 index 3c655ea376e89..0000000000000 --- a/boards/arduino/uno_r4/arduino_uno_r4_minima_defconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2023 TOKITA Hiroshi -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 - -CONFIG_BUILD_OUTPUT_HEX=y - -# Enable UART driver -CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable GPIO -CONFIG_GPIO=y - -CONFIG_CLOCK_CONTROL=y - -CONFIG_USE_DT_CODE_PARTITION=y diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi b/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi index 9add47e472363..47f94cc3a0eb9 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi @@ -4,18 +4,23 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - &pinctrl { - sci2_default: sci2_default { + iic0_default: iic0_default { group1 { - /* tx */ - psels = ; + /* SCL0 SDA0 */ + psels = , + ; drive-strength = "medium"; }; - group2 { - /* rx */ - psels = ; + }; + + spi0_default: spi0_default { + group1 { + /* MOSI MISO RSPCK SSL */ + psels = , + , + , + ; }; }; }; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi.dts b/boards/arduino/uno_r4/arduino_uno_r4_wifi.dts deleted file mode 100644 index a3a2019990ebc..0000000000000 --- a/boards/arduino/uno_r4/arduino_uno_r4_wifi.dts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2024 TOKITA Hiroshi - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include "arduino_uno_r4_common.dtsi" -#include "arduino_uno_r4_wifi-pinctrl.dtsi" - -/ { - model = "Arduino Uno R4 WiFi"; - - leds { - compatible = "gpio-leds"; - led: led { - gpios = <&ioport1 2 GPIO_ACTIVE_HIGH>; - }; - }; - - aliases { - led0 = &led; - }; - - arduino_header: connector { - compatible = "arduino-header-r3"; - #gpio-cells = <2>; - gpio-map-mask = <0xffffffff 0xffffffc0>; - gpio-map-pass-thru = <0 0x3f>; - gpio-map = <0 0 &ioport0 14 0>, /* A0 */ - <1 0 &ioport0 0 0>, /* A1 */ - <2 0 &ioport0 1 0>, /* A2 */ - <3 0 &ioport0 2 0>, /* A3 */ - <4 0 &ioport1 1 0>, /* A4 */ - <5 0 &ioport1 0 0>, /* A5 */ - <6 0 &ioport3 1 0>, /* D0 */ - <7 0 &ioport3 2 0>, /* D1 */ - <8 0 &ioport1 4 0>, /* D2 */ - <9 0 &ioport1 5 0>, /* D3 */ - <10 0 &ioport1 6 0>, /* D4 */ - <11 0 &ioport1 7 0>, /* D5 */ - <12 0 &ioport1 11 0>, /* D6 */ - <13 0 &ioport1 12 0>, /* D7 */ - <14 0 &ioport3 4 0>, /* D8 */ - <15 0 &ioport3 3 0>, /* D9 */ - <16 0 &ioport1 3 0>, /* D10 */ - <17 0 &ioport4 11 0>, /* D11 */ - <18 0 &ioport4 10 0>, /* D12 */ - <19 0 &ioport1 2 0>, /* D13 */ - <20 0 &ioport1 1 0>, /* D14 */ - <21 0 &ioport1 0 0>; /* D15 */ - }; -}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi.overlay b/boards/arduino/uno_r4/arduino_uno_r4_wifi.overlay new file mode 100644 index 0000000000000..f411487d080dc --- /dev/null +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi.overlay @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "arduino_uno_r4_wifi-pinctrl.dtsi" + +#include +#include +#include + +/ { + model = "Arduino Uno R4 WiFi"; + + leds { + compatible = "gpio-leds"; + led: led { + gpios = <&arduino_header ARDUINO_HEADER_R3_D13 GPIO_ACTIVE_HIGH>; + }; + }; + + pwm_leds { + compatible = "pwm-leds"; + status = "disabled"; + pwm_led: pwm_led { + pwms = <&arduino_pwm ARDUINO_HEADER_R3_D13 PWM_MSEC(1) PWM_POLARITY_NORMAL>; + label = "PWM_LED"; + }; + }; + + aliases { + led0 = &led; + pwm-led0 = &pwm_led; + }; + + arduino_header: connector { + compatible = "arduino-header-r3"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + }; + + arduino_adc: analog-connector { + compatible = "arduino,uno-adc"; + #io-channel-cells = <1>; + io-channel-map = , /* P009 = CH09 */ + , /* P000 = CH00 */ + , /* P001 = CH01 */ + , /* P002 = CH02 */ + , /* P101 = CH21 */ + ; /* P100 = CH22 */ + }; + + arduino_pwm: connector-pwm { + compatible = "arduino-header-pwm"; + #pwm-cells = <3>; + pwm-map = , /* P104 = GPT1_B */ + , /* P105 = GPT1_A */ + , /* P106 = GPT0 B */ + , /* P107 = GPT0_A */ + , /* P111 = GPT3_A */ + , /* P112 = GPT3_B */ + , /* P304 = GPT7_A */ + , /* P303 = GPT7_B */ + , /* P103 = GPT2_A */ + , /* P411 = GPT6_A */ + , /* P410 = GPT6_B */ + ; /* P102 = GPT2_B */ + pwm-map-mask = <0xffffffff 0x0 0x0>; + pwm-map-pass-thru = <0x0 0xffffffff 0xffffffff>; + }; +}; + +&spi0 { + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; + interrupts = <28 1>, <29 1>, <30 1>, <31 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + status = "okay"; +}; + +&iic0 { + pinctrl-0 = <&iic0_default>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = ; + interrupts = <14 1>, <15 1>, <16 1>, <17 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + status = "okay"; +}; + +qwiic_i2c: &iic0 {}; +arduino_i2c: &iic1 {}; +arduino_spi: &spi0 {}; diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml b/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml index 30d3dfb89bc4e..e2e101e93abc0 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml @@ -1,4 +1,4 @@ -identifier: arduino_uno_r4_wifi +identifier: arduino_uno_r4@wifi name: Arduino Uno R4 WiFi type: mcu arch: arm @@ -7,5 +7,8 @@ toolchain: - gnuarmemb ram: 32 supported: + - adc - gpio + - pwm + - spi - uart diff --git a/boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig b/boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig deleted file mode 100644 index 48137e86d7ac2..0000000000000 --- a/boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2024 TOKITA Hiroshi -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000 - -CONFIG_BUILD_OUTPUT_HEX=y - -# Enable UART driver -CONFIG_SERIAL=y -CONFIG_UART_INTERRUPT_DRIVEN=y - -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable GPIO -CONFIG_GPIO=y - -CONFIG_CLOCK_CONTROL=y - -CONFIG_USE_DT_CODE_PARTITION=y diff --git a/boards/arduino/uno_r4/board.yml b/boards/arduino/uno_r4/board.yml index 9c168c300c223..ee0f51c47d4fd 100644 --- a/boards/arduino/uno_r4/board.yml +++ b/boards/arduino/uno_r4/board.yml @@ -1,11 +1,12 @@ -boards: - - name: arduino_uno_r4_minima - full_name: Arduino UNO R4 Minima - vendor: arduino - socs: - - name: r7fa4m1ab3cfm - - name: arduino_uno_r4_wifi - full_name: Arduino UNO R4 WiFi - vendor: arduino - socs: - - name: r7fa4m1ab3cfm +board: + name: arduino_uno_r4 + full_name: Arduino UNO R4 Minima/WiFi + vendor: arduino + revision: + format: custom + default: "minima" + revisions: + - name: "minima" + - name: "wifi" + socs: + - name: r7fa4m1ab3cfm diff --git a/boards/arduino/uno_r4/doc/img/arduino_uno_r4_minima.webp b/boards/arduino/uno_r4/doc/img/arduino_uno_r4_minima.webp new file mode 100644 index 0000000000000..c42a9e389e422 Binary files /dev/null and b/boards/arduino/uno_r4/doc/img/arduino_uno_r4_minima.webp differ diff --git a/boards/arduino/uno_r4/doc/index.rst b/boards/arduino/uno_r4/doc/index.rst index 1b2b28385bae4..71dcd0d94e487 100644 --- a/boards/arduino/uno_r4/doc/index.rst +++ b/boards/arduino/uno_r4/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_uno_r4: - -Arduino UNO R4 -############## +.. zephyr:board:: arduino_uno_r4 Overview ******** @@ -23,20 +20,13 @@ Hardware Supported Features ================== -The Arduino UNO R4 Minima/Wifi board configuration supports the following -hardware features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| UART | on-chip | Serial ports | -+-----------+------------+------------------------------------------+ +.. zephyr:board-supported-hw:: Programming and debugging ************************* +.. zephyr:board-supported-runners:: + Debug adapter ============= @@ -60,12 +50,12 @@ Here is an example for building and flashing the :zephyr:code-sample:`blinky` ap .. zephyr-app-commands:: :zephyr-app: samples/basic/blinky - :board: arduino_uno_r4_minima + :board: arduino_uno_r4@minima :goals: build flash .. zephyr-app-commands:: :zephyr-app: samples/basic/blinky - :board: arduino_uno_r4_wifi + :board: arduino_uno_r4@wifi :goals: build flash Debugging @@ -77,13 +67,13 @@ Also, see the instructions specific to the debug server that you use. .. zephyr-app-commands:: :zephyr-app: samples/basic/blinky - :board: arduino_uno_r4_minima + :board: arduino_uno_r4@minima :maybe-skip-config: :goals: debug .. zephyr-app-commands:: :zephyr-app: samples/basic/blinky - :board: arduino_uno_r4_wifi + :board: arduino_uno_r4@wifi :maybe-skip-config: :goals: debug diff --git a/boards/arduino/uno_r4/revision.cmake b/boards/arduino/uno_r4/revision.cmake new file mode 100644 index 0000000000000..f148e05dd0abb --- /dev/null +++ b/boards/arduino/uno_r4/revision.cmake @@ -0,0 +1,8 @@ +set(BOARD_REVISIONS "minima" "wifi") +if(NOT DEFINED BOARD_REVISION) + set(BOARD_REVISION "minima") +else() + if(NOT BOARD_REVISION IN_LIST BOARD_REVISIONS) + message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for arduino_uno_r4. Accepted revisions: ${BOARD_REVISIONS}") + endif() +endif() diff --git a/boards/arduino/zero/doc/index.rst b/boards/arduino/zero/doc/index.rst index 9e665aa75cd8e..150c864b3f950 100644 --- a/boards/arduino/zero/doc/index.rst +++ b/boards/arduino/zero/doc/index.rst @@ -1,7 +1,4 @@ -.. _arduino_zero: - -Arduino/Genuino Zero -#################### +.. zephyr:board:: arduino_zero Overview ******** @@ -10,10 +7,6 @@ The Arduino Zero is a maker-friendly development board with Atmel’s Embedded Debugger (EDBG), which provides a full debug interface without the need for additional hardware. -.. image:: img/arduino_zero.jpg - :align: center - :alt: Arduino Zero - Hardware ******** @@ -28,37 +21,7 @@ Hardware Supported Features ================== -The arduino_zero board configuration supports the following hardware -features: - -+-----------+------------+------------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==========================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+------------------------------------------+ -| Flash | on-chip | Can be used with LittleFS to store files | -+-----------+------------+------------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+------------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+------------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+------------------------------------------+ -| PWM | on-chip | Pulse Width Modulation | -+-----------+------------+------------------------------------------+ -| USART | on-chip | Serial ports | -+-----------+------------+------------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface ports | -+-----------+------------+------------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+------------------------------------------+ -| DAC | on-chip | Digital to analogue converter | -+-----------+------------+------------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/arduino/zero/arduino_zero_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -111,6 +74,8 @@ Arduino Zero, the DAC is available on pin A0. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The Arduino Zero comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAMD21 chip and is supported by OpenOCD. diff --git a/boards/arm/fvp_baser_aemv8r/doc/aarch32.rst b/boards/arm/fvp_baser_aemv8r/doc/aarch32.rst index 8fcc4d07b0ec9..080d316e6b783 100644 --- a/boards/arm/fvp_baser_aemv8r/doc/aarch32.rst +++ b/boards/arm/fvp_baser_aemv8r/doc/aarch32.rst @@ -82,7 +82,7 @@ Arm FVP emulated environment, for example, with the :zephyr:code-sample:`synchro .. zephyr-app-commands:: :zephyr-app: samples/synchronization :host-os: unix - :board: fvp_baser_aemv8r_aarch32 + :board: fvp_baser_aemv8r/fvp_aemv8r_aarch32 :goals: build This will build an image with the synchronization sample app. diff --git a/boards/arm/fvp_baser_aemv8r/doc/aarch64.rst b/boards/arm/fvp_baser_aemv8r/doc/aarch64.rst index 724ee182cc9a6..0f9a28d0a8107 100644 --- a/boards/arm/fvp_baser_aemv8r/doc/aarch64.rst +++ b/boards/arm/fvp_baser_aemv8r/doc/aarch64.rst @@ -91,7 +91,7 @@ Arm FVP emulated environment, for example, with the :zephyr:code-sample:`synchro .. zephyr-app-commands:: :zephyr-app: samples/synchronization :host-os: unix - :board: fvp_baser_aemv8r + :board: fvp_baser_aemv8r/fvp_aemv8r_aarch64 :goals: build This will build an image with the synchronization sample app. diff --git a/boards/arm/mps2/CMakeLists.txt b/boards/arm/mps2/CMakeLists.txt index 2f6cea861c66c..7a2209df8f894 100644 --- a/boards/arm/mps2/CMakeLists.txt +++ b/boards/arm/mps2/CMakeLists.txt @@ -1,8 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() -zephyr_library_sources(pinmux.c) - if(CONFIG_BOARD_MPS2_AN521_CPU1 AND NOT CONFIG_OPENAMP) # Building a firmware image for CPU1: this requires a binary # for CPU0, which will boot the device and wake up CPU1. diff --git a/boards/arm/mps2/board.cmake b/boards/arm/mps2/board.cmake index b52e1958cf4e2..98e34a997487b 100644 --- a/boards/arm/mps2/board.cmake +++ b/boards/arm/mps2/board.cmake @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates if(CONFIG_BOARD_MPS2_AN385) set(SUPPORTED_EMU_PLATFORMS qemu armfvp) @@ -48,6 +48,8 @@ elseif(CONFIG_BOARD_MPS2_AN521_CPU0 OR CONFIG_BOARD_MPS2_AN521_CPU0_NS OR CONFIG # TF-M (Secure) & Zephyr (Non Secure) image (when running # in-tree tests). set(QEMU_KERNEL_OPTION "-device;loader,file=${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") + + set(ARMFVP_FLAGS ${ARMFVP_FLAGS} -a ${APPLICATION_BINARY_DIR}/zephyr/tfm_merged.hex) elseif(CONFIG_OPENAMP) set(QEMU_EXTRA_FLAGS "-device;loader,file=${REMOTE_ZEPHYR_DIR}/zephyr.elf") elseif(CONFIG_BOARD_MPS2_AN521_CPU1) diff --git a/boards/arm/mps2/mps2-pinctrl.dtsi b/boards/arm/mps2/mps2-pinctrl.dtsi new file mode 100644 index 0000000000000..da259040e9754 --- /dev/null +++ b/boards/arm/mps2/mps2-pinctrl.dtsi @@ -0,0 +1,67 @@ +/* + * Copyright 2025 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + /omit-if-no-ref/ uart3_default: uart3_default { + group1 { + pinmux = ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ uart4_default: uart4_default { + group1 { + pinmux = ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ spi0_default: spi0_default { + group1 { + pinmux = , , + ; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ spi1_default: spi1_default { + group1 { + pinmux = , , + ; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ sbcon0_default: sbcon0_default { + group1 { + pinmux = , ; + input-enable; + }; + }; + + /omit-if-no-ref/ sbcon1_default: sbcon1_default { + group1 { + pinmux = , ; + input-enable; + }; + }; +}; diff --git a/boards/arm/mps2/mps2_an383.yaml b/boards/arm/mps2/mps2_an383.yaml index c7e2ae8ba3fb0..249225737754a 100644 --- a/boards/arm/mps2/mps2_an383.yaml +++ b/boards/arm/mps2/mps2_an383.yaml @@ -8,7 +8,6 @@ simulation: toolchain: - zephyr - gnuarmemb - - xtools supported: - counter - netif:serial-net diff --git a/boards/arm/mps2/mps2_an386.yaml b/boards/arm/mps2/mps2_an386.yaml index c241948ce498e..f71e166e683d4 100644 --- a/boards/arm/mps2/mps2_an386.yaml +++ b/boards/arm/mps2/mps2_an386.yaml @@ -8,7 +8,6 @@ simulation: toolchain: - zephyr - gnuarmemb - - xtools supported: - counter - gpio diff --git a/boards/arm/mps2/mps2_an500.yaml b/boards/arm/mps2/mps2_an500.yaml index 243fc64083df2..cc4c713d799f9 100644 --- a/boards/arm/mps2/mps2_an500.yaml +++ b/boards/arm/mps2/mps2_an500.yaml @@ -8,7 +8,6 @@ simulation: toolchain: - zephyr - gnuarmemb - - xtools supported: - counter - gpio diff --git a/boards/arm/mps2/mps2_an521-common.dtsi b/boards/arm/mps2/mps2_an521-common.dtsi index 5b1959ff5fe38..b96f1144982a1 100644 --- a/boards/arm/mps2/mps2_an521-common.dtsi +++ b/boards/arm/mps2/mps2_an521-common.dtsi @@ -1,5 +1,6 @@ /* * Copyright (c) 2019 Linaro Limited + * Copyright 2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -112,6 +113,8 @@ uart3: uart@203000 { interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; + pinctrl-0 = <&uart3_default>; + pinctrl-names = "default"; }; uart4: uart@204000 { @@ -121,6 +124,8 @@ uart4: uart@204000 { interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; + pinctrl-0 = <&uart4_default>; + pinctrl-names = "default"; }; i2c_touch: i2c@207000 { @@ -145,6 +150,8 @@ i2c_shield0: i2c@20c000 { #address-cells = <1>; #size-cells = <0>; reg = <0x20c000 0x1000>; + pinctrl-0 = <&sbcon0_default>; + pinctrl-names = "default"; }; i2c_shield1: i2c@20d000 { @@ -153,10 +160,12 @@ i2c_shield1: i2c@20d000 { #address-cells = <1>; #size-cells = <0>; reg = <0x20d000 0x1000>; + pinctrl-0 = <&sbcon1_default>; + pinctrl-names = "default"; }; gpio_led0: mps2_fpgaio@302000 { - compatible = "arm,mps2-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x302000 0x4>; gpio-controller; @@ -165,16 +174,17 @@ gpio_led0: mps2_fpgaio@302000 { }; gpio_button: mps2_fpgaio@302008 { - compatible = "arm,mps2-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x302008 0x4>; gpio-controller; #gpio-cells = <1>; ngpios = <2>; + direction-input; }; gpio_misc: mps2_fpgaio@30204c { - compatible = "arm,mps2-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x30204c 0x4>; gpio-controller; @@ -189,3 +199,8 @@ eth0: eth@2000000 { reg = <0x2000000 0x100000>; interrupts = <48 3>; }; + +pinctrl: pinctrl { + compatible = "arm,mps2-pinctrl"; + status = "okay"; +}; diff --git a/boards/arm/mps2/mps2_an521_cpu0.dts b/boards/arm/mps2/mps2_an521_cpu0.dts index 2bb956645cafa..532384377da5e 100644 --- a/boards/arm/mps2/mps2_an521_cpu0.dts +++ b/boards/arm/mps2/mps2_an521_cpu0.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2019 Linaro Limited + * Copyright 2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -128,3 +129,5 @@ &uart1 { status = "okay"; }; + +#include "mps2-pinctrl.dtsi" diff --git a/boards/arm/mps2/mps2_an521_cpu0.yaml b/boards/arm/mps2/mps2_an521_cpu0.yaml index 2e73e6b113abc..e511285c190f4 100644 --- a/boards/arm/mps2/mps2_an521_cpu0.yaml +++ b/boards/arm/mps2/mps2_an521_cpu0.yaml @@ -15,7 +15,6 @@ supported: testing: default: true ignore_tags: - - drivers - bluetooth - net - timer diff --git a/boards/arm/mps2/mps2_an521_cpu0_ns.dts b/boards/arm/mps2/mps2_an521_cpu0_ns.dts index e2b24cd9ba571..d67718fcc59af 100644 --- a/boards/arm/mps2/mps2_an521_cpu0_ns.dts +++ b/boards/arm/mps2/mps2_an521_cpu0_ns.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2019 Linaro Limited + * Copyright 2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -142,3 +143,4 @@ &nvic { arm,num-irq-priority-bits = <3>; }; +#include "mps2-pinctrl.dtsi" diff --git a/boards/arm/mps2/mps2_an521_cpu1.dts b/boards/arm/mps2/mps2_an521_cpu1.dts index 311694ca39997..24b39b50978b2 100644 --- a/boards/arm/mps2/mps2_an521_cpu1.dts +++ b/boards/arm/mps2/mps2_an521_cpu1.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2019 Linaro Limited + * Copyright 2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -144,3 +145,5 @@ &nvic { arm,num-irq-priority-bits = <3>; }; + +#include "mps2-pinctrl.dtsi" diff --git a/boards/arm/mps2/mps2_base.dtsi b/boards/arm/mps2/mps2_base.dtsi index 4d8106aa9126b..021373fac43a1 100644 --- a/boards/arm/mps2/mps2_base.dtsi +++ b/boards/arm/mps2/mps2_base.dtsi @@ -1,4 +1,4 @@ -/* Copyright 2024 Arm Limited and/or its affiliates */ +/* Copyright 2024-2025 Arm Limited and/or its affiliates */ /* SPDX-License-Identifier: Apache-2.0 */ / { @@ -145,6 +145,8 @@ interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; + pinctrl-0 = <&uart3_default>; + pinctrl-names = "default"; }; wdog0: wdog@40008000 { @@ -160,6 +162,8 @@ interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; + pinctrl-0 = <&uart4_default>; + pinctrl-names = "default"; }; gpio0: gpio@40010000 { @@ -225,6 +229,8 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x40029000 0x1000>; + pinctrl-0 = <&sbcon0_default>; + pinctrl-names = "default"; }; i2c_shield1: i2c@4002a000 { @@ -233,10 +239,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <0x4002a000 0x1000>; + pinctrl-0 = <&sbcon1_default>; + pinctrl-names = "default"; }; gpio_led0: mps2_fpgaio@40028000 { - compatible = "arm,mps2-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x40028000 0x4>; gpio-controller; #gpio-cells = <1>; @@ -244,23 +252,31 @@ }; gpio_button: mps2_fpgaio@40028008 { - compatible = "arm,mps2-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x40028008 0x4>; gpio-controller; #gpio-cells = <1>; ngpios = <2>; + direction-input; }; gpio_misc: mps2_fpgaio@4002804c { - compatible = "arm,mps2-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x4002804c 0x4>; gpio-controller; #gpio-cells = <1>; ngpios = <10>; }; }; + + pinctrl: pinctrl { + compatible = "arm,mps2-pinctrl"; + status = "okay"; + }; }; &nvic { arm,num-irq-priority-bits = <3>; }; + +#include "mps2-pinctrl.dtsi" diff --git a/boards/arm/mps2/pinmux.c b/boards/arm/mps2/pinmux.c deleted file mode 100644 index 6cf9398307286..0000000000000 --- a/boards/arm/mps2/pinmux.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2016 Linaro Limited - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include - -/** - * @brief Pinmux driver for ARM MPS2 AN385 Board - * - * The ARM MPS2 AN385 Board has 4 GPIO controllers. These controllers - * are responsible for pin muxing, input/output, pull-up, etc. - * - * All GPIO controller pins are exposed via the following sequence of pin - * numbers: - * Pins 0 - 15 are for GPIO0 - * Pins 16 - 31 are for GPIO1 - * Pins 32 - 47 are for GPIO2 - * Pins 48 - 51 are for GPIO3 - * - * For the GPIO controllers configuration ARM MPS2 AN385 Board follows the - * Arduino compliant pin out. - */ - -#define CMSDK_AHB_GPIO0_DEV \ - ((volatile struct gpio_cmsdk_ahb *)DT_REG_ADDR(DT_NODELABEL(gpio0))) -#define CMSDK_AHB_GPIO1_DEV \ - ((volatile struct gpio_cmsdk_ahb *)DT_REG_ADDR(DT_NODELABEL(gpio1))) -#define CMSDK_AHB_GPIO2_DEV \ - ((volatile struct gpio_cmsdk_ahb *)DT_REG_ADDR(DT_NODELABEL(gpio2))) -#define CMSDK_AHB_GPIO3_DEV \ - ((volatile struct gpio_cmsdk_ahb *)DT_REG_ADDR(DT_NODELABEL(gpio3))) - -/* - * This is the mapping from the ARM MPS2 AN385 Board pins to GPIO - * controllers. - * - * D0 : EXT_0 - * D1 : EXT_4 - * D2 : EXT_2 - * D3 : EXT_3 - * D4 : EXT_1 - * D5 : EXT_6 - * D6 : EXT_7 - * D7 : EXT_8 - * D8 : EXT_9 - * D9 : EXT_10 - * D10 : EXT_12 - * D11 : EXT_13 - * D12 : EXT_14 - * D13 : EXT_11 - * D14 : EXT_15 - * D15 : EXT_5 - * D16 : EXT_16 - * D17 : EXT_17 - * D18 : EXT_18 - * D19 : EXT_19 - * D20 : EXT_20 - * D21 : EXT_21 - * D22 : EXT_22 - * D23 : EXT_23 - * D24 : EXT_24 - * D25 : EXT_25 - * D26 : EXT_26 - * D27 : EXT_30 - * D28 : EXT_28 - * D29 : EXT_29 - * D30 : EXT_27 - * D31 : EXT_32 - * D32 : EXT_33 - * D33 : EXT_34 - * D34 : EXT_35 - * D35 : EXT_36 - * D36 : EXT_38 - * D37 : EXT_39 - * D38 : EXT_40 - * D39 : EXT_44 - * D40 : EXT_41 - * D41 : EXT_31 - * D42 : EXT_37 - * D43 : EXT_42 - * D44 : EXT_43 - * D45 : EXT_45 - * D46 : EXT_46 - * D47 : EXT_47 - * D48 : EXT_48 - * D49 : EXT_49 - * D50 : EXT_50 - * D51 : EXT_51 - * - * UART_3_RX : D0 - * UART_3_TX : D1 - * SPI_3_CS : D10 - * SPI_3_MOSI : D11 - * SPI_3_MISO : D12 - * SPI_3_SCLK : D13 - * I2C_3_SDA : D14 - * I2C_3_SCL : D15 - * UART_4_RX : D26 - * UART_4_TX : D30 - * SPI_4_CS : D36 - * SPI_4_MOSI : D37 - * SPI_4_MISO : D38 - * SPI_4_SCK : D39 - * I2C_4_SDA : D40 - * I2C_4_SCL : D41 - * - */ -static void arm_mps2_pinmux_defaults(void) -{ - uint32_t gpio_0 = 0U; - uint32_t gpio_1 = 0U; - uint32_t gpio_2 = 0U; - - /* Set GPIO Alternate Functions */ - - gpio_0 = (1<<0) /* Shield 0 UART 3 RXD */ - | (1<<4) /* Shield 0 UART 3 TXD */ - | (1<<5) /* Shield 0 I2C SCL SBCON2 */ - | (1<<15) /* Shield 0 I2C SDA SBCON2 */ - | (1<<11) /* Shield 0 SPI 3 SCK */ - | (1<<12) /* Shield 0 SPI 3 SS */ - | (1<<13) /* Shield 0 SPI 3 MOSI */ - | (1<<14); /* Shield 0 SPI 3 MISO */ - - CMSDK_AHB_GPIO0_DEV->altfuncset = gpio_0; - - gpio_1 = (1<<10) /* Shield 1 UART 4 RXD */ - | (1<<14) /* Shield 1 UART 4 TXD */ - | (1<<15) /* Shield 1 I2C SCL SBCON3 */ - | (1<<0) /* ADC SPI 2 SS */ - | (1<<1) /* ADC SPI 2 MISO */ - | (1<<2) /* ADC SPI 2 MOSI */ - | (1<<3) /* ADC SPI 2 SCK */ - | (1<<5) /* USER BUTTON 0 */ - | (1<<6); /* USER BUTTON 1 */ - - CMSDK_AHB_GPIO1_DEV->altfuncset = gpio_1; - - gpio_2 = (1<<9) /* Shield 1 I2C SDA SBCON3 */ - | (1<<6) /* Shield 1 SPI 4 SS */ - | (1<<7) /* Shield 1 SPI 4 MOSI */ - | (1<<8) /* Shield 1 SPI 4 MISO */ - | (1<<12); /* Shield 1 SPI 4 SCK */ - - CMSDK_AHB_GPIO2_DEV->altfuncset = gpio_2; -} - -static int arm_mps2_pinmux_init(void) -{ - - arm_mps2_pinmux_defaults(); - - return 0; -} - -SYS_INIT(arm_mps2_pinmux_init, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/boards/arm/mps3/Kconfig.defconfig b/boards/arm/mps3/Kconfig.defconfig index 4ce6cf0c910b9..014b80f307fb3 100644 --- a/boards/arm/mps3/Kconfig.defconfig +++ b/boards/arm/mps3/Kconfig.defconfig @@ -1,5 +1,5 @@ # Copyright (c) 2018-2021 Linaro Limited -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 if BOARD_MPS3_CORSTONE300_AN547 || BOARD_MPS3_CORSTONE300_AN552 || BOARD_MPS3_CORSTONE300_FVP || BOARD_MPS3_CORSTONE310_AN555 || BOARD_MPS3_CORSTONE310_FVP @@ -19,4 +19,14 @@ config UART_INTERRUPT_DRIVEN endif # SERIAL +if ROMSTART_RELOCATION_ROM && (BOARD_MPS3_CORSTONE310_AN555 || BOARD_MPS3_CORSTONE310_FVP) + +config ROMSTART_REGION_ADDRESS + default $(dt_nodelabel_reg_addr_hex,itcm) + +config ROMSTART_REGION_SIZE + default $(dt_nodelabel_reg_size_hex,itcm,0,k) + +endif + endif diff --git a/boards/arm/mps3/board.cmake b/boards/arm/mps3/board.cmake index ca090a832fc80..e6204c4c2eabd 100644 --- a/boards/arm/mps3/board.cmake +++ b/boards/arm/mps3/board.cmake @@ -1,5 +1,5 @@ # Copyright (c) 2021 Linaro -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 # The FVP variant must be used to enable Ethos-U55 NPU support, but QEMU also @@ -37,6 +37,10 @@ elseif(CONFIG_BOARD_MPS3_CORSTONE310_FVP OR CONFIG_BOARD_MPS3_CORSTONE310_FVP_NS set(ARMFVP_FLAGS # default is '0x11000000' but should match cpu.INITSVTOR which is 0. -C mps3_board.sse300.iotss3_systemcontrol.INITSVTOR_RST=0 + # default is 0x8, this change is needed since we split flash into itcm + # and sram and it reduces the number of available mpu regions causing a + # few MPU tests to fail. + -C cpu0.MPU_S=16 ) endif() endif() @@ -48,6 +52,8 @@ if (CONFIG_BUILD_WITH_TFM) # TF-M (Secure) & Zephyr (Non Secure) image (when running # in-tree tests). set(QEMU_KERNEL_OPTION "-device;loader,file=${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") + + set(ARMFVP_FLAGS ${ARMFVP_FLAGS} -a ${APPLICATION_BINARY_DIR}/zephyr/tfm_merged.hex) endif() # FVP Parameters diff --git a/boards/arm/mps3/mps3-pinctrl.dtsi b/boards/arm/mps3/mps3-pinctrl.dtsi new file mode 100644 index 0000000000000..17b143ae6442c --- /dev/null +++ b/boards/arm/mps3/mps3-pinctrl.dtsi @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + /omit-if-no-ref/ uart3_default: uart3_default { + group1 { + pinmux = ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ uart4_default: uart4_default { + group1 { + pinmux = ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ spi3_default: spi3_default { + group1 { + pinmux = , , + ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ spi4_default: spi4_default { + group1 { + pinmux = , , ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ sbcon2_default: sbcon2_default { + group1 { + pinmux = , ; + input-enable; + }; + }; + + /omit-if-no-ref/ sbcon3_default: sbcon3_default { + group1 { + pinmux = , ; + input-enable; + }; + }; +}; diff --git a/boards/arm/mps3/mps3_common.dtsi b/boards/arm/mps3/mps3_common.dtsi index 798af2633103f..3348101bc7236 100644 --- a/boards/arm/mps3/mps3_common.dtsi +++ b/boards/arm/mps3/mps3_common.dtsi @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -104,3 +104,4 @@ &nvic { arm,num-irq-priority-bits = <3>; }; +#include "mps3-pinctrl.dtsi" diff --git a/boards/arm/mps3/mps3_common_soc_peripheral.dtsi b/boards/arm/mps3/mps3_common_soc_peripheral.dtsi index 6fd5c7acd4024..d46f6c602cf10 100644 --- a/boards/arm/mps3/mps3_common_soc_peripheral.dtsi +++ b/boards/arm/mps3/mps3_common_soc_peripheral.dtsi @@ -1,6 +1,6 @@ /* * Copyright (c) 2019-2021 Linaro Limited - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -85,6 +85,8 @@ spi_shield0: spi@9203000 { clocks = <&sysclk>; #address-cells = <1>; #size-cells = <0>; + pinctrl-0 = <&spi3_default>; + pinctrl-names = "default"; }; spi_shield1: spi@9204000 { @@ -95,6 +97,8 @@ spi_shield1: spi@9204000 { clocks = <&sysclk>; #address-cells = <1>; #size-cells = <0>; + pinctrl-0 = <&spi4_default>; + pinctrl-names = "default"; }; i2c_shield0: i2c@9205000 { @@ -103,6 +107,8 @@ i2c_shield0: i2c@9205000 { #address-cells = <1>; #size-cells = <0>; reg = <0x9205000 0x1000>; + pinctrl-0 = <&sbcon2_default>; + pinctrl-names = "default"; }; i2c_shield1: i2c@9206000 { @@ -111,6 +117,8 @@ i2c_shield1: i2c@9206000 { #address-cells = <1>; #size-cells = <0>; reg = <0x9206000 0x1000>; + pinctrl-0 = <&sbcon3_default>; + pinctrl-names = "default"; }; i2c_ddr4_eeprom: i2c@9208000 { @@ -122,7 +130,7 @@ i2c_ddr4_eeprom: i2c@9208000 { }; gpio_led0: mps3_fpgaio@9302000 { - compatible = "arm,mps3-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x9302000 0x4>; gpio-controller; @@ -131,16 +139,17 @@ gpio_led0: mps3_fpgaio@9302000 { }; gpio_button: mps3_fpgaio@9302008 { - compatible = "arm,mps3-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x9302008 0x4>; gpio-controller; #gpio-cells = <1>; ngpios = <2>; + direction-input; }; gpio_misc: mps3_fpgaio@930204c { - compatible = "arm,mps3-fpgaio-gpio"; + compatible = "arm,mmio32-gpio"; reg = <0x930204c 0x4>; gpio-controller; @@ -182,6 +191,8 @@ uart3: uart@9306000 { interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; + pinctrl-0 = <&uart3_default>; + pinctrl-names = "default"; }; uart4: uart@9307000 { @@ -191,6 +202,8 @@ uart4: uart@9307000 { interrupt-names = "tx", "rx"; clocks = <&sysclk>; current-speed = <115200>; + pinctrl-0 = <&uart4_default>; + pinctrl-names = "default"; }; uart5: uart@9308000 { @@ -202,3 +215,8 @@ uart5: uart@9308000 { clocks = <&sysclk>; current-speed = <115200>; }; + +pinctrl: pinctrl { + compatible = "arm,mps3-pinctrl"; + status = "okay"; +}; diff --git a/boards/arm/mps3/mps3_corstone300_an547.dts b/boards/arm/mps3/mps3_corstone300_an547.dts index ae71ddf72825a..55188180f0cf0 100644 --- a/boards/arm/mps3/mps3_corstone300_an547.dts +++ b/boards/arm/mps3/mps3_corstone300_an547.dts @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 Linaro Limited - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-an547"; @@ -95,3 +94,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone300_an547.yaml b/boards/arm/mps3/mps3_corstone300_an547.yaml index 27d74d8c571b6..b63d2b1211ce7 100644 --- a/boards/arm/mps3/mps3_corstone300_an547.yaml +++ b/boards/arm/mps3/mps3_corstone300_an547.yaml @@ -1,6 +1,6 @@ # # Copyright (c) 2019-2021 Linaro Limited -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # @@ -20,6 +20,7 @@ toolchain: supported: - gpio testing: + default: true ignore_tags: - drivers - bluetooth diff --git a/boards/arm/mps3/mps3_corstone300_an547_ns.dts b/boards/arm/mps3/mps3_corstone300_an547_ns.dts index 5a4e0031946c8..9540682e37b2b 100644 --- a/boards/arm/mps3/mps3_corstone300_an547_ns.dts +++ b/boards/arm/mps3/mps3_corstone300_an547_ns.dts @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 Linaro Limited - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +11,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-an547"; @@ -100,3 +99,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone300_an552.dts b/boards/arm/mps3/mps3_corstone300_an552.dts index 7c7ec8d02a5c9..51aabcda2fa49 100644 --- a/boards/arm/mps3/mps3_corstone300_an552.dts +++ b/boards/arm/mps3/mps3_corstone300_an552.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-an552"; @@ -94,3 +93,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone300_an552_ns.dts b/boards/arm/mps3/mps3_corstone300_an552_ns.dts index 17e9d259bca9d..7b8bab99ff6dc 100644 --- a/boards/arm/mps3/mps3_corstone300_an552_ns.dts +++ b/boards/arm/mps3/mps3_corstone300_an552_ns.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-an552"; @@ -99,3 +98,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone300_fvp.dts b/boards/arm/mps3/mps3_corstone300_fvp.dts index eff11378c6166..886b8d7762911 100644 --- a/boards/arm/mps3/mps3_corstone300_fvp.dts +++ b/boards/arm/mps3/mps3_corstone300_fvp.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-fvp"; @@ -94,3 +93,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone300_fvp.yaml b/boards/arm/mps3/mps3_corstone300_fvp.yaml index 07c8c8a131e11..e6cb88bc5a748 100644 --- a/boards/arm/mps3/mps3_corstone300_fvp.yaml +++ b/boards/arm/mps3/mps3_corstone300_fvp.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 identifier: mps3/corstone300/fvp @@ -16,8 +16,8 @@ toolchain: supported: - gpio testing: + default: true ignore_tags: - - drivers - bluetooth - net - timer diff --git a/boards/arm/mps3/mps3_corstone300_fvp_ns.dts b/boards/arm/mps3/mps3_corstone300_fvp_ns.dts index 8a9704cae3a8c..d2be764eb5020 100644 --- a/boards/arm/mps3/mps3_corstone300_fvp_ns.dts +++ b/boards/arm/mps3/mps3_corstone300_fvp_ns.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-fvp"; @@ -99,3 +98,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone310_an555.dts b/boards/arm/mps3/mps3_corstone310_an555.dts index f16aff58eae82..47c2a9626a813 100644 --- a/boards/arm/mps3/mps3_corstone310_an555.dts +++ b/boards/arm/mps3/mps3_corstone310_an555.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-an555"; @@ -20,8 +19,8 @@ chosen { zephyr,console = &uart0; zephyr,shell-uart = &uart0; - zephyr,sram = &dtcm; - zephyr,flash = &itcm; + zephyr,sram = &sram; + zephyr,flash = &isram; }; cpus { @@ -94,3 +93,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone310_an555_defconfig b/boards/arm/mps3/mps3_corstone310_an555_defconfig index f5607f3da4c2f..cfea436df56a4 100644 --- a/boards/arm/mps3/mps3_corstone310_an555_defconfig +++ b/boards/arm/mps3/mps3_corstone310_an555_defconfig @@ -1,4 +1,4 @@ -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 CONFIG_RUNTIME_NMI=y @@ -15,3 +15,5 @@ CONFIG_SERIAL=y # Build a Secure firmware image CONFIG_TRUSTED_EXECUTION_SECURE=y +# ROMSTART_REGION address and size are defined in Kconfig.defconfig +CONFIG_ROMSTART_RELOCATION_ROM=y diff --git a/boards/arm/mps3/mps3_corstone310_an555_ns.dts b/boards/arm/mps3/mps3_corstone310_an555_ns.dts index 786ca6d9eb16d..4a910777e113b 100644 --- a/boards/arm/mps3/mps3_corstone310_an555_ns.dts +++ b/boards/arm/mps3/mps3_corstone310_an555_ns.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-an555"; @@ -99,3 +98,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone310_fvp.dts b/boards/arm/mps3/mps3_corstone310_fvp.dts index 6ad45b5f97352..585a7297d72c1 100644 --- a/boards/arm/mps3/mps3_corstone310_fvp.dts +++ b/boards/arm/mps3/mps3_corstone310_fvp.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-fvp"; @@ -20,8 +19,8 @@ chosen { zephyr,console = &uart0; zephyr,shell-uart = &uart0; - zephyr,sram = &dtcm; - zephyr,flash = &itcm; + zephyr,sram = &sram; + zephyr,flash = &isram; }; cpus { @@ -94,3 +93,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/mps3/mps3_corstone310_fvp.yaml b/boards/arm/mps3/mps3_corstone310_fvp.yaml index be08cf95aca2b..7259d65a2389c 100644 --- a/boards/arm/mps3/mps3_corstone310_fvp.yaml +++ b/boards/arm/mps3/mps3_corstone310_fvp.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 identifier: mps3/corstone310/fvp @@ -16,6 +16,7 @@ toolchain: supported: - gpio testing: + default: true ignore_tags: - drivers - bluetooth diff --git a/boards/arm/mps3/mps3_corstone310_fvp_defconfig b/boards/arm/mps3/mps3_corstone310_fvp_defconfig index f5607f3da4c2f..cfea436df56a4 100644 --- a/boards/arm/mps3/mps3_corstone310_fvp_defconfig +++ b/boards/arm/mps3/mps3_corstone310_fvp_defconfig @@ -1,4 +1,4 @@ -# Copyright 2024 Arm Limited and/or its affiliates +# Copyright 2024-2025 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 CONFIG_RUNTIME_NMI=y @@ -15,3 +15,5 @@ CONFIG_SERIAL=y # Build a Secure firmware image CONFIG_TRUSTED_EXECUTION_SECURE=y +# ROMSTART_REGION address and size are defined in Kconfig.defconfig +CONFIG_ROMSTART_RELOCATION_ROM=y diff --git a/boards/arm/mps3/mps3_corstone310_fvp_ns.dts b/boards/arm/mps3/mps3_corstone310_fvp_ns.dts index acc9b5fb737e3..9cd73ee3959fa 100644 --- a/boards/arm/mps3/mps3_corstone310_fvp_ns.dts +++ b/boards/arm/mps3/mps3_corstone310_fvp_ns.dts @@ -1,5 +1,5 @@ /* - * Copyright 2024 Arm Limited and/or its affiliates + * Copyright 2024-2025 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 */ @@ -10,7 +10,6 @@ #include #include #include -#include "mps3_common.dtsi" / { compatible = "arm,mps3-fvp"; @@ -99,3 +98,4 @@ }; }; }; +#include "mps3_common.dtsi" diff --git a/boards/arm/v2m_beetle/CMakeLists.txt b/boards/arm/v2m_beetle/CMakeLists.txt deleted file mode 100644 index 9bc25bae4c64e..0000000000000 --- a/boards/arm/v2m_beetle/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -zephyr_library() -zephyr_library_sources(pinmux.c) diff --git a/boards/arm/v2m_beetle/pinmux.c b/boards/arm/v2m_beetle/pinmux.c deleted file mode 100644 index 856239761b806..0000000000000 --- a/boards/arm/v2m_beetle/pinmux.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2016 Linaro Limited - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include - -/** - * @brief Pinmux driver for ARM V2M Beetle Board - * - * The ARM V2M Beetle Board has 4 GPIO controllers. These controllers - * are responsible for pin muxing, input/output, pull-up, etc. - * - * The GPIO controllers 2 and 3 are reserved and therefore not exposed by - * this driver. - * - * All GPIO controller exposed pins are exposed via the following sequence of - * pin numbers: - * Pins 0 - 15 are for GPIO0 - * Pins 16 - 31 are for GPIO1 - * - * For the exposed GPIO controllers ARM V2M Beetle Board follows the Arduino - * compliant pin out. - */ - -#define CMSDK_AHB_GPIO0_DEV \ - ((volatile struct gpio_cmsdk_ahb *)DT_REG_ADDR(DT_NODELABEL(gpio0))) -#define CMSDK_AHB_GPIO1_DEV \ - ((volatile struct gpio_cmsdk_ahb *)DT_REG_ADDR(DT_NODELABEL(gpio1))) - -/* - * This is the mapping from the ARM V2M Beetle Board pins to GPIO - * controllers. - * - * D0 : P0_0 - * D1 : P0_1 - * D2 : P0_2 - * D3 : P0_3 - * D4 : P0_4 - * D5 : P0_5 - * D6 : P0_6 - * D7 : P0_7 - * D8 : P0_8 - * D9 : P0_9 - * D10 : P0_10 - * D11 : P0_11 - * D12 : P0_12 - * D13 : P0_13 - * D14 : P0_14 - * D15 : P0_15 - * D16 : P1_0 - * D17 : P1_1 - * D18 : P1_2 - * D19 : P1_3 - * D20 : P1_4 - * D21 : P1_5 - * D22 : P1_6 - * D23 : P1_7 - * D24 : P1_8 - * D25 : P1_9 - * D26 : P1_10 - * D27 : P1_11 - * D28 : P1_12 - * D29 : P1_13 - * D30 : P1_14 - * D31 : P1_15 - * - * UART_0_RX : D0 - * UART_0_TX : D1 - * SPI_0_CS : D10 - * SPI_0_MOSI : D11 - * SPI_0_MISO : D12 - * SPI_0_SCLK : D13 - * I2C_0_SCL : D14 - * I2C_0_SDA : D15 - * UART_1_RX : D16 - * UART_1_TX : D17 - * SPI_1_CS : D18 - * SPI_1_MOSI : D19 - * SPI_1_MISO : D20 - * SPI_1_SCK : D21 - * I2C_1_SDA : D22 - * I2C_1_SCL : D23 - * - */ -static void arm_v2m_beetle_pinmux_defaults(void) -{ - uint32_t gpio_0 = 0U; - uint32_t gpio_1 = 0U; - - /* Set GPIO Alternate Functions */ - - gpio_0 = (1<<0); /* Shield 0 UART 0 RXD */ - gpio_0 |= (1<<1); /* Shield 0 UART 0 TXD */ - gpio_0 |= (1<<14); /* Shield 0 I2C SDA SBCON2 */ - gpio_0 |= (1<<15); /* Shield 0 I2C SCL SBCON2 */ - gpio_0 |= (1<<10); /* Shield 0 SPI_3 nCS */ - gpio_0 |= (1<<11); /* Shield 0 SPI_3 MOSI */ - gpio_0 |= (1<<12); /* Shield 0 SPI_3 MISO */ - gpio_0 |= (1<<13); /* Shield 0 SPI_3 SCK */ - - CMSDK_AHB_GPIO0_DEV->altfuncset = gpio_0; - - gpio_1 = (1<<0); /* UART 1 RXD */ - gpio_1 |= (1<<1); /* UART 1 TXD */ - gpio_1 |= (1<<6); /* Shield 1 I2C SDA */ - gpio_1 |= (1<<7); /* Shield 1 I2C SCL */ - gpio_1 |= (1<<2); /* ADC SPI_1 nCS */ - gpio_1 |= (1<<3); /* ADC SPI_1 MOSI */ - gpio_1 |= (1<<4); /* ADC SPI_1 MISO */ - gpio_1 |= (1<<5); /* ADC SPI_1 SCK */ - - gpio_1 |= (1<<8); /* QSPI CS 2 */ - gpio_1 |= (1<<9); /* QSPI CS 1 */ - gpio_1 |= (1<<10); /* QSPI IO 0 */ - gpio_1 |= (1<<11); /* QSPI IO 1 */ - gpio_1 |= (1<<12); /* QSPI IO 2 */ - gpio_1 |= (1<<13); /* QSPI IO 3 */ - gpio_1 |= (1<<14); /* QSPI SCK */ - - CMSDK_AHB_GPIO1_DEV->altfuncset = gpio_1; - - /* Set the ARD_PWR_EN GPIO1[15] as an output */ - CMSDK_AHB_GPIO1_DEV->outenableset |= (0x1 << 15); - /* Set on 3v3 (for ARDUINO HDR compliance) */ - CMSDK_AHB_GPIO1_DEV->data |= (0x1 << 15); -} - -static int arm_v2m_beetle_pinmux_init(void) -{ - - arm_v2m_beetle_pinmux_defaults(); - - return 0; -} - -SYS_INIT(arm_v2m_beetle_pinmux_init, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/boards/arm/v2m_beetle/v2m_beetle-pinctrl.dtsi b/boards/arm/v2m_beetle/v2m_beetle-pinctrl.dtsi new file mode 100644 index 0000000000000..3bd342daac9a1 --- /dev/null +++ b/boards/arm/v2m_beetle/v2m_beetle-pinctrl.dtsi @@ -0,0 +1,66 @@ +/* + * Copyright 2025 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + /omit-if-no-ref/ uart0_default: uart0_default { + group1 { + pinmux = ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ uart1_default: uart1_default { + group1 { + pinmux = ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ spi0_default: spi0_default { + group1 { + pinmux = , , ; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ spi1_default: spi1_default { + group1 { + pinmux = , , ; + + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + /omit-if-no-ref/ sbcon0_default: sbcon0_default { + group1 { + pinmux = , ; + input-enable; + }; + }; + + /omit-if-no-ref/ sbcon1_default: sbcon1_default { + group1 { + pinmux = , ; + input-enable; + }; + }; +}; diff --git a/boards/arm/v2m_beetle/v2m_beetle.dts b/boards/arm/v2m_beetle/v2m_beetle.dts index abb2687701c6e..8e8dc71872afb 100644 --- a/boards/arm/v2m_beetle/v2m_beetle.dts +++ b/boards/arm/v2m_beetle/v2m_beetle.dts @@ -74,6 +74,8 @@ interrupts = <0 3>; clocks = <&sysclk &syscon>; current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; }; uart1: uart@40005000 { @@ -82,6 +84,8 @@ interrupts = <2 3>; clocks = <&sysclk &syscon>; current-speed = <115200>; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; }; wdog0: wdog@40008000 { @@ -131,9 +135,15 @@ reg = <0x4001f000 0x1000>; #clock-cells = <0>; }; + + pinctrl: pinctrl { + compatible = "arm,mps3-pinctrl"; + status = "okay"; + }; }; }; &nvic { arm,num-irq-priority-bits = <3>; }; +#include "v2m_beetle-pinctrl.dtsi" diff --git a/boards/aspeed/ast1030_evb/doc/index.rst b/boards/aspeed/ast1030_evb/doc/index.rst index 1c23d7d2644ff..1faa0185e27fa 100644 --- a/boards/aspeed/ast1030_evb/doc/index.rst +++ b/boards/aspeed/ast1030_evb/doc/index.rst @@ -26,22 +26,7 @@ Hardware Supported Features ================== -The following features are supported: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr (at the moment) - -The default configuration can be found in -:zephyr_file:`boards/aspeed/ast1030_evb/ast1030_evb_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -63,6 +48,8 @@ UART5 is configured for serial logs. The default serial setup is 115200 8N1. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + This board comes with a JTAG port which facilitates debugging using a single physical connection. Flashing diff --git a/boards/atmarktechno/degu_evk/board.cmake b/boards/atmarktechno/degu_evk/board.cmake index 33b72c2e9693e..028127e8ef024 100644 --- a/boards/atmarktechno/degu_evk/board.cmake +++ b/boards/atmarktechno/degu_evk/board.cmake @@ -2,5 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/atmel/sam/sam4e_xpro/doc/index.rst b/boards/atmel/sam/sam4e_xpro/doc/index.rst index 1069727aa6c8f..fe51eaf3f9043 100644 --- a/boards/atmel/sam/sam4e_xpro/doc/index.rst +++ b/boards/atmel/sam/sam4e_xpro/doc/index.rst @@ -27,45 +27,7 @@ Hardware Supported Features ================== -The sam4e_xpro board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| AFEC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | counter | -+-----------+------------+-------------------------------------+ -| ETHERNET | on-chip | ethernet | -+-----------+------------+-------------------------------------+ -| HWINFO | on-chip | hwinfo | -+-----------+------------+-------------------------------------+ -| HSMCI | on-chip | sdhc | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| USART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam/sam4e_xpro/sam4e_xpro_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -89,6 +51,8 @@ chip. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing the Zephyr project onto SAM4E MCU requires the `OpenOCD tool`_. By default a factory new SAM4E chip will boot SAM-BA boot loader located in the ROM, not the flashed image. This is determined by the value of GPNVM1 diff --git a/boards/atmel/sam/sam4l_ek/doc/index.rst b/boards/atmel/sam/sam4l_ek/doc/index.rst index f958a54051549..899498f61a539 100644 --- a/boards/atmel/sam/sam4l_ek/doc/index.rst +++ b/boards/atmel/sam/sam4l_ek/doc/index.rst @@ -49,38 +49,7 @@ Hardware Supported Features ================== -The sam4l_ek board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| MPU | on-chip | arch/arm | -+-----------+------------+-------------------------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | counter | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| HWINFO | on-chip | Unique 120 bit serial number | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+-----------+------------+-------------------------------------+ -| TWIM | on-chip | i2c master port-interrupt | -+-----------+------------+-------------------------------------+ -| USART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| USB | on-chip | usb device | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam/sam4l_ek/sam4l_ek_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -104,6 +73,8 @@ between all others headers and RS-485 port. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM4L-EK board have a Segger Embedded Debugger Unit `J-Link OB `_. This provides a debug interface to the SAM4LC4C chip. You can use Ozone or JLink to communicate with diff --git a/boards/atmel/sam/sam4s_xplained/doc/index.rst b/boards/atmel/sam/sam4s_xplained/doc/index.rst index 792c407da8cdc..6f39a88367ada 100644 --- a/boards/atmel/sam/sam4s_xplained/doc/index.rst +++ b/boards/atmel/sam/sam4s_xplained/doc/index.rst @@ -23,45 +23,7 @@ Hardware Supported Features ================== -The sam4s_xplained board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | counter | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| HWINFO | on-chip | Unique device serial number | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| SMC | on-chip | memc (PSRAM) | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| USART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam/sam4s_xplained/sam4s_xplained_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -86,6 +48,8 @@ The section flashing uses the UART from the Segger USB debug connection. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM4S Xplained board comes with Segger `J-Link OB `_. This provides a debug interface to the SAM4S16C chip. You can use Ozone or JLink to communicate with diff --git a/boards/atmel/sam/sam_e70_xplained/doc/index.rst b/boards/atmel/sam/sam_e70_xplained/doc/index.rst index 6c8164391768f..659f793049d54 100644 --- a/boards/atmel/sam/sam_e70_xplained/doc/index.rst +++ b/boards/atmel/sam/sam_e70_xplained/doc/index.rst @@ -27,53 +27,7 @@ Hardware Supported Features ================== -The sam_e70_xplained board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| AFEC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| CAN FD | on-chip | can | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | counter | -+-----------+------------+-------------------------------------+ -| ETHERNET | on-chip | ethernet | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+-----------+------------+-------------------------------------+ -| HWINFO | on-chip | Unique device serial number | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| I2S | on-chip | i2s | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| USART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| XDMAC | on-chip | dma | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -96,6 +50,8 @@ chip. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing the Zephyr project onto SAM E70 MCU requires the `OpenOCD tool`_. Support for Atmel SAM E microcontroller series was added in OpenOCD release 0.10.0, which was added in Zephyr SDK 0.9.2. diff --git a/boards/atmel/sam/sam_v71_xult/doc/index.rst b/boards/atmel/sam/sam_v71_xult/doc/index.rst index cb7ecbfda4398..d58c6ded861e2 100644 --- a/boards/atmel/sam/sam_v71_xult/doc/index.rst +++ b/boards/atmel/sam/sam_v71_xult/doc/index.rst @@ -33,53 +33,7 @@ Hardware Supported Features ================== -The sam_v71_xplained_ultra board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| AFEC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| CAN FD | on-chip | can | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | counter | -+-----------+------------+-------------------------------------+ -| ETHERNET | on-chip | ethernet | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+-----------+------------+-------------------------------------+ -| HWINFO | on-chip | Unique device serial number | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| I2S | on-chip | i2s | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| USART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| XDMAC | on-chip | dma | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -102,6 +56,8 @@ for the console and is available as a Virtual COM Port via EDBG USB chip. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing the Zephyr project onto SAM V71 MCU requires the `OpenOCD tool`_. By default a factory new SAM V71 chip will boot the `SAM-BA`_ boot loader located in the ROM, not the flashed image. This is determined by the value diff --git a/boards/atmel/sam0/samc21n_xpro/doc/index.rst b/boards/atmel/sam0/samc21n_xpro/doc/index.rst index 678e3afa45300..094f75631ea01 100644 --- a/boards/atmel/sam0/samc21n_xpro/doc/index.rst +++ b/boards/atmel/sam0/samc21n_xpro/doc/index.rst @@ -25,53 +25,7 @@ Hardware Supported Features ================== -The samc21n_xpro board configuration supports the following hardware -features: - -.. list-table:: - :header-rows: 1 - - * - Interface - - Controller - - Driver / Component - * - NVIC - - on-chip - - nested vector interrupt controller - * - Flash - - on-chip - - Can be used with LittleFS to store files - * - SYSTICK - - on-chip - - systick - * - WDT - - on-chip - - Watchdog - * - ADC - - on-chip - - Analog to Digital Converter - * - GPIO - - on-chip - - I/O ports - * - PWM - - on-chip - - Pulse Width Modulation - * - USART - - on-chip - - Serial ports - * - I2C - - on-chip - - I2C ports - * - SPI - - on-chip - - Serial Peripheral Interface ports - * - CAN - - on-chip - - CAN ports - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam0/samc21n_xpro/samc21n_xpro_defconfig`. +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -129,6 +83,8 @@ driven by TCC2 instead of by GPIO. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM C21N Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAMC21 chip and is supported by OpenOCD. diff --git a/boards/atmel/sam0/samd20_xpro/doc/index.rst b/boards/atmel/sam0/samd20_xpro/doc/index.rst index 6127a37aff685..f374a15dad3e7 100644 --- a/boards/atmel/sam0/samd20_xpro/doc/index.rst +++ b/boards/atmel/sam0/samd20_xpro/doc/index.rst @@ -23,47 +23,7 @@ Hardware Supported Features ================== -The samd20_xpro board configuration supports the following hardware -features: - -.. list-table:: - :header-rows: 1 - - * - Interface - - Controller - - Driver / Component - * - NVIC - - on-chip - - nested vector interrupt controller - * - Flash - - on-chip - - Can be used with LittleFS to store files - * - SYSTICK - - on-chip - - systick - * - WDT - - on-chip - - Watchdog - * - ADC - - on-chip - - Analog to Digital Converter - * - GPIO - - on-chip - - I/O ports - * - USART - - on-chip - - Serial ports - * - I2C - - on-chip - - I2C ports - * - SPI - - on-chip - - Serial Peripheral Interface ports - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam0/samd20_xpro/samd20_xpro_defconfig`. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -93,6 +53,8 @@ SERCOM0 is available on the EXT1 connector. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM D20 Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAMD20 chip and is supported by OpenOCD. diff --git a/boards/atmel/sam0/samd21_xpro/doc/index.rst b/boards/atmel/sam0/samd21_xpro/doc/index.rst index 057d6d80b8de4..a7b2245e15862 100644 --- a/boards/atmel/sam0/samd21_xpro/doc/index.rst +++ b/boards/atmel/sam0/samd21_xpro/doc/index.rst @@ -23,53 +23,7 @@ Hardware Supported Features ================== -The samd21_xpro board configuration supports the following hardware -features: - -.. list-table:: - :header-rows: 1 - - * - Interface - - Controller - - Driver / Component - * - NVIC - - on-chip - - nested vector interrupt controller - * - Flash - - on-chip - - Can be used with LittleFS to store files - * - SYSTICK - - on-chip - - systick - * - WDT - - on-chip - - Watchdog - * - ADC - - on-chip - - Analog to Digital Converter - * - GPIO - - on-chip - - I/O ports - * - PWM - - on-chip - - Pulse Width Modulation - * - USART - - on-chip - - Serial ports - * - I2C - - on-chip - - I2C ports - * - SPI - - on-chip - - Serial Peripheral Interface ports - * - USB - - on-chip - - Universal Serial Bus device ports - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam0/samd21_xpro/samd21_xpro_defconfig`. +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -134,6 +88,8 @@ SERCOM5 is connected to an 8 megabit SPI flash. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM D21 Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAMD21 chip and is supported by OpenOCD. diff --git a/boards/atmel/sam0/same54_xpro/doc/index.rst b/boards/atmel/sam0/same54_xpro/doc/index.rst index 61b127d7a1b50..3e76b6492d372 100644 --- a/boards/atmel/sam0/same54_xpro/doc/index.rst +++ b/boards/atmel/sam0/same54_xpro/doc/index.rst @@ -3,7 +3,7 @@ Overview ******** -The SAM E54 Xplained Pro evaluation kit is ideal for evaluation and +The `SAM E54 Xplained Pro Evaluation Kit`_ is ideal for evaluation and prototyping with the SAM E54 Cortex®-M4F processor-based microcontrollers. The kit includes Atmel’s Embedded Debugger (EDBG), which provides a full debug interface without the need for additional @@ -36,61 +36,7 @@ Hardware Supported Features ================== -The same54_xpro board configuration supports the following hardware -features: - -+---------------+------------+----------------------------+ -| Interface | Controller | Driver/Component | -+===============+============+============================+ -| ADC | on-chip | adc | -+---------------+------------+----------------------------+ -| DAC | on-chip | dac | -+---------------+------------+----------------------------+ -| DMAC | on-chip | dma | -+---------------+------------+----------------------------+ -| EEPROM | i2c | eeprom, EUI-48 MAC Address | -+---------------+------------+----------------------------+ -| EIC | on-chip | interrupt_controller | -+---------------+------------+----------------------------+ -| GMAC | on-chip | ethernet, mdio | -+---------------+------------+----------------------------+ -| GPIO | on-chip | gpio | -+---------------+------------+----------------------------+ -| MPU | on-chip | arch/arm | -+---------------+------------+----------------------------+ -| NVIC | on-chip | arch/arm | -+---------------+------------+----------------------------+ -| NVMCTRL | on-chip | flash | -+---------------+------------+----------------------------+ -| PORT | on-chip | pinctrl | -+---------------+------------+----------------------------+ -| RTC | on-chip | timer | -+---------------+------------+----------------------------+ -| SERCOM I2C | on-chip | i2c | -+---------------+------------+----------------------------+ -| SERCOM SPI | on-chip | spi | -+---------------+------------+----------------------------+ -| SERCOM USART | on-chip | serial, console | -+---------------+------------+----------------------------+ -| Serial Number | on-chip | hwinfo | -+---------------+------------+----------------------------+ -| SYSTICK | on-chip | timer | -+---------------+------------+----------------------------+ -| TC | on-chip | counter | -+---------------+------------+----------------------------+ -| TCC | on-chip | counter, pwm | -+---------------+------------+----------------------------+ -| TRNG | on-chip | entropy | -+---------------+------------+----------------------------+ -| USB | on-chip | usb | -+---------------+------------+----------------------------+ -| WDT | on-chip | watchdog | -+---------------+------------+----------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam0/same54_xpro/same54_xpro_defconfig`. +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -98,8 +44,9 @@ Pin Mapping The SAM E54 Xplained Pro evaluation kit has 4 GPIO controllers. These controllers are responsible for pin muxing, input/output, pull-up, etc. -For more details please refer to `SAM D5x/E5x Family Datasheet`_ and the `SAM E54 -Xplained Pro Schematic`_. +For more details please refer to `SAM D5x/E5x Family Datasheet (Web)`_, the `SAM E54 +Xplained Pro Schematic (Blue PCB)`_, or `SAM E54 +Xplained Pro Schematic (Red PCB)`_. .. image:: img/ATSAME54-XPRO-pinout.jpg :align: center @@ -165,6 +112,8 @@ Authentication device. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM E54 Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAME54 chip and is supported by OpenOCD. @@ -213,11 +162,17 @@ References .. target-notes:: -.. _Microchip website: - http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATSAME54-XPRO +.. _SAM E54 Xplained Pro Evaluation Kit: + https://www.microchip.com/en-us/development-tool/ATSAME54-XPRO + +.. _SAM D5x/E5x Family Datasheet (Web): + https://onlinedocs.microchip.com/oxy/GUID-AA358083-AEED-4BA8-8511-9F986D3390A5-en-US-2/index.html + +.. _Sam D5x/E5x Family Datasheet (PDF): + https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/UserGuides/70005321A.pdf -.. _SAM D5x/E5x Family Datasheet: - http://ww1.microchip.com/downloads/en/DeviceDoc/60001507C.pdf +.. _SAM E54 Xplained Pro Schematic (Blue PCB): + https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/BoardDesignFiles/SAM-E54-Xplained-Pro-Design-Documentation-Rev9.zip -.. _SAM E54 Xplained Pro Schematic: - http://ww1.microchip.com/downloads/en/DeviceDoc/SAME54-Xplained-Pro_Design-Documentation.zip +.. _SAM E54 Xplained Pro Schematic (Red PCB): + https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/BoardDesignFiles/SAM-E54-Xplained-Pro-Design-Documentation-Rev11.zip diff --git a/boards/atmel/sam0/saml21_xpro/doc/index.rst b/boards/atmel/sam0/saml21_xpro/doc/index.rst index b92e1bf09a70c..90ee26760882e 100644 --- a/boards/atmel/sam0/saml21_xpro/doc/index.rst +++ b/boards/atmel/sam0/saml21_xpro/doc/index.rst @@ -23,50 +23,7 @@ Hardware Supported Features ================== -The saml21_xpro board configuration supports the following hardware -features: - -.. list-table:: - :header-rows: 1 - - * - Interface - - Controller - - Driver / Component - * - NVIC - - on-chip - - nested vector interrupt controller - * - Flash - - on-chip - - Can be used with LittleFS to store files - * - SYSTICK - - on-chip - - systick - * - WDT - - on-chip - - Watchdog - * - GPIO - - on-chip - - I/O ports - * - PWM - - on-chip - - Pulse Width Modulation - * - USART - - on-chip - - Serial ports - * - I2C - - on-chip - - I2C ports - * - SPI - - on-chip - - Serial Peripheral Interface ports - * - TRNG - - on-chip - - True Random Number Generator - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam0/saml21_xpro/saml21_xpro_defconfig`. +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -136,6 +93,8 @@ The SAML21 MCU has 6 SERCOM based SPIs, with two configured as SPI in this BSP. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM L21 Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAML21 chip and is supported by OpenOCD. diff --git a/boards/atmel/sam0/samr21_xpro/doc/index.rst b/boards/atmel/sam0/samr21_xpro/doc/index.rst index e04b4d7a711fb..94db3100c6ee5 100644 --- a/boards/atmel/sam0/samr21_xpro/doc/index.rst +++ b/boards/atmel/sam0/samr21_xpro/doc/index.rst @@ -23,33 +23,7 @@ Hardware Supported Features ================== -The samr21_xpro board configuration supports the following hardware -features: - -+-----------+------------+--------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+--------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+--------------------------------------+ -| WDT | on-chip | Watchdog | -+-----------+------------+--------------------------------------+ -| GPIO | on-chip | I/O ports | -+-----------+------------+--------------------------------------+ -| PWM | on-chip | Pulse Width Modulation | -+-----------+------------+--------------------------------------+ -| USART | on-chip | Serial ports | -+-----------+------------+--------------------------------------+ -| SPI | on-chip | Serial Peripheral Interface ports | -+-----------+------------+--------------------------------------+ -| I2C | on-chip | I2C Peripheral Interface ports | -+-----------+------------+--------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam0/samr21_xpro/samr21_xpro_defconfig`. +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -160,6 +134,8 @@ echo demo. More information at :zephyr:code-sample:`sockets-echo-server` and Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM R21 Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAMR21 chip and is supported by OpenOCD. diff --git a/boards/atmel/sam0/samr34_xpro/doc/index.rst b/boards/atmel/sam0/samr34_xpro/doc/index.rst index 4a38544be350f..001233e118088 100644 --- a/boards/atmel/sam0/samr34_xpro/doc/index.rst +++ b/boards/atmel/sam0/samr34_xpro/doc/index.rst @@ -28,63 +28,7 @@ Hardware Supported Features ================== -The samr34_xpro board configuration supports the following hardware -features: - -.. list-table:: - :header-rows: 1 - - * - Interface - - Controller - - Driver / Component - * - NVIC - - on-chip - - nested vector interrupt controller - * - Flash - - on-chip - - Can be used with LittleFS to store files - * - SYSTICK - - on-chip - - systick - * - WDT - - on-chip - - Watchdog - * - GPIO - - on-chip - - I/O ports - * - PWM - - on-chip - - Pulse Width Modulation - * - USART - - on-chip - - Serial ports - * - I2C - - on-chip - - I2C ports - * - SPI - - on-chip - - Serial Peripheral Interface ports - * - TRNG - - on-chip - - True Random Number Generator - -The following hardware features are supported by Zephyr, but not yet fully -supported by the SOC: - -.. list-table:: - :header-rows: 1 - - * - Interface - - Controller - - Driver / Component - * - LoRa Radio - - on-chip - - Internal SX1276 LoRa Radio - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the Kconfig -:zephyr_file:`boards/atmel/sam0/samr34_xpro/samr34_xpro_defconfig`. +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -150,6 +94,8 @@ The SAMR34 MCU has 6 SERCOM based SPIs, with two configured as SPI in this BSP. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The SAM R34 Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This provides a debug interface to the SAMR34 chip and is supported by OpenOCD. diff --git a/boards/bbc/microbit/board.cmake b/boards/bbc/microbit/board.cmake index b6bae59502cb0..aad2286503c56 100644 --- a/boards/bbc/microbit/board.cmake +++ b/boards/bbc/microbit/board.cmake @@ -9,6 +9,7 @@ set(OPENOCD_NRF5_SUBFAMILY "nrf51") set(OPENOCD_NRF5_INTERFACE "cmsis-dap") include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) diff --git a/boards/bbc/microbit/doc/index.rst b/boards/bbc/microbit/doc/index.rst index 1d829d89a89ae..9224cd4f24da7 100644 --- a/boards/bbc/microbit/doc/index.rst +++ b/boards/bbc/microbit/doc/index.rst @@ -13,13 +13,6 @@ magnetometer sensors, Bluetooth and USB connectivity, a display consisting of external battery pack. The device inputs and outputs are through five ring connectors that are part of the 23-pin edge connector. -* :abbr:`NVIC (Nested Vectored Interrupt Controller)` -* :abbr:`RTC (nRF RTC System Clock)` -* UART -* GPIO -* FLASH -* RADIO (Bluetooth Low Energy) - More information about the board can be found at the `microbit website`_. Hardware @@ -39,29 +32,13 @@ The micro:bit has the following physical features: Supported Features ================== -The bbc_microbit board configuration supports the following nRF51 -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| UART | on-chip | serial port | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/bbc/microbit_v2/board.cmake b/boards/bbc/microbit_v2/board.cmake index c94ffa1630696..0dd45ff28f76d 100644 --- a/boards/bbc/microbit_v2/board.cmake +++ b/boards/bbc/microbit_v2/board.cmake @@ -9,6 +9,7 @@ set(OPENOCD_NRF5_SUBFAMILY "nrf52") # in which case the following line should be removed to default back to "jlink" OpenOCD interface set(OPENOCD_NRF5_INTERFACE "cmsis-dap") include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) diff --git a/boards/bbc/microbit_v2/doc/index.rst b/boards/bbc/microbit_v2/doc/index.rst index 62c3cee2252c3..24fbaf5d2a36d 100644 --- a/boards/bbc/microbit_v2/doc/index.rst +++ b/boards/bbc/microbit_v2/doc/index.rst @@ -33,29 +33,13 @@ The micro:bit-v2 has the following physical features: Supported Features ================== -The bbc_microbit_v2 board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| UART | on-chip | serial port | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/bcdevices/plt_demo_v2/board.cmake b/boards/bcdevices/plt_demo_v2/board.cmake index 2935563797340..ebf0cf5bffa94 100644 --- a/boards/bcdevices/plt_demo_v2/board.cmake +++ b/boards/bcdevices/plt_demo_v2/board.cmake @@ -4,6 +4,7 @@ set(OPENOCD_NRF5_SUBFAMILY "nrf52") board_runner_args(nrfjprog "--nrf-family=NRF52") board_runner_args(jlink "--device=nRF52832_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52832" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/bcdevices/plt_demo_v2/doc/index.rst b/boards/bcdevices/plt_demo_v2/doc/index.rst index 646e5c9202507..cdab9ada052e4 100644 --- a/boards/bcdevices/plt_demo_v2/doc/index.rst +++ b/boards/bcdevices/plt_demo_v2/doc/index.rst @@ -41,40 +41,7 @@ Hardware Supported Features ================== -The Blue Clover PLT Demo V2 board configuration supports the -following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -105,6 +72,8 @@ NFC Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``blueclover_plt_demo_v2/nrf52832`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/beagle/beagleconnect_freedom/doc/index.rst b/boards/beagle/beagleconnect_freedom/doc/index.rst index 8bf3bf4e6e60d..3fac0a1f08dea 100644 --- a/boards/beagle/beagleconnect_freedom/doc/index.rst +++ b/boards/beagle/beagleconnect_freedom/doc/index.rst @@ -24,41 +24,7 @@ GPIO expander. Supported Features ================== -The board configuration supports the following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| I2C | on-chip | i2c | -+-----------+------------+----------------------+ -| SPI | on-chip | spi | -+-----------+------------+----------------------+ -| HWINFO | on-chip | hwinfo | -+-----------+------------+----------------------+ -| I2C | off-chip | OPT3001 | -+-----------+------------+----------------------+ -| I2C | off-chip | HDC2010 | -+-----------+------------+----------------------+ -| I2C | off-chip | BCF_BRIDGE_MCU | -+-----------+------------+----------------------+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| RADIO | on-chip | ieee802154 | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== diff --git a/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst b/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst index 24665eafce18e..7f38c4589c737 100644 --- a/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst +++ b/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst @@ -55,23 +55,7 @@ BeaglePlay ARM Cortex-A53 CPUs typically run Linux, while the CC1352P7 Cortex-M4 Supported Features ================== -The ``beagleplay/cc1352p7`` board target supports the following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| RADIO | on-chip | ieee802154 | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -137,6 +121,8 @@ CC1352 reset is connected to AM62 GPIO0_14. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2 b/boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2 new file mode 100644 index 0000000000000..b154f4e2e4e2b --- /dev/null +++ b/boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2 @@ -0,0 +1,8 @@ +# BeagleBoard.org PocketBeagle 2 +# +# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation +# +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_POCKETBEAGLE_2 + select SOC_AM6232_M4 if BOARD_POCKETBEAGLE_2_AM6232_M4 diff --git a/boards/beagle/pocketbeagle_2/board.cmake b/boards/beagle/pocketbeagle_2/board.cmake new file mode 100644 index 0000000000000..d1f7b9aff412b --- /dev/null +++ b/boards/beagle/pocketbeagle_2/board.cmake @@ -0,0 +1,10 @@ +# BeagleBoard.org PocketBeagle 2 +# +# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation +# +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_SOC_AM6232_M4) + board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3339") + include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +endif() diff --git a/boards/beagle/pocketbeagle_2/board.yml b/boards/beagle/pocketbeagle_2/board.yml new file mode 100644 index 0000000000000..03f54cde3bb1c --- /dev/null +++ b/boards/beagle/pocketbeagle_2/board.yml @@ -0,0 +1,12 @@ +board: + name: pocketbeagle_2 + full_name: PocketBeagle 2 + vendor: beagle + socs: + - name: am6232 + revision: + format: custom + exact: true + default: "A0" + revisions: + - name: "A0" diff --git a/boards/beagle/pocketbeagle_2/doc/img/pocketbeagle_2.webp b/boards/beagle/pocketbeagle_2/doc/img/pocketbeagle_2.webp new file mode 100644 index 0000000000000..34ecf2d1e0004 Binary files /dev/null and b/boards/beagle/pocketbeagle_2/doc/img/pocketbeagle_2.webp differ diff --git a/boards/beagle/pocketbeagle_2/doc/index.rst b/boards/beagle/pocketbeagle_2/doc/index.rst new file mode 100644 index 0000000000000..ecd9542919c90 --- /dev/null +++ b/boards/beagle/pocketbeagle_2/doc/index.rst @@ -0,0 +1,121 @@ +.. zephyr:board:: pocketbeagle_2 + +Overview +******** + +PocketBeagle 2 is a computational platform powered by TI AM62x SoC (there are two +revisions, AM6232 and AM6254). + +The board configuration provides support for the ARM Cortex-M4F MCU core. + +See the `PocketBeagle 2 Product Page`_ for details. + +Hardware +******** +PocketBeagle 2 features the TI AM62x SoC based around an Arm Cortex-A53 multicore +cluster with an Arm Cortex-M4F microcontroller, Imagination Technologies AXE-1-16 +graphics processor (from revision A1) and TI programmable real-time unit subsystem +microcontroller cluster coprocessors. + +Zephyr is ported to run on the M4F core and the following listed hardware +specifications are used: + +- Low-power ARM Cortex-M4F +- Memory + + - 256KB of SRAM + - 512MB of DDR4 + +Currently supported PocketBeagle 2 revisions: + +- A0: Comes wth SOC AM6232 + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Devices +======== +System Clock +------------ + +This board configuration uses a system clock frequency of 400 MHz. + +DDR RAM +------- + +The board has 512MB of DDR RAM available. This board configuration +allocates Zephyr 4kB of RAM (only for resource table: 0x9CC00000 to 0x9CC00400). + +Serial Port +----------- + +This board configuration uses a single serial communication channel with the +MCU domain UART (MCU_UART0, i.e. P2.05 as RX and P2.07 as TX). + +SD Card +******* + +Download BeagleBoard.org's official `BeagleBoard Imaging Utility`_ to create bootable +SD-card with the Linux distro image. This will boot Linux on the A53 application +cores. These cores will then load the Zephyr binary on the M4 core using remoteproc. + +Flashing +******** + +The board supports remoteproc using the OpenAMP resource table. + +The testing requires the binary to be copied to the SD card to allow the A53 cores to load it while booting using remoteproc. + +To test the M4F core, we build the :zephyr:code-sample:`hello_world` sample with the following command. + +.. zephyr-app-commands:: + :board: pocketbeagle_2/am6232/m4 + :zephyr-app: samples/hello_world + :goals: build + +This builds the program and the binary is present in the :file:`build/zephyr` directory as +:file:`zephyr.elf`. + +We now copy this binary onto the SD card in the :file:`/lib/firmware` directory and name it as +:file:`am62-mcu-m4f0_0-fw`. + +.. code-block:: console + + # Mount the SD card at sdcard for example + sudo mount /dev/sdX sdcard + # copy the elf to the /lib/firmware directory + sudo cp --remove-destination zephyr.elf sdcard/lib/firmware/am62-mcu-m4f0_0-fw + +The SD card can now be used for booting. The binary will now be loaded onto the M4F core on boot. + +The binary will run and print Hello world to the MCU_UART0 port. + +Debugging +********* + +The board supports debugging M4 core from the A53 cores running Linux. Since the target needs +superuser privilege, openocd needs to be launched seperately for now: + +.. code-block:: console + + sudo openocd -f board/ti_am625_swd_native.cfg + + +Start debugging + +.. zephyr-app-commands:: + :goals: debug + +References +********** + +* `PocketBeagle 2 Product Page`_ +* `Documentation `_ + +.. _PocketBeagle 2 Product Page: + https://www.beagleboard.org/boards/pocketbeagle-2 + +.. _BeagleBoard Imaging Utility: + https://github.com/beagleboard/bb-imager-rs/releases diff --git a/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4-pinctrl.dtsi b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4-pinctrl.dtsi new file mode 100644 index 0000000000000..7f54984345a2a --- /dev/null +++ b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4-pinctrl.dtsi @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + mcu_uart0_rx_default: mcu_uart0_rx_default { + pinmux = ; + }; + + mcu_uart0_tx_default: mcu_uart0_tx_default { + pinmux = ; + }; +}; diff --git a/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.dts b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.dts new file mode 100644 index 0000000000000..6b1c256976b50 --- /dev/null +++ b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.dts @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "pocketbeagle_2_am6232_m4-pinctrl.dtsi" + +/ { + model = "BeagleBoard.org PocketBeagle 2"; + compatible = "beagle,pocketbeagle_2_m4"; + + chosen { + zephyr,sram = &sram0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,ipc = &ipc0; + zephyr,ipc_shm = &ddr0; + zephyr,sram1 = &ddr1; + }; + + cpus { + cpu@0 { + status = "okay"; + clock-frequency = <400000000>; + }; + }; + + ddr0: memory@9cb00000 { + compatible = "mmio-sram"; + reg = <0x9cb00000 DT_SIZE_M(1)>; + }; + + rsc_table: memory@9cc00000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x9cc00000 DT_SIZE_K(4)>; + zephyr,memory-region = "RSC_TABLE"; + }; + + ddr1: memory@9cc01000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x9cc01000 (DT_SIZE_M(15) - DT_SIZE_K(4))>; + zephyr,memory-region = "DDR"; + }; + + ipc0: ipc { + compatible = "zephyr,mbox-ipm"; + mboxes = <&mbox0 0>, <&mbox0 1>; + mbox-names = "tx", "rx"; + }; +}; + +&uart0 { + current-speed = <115200>; + pinctrl-0 = <&mcu_uart0_rx_default &mcu_uart0_tx_default>; + pinctrl-names = "default"; + status = "okay"; +}; diff --git a/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.yaml b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.yaml new file mode 100644 index 0000000000000..fc258c2e383d9 --- /dev/null +++ b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.yaml @@ -0,0 +1,10 @@ +identifier: pocketbeagle_2/am6232/m4 +name: BeagleBoard.org PocketBeagle 2 +type: mcu +arch: arm +toolchain: + - zephyr +ram: 192 +vendor: beagle +supported: + - uart diff --git a/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4_defconfig b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4_defconfig new file mode 100644 index 0000000000000..02a9f623a2714 --- /dev/null +++ b/boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4_defconfig @@ -0,0 +1,18 @@ +# BeagleBoard.org PocketBeagle 2 +# +# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation +# +# SPDX-License-Identifier: Apache-2.0 + +# Platform Configuration +CONFIG_CORTEX_M_SYSTICK=y + +# Zephyr Kernel Configuration +CONFIG_XIP=n + +# Serial Driver +CONFIG_SERIAL=y + +# Enable Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/beagle/pocketbeagle_2/revision.cmake b/boards/beagle/pocketbeagle_2/revision.cmake new file mode 100644 index 0000000000000..f7698f24bf31e --- /dev/null +++ b/boards/beagle/pocketbeagle_2/revision.cmake @@ -0,0 +1,10 @@ +set(BOARD_REVISIONS "A0") + +# If BOARD_REVISION not set, use the default revision +if(NOT DEFINED BOARD_REVISION) + set(BOARD_REVISION ${LIST_BOARD_REVISION_DEFAULT}) +endif() + +if(NOT BOARD_REVISION IN_LIST BOARD_REVISIONS) + message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for PocketBeagle 2. Accepted revisions: ${BOARD_REVISIONS}") +endif() diff --git a/boards/beagle/pocketbeagle_2/support/openocd.cfg b/boards/beagle/pocketbeagle_2/support/openocd.cfg new file mode 100644 index 0000000000000..f0cff3f9e2db6 --- /dev/null +++ b/boards/beagle/pocketbeagle_2/support/openocd.cfg @@ -0,0 +1,7 @@ +# BeagleBoard.org PocketBeagle 2 +# +# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation +# +# SPDX-License-Identifier: Apache-2.0 + +source [find board/ti_am625_swd_native.cfg] diff --git a/boards/blues/cygnet/Kconfig.cygnet b/boards/blues/cygnet/Kconfig.cygnet new file mode 100644 index 0000000000000..f907d27024bac --- /dev/null +++ b/boards/blues/cygnet/Kconfig.cygnet @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Blues +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_CYGNET + select SOC_STM32L433XX diff --git a/boards/blues/cygnet/Kconfig.defconfig b/boards/blues/cygnet/Kconfig.defconfig new file mode 100644 index 0000000000000..898cdfcf29a79 --- /dev/null +++ b/boards/blues/cygnet/Kconfig.defconfig @@ -0,0 +1,12 @@ +# STM32L433CC Cygnet board configuration + +# Copyright (c) 2025 Blues +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_CYGNET + +config SPI_STM32_INTERRUPT + default y + depends on SPI + +endif # BOARD_CYGNET diff --git a/boards/blues/cygnet/board.cmake b/boards/blues/cygnet/board.cmake new file mode 100644 index 0000000000000..3f2cb76285919 --- /dev/null +++ b/boards/blues/cygnet/board.cmake @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 + +# keep first +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") +board_runner_args(jlink "--device=STM32L433CC" "--speed=4000") + +# keep first +include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/blues/cygnet/board.yml b/boards/blues/cygnet/board.yml new file mode 100644 index 0000000000000..4341ee22c8e2f --- /dev/null +++ b/boards/blues/cygnet/board.yml @@ -0,0 +1,6 @@ +board: + name: cygnet + full_name: Cygnet + vendor: blues + socs: + - name: stm32l433xx diff --git a/boards/blues/cygnet/cygnet.dts b/boards/blues/cygnet/cygnet.dts new file mode 100644 index 0000000000000..00fd5282bd2e7 --- /dev/null +++ b/boards/blues/cygnet/cygnet.dts @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2025 Blues + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include +#include "feather_connector.dtsi" +#include + +/ { + model = "Blues Cygnet"; + compatible = "blues,cygnet"; + + chosen { + zephyr,console = &lpuart1; + zephyr,shell-uart = &lpuart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds: leds { + compatible = "gpio-leds"; + + user_led: led_0 { + gpios = <&gpioa 8 GPIO_ACTIVE_HIGH>; + label = "User LED"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + user_button: button { + gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; + label = "User Button"; + zephyr,code = ; + }; + }; + + aliases { + led0 = &user_led; + sw0 = &user_button; + }; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hsi { + status = "okay"; +}; + +&pll { + div-m = <1>; + mul-n = <20>; + div-p = <7>; + div-q = <2>; + div-r = <4>; + clocks = <&clk_hsi>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; + apb2-prescaler = <1>; +}; + +&lpuart1 { + pinctrl-0 = <&lpuart1_tx_pb11 &lpuart1_rx_pb10>; + pinctrl-names = "default"; + current-speed = <115200>; + status = "okay"; +}; + +&usart1 { + pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; + pinctrl-names = "default"; + current-speed = <115200>; +}; + +&spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pb5>; + pinctrl-names = "default"; + cs-gpios = <&gpiob 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + status = "okay"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; + pinctrl-names = "default"; + clock-frequency = ; + status = "okay"; +}; + +&timers2 { + status = "okay"; + + pwm2: pwm { + status = "okay"; + pinctrl-0 = <&tim2_ch1_pa0>; + pinctrl-names = "default"; + }; +}; + +&can1 { + pinctrl-0 = <&can1_rx_pb8 &can1_tx_pb9>; + pinctrl-names = "default"; + status = "okay"; +}; + +&rtc { + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>, + <&rcc STM32_SRC_LSI RTC_SEL(2)>; + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * Reserve the final 16 KiB for file system partition + */ + storage_partition: partition@3c000 { + label = "storage"; + reg = <0x0003c000 DT_SIZE_K(16)>; + }; + }; +}; diff --git a/boards/blues/cygnet/cygnet.yaml b/boards/blues/cygnet/cygnet.yaml new file mode 100644 index 0000000000000..88af7f3d91d36 --- /dev/null +++ b/boards/blues/cygnet/cygnet.yaml @@ -0,0 +1,22 @@ +identifier: cygnet +name: Blues Cygnet +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +ram: 64 +flash: 256 +supported: + - nvs + - can + - spi + - i2c + - pwm + - gpio + - counter + - feather_serial + - feather_i2c + - feather_spi +vendor: blues diff --git a/boards/blues/cygnet/cygnet_defconfig b/boards/blues/cygnet/cygnet_defconfig new file mode 100644 index 0000000000000..674354645c175 --- /dev/null +++ b/boards/blues/cygnet/cygnet_defconfig @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable HW stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable GPIO +CONFIG_GPIO=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/blues/cygnet/doc/img/cygnet-pinout.webp b/boards/blues/cygnet/doc/img/cygnet-pinout.webp new file mode 100644 index 0000000000000..9499bcaa82eb5 Binary files /dev/null and b/boards/blues/cygnet/doc/img/cygnet-pinout.webp differ diff --git a/boards/blues/cygnet/doc/img/cygnet.webp b/boards/blues/cygnet/doc/img/cygnet.webp new file mode 100644 index 0000000000000..a1355669cb22f Binary files /dev/null and b/boards/blues/cygnet/doc/img/cygnet.webp differ diff --git a/boards/blues/cygnet/doc/index.rst b/boards/blues/cygnet/doc/index.rst new file mode 100644 index 0000000000000..8283eb15db69e --- /dev/null +++ b/boards/blues/cygnet/doc/index.rst @@ -0,0 +1,204 @@ +.. zephyr:board:: cygnet + +Overview +******** + +The Blues Cygnet board features an ARM Cortex-M4 based STM32L433CC MCU +with a wide range of connectivity support and configurations. Here are +some highlights of the Cygnet board: + +- STM32L4 microcontroller in LQFP48 package +- Adafruit Feather connector +- User LED +- User push-button +- USB Type-C connector + +More information about the board can be found at the `Blues Cygnet website`_. + +Hardware +******** + +The STM32L433CC SoC provides the following hardware IPs: + +- Ultra-low-power with FlexPowerControl (down to 28 nA Standby mode and 84 + |micro| A/MHz run mode) +- Core: ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU, frequency up to 80 MHz, + 100DMIPS/1.25DMIPS/MHz (Dhrystone 2.1) +- Clock Sources: + + - 32 kHz crystal oscillator for RTC (LSE) + - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%) + - Internal low-power 32 kHz RC ( |plusminus| 5%) + - Internal multispeed 100 kHz to 48 MHz oscillator, auto-trimmed by + LSE (better than |plusminus| 0.25 % accuracy) + - 2 PLLs for system clock, USB, audio, ADC + +- RTC with HW calendar, alarms and calibration +- 11x timers: + + - 1x 16-bit advanced motor-control + - 1x 32-bit and 2x 16-bit general purpose + - 2x 16-bit basic + - 2x low-power 16-bit timers (available in Stop mode) + - 2x watchdogs + - SysTick timer + +- Up to 21 fast I/Os, most 5 V-tolerant +- Memories + + - Up to 256 KB single bank Flash, proprietary code readout protection + - 64 KB of SRAM including 16 KB with hardware parity check + +- Rich analog peripherals (independent supply) + + - 1x 12-bit ADC 5 MSPS, up to 16-bit with hardware oversampling, 200 + |micro| A/MSPS + - 2x 12-bit DAC output channels, low-power sample and hold + - 1x operational amplifiers with built-in PGA + - 2x ultra-low-power comparators + +- 17x communication interfaces + + - USB 2.0 full-speed crystal less solution with LPM and BCD + - 1x SAI (serial audio interface) + - 3x I2C FM+(1 Mbit/s), SMBus/PMBus + - 4x USARTs (ISO 7816, LIN, IrDA, modem) + - 1x LPUART (Stop 2 wake-up) + - 3x SPIs (and 1x Quad SPI) + - CAN (2.0B Active) + +- 14-channel DMA controller +- True random number generator +- CRC calculation unit, 96-bit unique ID +- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell* + +More information about STM32L433CC can be found here: + +- `STM32L433CC on www.st.com`_ +- `STM32L432 reference manual`_ + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +.. note:: CAN feature requires a CAN transceiver. + +Connections and IOs +=================== + +The Cygnet board has 6 GPIO controllers. These controllers are responsible for pin muxing, +input/output, pull-up, etc. + +Available pins +-------------- +.. image:: img/cygnet-pinout.webp + :align: center + :alt: Cygnet Pinout + +For more details please refer to `Blues Cygnet User Manual`_. + +Default Zephyr Peripheral Mapping +--------------------------------- + +- LPUART_1_TX : PB11 +- LPUART_1_RX : PB10 +- UART_1_TX : PA9 +- UART_1_RX : PA10 +- I2C_1_SCL : PB6 +- I2C_1_SDA : PB7 +- PWM_2_CH1 : PA0 +- SPI_1: SCK/MISO/MOSI : PA5/PA6/PB5 + +System Clock +------------ + +The Cygnet board System Clock could be driven by internal or external oscillator, +as well as main PLL clock. By default System clock is driven by PLL clock at 80MHz, +driven by 16MHz high speed internal oscillator. + +Serial Port +----------- + +The Cygnet board has 4 U(S)ARTs and 1 LPUART. The Zephyr console output is assigned +to LPUART1. Default settings are 115200 8N1. + + +Programming and Debugging +************************* + +The Cygnet board requires an ST-LINK embedded debug tool in order to be programmed and debugged. + +Applications for the ``cygnet`` board configuration can be built and +flashed in the usual way (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +Flashing +======== + +The board is configured to be flashed using west `STM32CubeProgrammer`_ runner, +so its :ref:`installation ` is required. + +Alternatively, OpenOCD or JLink can also be used to flash the board using +the ``--runner`` (or ``-r``) option: + +.. code-block:: console + + $ west flash --runner openocd + $ west flash --runner jlink + +Flashing an application to Cygnet +--------------------------------- + +Connect the Cygnet to the ST-LINK debugger, then run a serial host program to connect with your Cygnet board. + +.. code-block:: console + + $ picocom /dev/ttyACM0 -b 115200 + +Now build and flash an application. Here is an example for +:zephyr:code-sample:`hello_world`. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: cygnet + :goals: build flash + +You should see the following message on the console: + +.. code-block:: console + + $ Hello World! cygnet + + +Debugging +========= + +You can debug an application in the usual way. Here is an example for the +:zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: cygnet + :maybe-skip-config: + :goals: debug + +References +********** + +.. target-notes:: + +.. _Blues Cygnet website: + https://www.blues.dev/ + +.. _Blues Cygnet User Manual: + https://dev.blues.io/feather-mcus/cygnet/cygnet-introduction/ + +.. _STM32L433CC on www.st.com: + https://www.st.com/en/microcontrollers-microprocessors/stm32l433cc.html + +.. _STM32L432 reference manual: + https://www.st.com/resource/en/reference_manual/dm00151940.pdf + +.. _STM32CubeProgrammer: + https://www.st.com/en/development-tools/stm32cubeprog.html diff --git a/boards/blues/cygnet/feather_connector.dtsi b/boards/blues/cygnet/feather_connector.dtsi new file mode 100644 index 0000000000000..da08fb458847d --- /dev/null +++ b/boards/blues/cygnet/feather_connector.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025 Blues Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + feather_header: connector { + compatible = "adafruit-feather-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpioa 0 0>, /* A0 */ + <1 0 &gpioa 1 0>, /* A1 */ + <2 0 &gpioa 2 0>, /* A2 */ + <3 0 &gpioa 3 0>, /* A3 */ + <4 0 &gpiob 1 0>, /* A4 */ + <5 0 &gpioa 7 0>, /* A5 */ + <6 0 &gpioa 5 0>, /* SCK */ + <7 0 &gpiob 5 0>, /* MOSI */ + <8 0 &gpioa 6 0>, /* MISO */ + <9 0 &gpioa 10 0>, /* RX */ + <10 0 &gpioa 9 0>, /* TX */ + <11 0 &gpiob 1 0>, /* D4 */ + <12 0 &gpiob 7 0>, /* SDA */ + <13 0 &gpiob 6 0>, /* SCL */ + <14 0 &gpiob 8 0>, /* D5 */ + <15 0 &gpiob 9 0>, /* D6 */ + <16 0 &gpiob 14 0>, /* D9 */ + <17 0 &gpiob 13 0>, /* D10 */ + <18 0 &gpiob 0 0>, /* D11 */ + <19 0 &gpiob 15 0>, /* D12 */ + <20 0 &gpiob 4 0>; /* D13 */ + }; +}; + +feather_serial: &usart1 {}; +feather_i2c: &i2c1 {}; +feather_spi: &spi1 {}; diff --git a/boards/blues/cygnet/support/openocd.cfg b/boards/blues/cygnet/support/openocd.cfg new file mode 100644 index 0000000000000..cd566c1fa1c97 --- /dev/null +++ b/boards/blues/cygnet/support/openocd.cfg @@ -0,0 +1,7 @@ +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l4x.cfg] + +reset_config srst_only diff --git a/boards/blues/swan_r5/doc/index.rst b/boards/blues/swan_r5/doc/index.rst index 51212bd4c6420..0c2c796abd4cf 100644 --- a/boards/blues/swan_r5/doc/index.rst +++ b/boards/blues/swan_r5/doc/index.rst @@ -85,37 +85,7 @@ More information about Swan can be found here: Supported Features ================== -The Zephyr Swan board configuration supports the following -hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| USB | on-chip | usb | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on this Zephyr port. - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/blues/swan_r5/swan_r5_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -189,6 +159,8 @@ assigned to LPUART. Default settings are 115200 8N1. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Connect Swan to your host computer using the USB port. Then build and flash an application. Here is an example for the :zephyr:code-sample:`hello_world` application. diff --git a/boards/bytesatwork/bytesensi_l/bytesensi_l.dts b/boards/bytesatwork/bytesensi_l/bytesensi_l.dts index 2054d6bd2e2e7..b3be00fc171e2 100644 --- a/boards/bytesatwork/bytesensi_l/bytesensi_l.dts +++ b/boards/bytesatwork/bytesensi_l/bytesensi_l.dts @@ -93,15 +93,15 @@ int-gpios = <&gpio0 25 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; - temperature_sensor: tmp116@4a { + temperature_sensor: tmp11x@4a { status = "okay"; - compatible = "ti,tmp116"; + compatible = "ti,tmp11x"; reg = <0x4a>; #address-cells = <1>; #size-cells = <0>; - eeprom: ti_tmp116_eeprom@0 { - compatible = "ti,tmp116-eeprom"; + eeprom: ti_tmp11x_eeprom@0 { + compatible = "ti,tmp11x-eeprom"; reg = <0x0>; read-only; }; diff --git a/boards/bytesatwork/bytesensi_l/doc/index.rst b/boards/bytesatwork/bytesensi_l/doc/index.rst index d1b220a778b94..35e402497edcc 100644 --- a/boards/bytesatwork/bytesensi_l/doc/index.rst +++ b/boards/bytesatwork/bytesensi_l/doc/index.rst @@ -12,33 +12,7 @@ Hardware Supported Features ================== -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| GPS | u-blox | gnss | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ -| RADIO | Semtech | LoRa | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -121,6 +95,8 @@ External GPS Antenna @ J3 Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== The byteSENSI-L board can be flashed with the SEGGER JLink programmer. diff --git a/boards/circuitdojo/feather/board.cmake b/boards/circuitdojo/feather/board.cmake index 9c0c33243af67..91aec43ebb51b 100644 --- a/boards/circuitdojo/feather/board.cmake +++ b/boards/circuitdojo/feather/board.cmake @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/common/esp32.board.cmake b/boards/common/esp32.board.cmake index cfe7b7683fc1d..4669c2e620bea 100644 --- a/boards/common/esp32.board.cmake +++ b/boards/common/esp32.board.cmake @@ -13,4 +13,4 @@ board_runner_args(openocd --gdb-init "thb main") set(ESP_IDF_PATH ${ZEPHYR_HAL_ESPRESSIF_MODULE_DIR}) assert(ESP_IDF_PATH "ESP_IDF_PATH is not set") -board_finalize_runner_args(esp32 "--esp-idf-path=${ESP_IDF_PATH}") +board_runner_args(esp32 "--esp-idf-path=${ESP_IDF_PATH}") diff --git a/boards/common/openocd-adi-max32.boards.cmake b/boards/common/openocd-adi-max32.boards.cmake index 93409dd6901f8..c231f5ad1cf2b 100644 --- a/boards/common/openocd-adi-max32.boards.cmake +++ b/boards/common/openocd-adi-max32.boards.cmake @@ -3,33 +3,22 @@ # # SPDX-License-Identifier: Apache-2.0 -# Default cmsis-dap, it will be overwritten below if requires -set(MAX32_INTERFACE_CFG "cmsis-dap.cfg") +if(CONFIG_ARCH STREQUAL "riscv") + set(MAX32_TARGET_CFG "${CONFIG_SOC}_riscv.cfg") + set(MAX32_INTERFACE_CFG "olimex-arm-usb-ocd-h.cfg") +else() + set(MAX32_TARGET_CFG "${CONFIG_SOC}.cfg") + set(MAX32_INTERFACE_CFG "cmsis-dap.cfg") +endif() -if(CONFIG_SOC_MAX32655_M4) - set(MAX32_TARGET_CFG "max32655.cfg") -elseif(CONFIG_SOC_MAX32662) - set(MAX32_TARGET_CFG "max32662.cfg") -elseif(CONFIG_SOC_MAX32666) +# MAX32666 share the same target configuration file with MAX32665 +if(CONFIG_SOC_MAX32666) set(MAX32_TARGET_CFG "max32665.cfg") -elseif(CONFIG_SOC_MAX32670) - set(MAX32_TARGET_CFG "max32670.cfg") -elseif(CONFIG_SOC_MAX32672) - set(MAX32_TARGET_CFG "max32672.cfg") -elseif(CONFIG_SOC_MAX32675) - set(MAX32_TARGET_CFG "max32675.cfg") -elseif(CONFIG_SOC_MAX32680_M4) - set(MAX32_TARGET_CFG "max32680.cfg") -elseif(CONFIG_SOC_MAX32690_M4) - set(MAX32_TARGET_CFG "max32690.cfg") -elseif(CONFIG_SOC_MAX78000_M4) - set(MAX32_TARGET_CFG "max78000.cfg") -elseif(CONFIG_SOC_MAX78002_M4) - set(MAX32_TARGET_CFG "max78002.cfg") endif() board_runner_args(openocd --cmd-pre-init "source [find interface/${MAX32_INTERFACE_CFG}]") board_runner_args(openocd --cmd-pre-init "source [find target/${MAX32_TARGET_CFG}]") +board_runner_args(openocd "--target-handle=_CHIPNAME.cpu") if(CONFIG_SOC_FAMILY_MAX32_M4) board_runner_args(openocd --cmd-pre-init "allow_low_pwr_dbg") diff --git a/boards/common/rfp.board.cmake b/boards/common/rfp.board.cmake new file mode 100644 index 0000000000000..afce0c8019cc4 --- /dev/null +++ b/boards/common/rfp.board.cmake @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_set_flasher_ifnset(rfp) + +board_finalize_runner_args(rfp) diff --git a/boards/contextualelectronics/abc/board.cmake b/boards/contextualelectronics/abc/board.cmake index 261663eef4e27..1482c471b4cd9 100644 --- a/boards/contextualelectronics/abc/board.cmake +++ b/boards/contextualelectronics/abc/board.cmake @@ -3,6 +3,7 @@ set(OPENOCD_NRF5_SUBFAMILY "nrf52") board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/contextualelectronics/abc/doc/index.rst b/boards/contextualelectronics/abc/doc/index.rst index d7f12bc4738cd..02ddb9689e5f5 100644 --- a/boards/contextualelectronics/abc/doc/index.rst +++ b/boards/contextualelectronics/abc/doc/index.rst @@ -35,38 +35,8 @@ is 32.768 kHz. The frequency of the main clock is 32 MHz. Supported Features ================== -The contextualelectronics_abc board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| Modem | on-board | quectel_bg9x | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: + See `ABC Board website`_ for more details on this board, and `Nordic Semiconductor Infocenter`_ for a complete list of SoC features. @@ -74,6 +44,8 @@ features. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``contextualelectronics_abc`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/croxel/croxel_cx1825/board.cmake b/boards/croxel/croxel_cx1825/board.cmake index f95878945bedf..506a133984038 100644 --- a/boards/croxel/croxel_cx1825/board.cmake +++ b/boards/croxel/croxel_cx1825/board.cmake @@ -2,6 +2,7 @@ board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/croxel/croxel_cx1825/doc/index.rst b/boards/croxel/croxel_cx1825/doc/index.rst index ab88c4dd4321d..cee944d5f97a8 100644 --- a/boards/croxel/croxel_cx1825/doc/index.rst +++ b/boards/croxel/croxel_cx1825/doc/index.rst @@ -46,12 +46,7 @@ Hardware Supported Features ================== -- Discrete LEDs (red and green) -- Buttons (User and Reset) -- Sensors (Accelerometer, Light, Temperature and Humidity, Pressure and Hall-Effect sensors) -- Beeper -- Radio (Bluetooth, IEEE 802.15.4) -- SOC peripherals (ADC, Clock, Flash, GPIO, I2C, MPU, NVIC, PWM, Radio, RTC, SPI, USB, WDT) +.. zephyr:board-supported-hw:: Future Feature Support ====================== @@ -81,6 +76,8 @@ Digital Inputs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``croxel_cx1825/nrf52840`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/ct/ctcc/board.cmake b/boards/ct/ctcc/board.cmake index 11d0511404b1a..65f36c72e6c85 100644 --- a/boards/ct/ctcc/board.cmake +++ b/boards/ct/ctcc/board.cmake @@ -3,6 +3,7 @@ if(CONFIG_BOARD_CTCC_NRF52840) board_runner_args(nrfjprog "--softreset") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") + include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) elseif(CONFIG_BOARD_CTCC_NRF9161 OR CONFIG_BOARD_CTCC_NRF9161_NS) @@ -14,6 +15,7 @@ elseif(CONFIG_BOARD_CTCC_NRF9161 OR CONFIG_BOARD_CTCC_NRF9161_NS) endif() board_runner_args(nrfjprog "--softreset") board_runner_args(pyocd "--target=nrf9161" "--frequency=4000000") + include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) endif() diff --git a/boards/ct/ctcc/doc/index.rst b/boards/ct/ctcc/doc/index.rst index 97780246a742c..5a890893c230f 100644 --- a/boards/ct/ctcc/doc/index.rst +++ b/boards/ct/ctcc/doc/index.rst @@ -57,63 +57,7 @@ Hardware Supported Features ================== -The ``ctcc/nrf52840`` board target supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -The ``ctcc/nrf9161`` board target supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| FLASH | external | spi | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| RADIO | on-chip | LTE-M/NB-IoT, | -| | | DECT NR\+ | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| SPU | on-chip | system protection | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -137,6 +81,8 @@ nRF9161: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for ``ctcc`` boards can be built in the usual way (see :ref:`build_an_application` for more details). diff --git a/boards/cypress/cy8ckit_062_ble/doc/index.rst b/boards/cypress/cy8ckit_062_ble/doc/index.rst index 01ad4696ea23b..8a5090a5ed4ab 100644 --- a/boards/cypress/cy8ckit_062_ble/doc/index.rst +++ b/boards/cypress/cy8ckit_062_ble/doc/index.rst @@ -1,7 +1,4 @@ -.. _cy8ckit_062_ble: - -INFINEON PSOC 63 BLE Pioneer Kit -################################ +.. zephyr:board:: cy8ckit_062_ble Overview ******** @@ -30,10 +27,6 @@ enabling you to emulate a BLE host on your computer. The Cortex-M0+ is a primary core on the board's SoC. It starts first and enables the CM4 core. -.. image:: img/cy8ckit-062-ble.jpg - :align: center - :alt: CY8CKIT_062_BLE - 1. Battery charging indicator (LED6) 2. USB PD output voltage availability indicator (LED7) 3. KitProg2 USB Type-C connector (J10) @@ -147,6 +140,8 @@ To get the OpenOCD package, it is required that you Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The CY8CKIT-062-BLE includes an onboard programmer/debugger (KitProg2) with mass storage programming to provide debugging, flash programming, and serial communication over USB. There are also PSOC 6 program and debug headers J11 diff --git a/boards/cypress/cy8ckit_062_wifi_bt/doc/index.rst b/boards/cypress/cy8ckit_062_wifi_bt/doc/index.rst index a0ad601ad6334..dc201ecc7a78c 100644 --- a/boards/cypress/cy8ckit_062_wifi_bt/doc/index.rst +++ b/boards/cypress/cy8ckit_062_wifi_bt/doc/index.rst @@ -1,7 +1,4 @@ -.. _cy8ckit_062_wifi_bt: - -INFINEON PSOC 6 WiFi-BT Pioneer Kit -################################### +.. zephyr:board:: cy8ckit_062_wifi_bt Overview ******** @@ -23,10 +20,6 @@ The PSOC 6 WiFi-BT Pioneer board offers compatibility with Arduino shields. The Cortex-M0+ is a primary core on the board's SoC. It starts first and enables the CM4 core. -.. image:: img/cy8ckit_062_wifi_bt_m0.jpg - :align: center - :alt: CY8CKIT_062_WIFI_BT - 1. USB PD output voltage availability indicator (LED7) 2. Battery charging indicator (LED6) 3. KitProg2 USB Type-C connector (J10) @@ -134,6 +127,8 @@ To get the OpenOCD package, it is required that you Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The CY8CKIT-062-WiFi-BT includes an onboard programmer/debugger (KitProg2) with mass storage programming to provide debugging, flash programming, and serial communication over USB. There are also PSOC 6 program and debug headers J11 diff --git a/boards/deprecated.cmake b/boards/deprecated.cmake index 78a960ec2e4ae..1dd7b14a629b5 100644 --- a/boards/deprecated.cmake +++ b/boards/deprecated.cmake @@ -16,6 +16,15 @@ set(adafruit_feather_DEPRECATED adafruit_feather_nrf52840/nrf52840 ) +set(arduino_uno_r4_minima_DEPRECATED + arduino_uno_r4@minima +) +set(arduino_uno_r4_wifi_DEPRECATED + arduino_uno_r4@wifi +) +set(esp32c6_devkitc_DEPRECATED + esp32c6_devkitc/esp32c6/hpcore +) set(qemu_xtensa_DEPRECATED qemu_xtensa/dc233c ) @@ -37,3 +46,9 @@ set(mimxrt1060_evk_DEPRECATED set(mimxrt1060_evkb_DEPRECATED mimxrt1060_evk@B/mimxrt1062/qspi ) +set(neorv32_DEPRECATED + neorv32/neorv32/up5kdemo +) +set(xiao_esp32c6_DEPRECATED + xiao_esp32c6/esp32c6/hpcore +) diff --git a/boards/dptechnics/walter/doc/index.rst b/boards/dptechnics/walter/doc/index.rst index c77e266f52be1..eb5dc5e3d50f2 100644 --- a/boards/dptechnics/walter/doc/index.rst +++ b/boards/dptechnics/walter/doc/index.rst @@ -58,47 +58,7 @@ Form factor Supported Features ================== -Current Zephyr's Walter board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI/CAN | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| GDMA | on-chip | dma | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ -| Cellular | on-board | modem_cellular | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Prerequisites ------------- @@ -117,6 +77,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/dptechnics/walter/walter_esp32s3_procpu.dts b/boards/dptechnics/walter/walter_esp32s3_procpu.dts index 8d864885e0f00..0568d597960b1 100644 --- a/boards/dptechnics/walter/walter_esp32s3_procpu.dts +++ b/boards/dptechnics/walter/walter_esp32s3_procpu.dts @@ -49,6 +49,7 @@ status = "okay"; compatible = "sqn,gm02s"; mdm-reset-gpios = <&gpio1 13 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>; + mdm-wake-gpios = <&gpio1 14 (GPIO_OPEN_SOURCE | GPIO_ACTIVE_HIGH)>; }; }; @@ -120,3 +121,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/dragino/lsn50/doc/index.rst b/boards/dragino/lsn50/doc/index.rst index 999c809a90f41..d5981b51817b4 100644 --- a/boards/dragino/lsn50/doc/index.rst +++ b/boards/dragino/lsn50/doc/index.rst @@ -78,24 +78,7 @@ More information about STM32L072CZ can be found here: Supported Features ================== -The Zephyr Dragino LSN50 board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on this Zephyr port. - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/dragino/lsn50/dragino_lsn50_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -130,6 +113,8 @@ Default settings are 115200 8N1. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``dragino_lsn50`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/dragino/nbsn95/doc/index.rst b/boards/dragino/nbsn95/doc/index.rst index c18bb7eee4019..c99e6c87bdcdb 100644 --- a/boards/dragino/nbsn95/doc/index.rst +++ b/boards/dragino/nbsn95/doc/index.rst @@ -77,24 +77,7 @@ More information about STM32L072CZ can be found here: Supported Features ================== -The Zephyr Dragino NBSN95 board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on this Zephyr port. - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/dragino/nbsn95/dragino_nbsn95_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -129,6 +112,8 @@ Default settings are 115200 8N1. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``dragino_nbsn95`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/ebyte/e73_tbb/board.cmake b/boards/ebyte/e73_tbb/board.cmake index f99446d144d06..5db65eede593d 100644 --- a/boards/ebyte/e73_tbb/board.cmake +++ b/boards/ebyte/e73_tbb/board.cmake @@ -2,6 +2,7 @@ board_runner_args(jlink "--device=nrf52" "--speed=4000") board_runner_args(pyocd "--target=nrf52" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/ebyte/e73_tbb/doc/index.rst b/boards/ebyte/e73_tbb/doc/index.rst index 5d1327e322c7c..68bd2608dc91d 100644 --- a/boards/ebyte/e73_tbb/doc/index.rst +++ b/boards/ebyte/e73_tbb/doc/index.rst @@ -39,42 +39,8 @@ and solder NFC antenna using NFC_ANT connector. Supported Features ================== -The ebyte_e73_tbb/nrf52832 board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features are not supported by the Zephyr kernel. +.. zephyr:board-supported-hw:: + See `E73-TBB website`_ and `Nordic Semiconductor Infocenter`_ for a complete list of nRF52832 hardware features. @@ -169,6 +135,8 @@ NFC_ANT Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/electronut/nrf52840_blip/doc/index.rst b/boards/electronut/nrf52840_blip/doc/index.rst index 03dfff0bf5666..376412e4d4070 100644 --- a/boards/electronut/nrf52840_blip/doc/index.rst +++ b/boards/electronut/nrf52840_blip/doc/index.rst @@ -34,43 +34,7 @@ is 32 MHz. Supported Features ================== -The nrf52840_blip board configuration supports the following -hardware features currently: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -116,6 +80,8 @@ MicroSD is connected to these pins, and CS pin is connected to P0.17. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``nrf52840_blip`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details); The onboard Black Magic diff --git a/boards/electronut/nrf52840_papyr/board.cmake b/boards/electronut/nrf52840_papyr/board.cmake index 65580b0fef534..3ca8757d61325 100644 --- a/boards/electronut/nrf52840_papyr/board.cmake +++ b/boards/electronut/nrf52840_papyr/board.cmake @@ -2,4 +2,5 @@ board_runner_args(nrfjprog "--softreset") include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) diff --git a/boards/electronut/nrf52840_papyr/doc/nrf52840_papyr.rst b/boards/electronut/nrf52840_papyr/doc/nrf52840_papyr.rst index 391175eebc261..f674496b02186 100644 --- a/boards/electronut/nrf52840_papyr/doc/nrf52840_papyr.rst +++ b/boards/electronut/nrf52840_papyr/doc/nrf52840_papyr.rst @@ -36,41 +36,7 @@ is 32 MHz. Supported Features ================== -The nrf52840_papyr board configuration supports the following -hardware features currently: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -123,6 +89,8 @@ Other pins used by the e-paper display are: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``nrf52840_papyr`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details); Black Magic diff --git a/boards/element14/warp7/doc/index.rst b/boards/element14/warp7/doc/index.rst index d0940f5271ac9..016681c30ab0c 100644 --- a/boards/element14/warp7/doc/index.rst +++ b/boards/element14/warp7/doc/index.rst @@ -68,33 +68,7 @@ For more information about the i.MX7 SoC and WaRP7, see these references: Supported Features ================== -The WaRP7 configuration supports the following hardware features on the -Cortex M4 Core: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| SENSOR | off-chip | fxos8700 polling; | -| | | fxos8700 trigger; | -| | | fxas21002 polling; | -| | | fxas21002 trigger; | -+-----------+------------+-------------------------------------+ - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/element14/warp7/warp7_mcimx7d_m4_defconfig` - -Other hardware features are not currently supported by the port. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -136,6 +110,8 @@ the number 6 is used in the mikroBUS connector. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The WaRP7 doesn't have QSPI flash for the M4 and it needs to be started by the A7 core. The A7 core is responsible to load the M4 binary application into the RAM, put the M4 in reset, set the M4 Program Counter and Stack Pointer, and diff --git a/boards/ene/kb1200_evb/doc/index.rst b/boards/ene/kb1200_evb/doc/index.rst index 6558b8dad5457..2bd60859af771 100644 --- a/boards/ene/kb1200_evb/doc/index.rst +++ b/boards/ene/kb1200_evb/doc/index.rst @@ -1,7 +1,4 @@ -.. _ene_kb1200_evb: - -ENE KB1200_EVB -############## +.. zephyr:board:: kb1200_evb Overview ******** @@ -24,38 +21,7 @@ Hardware Supported Features ================== -The following features are supported: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc controller | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | reset and clock control | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c port/controller | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| PMU | on-chip | power management | -+-----------+------------+-------------------------------------+ -| PSL | on-chip | power switch logic | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pulse width modulator | -+-----------+------------+-------------------------------------+ -| TACH | on-chip | tachometer sensor | -+-----------+------------+-------------------------------------+ -| SER | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr (at the moment) +.. zephyr:board-supported-hw:: System Clock ============ @@ -67,6 +33,8 @@ See Processor clock control register (refer 5.1 General Configuration) Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/enjoydigital/litex_vexriscv/doc/index.rst b/boards/enjoydigital/litex_vexriscv/doc/index.rst index f9764907eb449..bd47c381a73b7 100644 --- a/boards/enjoydigital/litex_vexriscv/doc/index.rst +++ b/boards/enjoydigital/litex_vexriscv/doc/index.rst @@ -1,7 +1,4 @@ -.. _litex-vexriscv: - -LiteX VexRiscv -############## +.. zephyr:board:: litex_vexriscv LiteX VexRiscv is an example of a system on a chip (SoC) that consists of a `VexRiscv processor `_ @@ -20,10 +17,6 @@ LiteX VexRiscv SoC implementation generated for the `_ or `SDI-MIPI Video Converter `_. -.. image:: img/litex_vexriscv.jpg - :align: center - :alt: LiteX VexRiscv on Digilent Arty 35T Board - LiteX is based on `Migen `_/`MiSoC SoC builder `_ and provides ready-made system components such as buses, streams, interconnects, @@ -49,6 +42,11 @@ using the `Zephyr on LiteX VexRiscv `_ reference platform. You can also use the official LiteX SoC Builder. +Supported Features +****************** + +.. zephyr:board-supported-hw:: + Bitstream generation ******************** diff --git a/boards/enjoydigital/litex_vexriscv/litex_vexriscv.dts b/boards/enjoydigital/litex_vexriscv/litex_vexriscv.dts index 19f56f8b2897f..cb3082619031c 100644 --- a/boards/enjoydigital/litex_vexriscv/litex_vexriscv.dts +++ b/boards/enjoydigital/litex_vexriscv/litex_vexriscv.dts @@ -72,6 +72,10 @@ status = "okay"; }; +&i2c1 { + status = "okay"; +}; + &pwm0 { status = "okay"; }; diff --git a/boards/espressif/esp32_devkitc_wroom/doc/index.rst b/boards/espressif/esp32_devkitc_wroom/doc/index.rst index 228660a603aa7..9b5bc1c6baf85 100644 --- a/boards/espressif/esp32_devkitc_wroom/doc/index.rst +++ b/boards/espressif/esp32_devkitc_wroom/doc/index.rst @@ -50,45 +50,7 @@ and/or exchanging data over OpenAMP framework. See :zephyr:code-sample-category: Supported Features ================== -Current Zephyr's ESP32-DevKitC-WROOM board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements =================== @@ -110,6 +72,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom-pinctrl.dtsi b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom-pinctrl.dtsi index b1f03780559bb..1089af3047e8c 100644 --- a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom-pinctrl.dtsi +++ b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2022-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -74,5 +74,35 @@ output-high; }; }; + + i2s0_default: i2s0_default { + group1 { + pinmux = , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + i2s1_default: i2s1_default { + group1 { + pinmux = , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; }; diff --git a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts index 783a8f2a7f7bf..e9d5e2855ab07 100644 --- a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts +++ b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -89,6 +89,18 @@ pinctrl-names = "default"; }; +&i2s0 { + pinctrl-0 = <&i2s0_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + +&i2s1 { + pinctrl-0 = <&i2s1_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + &spi2 { #address-cells = <1>; #size-cells = <0>; @@ -132,3 +144,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.yaml b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.yaml index 7bc3c8feb55f7..c3e9af32006fb 100644 --- a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.yaml +++ b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu.yaml @@ -9,6 +9,7 @@ supported: - dac - gpio - i2c + - i2s - watchdog - uart - nvs diff --git a/boards/espressif/esp32_devkitc_wrover/doc/index.rst b/boards/espressif/esp32_devkitc_wrover/doc/index.rst index cf1fb64f32f2c..5bab845c93887 100644 --- a/boards/espressif/esp32_devkitc_wrover/doc/index.rst +++ b/boards/espressif/esp32_devkitc_wrover/doc/index.rst @@ -50,45 +50,7 @@ and/or exchanging data over OpenAMP framework. See :zephyr:code-sample-category: Supported Features ================== -Current Zephyr's ESP32-DevKitC-WROVER board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements =================== @@ -110,6 +72,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover-pinctrl.dtsi b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover-pinctrl.dtsi index f4f51cce98aec..dbfd9d07b803d 100644 --- a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover-pinctrl.dtsi +++ b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2022-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -74,4 +74,34 @@ output-high; }; }; + + i2s0_default: i2s0_default { + group1 { + pinmux = , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + i2s1_default: i2s1_default { + group1 { + pinmux = , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; }; diff --git a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts index 33f0f3f134b3a..c91a717811314 100644 --- a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts +++ b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -89,6 +89,18 @@ pinctrl-names = "default"; }; +&i2s0 { + pinctrl-0 = <&i2s0_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + +&i2s1 { + pinctrl-0 = <&i2s1_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + &spi2 { #address-cells = <1>; #size-cells = <0>; @@ -128,3 +140,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.yaml b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.yaml index 62e40f71e9373..32de7a52bd3c2 100644 --- a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.yaml +++ b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu.yaml @@ -9,6 +9,7 @@ supported: - dac - gpio - i2c + - i2s - watchdog - uart - nvs diff --git a/boards/espressif/esp32_ethernet_kit/doc/index.rst b/boards/espressif/esp32_ethernet_kit/doc/index.rst index 7233284d31413..22a942989fdae 100644 --- a/boards/espressif/esp32_ethernet_kit/doc/index.rst +++ b/boards/espressif/esp32_ethernet_kit/doc/index.rst @@ -34,6 +34,13 @@ features FTDI FT2232H chip - an advanced multi-interface USB bridge. This chip enables to use JTAG for direct debugging of ESP32 through the USB interface without a separate JTAG debugger. +Hardware +******** + +Supported Features +================== + +.. zephyr:board-supported-hw:: Functionality Overview ====================== @@ -425,6 +432,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit-pinctrl.dtsi b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit-pinctrl.dtsi index 3e30654db8b8e..1b6bd6b701cc0 100644 --- a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit-pinctrl.dtsi +++ b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Grant Ramsay + * Copyright (c) 2022-2025 Grant Ramsay * * SPDX-License-Identifier: Apache-2.0 */ @@ -40,4 +40,33 @@ }; }; + i2s0_default: i2s0_default { + group1 { + pinmux = , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + i2s1_default: i2s1_default { + group1 { + pinmux = , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; }; diff --git a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts index 799c17ad84955..bf2fbbd6d3a7e 100644 --- a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts +++ b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Grant Ramsay + * Copyright (c) 2022-2025 Grant Ramsay * * SPDX-License-Identifier: Apache-2.0 */ @@ -43,6 +43,18 @@ status = "okay"; }; +&i2s0 { + pinctrl-0 = <&i2s0_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + +&i2s1 { + pinctrl-0 = <&i2s1_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + &spi2 { #address-cells = <1>; #size-cells = <0>; @@ -89,3 +101,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.yaml b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.yaml index fb3c3cdd704af..f6fd5a5f410ca 100644 --- a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.yaml +++ b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.yaml @@ -10,4 +10,5 @@ supported: - uart - nvs - pwm + - i2s vendor: espressif diff --git a/boards/espressif/esp32c3_devkitc/doc/index.rst b/boards/espressif/esp32c3_devkitc/doc/index.rst index a57d0be26235a..eae08a6b8fccd 100644 --- a/boards/espressif/esp32c3_devkitc/doc/index.rst +++ b/boards/espressif/esp32c3_devkitc/doc/index.rst @@ -42,41 +42,7 @@ manual at `ESP32-C3 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-C3-DevKitC board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI | on-chip | can | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements ******************* @@ -98,6 +64,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32c3_devkitc/esp32c3_devkitc.dts b/boards/espressif/esp32c3_devkitc/esp32c3_devkitc.dts index 86326fcc077f0..ec61f303a6c6d 100644 --- a/boards/espressif/esp32c3_devkitc/esp32c3_devkitc.dts +++ b/boards/espressif/esp32c3_devkitc/esp32c3_devkitc.dts @@ -97,3 +97,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32c3_devkitm/doc/index.rst b/boards/espressif/esp32c3_devkitm/doc/index.rst index 24eb23bc7b8a7..d4fcb4e1713a1 100644 --- a/boards/espressif/esp32c3_devkitm/doc/index.rst +++ b/boards/espressif/esp32c3_devkitm/doc/index.rst @@ -42,41 +42,7 @@ manual at `ESP32-C3 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-C3-Devkitm board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI | on-chip | can | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements ******************* @@ -98,6 +64,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts b/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts index 25bd583daee3d..2e1b41edfc198 100644 --- a/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts +++ b/boards/espressif/esp32c3_devkitm/esp32c3_devkitm.dts @@ -103,3 +103,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32c3_rust/doc/index.rst b/boards/espressif/esp32c3_rust/doc/index.rst index a6f41a01866c6..144b6948b85ec 100644 --- a/boards/espressif/esp32c3_rust/doc/index.rst +++ b/boards/espressif/esp32c3_rust/doc/index.rst @@ -42,41 +42,7 @@ manual at `ESP32-C3 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-C3-DevKit-RUST board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI | on-chip | can | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: I2C Peripherals =============== @@ -143,6 +109,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32c3_rust/esp32c3_rust.dts b/boards/espressif/esp32c3_rust/esp32c3_rust.dts index 867fa84adcf63..9c931e91f5784 100644 --- a/boards/espressif/esp32c3_rust/esp32c3_rust.dts +++ b/boards/espressif/esp32c3_rust/esp32c3_rust.dts @@ -128,3 +128,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32c6_devkitc/Kconfig b/boards/espressif/esp32c6_devkitc/Kconfig index c6a99b1032dc7..e24ba970a9bbc 100644 --- a/boards/espressif/esp32c6_devkitc/Kconfig +++ b/boards/espressif/esp32c6_devkitc/Kconfig @@ -3,4 +3,5 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD int - default 4096 + default 4096 if BOARD_ESP32C6_DEVKITC_ESP32C6_HPCORE + default 256 if BOARD_ESP32C6_DEVKITC_ESP32C6_LPCORE diff --git a/boards/espressif/esp32c6_devkitc/Kconfig.esp32c6_devkitc b/boards/espressif/esp32c6_devkitc/Kconfig.esp32c6_devkitc index 4bd1fce4efc33..9b30251fea4f7 100644 --- a/boards/espressif/esp32c6_devkitc/Kconfig.esp32c6_devkitc +++ b/boards/espressif/esp32c6_devkitc/Kconfig.esp32c6_devkitc @@ -5,3 +5,5 @@ config BOARD_ESP32C6_DEVKITC select SOC_ESP32_C6_WROOM_1U_N8 + select SOC_ESP32C6_HPCORE if BOARD_ESP32C6_DEVKITC_ESP32C6_HPCORE + select SOC_ESP32C6_LPCORE if BOARD_ESP32C6_DEVKITC_ESP32C6_LPCORE diff --git a/boards/espressif/esp32c6_devkitc/doc/index.rst b/boards/espressif/esp32c6_devkitc/doc/index.rst index ab81b187d746a..ee0f04afaa776 100644 --- a/boards/espressif/esp32c6_devkitc/doc/index.rst +++ b/boards/espressif/esp32c6_devkitc/doc/index.rst @@ -84,43 +84,7 @@ manual at `ESP32-C6 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-C6-DevKitC board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| GDMA | on-chip | dma | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements ******************* @@ -142,6 +106,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== @@ -183,7 +149,7 @@ To build the sample application using sysbuild use the command: .. zephyr-app-commands:: :tool: west :zephyr-app: samples/hello_world - :board: esp32c6_devkitc + :board: esp32c6_devkitc/esp32c6/hpcore :goals: build :west-args: --sysbuild :compact: @@ -232,7 +198,7 @@ Build and flash applications as usual (see :ref:`build_an_application` and .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32c6_devkitc + :board: esp32c6_devkitc/esp32c6/hpcore :goals: build The usual ``flash`` target will work with the ``esp32c6_devkitc`` board @@ -241,7 +207,7 @@ application. .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32c6_devkitc + :board: esp32c6_devkitc/esp32c6/hpcore :goals: flash Open the serial monitor using the following command: @@ -256,7 +222,7 @@ message in the monitor: .. code-block:: console ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** - Hello World! esp32c6_devkitc + Hello World! esp32c6_devkitc/esp32c6/hpcore Debugging ********* @@ -273,7 +239,7 @@ Here is an example for building the :zephyr:code-sample:`hello_world` applicatio .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32c6_devkitc + :board: esp32c6_devkitc/esp32c6/hpcore :goals: build flash :gen-args: -DOPENOCD= -DOPENOCD_DEFAULT_PATH= @@ -281,9 +247,32 @@ You can debug an application in the usual way. Here is an example for the :zephy .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32c6_devkitc + :board: esp32c6_devkitc/esp32c6/hpcore :goals: debug +Low-Power CPU (LP CORE) +*********************** + +The ESP32-C6 SoC has two RISC-V cores: the High-Performance Core (HP CORE) and the Low-Power Core (LP CORE). +The LP Core features ultra low power consumption, an interrupt controller, a debug module and a system bus +interface for memory and peripheral access. + +The LP Core is in sleep mode by default. It has two application scenarios: + +- Power insensitive scenario: When the High-Performance CPU (HP Core) is active, the LP Core can assist the HP CPU with some speed and efficiency-insensitive controls and computations. +- Power sensitive scenario: When the HP CPU is in the power-down state to save power, the LP Core can be woken up to handle some external wake-up events. + +For more information, check the datasheet at `ESP32-C6 Datasheet`_ or the technical reference +manual at `ESP32-C6 Technical Reference Manual`_. + +The LP Core support is fully integrated with :ref:`sysbuild`. The user can enable the LP Core by adding +the following configuration to the project: + +.. code:: cfg + + CONFIG_ULP_COPROC_ENABLED=y + +See :zephyr:code-sample-category:`lp-core` folder as code reference. References ********** diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc.dts b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc.dts deleted file mode 100644 index 896ae30530cc9..0000000000000 --- a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc.dts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; - -#include -#include "esp32c6_devkitc-pinctrl.dtsi" -#include -#include - -/ { - model = "esp32c6_devkitc"; - compatible = "espressif,esp32c6"; - - chosen { - zephyr,sram = &sramhp; - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_partition; - }; - - aliases { - sw0 = &user_button1; - watchdog0 = &wdt0; - }; - - gpio_keys { - compatible = "gpio-keys"; - user_button1: button_1 { - label = "User SW1"; - gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - zephyr,code = ; - }; - }; -}; - -&uart0 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart0_default>; - pinctrl-names = "default"; -}; - -&trng0 { - status = "okay"; -}; - -&i2c0 { - status = "okay"; - clock-frequency = ; - pinctrl-0 = <&i2c0_default>; - pinctrl-names = "default"; -}; - -&spi2 { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - pinctrl-0 = <&spim2_default>; - pinctrl-names = "default"; -}; - -&gpio0 { - status = "okay"; -}; - -&wdt0 { - status = "okay"; -}; diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc.yaml b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc.yaml deleted file mode 100644 index 95385596d9de6..0000000000000 --- a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc.yaml +++ /dev/null @@ -1,18 +0,0 @@ -identifier: esp32c6_devkitc -name: ESP32-C6 -vendor: espressif -type: mcu -arch: riscv -toolchain: - - zephyr -supported: - - adc - - gpio - - watchdog - - uart - - dma - - pwm - - spi - - counter - - entropy - - i2c diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc-pinctrl.dtsi b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore-pinctrl.dtsi similarity index 100% rename from boards/espressif/esp32c6_devkitc/esp32c6_devkitc-pinctrl.dtsi rename to boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore-pinctrl.dtsi diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore.dts b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore.dts new file mode 100644 index 0000000000000..ef8dbea59b387 --- /dev/null +++ b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore.dts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "esp32c6_devkitc_hpcore-pinctrl.dtsi" +#include +#include + +/ { + model = "esp32c6_devkitc HP Core"; + compatible = "espressif,esp32c6"; + + chosen { + zephyr,sram = &sramhp; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; + + aliases { + sw0 = &user_button1; + watchdog0 = &wdt0; + }; + + gpio_keys { + compatible = "gpio-keys"; + user_button1: button_1 { + label = "User SW1"; + gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + }; + }; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&trng0 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore.yaml b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore.yaml new file mode 100644 index 0000000000000..6eed11176b057 --- /dev/null +++ b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore.yaml @@ -0,0 +1,21 @@ +identifier: esp32c6_devkitc/esp32c6/hpcore +name: ESP32-C6-DevKitC HP Core +vendor: espressif +type: mcu +arch: riscv +toolchain: + - zephyr +supported: + - adc + - gpio + - watchdog + - uart + - dma + - pwm + - spi + - counter + - entropy + - i2c +testing: + ignore_tags: + - bluetooth diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_defconfig b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore_defconfig similarity index 100% rename from boards/espressif/esp32c6_devkitc/esp32c6_devkitc_defconfig rename to boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore_defconfig diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore.dts b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore.dts new file mode 100644 index 0000000000000..739781e692b55 --- /dev/null +++ b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore.dts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include + +/ { + model = "Espressif ESP32C6-DevkitC LPCORE"; + compatible = "espressif,esp32c6"; + + chosen { + zephyr,sram = &sramlp; + zephyr,code-partition = &slot0_lpcore_partition; + zephyr,console = &lp_uart; + zephyr,shell-uart = &lp_uart; + }; +}; + +&lp_uart { + status = "okay"; + current-speed = <115200>; +}; diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore.yaml b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore.yaml new file mode 100644 index 0000000000000..49e25bcdba0af --- /dev/null +++ b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore.yaml @@ -0,0 +1,19 @@ +identifier: esp32c6_devkitc/esp32c6/lpcore +name: ESP32-C6-DevKitC LP Core +type: mcu +arch: riscv +toolchain: + - zephyr +supported: + - cpu + - uart + - serial +testing: + only_tags: + - introduction + ignore_tags: + - kernel + - posix + - chre + - cpp +vendor: espressif diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore_defconfig b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore_defconfig new file mode 100644 index 0000000000000..42ee26028f93d --- /dev/null +++ b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_lpcore_defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +# Memory protection +CONFIG_THREAD_STACK_INFO=n +CONFIG_THREAD_CUSTOM_DATA=n + +# Boot +CONFIG_BOOT_BANNER=n + +# Console +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_PRINTK=n +CONFIG_CBPRINTF_NANO=y + +# Build +CONFIG_SIZE_OPTIMIZATIONS=y diff --git a/boards/espressif/esp32s2_devkitc/doc/index.rst b/boards/espressif/esp32s2_devkitc/doc/index.rst index e5cb0ff6191dd..63bf3eca409b1 100644 --- a/boards/espressif/esp32s2_devkitc/doc/index.rst +++ b/boards/espressif/esp32s2_devkitc/doc/index.rst @@ -41,39 +41,7 @@ manual at `ESP32-S2 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-S2-devkitc board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements =================== @@ -95,6 +63,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32s2_devkitc/esp32s2_devkitc-pinctrl.dtsi b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc-pinctrl.dtsi index 756aaf9b5b729..434260d9486ea 100644 --- a/boards/espressif/esp32s2_devkitc/esp32s2_devkitc-pinctrl.dtsi +++ b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -65,4 +65,19 @@ }; }; + i2s0_default: i2s0_default { + group1 { + pinmux = , + , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; }; diff --git a/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.dts b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.dts index f60ce264843fb..337a63b6b56d5 100644 --- a/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.dts +++ b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -96,6 +96,12 @@ pinctrl-names = "default"; }; +&i2s0 { + pinctrl-0 = <&i2s0_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + &trng0 { status = "okay"; }; @@ -123,3 +129,7 @@ &dac { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.yaml b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.yaml index 44a6f971e3b74..b3598a28d9c04 100644 --- a/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.yaml +++ b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc.yaml @@ -9,6 +9,7 @@ supported: - dac - gpio - i2c + - i2s - watchdog - uart - nvs @@ -19,4 +20,7 @@ supported: - input - can - dma +testing: + ignore_tags: + - bluetooth vendor: espressif diff --git a/boards/espressif/esp32s2_saola/doc/index.rst b/boards/espressif/esp32s2_saola/doc/index.rst index a2ad776acfed5..d86a986b5e632 100644 --- a/boards/espressif/esp32s2_saola/doc/index.rst +++ b/boards/espressif/esp32s2_saola/doc/index.rst @@ -41,39 +41,7 @@ manual at `ESP32-S2 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-S2-Saola board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements =================== @@ -95,6 +63,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32s2_saola/esp32s2_saola-pinctrl.dtsi b/boards/espressif/esp32s2_saola/esp32s2_saola-pinctrl.dtsi index 7ab4fc6711945..5b402c838cfa9 100644 --- a/boards/espressif/esp32s2_saola/esp32s2_saola-pinctrl.dtsi +++ b/boards/espressif/esp32s2_saola/esp32s2_saola-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2022-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -65,4 +65,19 @@ }; }; + i2s0_default: i2s0_default { + group1 { + pinmux = , + , + , + , + , + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; }; diff --git a/boards/espressif/esp32s2_saola/esp32s2_saola.dts b/boards/espressif/esp32s2_saola/esp32s2_saola.dts index 88490f1d551c4..23249ceb3f645 100644 --- a/boards/espressif/esp32s2_saola/esp32s2_saola.dts +++ b/boards/espressif/esp32s2_saola/esp32s2_saola.dts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2021-2025 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ @@ -96,6 +96,12 @@ pinctrl-names = "default"; }; +&i2s0 { + pinctrl-0 = <&i2s0_default>; + pinctrl-names = "default"; + status = "disabled"; +}; + &trng0 { status = "okay"; }; @@ -119,3 +125,7 @@ &wdt0 { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32s2_saola/esp32s2_saola.yaml b/boards/espressif/esp32s2_saola/esp32s2_saola.yaml index bebe2a293a8a8..e8a37ffd2edca 100644 --- a/boards/espressif/esp32s2_saola/esp32s2_saola.yaml +++ b/boards/espressif/esp32s2_saola/esp32s2_saola.yaml @@ -9,6 +9,7 @@ supported: - dac - gpio - i2c + - i2s - watchdog - uart - nvs @@ -17,4 +18,7 @@ supported: - counter - entropy - input +testing: + ignore_tags: + - bluetooth vendor: espressif diff --git a/boards/espressif/esp32s3_devkitc/doc/index.rst b/boards/espressif/esp32s3_devkitc/doc/index.rst index 008b64fecae7e..4d5b07797a2e9 100644 --- a/boards/espressif/esp32s3_devkitc/doc/index.rst +++ b/boards/espressif/esp32s3_devkitc/doc/index.rst @@ -81,41 +81,7 @@ manual at `ESP32-S3 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-S3-DevKitC board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI/CAN | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| GDMA | on-chip | dma | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Prerequisites ------------- @@ -134,6 +100,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts index 48806ab5a4c71..a7dec600f4336 100644 --- a/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts +++ b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts @@ -147,3 +147,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32s3_devkitm/doc/index.rst b/boards/espressif/esp32s3_devkitm/doc/index.rst index ada774ec2a1e6..044a3a6a6607b 100644 --- a/boards/espressif/esp32s3_devkitm/doc/index.rst +++ b/boards/espressif/esp32s3_devkitm/doc/index.rst @@ -81,41 +81,7 @@ manual at `ESP32-S3 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP32-S3-DevKitM board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI/CAN | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| GDMA | on-chip | dma | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Prerequisites ------------- @@ -134,6 +100,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts index 89c5b8c164182..c468871e25e38 100644 --- a/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts +++ b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts @@ -147,3 +147,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp32s3_eye/doc/index.rst b/boards/espressif/esp32s3_eye/doc/index.rst index 662c4e5199877..e7b7643cbba1f 100644 --- a/boards/espressif/esp32s3_eye/doc/index.rst +++ b/boards/espressif/esp32s3_eye/doc/index.rst @@ -17,6 +17,11 @@ ESP32-S3-WROOM-1 module, camera, SD card slot, digital microphone, USB port, and and the sub board (ESP32-S3-EYE-SUB) that contains an LCD display. The main board and sub board are connected through pin headers. +Supported Features +------------------ + +.. zephyr:board-supported-hw:: + Block Diagram ------------- @@ -130,6 +135,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot ----------- diff --git a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts index 1b2afa8b83af0..7391ad2357e42 100644 --- a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts +++ b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts @@ -204,3 +204,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp8684_devkitm/doc/index.rst b/boards/espressif/esp8684_devkitm/doc/index.rst index 79c7294615034..c5e00b5b5b449 100644 --- a/boards/espressif/esp8684_devkitm/doc/index.rst +++ b/boards/espressif/esp8684_devkitm/doc/index.rst @@ -46,33 +46,7 @@ For detailed information check `ESP8684 Technical Reference Manual`_. Supported Features ================== -Current Zephyr's ESP8684-DevKitM board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: For a getting started user guide, please check `ESP8684-DevKitM User Guide`_. @@ -96,6 +70,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp8684_devkitm/esp8684_devkitm.dts b/boards/espressif/esp8684_devkitm/esp8684_devkitm.dts index a6a76ac4756bc..8081d955c8fdc 100644 --- a/boards/espressif/esp8684_devkitm/esp8684_devkitm.dts +++ b/boards/espressif/esp8684_devkitm/esp8684_devkitm.dts @@ -60,3 +60,7 @@ &timer0 { status = "disabled"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/espressif/esp_wrover_kit/doc/index.rst b/boards/espressif/esp_wrover_kit/doc/index.rst index 96f1c0570c2d8..0c5a2ee8dd4e6 100644 --- a/boards/espressif/esp_wrover_kit/doc/index.rst +++ b/boards/espressif/esp_wrover_kit/doc/index.rst @@ -441,45 +441,7 @@ Turn the Power Switch to ON, the 5V Power On LED should light up. Supported Features ================== -Current Zephyr's ESP32-Wrover-Kit board supports the following features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| SPI DMA | on-chip | spi | -+------------+------------+-------------------------------------+ -| TWAI | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ -| Bluetooth | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements =================== @@ -501,6 +463,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts index 614bd1ec54f54..552829c4c5264 100644 --- a/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts +++ b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu.dts @@ -218,3 +218,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_partition_conf.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_partition_conf.dtsi index 2fc651230f454..b85e3d03dc2d7 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_partition_conf.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_partition_conf.dtsi @@ -57,5 +57,5 @@ reg = <0x20040000 0x30000>; }; -/* Include default shared RAM configuration file */ -#include +/* Include shared RAM configuration file */ +#include "bl5340_dvk_nrf5340_shared_sram_planning_conf.dtsi" diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi index 1f5fc0bb3405a..ce2e145d58753 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet_common.dtsi @@ -63,5 +63,5 @@ }; }; -/* Include default shared RAM configuration file */ -#include +/* Include shared RAM configuration file */ +#include "bl5340_dvk_nrf5340_shared_sram_planning_conf.dtsi" diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_shared_sram_planning_conf.dtsi b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_shared_sram_planning_conf.dtsi new file mode 100644 index 0000000000000..fbb059494c36b --- /dev/null +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_shared_sram_planning_conf.dtsi @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019 Nordic Semiconductor ASA + * Copyright (c) 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Default shared SRAM planning when building for BL5340 DVK. + * This file is included by both nRF5340 CPUAPP (Application MCU) + * and nRF5340 CPUNET (Network MCU). + * - 64 kB SRAM allocated as Shared memory (sram0_shared) + * - Region defined after the image SRAM of Application MCU + */ + +/ { + chosen { + /* shared memory reserved for the inter-processor communication */ + zephyr,ipc_shm = &sram0_shared; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + sram0_shared: memory@20070000 { + /* SRAM allocated to shared memory */ + reg = <0x20070000 0x10000>; + }; + }; +}; diff --git a/boards/ezurio/bl5340_dvk/board.cmake b/boards/ezurio/bl5340_dvk/board.cmake index 15aec8e6a36df..41a597dead84d 100644 --- a/boards/ezurio/bl5340_dvk/board.cmake +++ b/boards/ezurio/bl5340_dvk/board.cmake @@ -16,6 +16,6 @@ if(CONFIG_TFM_FLASH_MERGED_BINARY) set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) endif() -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/bl5340_dvk/doc/index.rst b/boards/ezurio/bl5340_dvk/doc/index.rst index b19a0516c30d2..35ce806fc5359 100644 --- a/boards/ezurio/bl5340_dvk/doc/index.rst +++ b/boards/ezurio/bl5340_dvk/doc/index.rst @@ -56,78 +56,8 @@ is 32MHz. Supported Features ================== -The ``bl5340_dvk/nrf5340/cpuapp`` board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| QSPI(M) | on-chip | nor | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| SPU | on-chip | system protection | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -The ``bl5340_dvk/nrf5340/cpunet`` board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: + See `Nordic Semiconductor Infocenter`_ for a complete list of hardware features. @@ -261,6 +191,8 @@ Security components Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The BL5340's application core supports the Armv8-M Security Extension. Applications built for the ``bl5340_dvk/nrf5340/cpuapp`` board by default boot in the Secure state. diff --git a/boards/ezurio/bl652_dvk/board.cmake b/boards/ezurio/bl652_dvk/board.cmake index 9449b78cd4711..29682197edc8f 100644 --- a/boards/ezurio/bl652_dvk/board.cmake +++ b/boards/ezurio/bl652_dvk/board.cmake @@ -2,5 +2,6 @@ board_runner_args(nrfjprog "--softreset") board_runner_args(jlink "--device=nRF52832_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/bl652_dvk/doc/bl652_dvk.rst b/boards/ezurio/bl652_dvk/doc/bl652_dvk.rst index 27ec3f929288c..cdceadb2a34b6 100644 --- a/boards/ezurio/bl652_dvk/doc/bl652_dvk.rst +++ b/boards/ezurio/bl652_dvk/doc/bl652_dvk.rst @@ -43,42 +43,8 @@ Hardware Supported Features ================== -The BL652 DVK board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: + See `BL652 Module Website`_. Connections and IOs @@ -196,6 +162,8 @@ J32/J22 Digital I/O Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/ezurio/bl653_dvk/board.cmake b/boards/ezurio/bl653_dvk/board.cmake index 12b0d2996be7b..a19979a7e27b4 100644 --- a/boards/ezurio/bl653_dvk/board.cmake +++ b/boards/ezurio/bl653_dvk/board.cmake @@ -3,6 +3,7 @@ board_runner_args(nrfjprog "--softreset") board_runner_args(jlink "--device=nRF52833_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52833" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/ezurio/bl653_dvk/doc/bl653_dvk.rst b/boards/ezurio/bl653_dvk/doc/bl653_dvk.rst index e4de59757e853..811ce96a51789 100644 --- a/boards/ezurio/bl653_dvk/doc/bl653_dvk.rst +++ b/boards/ezurio/bl653_dvk/doc/bl653_dvk.rst @@ -33,45 +33,8 @@ Hardware Supported Features ================== -The BL653 DVK board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: + See `BL653 website`_ for a complete list of BL653 Development Kit board hardware features. @@ -98,6 +61,8 @@ Push buttons Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``bl653_dvk`` board configuration can be built, flashed, and debugged in the usual way. See :ref:`build_an_application` and :ref:`application_run` for more details on building and running. diff --git a/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.dts b/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.dts index d826a466bfd32..ee5d7260fa4e0 100644 --- a/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.dts +++ b/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.dts @@ -9,7 +9,8 @@ / { /* Information from Nordic SDK-Based Application Development and SKY66112 datasheet */ - sky66112_fem: fem { + nrf_radio_fem: fem { + status = "okay"; compatible = "generic-fem-two-ctrl-pins"; ctx-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; crx-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; @@ -21,5 +22,5 @@ }; &radio { - fem = <&sky66112_fem>; + fem = <&nrf_radio_fem>; }; diff --git a/boards/ezurio/bl654_dvk/board.cmake b/boards/ezurio/bl654_dvk/board.cmake index a99f3ce869322..32b02a35258b5 100644 --- a/boards/ezurio/bl654_dvk/board.cmake +++ b/boards/ezurio/bl654_dvk/board.cmake @@ -2,5 +2,6 @@ board_runner_args(nrfjprog "--softreset") board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/bl654_dvk/doc/bl654_dvk.rst b/boards/ezurio/bl654_dvk/doc/bl654_dvk.rst index 5a59932df25aa..30e238665871b 100644 --- a/boards/ezurio/bl654_dvk/doc/bl654_dvk.rst +++ b/boards/ezurio/bl654_dvk/doc/bl654_dvk.rst @@ -44,45 +44,8 @@ Hardware Supported Features ================== -The BL654 DVK board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: + See `BL654 website`_ for a complete list of BL654 Development Kit board hardware features. @@ -109,6 +72,8 @@ Push buttons Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``bl654_dvk`` board configuration can be built, flashed, and debugged in the usual way. See :ref:`build_an_application` and :ref:`application_run` for more details on building and running. diff --git a/boards/ezurio/bl654_sensor_board/board.cmake b/boards/ezurio/bl654_sensor_board/board.cmake index c1ca3bd12cf69..170466978324c 100644 --- a/boards/ezurio/bl654_sensor_board/board.cmake +++ b/boards/ezurio/bl654_sensor_board/board.cmake @@ -4,5 +4,6 @@ board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") board_runner_args(nrfjprog "--softreset") board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/bl654_sensor_board/doc/bl654_sensor_board.rst b/boards/ezurio/bl654_sensor_board/doc/bl654_sensor_board.rst index 373e9bf1bdcbb..605b5eb8c7fbb 100644 --- a/boards/ezurio/bl654_sensor_board/doc/bl654_sensor_board.rst +++ b/boards/ezurio/bl654_sensor_board/doc/bl654_sensor_board.rst @@ -40,43 +40,7 @@ Hardware Supported Features ================== -The BL654 Sensor Board configuration supports the following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. -See the `BL654 website`_ for a complete list of BL654 module hardware features. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -119,6 +83,8 @@ be blobbed. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``bl654_sensor_board`` board configuration can be built, flashed, and debugged in the usual way. See :ref:`build_an_application` and :ref:`application_run` for more details on building and running. An external diff --git a/boards/ezurio/bl654_usb/doc/bl654_usb.rst b/boards/ezurio/bl654_usb/doc/bl654_usb.rst index 33bf2a554dda3..04ac5759753f5 100644 --- a/boards/ezurio/bl654_usb/doc/bl654_usb.rst +++ b/boards/ezurio/bl654_usb/doc/bl654_usb.rst @@ -36,35 +36,8 @@ Hardware Supported Features ================== -The BL654 USB board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: + See `BL654 website`_ for a complete list of BL654 USB adapter hardware features. @@ -92,6 +65,8 @@ Zephyr console output is available as follows: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``bl654_usb`` board configuration can be built in the usual way (see :ref:`build_an_application` for more details). The ``bl654_usb`` board cannot be used for debugging. The compatible BL654 DVK diff --git a/boards/ezurio/bt510/board.cmake b/boards/ezurio/bt510/board.cmake index c1ca3bd12cf69..170466978324c 100644 --- a/boards/ezurio/bt510/board.cmake +++ b/boards/ezurio/bt510/board.cmake @@ -4,5 +4,6 @@ board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") board_runner_args(nrfjprog "--softreset") board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/bt510/doc/bt510.rst b/boards/ezurio/bt510/doc/bt510.rst index fdfd9312ffeb0..74b4c48703cfe 100644 --- a/boards/ezurio/bt510/doc/bt510.rst +++ b/boards/ezurio/bt510/doc/bt510.rst @@ -36,39 +36,7 @@ Hardware Supported Features ================== -The BT510 Sensor supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -116,6 +84,8 @@ The BT510 incorporates an I2C Silabs SI7055 temperature sensor. Refer to the `Si Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``bt510`` board configuration can be built, flashed, and debugged in the usual way. See :ref:`build_an_application` and :ref:`application_run` for more details on building and running. diff --git a/boards/ezurio/bt610/board.cmake b/boards/ezurio/bt610/board.cmake index 0a2feda9ee2e6..4d421a07db61c 100644 --- a/boards/ezurio/bt610/board.cmake +++ b/boards/ezurio/bt610/board.cmake @@ -3,6 +3,7 @@ board_runner_args(nrfjprog "--nrf-family=NRF52") board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/ezurio/bt610/doc/bt610.rst b/boards/ezurio/bt610/doc/bt610.rst index 0ae62035a48b7..afa138eac63d6 100644 --- a/boards/ezurio/bt610/doc/bt610.rst +++ b/boards/ezurio/bt610/doc/bt610.rst @@ -40,43 +40,7 @@ Hardware Supported Features ================== -The BT610 Sensor supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| QSPI | on-chip | qspi | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: .. figure:: img/bt610_board.jpg :align: center @@ -473,6 +437,8 @@ Required pins are as follows. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``bt610`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details); however, the standard diff --git a/boards/ezurio/mg100/board.cmake b/boards/ezurio/mg100/board.cmake index 790ab533b4a46..4a350c831677b 100644 --- a/boards/ezurio/mg100/board.cmake +++ b/boards/ezurio/mg100/board.cmake @@ -3,6 +3,7 @@ board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/ezurio/mg100/doc/index.rst b/boards/ezurio/mg100/doc/index.rst index 5f66c65e1478c..b2baed38724a0 100644 --- a/boards/ezurio/mg100/doc/index.rst +++ b/boards/ezurio/mg100/doc/index.rst @@ -49,47 +49,7 @@ Hardware Supported Features ================== -The MG100 board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ -| QSPI | on-chip | qspi/MX25R64(8MB) | -+-----------+------------+----------------------+ -| LIS3DH | I2C(M) | sensor/lis3dh | -+-----------+------------+----------------------+ -| HL7800 | UART | HL7800 modem driver | -+-----------+------------+----------------------+ -| SDMMC | SPI(M) | SD Card via SPI | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: See `MG100 website`_ for a complete list of MG100 hardware features. @@ -149,6 +109,8 @@ SPI MISO = P0.12 Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``mg100`` board configuration can be built and flashed in the usual way. (see :ref:`build_an_application` and :ref:`application_run` for more details) diff --git a/boards/ezurio/pinnacle_100_dvk/board.cmake b/boards/ezurio/pinnacle_100_dvk/board.cmake index d5f3c19d78448..829cac0ce82a4 100644 --- a/boards/ezurio/pinnacle_100_dvk/board.cmake +++ b/boards/ezurio/pinnacle_100_dvk/board.cmake @@ -3,6 +3,7 @@ board_runner_args(nrfjprog "--softreset") board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/ezurio/pinnacle_100_dvk/doc/index.rst b/boards/ezurio/pinnacle_100_dvk/doc/index.rst index 71511d8dfc815..d9f8b260efd2b 100644 --- a/boards/ezurio/pinnacle_100_dvk/doc/index.rst +++ b/boards/ezurio/pinnacle_100_dvk/doc/index.rst @@ -52,49 +52,7 @@ Hardware Supported Features ================== -The Pinnacle 100 development board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ -| QSPI | on-chip | qspi/MX25R64(8MB) | -+-----------+------------+----------------------+ -| BME680 | I2C(M) | sensor/bme680 | -+-----------+------------+----------------------+ -| HL7800 | UART | HL7800 modem driver | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: See `Pinnacle 100 website`_ for a complete list of Pinnacle 100 Development Kit hardware features. @@ -122,6 +80,8 @@ Push buttons Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``pinnacle_100_dvk`` board configuration can be built and flashed in the usual way. (see :ref:`build_an_application` and :ref:`application_run` for more details) diff --git a/boards/ezurio/rm1xx_dvk/board.cmake b/boards/ezurio/rm1xx_dvk/board.cmake index 677dc6bdf2b18..1f0cea559d116 100644 --- a/boards/ezurio/rm1xx_dvk/board.cmake +++ b/boards/ezurio/rm1xx_dvk/board.cmake @@ -2,5 +2,6 @@ board_runner_args(nrfjprog "--nrf-family=NRF51") board_runner_args(jlink "--device=nRF51822_xxAC" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/rm1xx_dvk/doc/index.rst b/boards/ezurio/rm1xx_dvk/doc/index.rst index 8462f92c1b25a..ebb994540ebad 100644 --- a/boards/ezurio/rm1xx_dvk/doc/index.rst +++ b/boards/ezurio/rm1xx_dvk/doc/index.rst @@ -48,40 +48,8 @@ is 16MHz. Supported Features ================== -The rm1xx_dvk board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| SPU | on-chip | system protection | -+-----------+------------+----------------------+ -| UART | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: + See `Nordic Semiconductor Infocenter`_ for a complete list of hardware features. @@ -125,6 +93,8 @@ Refer to the `Semtech SX1272 datasheet`_ for further details. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/fanke/fk743m5_xih6/Kconfig.fk743m5_xih6 b/boards/fanke/fk743m5_xih6/Kconfig.fk743m5_xih6 new file mode 100644 index 0000000000000..b429435dd0964 --- /dev/null +++ b/boards/fanke/fk743m5_xih6/Kconfig.fk743m5_xih6 @@ -0,0 +1,5 @@ +# Copyright (c) 2024 zack jiang, Honbo He +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_FK743M5_XIH6 + select SOC_STM32H743XX diff --git a/boards/fanke/fk743m5_xih6/board.cmake b/boards/fanke/fk743m5_xih6/board.cmake new file mode 100644 index 0000000000000..10170d65424f5 --- /dev/null +++ b/boards/fanke/fk743m5_xih6/board.cmake @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(openocd --target-handle=_CHIPNAME.cpu0) +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") +board_runner_args(jlink "--device=STM32H743XI" "--speed=4000") + +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/fanke/fk743m5_xih6/board.yml b/boards/fanke/fk743m5_xih6/board.yml new file mode 100644 index 0000000000000..b6a9f42f25d79 --- /dev/null +++ b/boards/fanke/fk743m5_xih6/board.yml @@ -0,0 +1,6 @@ +board: + name: fk743m5_xih6 + full_name: FK743M5-XIH6 + vendor: fanke + socs: + - name: stm32h743xx diff --git a/boards/fanke/fk743m5_xih6/doc/img/fk743m5_xih6.webp b/boards/fanke/fk743m5_xih6/doc/img/fk743m5_xih6.webp new file mode 100644 index 0000000000000..733b0efc806be Binary files /dev/null and b/boards/fanke/fk743m5_xih6/doc/img/fk743m5_xih6.webp differ diff --git a/boards/fanke/fk743m5_xih6/doc/index.rst b/boards/fanke/fk743m5_xih6/doc/index.rst new file mode 100644 index 0000000000000..0c7dbbfbe44ec --- /dev/null +++ b/boards/fanke/fk743m5_xih6/doc/index.rst @@ -0,0 +1,131 @@ +.. zephyr:board:: fk743m5_xih6 + +Overview +******** + +The FK743M5-XIH6 core board by FANKE Technology Co., Ltd. is an advanced microcontroller +platform based on the STMicroelectronics Arm® Cortex®-M7 core STM32H743XIH6 microcontroller. +This board is an ideal solution for developers looking to create high-performance +applications, leveraging its robust capabilities and support for sophisticated display +and image processing technologies. + +The FK743M5-XIH6 is designed as a reference design for user application development before +transitioning to the final product, significantly simplifying the development process. +Its wide range of hardware features, including advanced display and image processing capabilities, +allowing for comprehensive evaluation and testing of peripherals and functionalities. + +Hardware +******** + +FK743M5-XIH6 provides the following hardware components: + +- STM32H743XI in 265-TFBGA package +- ARM 32-bit Cortex-M7 CPU with FPU +- 480 MHz max CPU frequency +- 2048 KB Flash +- 1 MB SRAM: 192 Kbytes TCM RAM (64 Kbytes ITCM RAM + 128 Kbytes DTCM RAM), 864 Kbytes user SRAM, and 4 Kbytes SRAM in Backup domain +- Main clock: External 25MHz crystal oscillator. +- RTC: 32.768kHz crystal oscillator. +- high-resolution timers(2.1 ns max resolution, 1) +- 32-bit timers(2) +- 16-bit timers(17) +- 1 reset button, and 1 BOOT button +- 1 user LED +- External 64-Mbit QSPI (W25Q64) NOR Flash memory. +- USB OTG Full Speed and High Speed(1) +- 1 micro SD card +- 1 DCMI camera interface +- 1 SPI LCD interface +- SWD and serial port accessibility through a pin header +- Bring out 83 IO ports + +More information about STM32H743XI can be found here: + +- `STM32H743XI on www.st.com`_ + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Pin Mapping +=========== + +FK743M5-XIH6 board has 5 GPIO controllers. These controllers are responsible for pin muxing, +input/output, pull-up, etc. + +Default Zephyr Peripheral Mapping +--------------------------------- + +The FK743M5-XIH6 board is configured as follows + +- UART_1 TX/RX : PA9/PA10 (available on the header pins) +- User LED (blue) : PC13 +- SPI5 NCS/CLK/MOSI : PE11/PE12/PE14 (SPI LCD) +- QuadSPI NCS/CLK/IO0/IO1/IO2/IO3 : PG6/PF10/PF8/PF9/PF7/PF6 (NOR Flash) +- USB DM/DP : PA11/PA12 + +System Clock +============ + +The FK743M5-XIH6 System Clock could be driven by an internal or external oscillator, +as well as by the main PLL clock. By default the system clock is driven by the PLL clock at 480MHz, +driven by an 25MHz external crystal oscillator. + +Serial Port +=========== + +The Zephyr console output is assigned to UART1. The default communication settings are 115200 8N1. + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Applications for the ``fk743m5_xih6`` board target can be built and flashed in the usual +way (see :ref:`build_an_application` and :ref:`application_run` for more details). + +Flashing +======== + +The FK743M5-XIH6 board does not include an on-board debugger. As a result, it requires +an external debugger, such as ST-Link, for programming and debugging purposes. + +The board provides header pins for the Serial Wire Debug (SWD) interface. + +Flashing an application to FK743M5-XIH6 +--------------------------------------- + +To begin, connect the ST-Link Debug Programmer to the FK743M5-XIH6 board using the SWD +interface. Next, connect the ST-Link to your host computer via a USB port. +Once this setup is complete, you can proceed to build and flash your application to the board + +Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: fk743m5_xih6 + :goals: build flash + +Run a serial host program to connect with your board: + +.. code-block:: console + + $ minicom -D /dev/ttyACM0 -b 115200 + +Then, press the RESET button, you should see the following message: + +.. code-block:: console + + Hello World! fk743m5_xih6 + +Debugging +========= + +This current Zephyr port does not support debugging. + +References +********** + +.. target-notes:: +.. _STM32H743XI on www.st.com: https://www.st.com/en/microcontrollers/stm32h743xi.html diff --git a/boards/fanke/fk743m5_xih6/fk743m5_xih6.dts b/boards/fanke/fk743m5_xih6/fk743m5_xih6.dts new file mode 100644 index 0000000000000..93f9cd88847e6 --- /dev/null +++ b/boards/fanke/fk743m5_xih6/fk743m5_xih6.dts @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2025 zack jiang, Honbo He + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include + +/ { + model = "FANKE FK743M5-XIH6 board"; + compatible = "fanke,fk743m5-xih6"; + + chosen { + zephyr,console = &usart1; + zephyr,shell-uart = &usart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + + user_led: led_0 { + gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; + label = "User LED"; + }; + }; + + aliases { + led0 = &user_led; + }; +}; + +&clk_hsi48 { + status = "okay"; +}; + +&clk_hse { + clock-frequency = ; + status = "okay"; +}; + +&pll { + div-m = <5>; + mul-n = <192>; + div-p = <2>; + div-q = <4>; + div-r = <4>; + clocks = <&clk_hse>; + status = "okay"; +}; + +&pll3 { + div-m = <5>; + mul-n = <192>; + div-p = <2>; + div-q = <20>; + div-r = <99>; + clocks = <&clk_hse>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + d1cpre = <1>; + hpre = <2>; + d1ppre = <2>; + d2ppre1 = <2>; + d2ppre2 = <2>; + d3ppre = <2>; +}; + +&quadspi { + pinctrl-0 = <&quadspi_bk1_io0_pf8 &quadspi_bk1_io1_pf9 + &quadspi_bk1_io2_pf7 &quadspi_bk1_io3_pf6 + &quadspi_clk_pf10 &quadspi_bk1_ncs_pg6>; + pinctrl-names = "default"; + status = "okay"; + + /* Winbond external flash */ + w25q64_qspi: qspi-nor-flash@90000000 { + compatible = "st,stm32-qspi-nor"; + reg = <0x90000000 DT_SIZE_M(8)>; /* 64 Mbits */ + qspi-max-frequency = <40000000>; + status = "okay"; + spi-bus-width = <4>; + writeoc = "PP_1_1_4"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + storage_partition: partition@0 { + label = "storage"; + reg = <0x00000000 DT_SIZE_M(8)>; + }; + }; + }; +}; + +&usart1 { + pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; + pinctrl-names = "default"; + current-speed = <115200>; + status = "okay"; +}; + +&backup_sram { + status = "okay"; +}; + +&rng { + status = "okay"; +}; diff --git a/boards/fanke/fk743m5_xih6/fk743m5_xih6.yaml b/boards/fanke/fk743m5_xih6/fk743m5_xih6.yaml new file mode 100644 index 0000000000000..932fcb5f3f444 --- /dev/null +++ b/boards/fanke/fk743m5_xih6/fk743m5_xih6.yaml @@ -0,0 +1,16 @@ +identifier: fk743m5_xih6 +name: FANKE FK743M5-XIH6 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 1024 +flash: 2048 +supported: + - uart + - gpio + - spi + - backup_sram + - qspi +vendor: fanke diff --git a/boards/fanke/fk743m5_xih6/fk743m5_xih6_defconfig b/boards/fanke/fk743m5_xih6/fk743m5_xih6_defconfig new file mode 100644 index 0000000000000..13a1289e51c4f --- /dev/null +++ b/boards/fanke/fk743m5_xih6/fk743m5_xih6_defconfig @@ -0,0 +1,18 @@ +# Copyright (c) zack jiang, Honbo He +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable HW stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable UART +CONFIG_SERIAL=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y diff --git a/boards/fanke/fk743m5_xih6/support/openocd.cfg b/boards/fanke/fk743m5_xih6/support/openocd.cfg new file mode 100644 index 0000000000000..4ea6d13db0ba1 --- /dev/null +++ b/boards/fanke/fk743m5_xih6/support/openocd.cfg @@ -0,0 +1,25 @@ +# Copyright (c) zack jiang, Honbo He +# SPDX-License-Identifier: Apache-2.0 + +source [find interface/stlink-dap.cfg] +transport select "dapdirect_swd" + +set WORKAREASIZE 0x8000 + +set CHIPNAME STM32H743XI +set BOARDNAME FK743M5-XIH6 + +source [find target/stm32h7x.cfg] + +# Enable debug when in low power modes +set ENABLE_LOW_POWER 1 + +# Stop Watchdog counters when halt +set STOP_WATCHDOG 1 + +# Reset configuration +# use hardware reset, connect under reset +# connect_assert_srst needed if low power mode application running (WFI...) +reset_config srst_only srst_nogate connect_assert_srst +set CONNECT_UNDER_RESET 1 +set CORE_RESET 0 diff --git a/boards/fanke/fk750m1_vbt6/doc/index.rst b/boards/fanke/fk750m1_vbt6/doc/index.rst index 6a558bddc0873..f5340f336b6be 100644 --- a/boards/fanke/fk750m1_vbt6/doc/index.rst +++ b/boards/fanke/fk750m1_vbt6/doc/index.rst @@ -46,35 +46,7 @@ More information about STM32H750VB can be found here: Supported Features ================== -The Zephyr ``fk750m1_vbt6`` board target supports the following hardware -features: - -+-------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+=============+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-------------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-------------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-------------+------------+-------------------------------------+ -| RNG | on-chip | True Random number generator | -+-------------+------------+-------------------------------------+ -| Backup SRAM | on-chip | Backup SRAM | -+-------------+------------+-------------------------------------+ -| SPI | on-chip | spi bus | -+-------------+------------+-------------------------------------+ -| QUADSPI | on-chip | quadspi | -+-------------+------------+-------------------------------------+ - -Other hardware features are not yet supported on this Zephyr port. - -The default configuration per core can be found in -:zephyr_file:`boards/fanke/fk750m1_vbt6/fk750m1_vbt6_defconfig` +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -108,6 +80,8 @@ The Zephyr console output is assigned to UART1. The default communication settin Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``fk750m1_vbt6`` board target can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/firefly/roc_rk3568_pc/doc/index.rst b/boards/firefly/roc_rk3568_pc/doc/index.rst index bd55e747c5197..e26092db5766b 100644 --- a/boards/firefly/roc_rk3568_pc/doc/index.rst +++ b/boards/firefly/roc_rk3568_pc/doc/index.rst @@ -42,18 +42,7 @@ has frequency up to 2.0GHz. Zephyr OS is ported to run on it. Supported Features ================== -The Zephyr roc_rk3568_pc board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| GIC-v3 | on-chip | interrupt controller | -+-----------+------------+-------------------------------------+ -| ARM TIMER | on-chip | system clock | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Devices ======== @@ -72,6 +61,8 @@ CPU's UART2. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Use U-Boot to load the zephyr.bin to the memory and kick it: .. code-block:: console diff --git a/boards/franzininho/esp32s2_franzininho/doc/index.rst b/boards/franzininho/esp32s2_franzininho/doc/index.rst index 47f223b83ca28..bdbc20574ecdb 100644 --- a/boards/franzininho/esp32s2_franzininho/doc/index.rst +++ b/boards/franzininho/esp32s2_franzininho/doc/index.rst @@ -47,6 +47,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.dts b/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.dts index 2b182b569cbe7..f5e6429233ac2 100644 --- a/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.dts +++ b/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.dts @@ -111,3 +111,7 @@ &wdt0 { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.yaml b/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.yaml index da3da1bdc3ace..4fc82a2f23d76 100644 --- a/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.yaml +++ b/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.yaml @@ -14,4 +14,5 @@ supported: testing: ignore_tags: - heap + - bluetooth vendor: franzininho diff --git a/boards/fysetc/ucan/doc/index.rst b/boards/fysetc/ucan/doc/index.rst index f9b4b53809f84..725d87e62a4d4 100644 --- a/boards/fysetc/ucan/doc/index.rst +++ b/boards/fysetc/ucan/doc/index.rst @@ -16,28 +16,7 @@ drawings are available in the `UCAN GitHub repository`_. Supported Features ================== -The ``ucan`` board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| USB | on-chip | USB | -+-----------+------------+-------------------------------------+ -| CAN1 | on-chip | CAN controller | -+-----------+------------+-------------------------------------+ - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/fysetc/ucan/ucan_defconfig`. - -Other hardware features are not currently supported by the port. +.. zephyr:board-supported-hw:: System Clock ============ @@ -48,6 +27,8 @@ configured to provide a system clock of 48 MHz. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/gaisler/generic_leon3/doc/index.rst b/boards/gaisler/generic_leon3/doc/index.rst index 9f7781f3e2119..0dde96f2fc763 100644 --- a/boards/gaisler/generic_leon3/doc/index.rst +++ b/boards/gaisler/generic_leon3/doc/index.rst @@ -17,6 +17,8 @@ M2GL-EVAL-KIT. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Building ======== diff --git a/boards/gaisler/gr716a_mini/doc/index.rst b/boards/gaisler/gr716a_mini/doc/index.rst index 0f72330610554..77cf723119212 100644 --- a/boards/gaisler/gr716a_mini/doc/index.rst +++ b/boards/gaisler/gr716a_mini/doc/index.rst @@ -26,6 +26,8 @@ if enabled in GRMON, is preserved. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Building ======== diff --git a/boards/gardena/sgrm/doc/index.rst b/boards/gardena/sgrm/doc/index.rst index 40d05a9f4f340..5b0da0a61c735 100644 --- a/boards/gardena/sgrm/doc/index.rst +++ b/boards/gardena/sgrm/doc/index.rst @@ -24,24 +24,7 @@ Hardware Supported Features ================== -The ``sgrm`` board target supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| DMA | on-chip | dma | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -77,6 +60,8 @@ Connections and IOs Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/gd/gd32a503v_eval/doc/index.rst b/boards/gd/gd32a503v_eval/doc/index.rst index 8fcec05bdc34d..27e715227a709 100644 --- a/boards/gd/gd32a503v_eval/doc/index.rst +++ b/boards/gd/gd32a503v_eval/doc/index.rst @@ -39,47 +39,7 @@ For more information about the GD32A503 SoC and GD32A503V-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v8m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - * - PINMUX - - :kconfig:option:`CONFIG_PINCTRL` - - :dtcompatible:`gd,gd32-pinctrl-af` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`gd,gd32-adc` - * - DAC - - :kconfig:option:`CONFIG_DAC` - - :dtcompatible:`gd,gd32-dac` - * - FMC - - N/A - - :dtcompatible:`gd,gd32-flash-controller` - * - SPI - - :kconfig:option:`CONFIG_SPI` - - :dtcompatible:`gd,gd32-spi` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -90,6 +50,8 @@ is UART0 at PIN-72 and PIN-73. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before program your board make sure to configure boot setting and serial port. The default serial port is USART0. diff --git a/boards/gd/gd32e103v_eval/doc/index.rst b/boards/gd/gd32e103v_eval/doc/index.rst index 382bed8c7de0f..49d6f799199d5 100644 --- a/boards/gd/gd32e103v_eval/doc/index.rst +++ b/boards/gd/gd32e103v_eval/doc/index.rst @@ -43,24 +43,7 @@ For more information about the GD32E103 SoC and GD32E103V-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - NVIC - - N/A - - :dtcompatible:`arm,v7m-nvic` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - +.. zephyr:board-supported-hw:: Serial Port =========== @@ -71,6 +54,8 @@ is UART0 at PIN-9 and PIN-10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before program your board make sure to configure boot setting and serial port. The default serial port is USART0. This port uses header JP-5/6 to route signals between USB VBUS/ID and USART J2. diff --git a/boards/gd/gd32e507v_start/doc/index.rst b/boards/gd/gd32e507v_start/doc/index.rst index a8b8f7a946969..68eaf60ef49dc 100644 --- a/boards/gd/gd32e507v_start/doc/index.rst +++ b/boards/gd/gd32e507v_start/doc/index.rst @@ -30,34 +30,7 @@ For more information about the GD32E507 SoC and GD32E507V-START board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v8m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - -Other peripherals may be used if shields are connected to the board. +.. zephyr:board-supported-hw:: Serial Port =========== @@ -69,6 +42,8 @@ virtual COM port via the CN3 USB connector. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot jumpers as follows: diff --git a/boards/gd/gd32e507z_eval/doc/index.rst b/boards/gd/gd32e507z_eval/doc/index.rst index 610562b3eae22..f43863fbadb32 100644 --- a/boards/gd/gd32e507z_eval/doc/index.rst +++ b/boards/gd/gd32e507z_eval/doc/index.rst @@ -40,32 +40,7 @@ For more information about the GD32E507 SoC and GD32E507Z-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v8m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -77,6 +52,8 @@ virtual COM port via the J1 USB connector. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot jumpers as follows: diff --git a/boards/gd/gd32f350r_eval/doc/index.rst b/boards/gd/gd32f350r_eval/doc/index.rst index 2c7ad72635279..e30ab453690ef 100644 --- a/boards/gd/gd32f350r_eval/doc/index.rst +++ b/boards/gd/gd32f350r_eval/doc/index.rst @@ -35,29 +35,7 @@ For more information about the GD32F350 SoC and GD32F350R-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - NVIC - - N/A - - :dtcompatible:`arm,v7m-nvic` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - * - PINMUX - - :kconfig:option:`CONFIG_PINCTRL` - - :dtcompatible:`gd,gd32-pinctrl-af` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`gd,gd32-adc` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -68,6 +46,8 @@ is USART0 with TX connected at PA9 and RX at PA10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot and serial jumpers as follows: - J4: Select 2-3 for both (labeled as ``L``) diff --git a/boards/gd/gd32f403z_eval/doc/index.rst b/boards/gd/gd32f403z_eval/doc/index.rst index d304094a3e76e..7d2ca320ca7b0 100644 --- a/boards/gd/gd32f403z_eval/doc/index.rst +++ b/boards/gd/gd32f403z_eval/doc/index.rst @@ -43,27 +43,7 @@ For more information about the GD32F403 SoC and GD32F403Z-Eval board: Supported Features ================== -The board configuration supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| EXTI | on-chip | EXTI interrupt | -| | | controller | -+-----------+------------+-----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-----------------------+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| PWM | on-chip | PWM | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port-polling | -+-----------+------------+-----------------------+ -| ADC | on-chip | ADC | -+-----------+------------+-----------------------+ +.. zephyr:board-supported-hw:: Serial Port =========== @@ -74,6 +54,8 @@ is UART0 at PIN-9 and PIN-10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before program your board make sure to configure boot setting and serial port. The default serial port is USART0. This port uses header JP-5/6 to route signals between USB VBUS/ID and USART J2. diff --git a/boards/gd/gd32f407v_start/doc/index.rst b/boards/gd/gd32f407v_start/doc/index.rst index 68332eb51b8de..615659bf8209a 100644 --- a/boards/gd/gd32f407v_start/doc/index.rst +++ b/boards/gd/gd32f407v_start/doc/index.rst @@ -30,34 +30,7 @@ For more information about the GD32F407 SoC and GD32F407V-START board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v7m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - -Other peripherals may be used if shields are connected to the board. +.. zephyr:board-supported-hw:: Serial Port =========== @@ -68,6 +41,8 @@ is USART0 with TX connected at PB6 and RX at PB7. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot jumpers as follows: diff --git a/boards/gd/gd32f450i_eval/doc/index.rst b/boards/gd/gd32f450i_eval/doc/index.rst index d342cc9774d0b..05b2c20ba7a65 100644 --- a/boards/gd/gd32f450i_eval/doc/index.rst +++ b/boards/gd/gd32f450i_eval/doc/index.rst @@ -43,44 +43,7 @@ For more information about the GD32F450 SoC and GD32F450I-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v7m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - * - DAC - - :kconfig:option:`CONFIG_DAC` - - :dtcompatible:`gd,gd32-dac` - * - I2C - - :kconfig:option:`CONFIG_I2C` - - :dtcompatible:`gd,gd32-i2c` - * - EEPROM - - :kconfig:option:`CONFIG_EEPROM` - - :dtcompatible:`atmel,at24` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`gd,gd32-adc` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -91,6 +54,8 @@ is USART0 with TX connected at PA9 and RX at PA10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot and serial jumpers as follows: diff --git a/boards/gd/gd32f450v_start/doc/index.rst b/boards/gd/gd32f450v_start/doc/index.rst index 36870e0c6674c..6105b6afc16b5 100644 --- a/boards/gd/gd32f450v_start/doc/index.rst +++ b/boards/gd/gd32f450v_start/doc/index.rst @@ -30,34 +30,7 @@ For more information about the GD32F450 SoC and GD32F450V-START board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v8m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - -Other peripherals may be used if shields are connected to the board. +.. zephyr:board-supported-hw:: Serial Port =========== @@ -70,6 +43,8 @@ UART-USB adapter. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot jumpers as follows: diff --git a/boards/gd/gd32f450z_eval/doc/index.rst b/boards/gd/gd32f450z_eval/doc/index.rst index 5a8d8b74763e9..7b012d1ddb2cc 100644 --- a/boards/gd/gd32f450z_eval/doc/index.rst +++ b/boards/gd/gd32f450z_eval/doc/index.rst @@ -41,41 +41,7 @@ For more information about the GD32F450 SoC and GD32F450Z-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v7m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - * - DAC - - :kconfig:option:`CONFIG_DAC` - - :dtcompatible:`gd,gd32-dac` - * - I2C - - :kconfig:option:`CONFIG_I2C` - - :dtcompatible:`gd,gd32-i2c` - * - EEPROM - - :kconfig:option:`CONFIG_EEPROM` - - :dtcompatible:`atmel,at24` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -86,6 +52,8 @@ is USART0 with TX connected at PA9 and RX at PA10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot and serial jumpers as follows: diff --git a/boards/gd/gd32f470i_eval/doc/index.rst b/boards/gd/gd32f470i_eval/doc/index.rst index 1a8865f4d06fd..4c90c4d3f1249 100644 --- a/boards/gd/gd32f470i_eval/doc/index.rst +++ b/boards/gd/gd32f470i_eval/doc/index.rst @@ -42,44 +42,7 @@ For more information about the GD32F470 SoC and GD32F470I-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v7m-nvic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - * - DAC - - :kconfig:option:`CONFIG_DAC` - - :dtcompatible:`gd,gd32-dac` - * - I2C - - :kconfig:option:`CONFIG_I2C` - - :dtcompatible:`gd,gd32-i2c` - * - EEPROM - - :kconfig:option:`CONFIG_EEPROM` - - :dtcompatible:`atmel,at24` - * - SPI - - :kconfig:option:`CONFIG_SPI` - - :dtcompatible:`gd,gd32-spi` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -90,6 +53,8 @@ is USART0 with TX connected at PA9 and RX at PA10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot and serial jumpers as follows: diff --git a/boards/gd/gd32l233r_eval/doc/index.rst b/boards/gd/gd32l233r_eval/doc/index.rst index d677085625606..d025a2bf96e9e 100644 --- a/boards/gd/gd32l233r_eval/doc/index.rst +++ b/boards/gd/gd32l233r_eval/doc/index.rst @@ -34,35 +34,7 @@ For more information about the GD32L233 SoC and GD32L233R-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - EXTI - - :kconfig:option:`CONFIG_GD32_EXTI` - - :dtcompatible:`gd,gd32-exti` - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - NVIC - - N/A - - :dtcompatible:`arm,v8m-nvic` - * - SYSTICK - - N/A - - N/A - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - * - PINMUX - - :kconfig:option:`CONFIG_PINCTRL` - - :dtcompatible:`gd,gd32-pinctrl-af` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`gd,gd32-adc` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -74,6 +46,8 @@ CH04E serial connector with Mini-USB. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Using J-Link ============= diff --git a/boards/gd/gd32vf103c_starter/doc/index.rst b/boards/gd/gd32vf103c_starter/doc/index.rst index 40b22fa18c5af..a443dbde5f3cb 100644 --- a/boards/gd/gd32vf103c_starter/doc/index.rst +++ b/boards/gd/gd32vf103c_starter/doc/index.rst @@ -30,29 +30,7 @@ For more information about the GD32VF103 SoC and GD32VF103C-STARTER board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - Machine timer - - :kconfig:option:`CONFIG_RISCV_MACHINE_TIMER` - - :dtcompatible:`riscv,machine-timer` - * - Nuclei ECLIC Interrupt Controller - - :kconfig:option:`CONFIG_NUCLEI_ECLIC` - - :dtcompatible:`nuclei,eclic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -63,6 +41,8 @@ TX connected at PA9 and RX at PA10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot and serial jumpers as follows: diff --git a/boards/gd/gd32vf103v_eval/doc/index.rst b/boards/gd/gd32vf103v_eval/doc/index.rst index 773262c8eabee..2f8dd496f615e 100644 --- a/boards/gd/gd32vf103v_eval/doc/index.rst +++ b/boards/gd/gd32vf103v_eval/doc/index.rst @@ -37,32 +37,7 @@ For more information about the GD32VF103 SoC and GD32VF103V-EVAL board: Supported Features ================== -The board configuration supports the following hardware features: - -.. list-table:: - :header-rows: 1 - - * - Peripheral - - Kconfig option - - Devicetree compatible - * - GPIO - - :kconfig:option:`CONFIG_GPIO` - - :dtcompatible:`gd,gd32-gpio` - * - Machine timer - - :kconfig:option:`CONFIG_RISCV_MACHINE_TIMER` - - :dtcompatible:`riscv,machine-timer` - * - Nuclei ECLIC Interrupt Controller - - :kconfig:option:`CONFIG_NUCLEI_ECLIC` - - :dtcompatible:`nuclei,eclic` - * - PWM - - :kconfig:option:`CONFIG_PWM` - - :dtcompatible:`gd,gd32-pwm` - * - USART - - :kconfig:option:`CONFIG_SERIAL` - - :dtcompatible:`gd,gd32-usart` - * - ADC - - :kconfig:option:`CONFIG_ADC` - - :dtcompatible:`gd,gd32-adc` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -73,6 +48,8 @@ is USART0 with TX connected at PA9 and RX at PA10. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Before programming your board make sure to configure boot and serial jumpers as follows: diff --git a/boards/google/dragonclaw/doc/index.rst b/boards/google/dragonclaw/doc/index.rst index 3f717a84341f9..ed5c8c1113592 100644 --- a/boards/google/dragonclaw/doc/index.rst +++ b/boards/google/dragonclaw/doc/index.rst @@ -26,6 +26,8 @@ Peripherial Mapping Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Build application as usual for the ``dragonclaw`` board, and flash using μServo or an external J-Link connected to J4. If μServo is used, please follow the `Chromium EC Flashing Documentation`_. diff --git a/boards/google/icetower/doc/index.rst b/boards/google/icetower/doc/index.rst index 45ecb81be2dcd..7106102f718fe 100644 --- a/boards/google/icetower/doc/index.rst +++ b/boards/google/icetower/doc/index.rst @@ -26,6 +26,8 @@ Default Zephyr Peripheral Mapping: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Build application as usual for the ``google_icetower`` board, and flash using μServo or an external J-Link connected to J4. If μServo is used, please follow the `Chromium EC Flashing Documentation`_. diff --git a/boards/google/quincy/doc/index.rst b/boards/google/quincy/doc/index.rst index 12dc09329ca49..ec960007ec8bc 100644 --- a/boards/google/quincy/doc/index.rst +++ b/boards/google/quincy/doc/index.rst @@ -26,6 +26,8 @@ Peripheral Mapping Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Build application as usual for the ``google_quincy`` board target, and flash using μServo or an external J-Link connected to J4. If μServo is used, please follow the `Chromium EC Flashing Documentation`_ and diff --git a/boards/google/twinkie_v2/doc/index.rst b/boards/google/twinkie_v2/doc/index.rst index 3ba2f42e2672c..89450cf04ffa3 100644 --- a/boards/google/twinkie_v2/doc/index.rst +++ b/boards/google/twinkie_v2/doc/index.rst @@ -14,22 +14,7 @@ Hardware Supported Features ================== -The following features are supported: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | reset and clock control | -+-----------+------------+-------------------------------------+ -| FLASH | on-chip | flash memory | -+-----------+------------+-------------------------------------+ - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/google/twinkie_v2/google_twinkie_v2_defconfig` +.. zephyr:board-supported-hw:: Pin Mapping =========== @@ -45,6 +30,8 @@ Default Zephyr Peripheral Mapping: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Build application as usual for the ``google_twinkie_v2`` board, and flash using dfu-util or J-Link. diff --git a/boards/hardkernel/odroid_go/doc/index.rst b/boards/hardkernel/odroid_go/doc/index.rst index 0963435fa3d45..3c14c9c23b0f8 100644 --- a/boards/hardkernel/odroid_go/doc/index.rst +++ b/boards/hardkernel/odroid_go/doc/index.rst @@ -51,23 +51,7 @@ External Connector Supported Features ================== -The Zephyr odroid_go board configuration supports the following hardware -features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+------------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+------------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: System requirements ******************* @@ -89,6 +73,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/hardkernel/odroid_go/odroid_go_procpu.dts b/boards/hardkernel/odroid_go/odroid_go_procpu.dts index 386627ff3583b..38510fbeadfd2 100644 --- a/boards/hardkernel/odroid_go/odroid_go_procpu.dts +++ b/boards/hardkernel/odroid_go/odroid_go_procpu.dts @@ -174,3 +174,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst b/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst index c4987a76b8fc7..abe91f4ca90d2 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst +++ b/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst @@ -39,6 +39,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts index c641e773e0725..426a7a1337874 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts +++ b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts @@ -115,5 +115,9 @@ status = "okay"; }; +&wifi { + status = "okay"; +}; + /* Required by the ssd1306_128x64 shield which enables the OLED display */ arduino_i2c: &i2c0 {}; diff --git a/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst b/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst index 4f6430965e5a4..431f83d41ebeb 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst +++ b/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst @@ -20,13 +20,8 @@ The main hardware features are: Supported Features ================== -- LoRa via SPI -- UART0 (USB Serial via CP2102) -- UART1 -- I2C -- CAN (optional, need to enable) -- PWM LED -- User Switch / Button + +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -146,6 +141,8 @@ below to retrieve those files. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts index 9e02e3db483cc..631d873cd10bb 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts +++ b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu.dts @@ -176,3 +176,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/holyiot/yj16019/board.cmake b/boards/holyiot/yj16019/board.cmake index 4ffa4da957837..6de15b50c2965 100644 --- a/boards/holyiot/yj16019/board.cmake +++ b/boards/holyiot/yj16019/board.cmake @@ -1,4 +1,5 @@ board_runner_args(nrfjprog "--softreset") board_runner_args(jlink "--device=nRF52832_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/holyiot/yj16019/doc/index.rst b/boards/holyiot/yj16019/doc/index.rst index 86575a0838bcd..867fbdf88a6e2 100644 --- a/boards/holyiot/yj16019/doc/index.rst +++ b/boards/holyiot/yj16019/doc/index.rst @@ -30,34 +30,7 @@ The nRF52832 of the Holyiot YJ-16019 is clocked by an external crystal with a fr Supported Features ================== -The holyiot_yj16019 board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features have not been enabled yet for this board. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -71,6 +44,8 @@ LED and push button Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``holyiot_yj16019`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details); however, an external diff --git a/boards/iar/index.rst b/boards/iar/index.rst new file mode 100644 index 0000000000000..3cc895fdb5553 --- /dev/null +++ b/boards/iar/index.rst @@ -0,0 +1,10 @@ +.. _boards-iar: + +IAR +### + +.. toctree:: + :maxdepth: 1 + :glob: + + **/* diff --git a/boards/iar/stm32f429ii_aca/Kconfig.stm32f429ii_aca b/boards/iar/stm32f429ii_aca/Kconfig.stm32f429ii_aca new file mode 100644 index 0000000000000..f04f3979a7ea2 --- /dev/null +++ b/boards/iar/stm32f429ii_aca/Kconfig.stm32f429ii_aca @@ -0,0 +1,6 @@ +# Copyright (c) 2016 Linaro Limited. +# Copyright (c) 2025 IAR Systems. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_STM32F429II_ACA + select SOC_STM32F429XX diff --git a/boards/iar/stm32f429ii_aca/board.cmake b/boards/iar/stm32f429ii_aca/board.cmake new file mode 100644 index 0000000000000..1d0b4be283d68 --- /dev/null +++ b/boards/iar/stm32f429ii_aca/board.cmake @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=STM32F429II" "--speed=4000") +board_runner_args(pyocd "--target=stm32f429xi") +board_runner_args(pyocd "--flash-opt=-O reset_type=hw") +board_runner_args(pyocd "--flash-opt=-O connect_mode=under-reset") + +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/iar/stm32f429ii_aca/board.yml b/boards/iar/stm32f429ii_aca/board.yml new file mode 100644 index 0000000000000..67419bb50680e --- /dev/null +++ b/boards/iar/stm32f429ii_aca/board.yml @@ -0,0 +1,6 @@ +board: + name: stm32f429ii_aca + full_name: STM32F429II-ACA + vendor: iar + socs: + - name: stm32f429xx diff --git a/boards/iar/stm32f429ii_aca/doc/img/stm32f429ii_aca.webp b/boards/iar/stm32f429ii_aca/doc/img/stm32f429ii_aca.webp new file mode 100644 index 0000000000000..1ce5bb76c168f Binary files /dev/null and b/boards/iar/stm32f429ii_aca/doc/img/stm32f429ii_aca.webp differ diff --git a/boards/iar/stm32f429ii_aca/doc/index.rst b/boards/iar/stm32f429ii_aca/doc/index.rst new file mode 100644 index 0000000000000..cc95c94a0ff54 --- /dev/null +++ b/boards/iar/stm32f429ii_aca/doc/index.rst @@ -0,0 +1,138 @@ +.. zephyr:board:: stm32f429ii_aca + +Overview +******** + +The IAR STM32F429II-ACA evaluation board features an ARM Cortex-M4 based STM32F429II MCU. +Here are some highlights of the STM32F429II-ACA board: + +- STM32 microcontroller in LQFP144 package +- JTAG/SWD debugger/programmer interface +- Flexible board power supply + + - JTAG/SWD connector + - USB HS connector + +- 3x user push-buttons and 1x RESET push-button +- Open-close switch and on-auto-off switch +- 2x capacitive touch panels +- USB OTG with mini-USB connector +- Small speaker +- Trimmer potentiometer +- Nine LEDs + + - 1x power LED + - 3x car traffic light LEDs + - 2x pedestrian traffic light LEDs + - 1x car interior light LED + - 2x user LEDs + +Schematics for the board can be found `here `_ + +Hardware +******** + +The STM32F429II-ACA evaluation board provides the following hardware components: + +- STM32F429II in LQFP144 package +- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU +- 180 MHz max CPU frequency +- VDD from 1.8 V to 3.6 V +- 2 MB Internal Flash +- 4 Mbit External Flash +- 256+4 KB SRAM including 64-KB of core coupled memory +- GPIO with external interrupt capability +- 12-bit ADC +- 12-bit DAC +- RTC +- General Purpose Timers +- I2C +- SPI +- USB 2.0 OTG HS/FS with dedicated DMA, on-chip full-speed PHY and ULPI +- CRC calculation unit +- True random number generator +- DMA Controller + +More information about STM32F429II can be found here: + +- `STM32F429II on www.st.com`_ +- `STM32F429 Reference Manual`_ + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Default Zephyr Peripheral Mapping: +---------------------------------- +- I2C_1_SCL : PB8 +- I2C_1_SDA : PB7 +- I2C_2_SCL : PH4 +- I2C_2_SDA : PH5 +- SPI_5_NSS : PF6 +- SPI_5_SCK : PF7 +- SPI_5_MISO : PF8 +- SPI_5_MOSI : PF9 +- OTG_HS_ID : PB12 +- OTG_HS_DM : PB14 +- OTG_HS_DP : PB15 + +Serial Port +=========== + +By default, the STM32F429II-ACA evaluation board has no physical serial port available. +The board has up to 8 UARTs, of which none are used. + +USB Port +======== + +The STM32F429II-ACA evaluation board has a USB HS capable Mini-USB port. It is connected to the on-chip +OTG_HS peripheral. + +Programming and Debugging +************************* + +Applications for the ``stm32f429ii_aca`` board configuration can be built +and flashed in the usual way (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +Flashing +======== + +In order to flash this board using west, an external debug probe such as a Segger J-Link +has to be connected through the JTAG/SWD connector on the board. +By default, the board is set to be flashed using the jlink runner. +Alternatively, openocd, or pyocd can also be used as runners to flash the board using +the ``--runner`` (or ``-r``) option: + +.. code-block:: console + + $ west flash --runner openocd + $ west flash --runner pyocd + +First, connect the STM32F429II-ACA evaluation board to your host computer using +your debug probe through the JTAG/SWD connector to prepare it for flashing. +Then build and flash your application. + +Here is an example for the :zephyr:code-sample:`blinky` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: stm32f429ii_aca + :goals: build flash + +LED0 should then begin to blink continuously with a 1-second delay. + +References +********** + +.. target-notes:: + +.. _stm32f429ii-aca-schematics: + https://iar.my.salesforce.com/sfc/p/#30000000YATY/a/Qx000000vZVh/EzlIqYKIBVXN8PN4Q8MgtowSZrR_vZarwLiNJXw7UJw + +.. _STM32F429II on www.st.com: + https://www.st.com/en/microcontrollers-microprocessors/stm32f429ii.html + +.. _STM32F429 Reference Manual: + https://www.st.com/content/ccc/resource/technical/document/reference_manual/3d/6d/5a/66/b4/99/40/d4/DM00031020.pdf/files/DM00031020.pdf/jcr:content/translations/en.DM00031020.pdf diff --git a/boards/iar/stm32f429ii_aca/stm32f429ii_aca.dts b/boards/iar/stm32f429ii_aca/stm32f429ii_aca.dts new file mode 100644 index 0000000000000..ff7635b676d35 --- /dev/null +++ b/boards/iar/stm32f429ii_aca/stm32f429ii_aca.dts @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2017 Linaro Limited + * Copyright (c) 2024 STMicroelectronics + * Copyright (c) 2025 IAR Systems + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include +#include + +/ { + model = "IAR STM32F429II-ACA board"; + compatible = "iar,stm32f429ii-aca"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,ccm = &ccm0; + }; + + sdram2: sdram@d0000000 { + compatible = "zephyr,memory-region", "mmio-sram"; + device_type = "memory"; + reg = <0xd0000000 DT_SIZE_M(8)>; + zephyr,memory-region = "SDRAM2"; + }; + + leds { + compatible = "gpio-leds"; + + traffic_red_led: led_0 { + gpios = <&gpioa 4 GPIO_ACTIVE_LOW>; + label = "LED0"; + }; + + traffic_yellow_led: led_1 { + gpios = <&gpiod 4 GPIO_ACTIVE_LOW>; + label = "LED1"; + }; + + traffic_green_led: led_2 { + gpios = <&gpiod 5 GPIO_ACTIVE_LOW>; + label = "LED2"; + }; + + car_led: led_3 { + gpios = <&gpiod 6 GPIO_ACTIVE_LOW>; + label = "LED3"; + }; + + pedestrian_red_led: led_4 { + gpios = <&gpiod 7 GPIO_ACTIVE_LOW>; + label = "LED4"; + }; + + pedestrian_green_led: led_5 { + gpios = <&gpiod 11 GPIO_ACTIVE_LOW>; + label = "LED5"; + }; + + user_led_1: led_6 { + gpios = <&gpiod 12 GPIO_ACTIVE_LOW>; + label = "LED6"; + }; + + user_led_2: led_7 { + gpios = <&gpiod 13 GPIO_ACTIVE_LOW>; + label = "LED7"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + button0: button_0 { + label = "BUT0"; + gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + + button1: button_1 { + label = "BUT1"; + gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + + button2: button_2 { + label = "BUT2"; + gpios = <&gpiog 9 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + + open_close_switch: switch_0 { + label = "OPEN/CLOSE SWITCH"; + gpios = <&gpioi 11 GPIO_ACTIVE_HIGH>; + zephyr,code = ; + }; + + interior_light_switch_on: switch_1 { + label = "ON"; + gpios = <&gpioi 10 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + + interior_light_switch_auto: switch_2 { + label = "AUTO"; + gpios = <&gpioi 9 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + + interior_light_switch_off: switch_3 { + label = "OFF"; + gpios = <&gpioi 8 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + + cap_button0: cap_button_0 { + label = "CAP_BUT0"; + gpios = <&gpioh 6 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + + cap_button1: cap_button_1 { + label = "CAP_BUT1"; + gpios = <&gpioh 7 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + }; + + aliases { + led0 = &traffic_red_led; + led1 = &traffic_yellow_led; + led2 = &traffic_green_led; + led3 = &car_led; + led4 = &pedestrian_red_led; + led5 = &pedestrian_green_led; + led6 = &user_led_1; + led7 = &user_led_2; + sw0 = &button0; + sw1 = &button1; + sw2 = &button2; + sw3 = &open_close_switch; + sw4 = &interior_light_switch_on; + sw5 = &interior_light_switch_auto; + sw6 = &interior_light_switch_off; + sw7 = &cap_button0; + sw8 = &cap_button1; + }; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hse { + clock-frequency = ; + status = "okay"; +}; + +&pll { + div-m = <8>; + mul-n = <336>; + div-p = <2>; + div-q = <7>; + clocks = <&clk_hse>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <4>; + apb2-prescaler = <2>; +}; + +&rtc { + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>, + <&rcc STM32_SRC_LSI RTC_SEL(2)>; + status = "okay"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb7>; + pinctrl-names = "default"; + status = "okay"; + clock-frequency = ; +}; + +&i2c2 { + pinctrl-0 = <&i2c2_scl_ph4 &i2c2_sda_ph5>; + pinctrl-names = "default"; + status = "okay"; + clock-frequency = ; +}; + + +&spi5 { + pinctrl-0 = <&spi5_nss_pf6 &spi5_sck_pf7 + &spi5_miso_pf8 &spi5_mosi_pf9>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&gpioc 2 GPIO_ACTIVE_LOW>; +}; + +&fmc { + status = "okay"; + pinctrl-0 = <&fmc_nbl0_pe0 &fmc_nbl1_pe1 + &fmc_sdclk_pg8 &fmc_sdnwe_pc0 &fmc_sdcke0_pc3 + &fmc_sdne0_pc2 &fmc_sdnras_pf11 &fmc_sdncas_pg15 + &fmc_a0_pf0 &fmc_a1_pf1 &fmc_a2_pf2 &fmc_a3_pf3 + &fmc_a4_pf4 &fmc_a5_pf5 &fmc_a6_pf12 &fmc_a7_pf13 + &fmc_a8_pf14 &fmc_a9_pf15 &fmc_a10_pg0 &fmc_a11_pg1 + &fmc_a12_pg2 &fmc_a13_pg3 &fmc_a14_pg4 &fmc_a15_pg5 + &fmc_d0_pd14 &fmc_d1_pd15 &fmc_d2_pd0 &fmc_d3_pd1 + &fmc_d4_pe7 &fmc_d5_pe8 &fmc_d6_pe9 &fmc_d7_pe10 + &fmc_d8_pe11 &fmc_d9_pe12 &fmc_d10_pe13 &fmc_d11_pe14 + &fmc_d12_pe15 &fmc_d13_pd8 &fmc_d14_pd9 &fmc_d15_pd10>; + pinctrl-names = "default"; + + sdram { + status = "okay"; + + power-up-delay = <100>; + num-auto-refresh = <1>; + mode-register = <0>; + refresh-rate = <1386>; + + bank@1 { + reg = <1>; + + st,sdram-control = ; + st,sdram-timing = <2 7 4 7 2 2 2>; + }; + }; +}; + +&adc2 { + compatible = "st,stm32f4-adc", "st,stm32-adc"; + pinctrl-0 = <&adc2_in6_pa6>; + pinctrl-names = "default"; + st,adc-prescaler = <2>; + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + channel@6 { + reg = <6>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + }; +}; + +&dac1 { + pinctrl-0 = <&dac_out2_pa5>; + pinctrl-names = "default"; + status = "okay"; +}; + +zephyr_udc0: &usbotg_hs { + pinctrl-0 = <&usb_otg_hs_dm_pb14 &usb_otg_hs_dp_pb15 &usb_otg_hs_id_pb12>; + pinctrl-names = "default"; + status = "okay"; +}; diff --git a/boards/iar/stm32f429ii_aca/stm32f429ii_aca.yaml b/boards/iar/stm32f429ii_aca/stm32f429ii_aca.yaml new file mode 100644 index 0000000000000..b430c8f5d9bf0 --- /dev/null +++ b/boards/iar/stm32f429ii_aca/stm32f429ii_aca.yaml @@ -0,0 +1,15 @@ +identifier: stm32f429ii_aca +name: IAR STM32F429II ACA +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - iar +ram: 192 +flash: 2048 +supported: + - counter + - i2c + - spi +vendor: iar diff --git a/boards/iar/stm32f429ii_aca/stm32f429ii_aca_defconfig b/boards/iar/stm32f429ii_aca/stm32f429ii_aca_defconfig new file mode 100644 index 0000000000000..75a3154c8fb16 --- /dev/null +++ b/boards/iar/stm32f429ii_aca/stm32f429ii_aca_defconfig @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable HW stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable GPIO +CONFIG_GPIO=y diff --git a/boards/iar/stm32f429ii_aca/support/openocd.cfg b/boards/iar/stm32f429ii_aca/support/openocd.cfg new file mode 100644 index 0000000000000..fa1360a714323 --- /dev/null +++ b/boards/iar/stm32f429ii_aca/support/openocd.cfg @@ -0,0 +1,17 @@ +source [find interface/cmsis-dap.cfg] + +set CHIPNAME STM32F429IITx +set BOARDNAME STM32F429II-ACA + +source [find target/stm32f4x.cfg] + +$_TARGETNAME configure -event gdb-attach { + echo "Debugger attaching: halting execution" + reset halt + gdb_breakpoint_override hard +} + +$_TARGETNAME configure -event gdb-detach { + echo "Debugger detaching: resuming execution" + resume +} diff --git a/boards/index.rst b/boards/index.rst index 0643a355e590d..9b83276abbfeb 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -24,6 +24,10 @@ this page `. single field, selecting multiple options (such as two architectures) will show boards matching **either** option. + * The list of supported hardware features for each board is automatically generated using + information from the Devicetree. It may not be reflecting the full list of supported features + since some of them may not be enabled by default. + * Can't find your exact board? Don't worry! If a similar board with the same or a closely related MCU exists, you can use it as a :ref:`starting point ` for adding support for your own board. diff --git a/boards/infineon/cy8ckit_062s2_ai/doc/index.rst b/boards/infineon/cy8ckit_062s2_ai/doc/index.rst index 8395bcd98ce6c..a7c2ad2f4f62e 100644 --- a/boards/infineon/cy8ckit_062s2_ai/doc/index.rst +++ b/boards/infineon/cy8ckit_062s2_ai/doc/index.rst @@ -28,31 +28,7 @@ For more information about the CY8C624ABZI-S2D44 MCU SoC and CY8CKIT-062S2-AI bo Supported Features ================== -The ``cy8ckit_062s2_ai/cy8c624abzi_s2d44`` board target supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| GPIO | on-chip | GPIO | -+-----------+------------+-----------------------+ -| PINCTRL | on-chip | pin control | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-----------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-----------------------+ - - -The default configuration can be found in the defconfig and dts files: - - - :zephyr_file:`boards/infineon/cy8ckit_062s2_ai/cy8ckit_062s2_ai_defconfig` - - :zephyr_file:`boards/infineon/cy8ckit_062s2_ai/cy8ckit_062s2_ai.dts` +.. zephyr:board-supported-hw:: System Clock ============ @@ -87,6 +63,8 @@ Here is an example for building the :zephyr:code-sample:`blinky` sample applicat Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The CY8CKIT-062S2-AI board includes an onboard programmer/debugger (`KitProg3`_) to provide debugging, flash programming, and serial communication over USB. Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version, diff --git a/boards/infineon/cy8ckit_062s4/doc/index.rst b/boards/infineon/cy8ckit_062s4/doc/index.rst index b5e3e39cc1d84..8a1efe9fe282e 100644 --- a/boards/infineon/cy8ckit_062s4/doc/index.rst +++ b/boards/infineon/cy8ckit_062s4/doc/index.rst @@ -24,25 +24,7 @@ Hardware Supported Features ================== -The board configuration supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| PINCTRL | on-chip | pin control | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port-polling; | -+-----------+------------+-----------------------+ - - -The default configuration can be found in the Kconfig - -:zephyr_file:`boards/infineon/cy8ckit_062s4/cy8ckit_062s4_defconfig` +.. zephyr:board-supported-hw:: Clock Configuration =================== @@ -77,6 +59,8 @@ Here is an example for building the :zephyr:code-sample:`blinky` sample applicat Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The CY8CKIT-062S4 includes an onboard programmer/debugger (`KitProg3`_) to provide debugging, flash programming, and serial communication over USB. Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version, that supports KitProg3, to be installed. Infineon OpenOCD Installation diff --git a/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig index 063b782a33f97..54183d73c1ccb 100644 --- a/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig +++ b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig @@ -20,6 +20,3 @@ CONFIG_GPIO=y # Enable clock controller CONFIG_CLOCK_CONTROL=y - -# Main Stack Size -CONFIG_MAIN_STACK_SIZE=2048 diff --git a/boards/infineon/cy8cproto_062_4343w/doc/index.rst b/boards/infineon/cy8cproto_062_4343w/doc/index.rst index f04c28e5d00a7..c4696ca8d866f 100644 --- a/boards/infineon/cy8cproto_062_4343w/doc/index.rst +++ b/boards/infineon/cy8cproto_062_4343w/doc/index.rst @@ -49,27 +49,7 @@ Kit Contents: Supported Features ================== -The board configuration supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| GPIO | on-chip | GPIO | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-----------------------+ - - -The default configuration can be found in the Kconfig - -:zephyr_file:`boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig` - +.. zephyr:board-supported-hw:: System Clock ============ @@ -105,6 +85,8 @@ Here is an example for building the :zephyr:code-sample:`blinky` sample applicat Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The CY8CPROTO-062-4343W includes an onboard programmer/debugger (`KitProg3`_) to provide debugging, flash programming, and serial communication over USB. Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version, that supports KitProg3, to be installed. Infineon OpenOCD Installation diff --git a/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble_defconfig b/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble_defconfig index 0cbfa3b2e658b..51c814073a308 100644 --- a/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble_defconfig +++ b/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble_defconfig @@ -22,8 +22,5 @@ CONFIG_GPIO=y # Enable clock controller CONFIG_CLOCK_CONTROL=y -# Main Stack Size -CONFIG_MAIN_STACK_SIZE=2048 - # Add catcm0p sleep images for CM0 Devices CONFIG_SOC_PSOC6_CM0P_IMAGE_SLEEP=y diff --git a/boards/infineon/cy8cproto_063_ble/doc/index.rst b/boards/infineon/cy8cproto_063_ble/doc/index.rst index 90623b80382e7..f3c8326051371 100644 --- a/boards/infineon/cy8cproto_063_ble/doc/index.rst +++ b/boards/infineon/cy8cproto_063_ble/doc/index.rst @@ -22,38 +22,7 @@ For more information about the PSOC 63 BLE MCU SoC and CY8CPROTO-063-BLE board: Supported Features ================== -The board configuration supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| GPIO | on-chip | GPIO | -+-----------+------------+-----------------------+ -| PINCTRL | on-chip | pin control | -+-----------+------------+-----------------------+ -| SPI | on-chip | SPI | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-----------------------+ -| I2C | on-chip | I2C | -+-----------+------------+-----------------------+ -| PWM | on-chip | PWM | -+-----------+------------+-----------------------+ -| Counter | on-chip | Counter | -+-----------+------------+-----------------------+ -| Bluetooth | on-chip | Bluetooth | -+-----------+------------+-----------------------+ - - -The default configuration can be found in the Kconfig - -:zephyr_file:`boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble_defconfig` +.. zephyr:board-supported-hw:: System Clock ============ @@ -89,6 +58,8 @@ Here is an example for building the :zephyr:code-sample:`blinky` sample applicat Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The CY8CPROTO-063-BLE includes an onboard programmer/debugger (`KitProg3`_) to provide debugging, flash programming, and serial communication over USB. Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version, that supports KitProg3, to be installed. Infineon OpenOCD Installation diff --git a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig index 156152944b6a8..c59deaae71c2b 100644 --- a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig +++ b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig @@ -20,8 +20,5 @@ CONFIG_GPIO=y # Enable clock controller CONFIG_CLOCK_CONTROL=y -# Main Stack Size -CONFIG_MAIN_STACK_SIZE=2048 - # Enable code/data relocation to move SMIF driver into RAM CONFIG_CODE_DATA_RELOCATION=y diff --git a/boards/infineon/cyw920829m2evk_02/doc/index.rst b/boards/infineon/cyw920829m2evk_02/doc/index.rst index d4c5193c3820d..0dd56962c1500 100644 --- a/boards/infineon/cyw920829m2evk_02/doc/index.rst +++ b/boards/infineon/cyw920829m2evk_02/doc/index.rst @@ -36,26 +36,7 @@ Kit Contents: Supported Features ================== -The board configuration supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| GPIO | on-chip | GPIO | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-----------------------+ - - -The default configuration can be found in the Kconfig - -:zephyr_file:`boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig` +.. zephyr:board-supported-hw:: System Clock ============ @@ -88,6 +69,8 @@ Here is an example for building the :zephyr:code-sample:`blinky` sample applicat Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + The CYW920829M2EVK-02 includes an onboard programmer/debugger (`KitProg3`_) to provide debugging, flash programming, and serial communication over USB. Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version, that supports KitProg3, to be installed. The CYW920829M2EVK-02 supports RTT via a SEGGER JLink device, under the target name cyw20829_tm. This can be enabled for an application by building with the rtt-console snippet or setting the following config values: CONFIG_UART_CONSOLE=n, CONFIG_RTT_CONSOLE=y, and CONFIG_USE_SEGGER_RTT=y. diff --git a/boards/infineon/xmc45_relax_kit/doc/index.rst b/boards/infineon/xmc45_relax_kit/doc/index.rst index bfad619aedc35..5d89d5e2dbd1c 100644 --- a/boards/infineon/xmc45_relax_kit/doc/index.rst +++ b/boards/infineon/xmc45_relax_kit/doc/index.rst @@ -22,50 +22,9 @@ Details on the Relax Kit development board can be found in the `Relax Kit User M Supported Features ================== -* The on-board 12-MHz crystal allows the device to run at its maximum operating speed of 120MHz. - -The Relax Kit development board configuration supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port | -+-----------+------------+-----------------------+ -| SPI | on-chip | spi | -+-----------+------------+-----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+-----------------------+ -| ADC | on-chip | adc | -+-----------+------------+-----------------------+ -| DMA | on-chip | dma | -+-----------+------------+-----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-----------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-----------------------+ -| MDIO | on-chip | mdio | -+-----------+------------+-----------------------+ -| ETHERNET | on-chip | ethernet | -+-----------+------------+-----------------------+ -| PTP | on-chip | ethernet | -+-----------+------------+-----------------------+ -| RTC | on-chip | rtc | -+-----------+------------+-----------------------+ - -More details about the supported peripherals are available in `XMC4500 TRM`_ - -The default configuration can be found in the Kconfig - -:zephyr_file:`boards/infineon/xmc45_relax_kit/xmc45_relax_kit_defconfig` - -Other hardware features are not currently supported by the Zephyr kernel. +.. zephyr:board-supported-hw:: + +The on-board 12-MHz crystal allows the device to run at its maximum operating speed of 120MHz. Build hello world sample ************************ @@ -78,6 +37,9 @@ Here is an example for building the :zephyr:code-sample:`hello_world` sample app Programming and Debugging ************************* + +.. zephyr:board-supported-runners:: + West Commands ============= Here is an example for the :zephyr:code-sample:`hello_world` application. diff --git a/boards/infineon/xmc47_relax_kit/doc/index.rst b/boards/infineon/xmc47_relax_kit/doc/index.rst index d5796afd7ea85..09aa90843a03d 100644 --- a/boards/infineon/xmc47_relax_kit/doc/index.rst +++ b/boards/infineon/xmc47_relax_kit/doc/index.rst @@ -27,47 +27,9 @@ Details on the Relax Kit development board can be found in the `Relax Kit User M Supported Features ================== -The Relax Kit development board configuration supports the following hardware features: - -+-----------+------------+-----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=======================+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+-----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+-----------------------+ -| UART | on-chip | serial port | -+-----------+------------+-----------------------+ -| SPI | on-chip | spi | -+-----------+------------+-----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+-----------------------+ -| ADC | on-chip | adc | -+-----------+------------+-----------------------+ -| DMA | on-chip | dma | -+-----------+------------+-----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-----------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-----------------------+ -| MDIO | on-chip | mdio | -+-----------+------------+-----------------------+ -| ETHERNET | on-chip | ethernet | -+-----------+------------+-----------------------+ -| PTP | on-chip | ethernet | -+-----------+------------+-----------------------+ -| RTC | on-chip | rtc | -+-----------+------------+-----------------------+ +.. zephyr:board-supported-hw:: More details about the supported peripherals are available in `XMC4700 TRM`_ -Other hardware features are not currently supported by the Zephyr kernel. - -The default configuration can be found in the Kconfig - -:zephyr_file:`boards/infineon/xmc47_relax_kit/xmc47_relax_kit_defconfig` Build hello world sample ************************ @@ -80,6 +42,9 @@ Here is an example for building the :zephyr:code-sample:`hello_world` sample app Programming and Debugging ************************* + +.. zephyr:board-supported-runners:: + West Commands ============= Here is an example for the :zephyr:code-sample:`hello_world` application. diff --git a/boards/innblue/innblue21/board.cmake b/boards/innblue/innblue21/board.cmake index 12afc83afe364..641562c24c499 100644 --- a/boards/innblue/innblue21/board.cmake +++ b/boards/innblue/innblue21/board.cmake @@ -2,5 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/innblue/innblue21/doc/index.rst b/boards/innblue/innblue21/doc/index.rst index bafb7d9911a4a..6a923bc969a33 100644 --- a/boards/innblue/innblue21/doc/index.rst +++ b/boards/innblue/innblue21/doc/index.rst @@ -20,34 +20,7 @@ The following parts are built into the board: Supported Features ================== -The innblue21 board configuration supports the following -hardware (as of nRF9160) features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPU | on-chip | system protection | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -77,6 +50,8 @@ Security components Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + innblue21 supports the Armv8m Security Extension, and by default boots in the Secure state. diff --git a/boards/innblue/innblue22/board.cmake b/boards/innblue/innblue22/board.cmake index 12afc83afe364..641562c24c499 100644 --- a/boards/innblue/innblue22/board.cmake +++ b/boards/innblue/innblue22/board.cmake @@ -2,5 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/innblue/innblue22/doc/index.rst b/boards/innblue/innblue22/doc/index.rst index 9e84c4691dfa0..d87a7b222a81f 100644 --- a/boards/innblue/innblue22/doc/index.rst +++ b/boards/innblue/innblue22/doc/index.rst @@ -20,34 +20,7 @@ The following parts are built into the board: Supported Features ================== -The innblue22 board configuration supports the following -hardware (as of nRF9160) features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| SPU | on-chip | system protection | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -77,6 +50,8 @@ Security components Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + innblue22 supports the Armv8m Security Extension, and by default boots in the Secure state. diff --git a/boards/intel/adl/Kconfig.defconfig b/boards/intel/adl/Kconfig.defconfig index 3a6bcaf9ce02a..4e3f649a205dd 100644 --- a/boards/intel/adl/Kconfig.defconfig +++ b/boards/intel/adl/Kconfig.defconfig @@ -7,10 +7,10 @@ config BUILD_OUTPUT_STRIPPED config MP_MAX_NUM_CPUS default 2 -# TSC on this board is 1.9 GHz, HPET and APIC are 19.2 MHz +# TSC on this board is 1.5 GHz, HPET and APIC are 19.2 MHz config SYS_CLOCK_HW_CYCLES_PER_SEC - default 1900000000 if APIC_TSC_DEADLINE_TIMER - default 1900000000 if APIC_TIMER_TSC + default 1500000000 if APIC_TSC_DEADLINE_TIMER + default 1500000000 if APIC_TIMER_TSC default 19200000 if APIC_TIMER diff --git a/boards/intel/adsp/Kconfig.defconfig b/boards/intel/adsp/Kconfig.defconfig index eafedb0c550e6..8c804c48c7508 100644 --- a/boards/intel/adsp/Kconfig.defconfig +++ b/boards/intel/adsp/Kconfig.defconfig @@ -8,3 +8,18 @@ config DAI_SSP_HAS_POWER_CONTROL def_bool y endif + +if BOARD_INTEL_ADSP + +config MAIN_STACK_SIZE + default 2048 if BOARD_INTEL_ADSP_CAVS25 + default 2048 if BOARD_INTEL_ADSP_CAVS25_TGPH + default 2048 if BOARD_INTEL_ADSP_ACE15_MTPM + default 2048 if BOARD_INTEL_ADSP_ACE15_MTPM_SIM + default 2048 if BOARD_INTEL_ADSP_ACE20_LNL + default 2048 if BOARD_INTEL_ADSP_ACE20_LNL_SIM + default 4096 if BOARD_INTEL_ADSP_ACE30 + default 4096 if BOARD_INTEL_ADSP_ACE30_PTL + default 4096 if BOARD_INTEL_ADSP_ACE30_PTL_SIM + +endif # BOARD_INTEL_ADSP diff --git a/boards/intel/adsp/intel_adsp_ace15_mtpm_defconfig b/boards/intel/adsp/intel_adsp_ace15_mtpm_defconfig index 2237dfb963a20..9c0d2ca0cda6e 100644 --- a/boards/intel/adsp/intel_adsp_ace15_mtpm_defconfig +++ b/boards/intel/adsp/intel_adsp_ace15_mtpm_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/boards/intel/adsp/intel_adsp_ace15_mtpm_sim_defconfig b/boards/intel/adsp/intel_adsp_ace15_mtpm_sim_defconfig index 7a0513272345a..8c36c0e39dda9 100644 --- a/boards/intel/adsp/intel_adsp_ace15_mtpm_sim_defconfig +++ b/boards/intel/adsp/intel_adsp_ace15_mtpm_sim_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_INTEL_ADSP_SIM=y CONFIG_INTEL_ADSP_SIM_NO_SECONDARY_CORE_FLOW=y diff --git a/boards/intel/adsp/intel_adsp_ace20_lnl_defconfig b/boards/intel/adsp/intel_adsp_ace20_lnl_defconfig index 3d897eb967321..4f2503e2afcfb 100644 --- a/boards/intel/adsp/intel_adsp_ace20_lnl_defconfig +++ b/boards/intel/adsp/intel_adsp_ace20_lnl_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/boards/intel/adsp/intel_adsp_ace20_lnl_sim_defconfig b/boards/intel/adsp/intel_adsp_ace20_lnl_sim_defconfig index 5f03e403e3c70..6acb302da0b7c 100644 --- a/boards/intel/adsp/intel_adsp_ace20_lnl_sim_defconfig +++ b/boards/intel/adsp/intel_adsp_ace20_lnl_sim_defconfig @@ -1,6 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_INTEL_ADSP_SIM=y CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/boards/intel/adsp/intel_adsp_ace30_defconfig b/boards/intel/adsp/intel_adsp_ace30_defconfig index 913d2a8c3e3a9..85f377409f7e0 100644 --- a/boards/intel/adsp/intel_adsp_ace30_defconfig +++ b/boards/intel/adsp/intel_adsp_ace30_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=4096 - CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/boards/intel/adsp/intel_adsp_ace30_ptl_defconfig b/boards/intel/adsp/intel_adsp_ace30_ptl_defconfig index 913d2a8c3e3a9..85f377409f7e0 100644 --- a/boards/intel/adsp/intel_adsp_ace30_ptl_defconfig +++ b/boards/intel/adsp/intel_adsp_ace30_ptl_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=4096 - CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/boards/intel/adsp/intel_adsp_ace30_ptl_sim_defconfig b/boards/intel/adsp/intel_adsp_ace30_ptl_sim_defconfig index 429223286bf0c..5373f0c0bf841 100644 --- a/boards/intel/adsp/intel_adsp_ace30_ptl_sim_defconfig +++ b/boards/intel/adsp/intel_adsp_ace30_ptl_sim_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_INTEL_ADSP_SIM=y CONFIG_INTEL_ADSP_SIM_NO_SECONDARY_CORE_FLOW=y diff --git a/boards/intel/adsp/intel_adsp_cavs25_defconfig b/boards/intel/adsp/intel_adsp_cavs25_defconfig index 24443bce131fb..37aab5b06d447 100644 --- a/boards/intel/adsp/intel_adsp_cavs25_defconfig +++ b/boards/intel/adsp/intel_adsp_cavs25_defconfig @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/boards/intel/adsp/intel_adsp_cavs25_tgph_defconfig b/boards/intel/adsp/intel_adsp_cavs25_tgph_defconfig index 7e79840a033cc..d842740df75c1 100644 --- a/boards/intel/adsp/intel_adsp_cavs25_tgph_defconfig +++ b/boards/intel/adsp/intel_adsp_cavs25_tgph_defconfig @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/boards/intel/btl/CMakeLists.txt b/boards/intel/btl/CMakeLists.txt new file mode 100644 index 0000000000000..ee5e7343e8377 --- /dev/null +++ b/boards/intel/btl/CMakeLists.txt @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Create an EFI image +if(CONFIG_BUILD_OUTPUT_EFI) + set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/arch/x86/zefi/zefi.py + -c ${CMAKE_C_COMPILER} + -o ${CMAKE_OBJCOPY} + -i ${ZEPHYR_BASE}/include ${PROJECT_BINARY_DIR}/include/generated + -f ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.elf + $<$:--verbose> + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) +endif() diff --git a/boards/intel/btl/Kconfig.defconfig b/boards/intel/btl/Kconfig.defconfig new file mode 100644 index 0000000000000..177c7c1f0d2ba --- /dev/null +++ b/boards/intel/btl/Kconfig.defconfig @@ -0,0 +1,71 @@ +# Copyright (c) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + + +config BUILD_OUTPUT_STRIPPED + default y + +config MP_MAX_NUM_CPUS + default 2 + +# TSC on this board is 2.9 GHz, HPET is 19.2 MHz +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 2900000000 if APIC_TSC_DEADLINE_TIMER + default 2900000000 if APIC_TIMER_TSC + default 19200000 + +if APIC_TIMER + +config APIC_TIMER_IRQ + default 24 + +endif + +if APIC_TIMER_TSC + +config APIC_TIMER_TSC_M + default 3 + +config APIC_TIMER_TSC_N + default 249 + +endif + +config ACPI + default y + +if ACPI + +config HEAP_MEM_POOL_ADD_SIZE_ACPI + default 64000000 + +config MAIN_STACK_SIZE + default 320000 + +if SHELL + +config SHELL_STACK_SIZE + default 320000 + +endif # SHELL + +endif # ACPI + +if DMA + +config DMA_64BIT + default y + +config DMA_DW_HW_LLI + default n + +config DMA_DW_CHANNEL_COUNT + default 2 + +endif + +config UART_NS16550_INTEL_LPSS_DMA + default y if BOARD_INTEL_BTL_S_CRB + +config HAS_COVERAGE_SUPPORT + default y diff --git a/boards/intel/btl/Kconfig.intel_btl_s_crb b/boards/intel/btl/Kconfig.intel_btl_s_crb new file mode 100644 index 0000000000000..19f802f0c31cc --- /dev/null +++ b/boards/intel/btl/Kconfig.intel_btl_s_crb @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_INTEL_BTL_S_CRB + select SOC_RAPTOR_LAKE diff --git a/boards/intel/btl/board.cmake b/boards/intel/btl/board.cmake new file mode 100644 index 0000000000000..6b01bab2aeea8 --- /dev/null +++ b/boards/intel/btl/board.cmake @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_set_flasher_ifnset(misc-flasher) +board_finalize_runner_args(misc-flasher) diff --git a/boards/intel/btl/board.yml b/boards/intel/btl/board.yml new file mode 100644 index 0000000000000..f3b6dd2e2f81a --- /dev/null +++ b/boards/intel/btl/board.yml @@ -0,0 +1,6 @@ +boards: + - name: intel_btl_s_crb + full_name: Bartlett Lake P CRB + vendor: intel + socs: + - name: raptor_lake diff --git a/boards/intel/btl/doc/index.rst b/boards/intel/btl/doc/index.rst new file mode 100644 index 0000000000000..239a679eb893a --- /dev/null +++ b/boards/intel/btl/doc/index.rst @@ -0,0 +1,57 @@ +.. zephyr:board:: intel_btl_s_crb + +Overview +******** +Bartlett Lake processor is a 64-bit multi-core processor built on Intel 7 process +Technology. Bartlett Lake is based on a Hybrid architecture, utilizing +P-cores for performance and E-Cores for efficiency. + +The S-Processor line is a 2-Chip Platform that includes the Processor Die and +Platform Controller Hub (PCH-S) Die in the Package. + +For more information about Raptor Lake Processor lines, P-cores, and E-cores +please refer to `BTL`_. + +This board configuration enables kernel support for the Bartlett Lake S boards. + +Hardware +******** + +.. zephyr:board-supported-hw:: + +General information about the board can be found at the `BTL`_ website. + +Connections and IOs +=================== + +Refer to the `BTL`_ website for more information. + +Programming and Debugging +************************* +Use the following procedures for booting an image for an Bartlett Lake S CRB board. + +.. contents:: + :depth: 1 + :local: + :backlinks: top + +Build Zephyr application +======================== + +#. Build a Zephyr application; for instance, to build the ``hello_world`` + application for Bartlett Lake S CRB: + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: intel_btl_s_crb + :goals: build + + .. note:: + + A Zephyr EFI image file named :file:`zephyr.efi` is automatically + created in the build directory after the application is built. + +.. include:: ../../../intel/common/efi_boot.rst + :start-after: start_include_here + +.. _BTL: https://www.intel.com/content/www/us/en/secure/content-details/839635/bartlett-lake-s-processor-external-design-specification-eds-for-edge-platforms.html?DocID=839635 diff --git a/boards/intel/btl/intel_btl_s_crb.dts b/boards/intel/btl/intel_btl_s_crb.dts new file mode 100644 index 0000000000000..3ae2d4592c8df --- /dev/null +++ b/boards/intel/btl/intel_btl_s_crb.dts @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2025 Intel Corporation + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include + +#define DT_DRAM_SIZE DT_SIZE_M(2048) + +#include + +/ { + model = "intel_btl_s_crb"; + compatible = "intel,bartlett-lake-crb"; + + chosen { + zephyr,sram = &dram0; + zephyr,console = &uart_ec_0; + zephyr,shell-uart = &uart_ec_0; + }; + + aliases { + watchdog0 = &tco_wdt; + rtc = &rtc; + }; +}; + +&uart_ec_0 { + status = "okay"; +}; + +&rtc { + status = "okay"; +}; diff --git a/boards/intel/btl/intel_btl_s_crb.yaml b/boards/intel/btl/intel_btl_s_crb.yaml new file mode 100644 index 0000000000000..a569213d394ae --- /dev/null +++ b/boards/intel/btl/intel_btl_s_crb.yaml @@ -0,0 +1,15 @@ +identifier: intel_btl_s_crb +name: Bartlett Lake S CRB +type: mcu +arch: x86 +toolchain: + - zephyr +ram: 2048 +supported: + - acpi + - smp +testing: + ignore_tags: + - net + - bluetooth +vendor: intel diff --git a/boards/intel/btl/intel_btl_s_crb_defconfig b/boards/intel/btl/intel_btl_s_crb_defconfig new file mode 100644 index 0000000000000..853850deb12c5 --- /dev/null +++ b/boards/intel/btl/intel_btl_s_crb_defconfig @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_PIC_DISABLE=y +CONFIG_LOAPIC=y +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_NS16550=y +CONFIG_UART_NS16550_VARIANT_NS16750=y +CONFIG_UART_CONSOLE=y +CONFIG_X2APIC=y +CONFIG_SMP=y +CONFIG_BUILD_OUTPUT_EFI=y diff --git a/boards/intel/rpl/Kconfig.defconfig b/boards/intel/rpl/Kconfig.defconfig index 4eb5d8c3126c7..6478c25f658e5 100644 --- a/boards/intel/rpl/Kconfig.defconfig +++ b/boards/intel/rpl/Kconfig.defconfig @@ -8,12 +8,26 @@ config BUILD_OUTPUT_STRIPPED config MP_MAX_NUM_CPUS default 2 -# TSC on this board is 1.9 GHz, HPET and APIC are 19.2 MHz +if BOARD_INTEL_RPL_S_CRB + +# TSC on this board is 2.4 GHz for RPL-S, HPET and APIC are 19.2 MHz config SYS_CLOCK_HW_CYCLES_PER_SEC - default 1900000000 if APIC_TSC_DEADLINE_TIMER - default 1900000000 if APIC_TIMER_TSC + default 2400000000 if APIC_TSC_DEADLINE_TIMER + default 2400000000 if APIC_TIMER_TSC default 19200000 +endif #BOARD_INTEL_RPL_S_CRB + +if BOARD_INTEL_RPL_P_CRB + +# TSC on this board is 1.8 GHz for RPL-P, HPET and APIC are 19.2 MHz +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 1800000000 if APIC_TSC_DEADLINE_TIMER + default 1800000000 if APIC_TIMER_TSC + default 19200000 + +endif #BOARD_INTEL_RPL_P_CRB + if APIC_TIMER config APIC_TIMER_IRQ default 24 diff --git a/boards/ite/it515xx_evb/Kconfig.defconfig b/boards/ite/it515xx_evb/Kconfig.defconfig new file mode 100644 index 0000000000000..e5033cdd7c321 --- /dev/null +++ b/boards/ite/it515xx_evb/Kconfig.defconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2025 ITE Corporation. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_IT515XX_EVB + +if PM + +config PM_DEVICE + default y + +choice PM_POLICY + default PM_POLICY_CUSTOM +endchoice + +endif # PM + +endif # BOARD_IT515XX_EVB diff --git a/boards/ite/it515xx_evb/Kconfig.it515xx_evb b/boards/ite/it515xx_evb/Kconfig.it515xx_evb new file mode 100644 index 0000000000000..123837216ab8b --- /dev/null +++ b/boards/ite/it515xx_evb/Kconfig.it515xx_evb @@ -0,0 +1,5 @@ +# Copyright (c) 2025 ITE Corporation. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_IT515XX_EVB + select SOC_IT51526AW diff --git a/boards/ite/it515xx_evb/board.yml b/boards/ite/it515xx_evb/board.yml new file mode 100644 index 0000000000000..d4c7074979fa7 --- /dev/null +++ b/boards/ite/it515xx_evb/board.yml @@ -0,0 +1,6 @@ +board: + name: it515xx_evb + full_name: IT51XXX series + vendor: ite + socs: + - name: it51526aw diff --git a/boards/ite/it515xx_evb/doc/index.rst b/boards/ite/it515xx_evb/doc/index.rst new file mode 100644 index 0000000000000..cdd3ad54735bf --- /dev/null +++ b/boards/ite/it515xx_evb/doc/index.rst @@ -0,0 +1,163 @@ +.. zephyr:board:: it515xx_evb + +Overview +******** + +The IT51XXX is a 32-bit RISC-V microcontroller. +And a highly integrated embedded controller with system functions. +It is suitable for mobile system applications. The picture below is +the IT51526 development board (also known as it515xx_evb) and its debug card. + +.. figure:: it515xx_evb_and_debug_card.webp + :align: center + :alt: IT51526 EVB + +To find out more about ITE, visit our World Wide Web at:`ITE's website`_ + +Hardware +******** +The IT51XXX series contains different chip types(ex, it51526, it51527), +and they support different hardware features. +Listing the IT51526 hardware features as following: + +- RISC-V RV32IMC instruction set +- 4KB instruction cache size +- 128KB SRAM in total +- Built-in 32.768 kHz clock generator +- Embedded Flash, 512K/1024K-byte e-flash +- eSPI, SPI, BRAM, KBC, PECI, UART +- GPIO, PWM, ADC, INTC, WUC, Timer, Watchdog, KB scan, JTAG +- Support 3 Voltage Comparator +- Support Cryptographic Engine +- 9 SMBus hosts, 3 targets, with 12 SMBus channels, compatible with I2C +- I3C host: Support two I3C controllers, compliant with the MIPI I3C v1.0 SEPC. +- Two-wire serial interface up to 12.5MHz using Push-Pull. +- Support SDR, IBI, Hot-Join. +- I3C target: Support SDR, FIFO co-use DLM. Support Push-Pull output. + + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and debugging on it51526 +************************************ + +In order to upload the application to the device, +you'll need our flash tool and Download board. +You can get them at: `ITE's website`_. + +Wiring +======= +#. Connect the Download Board to your host computer using the USB cable. + +#. Connect the it515xx_evb to the evolution motherboard. + +#. Connect the Download Board J5 to J38(GPC1 & GPC2) on the evolution motherboard. + +#. Connect the USB to UART wire to UART0 connector on the evolution motherboard. + + .. image:: it515xx_evb_wiring.webp + :align: center + :alt: it515xx_evb wiring + + .. note:: Be careful during connection! + Use separate wires to connect I2C pins with pins on the it515xx_evb board. + Wiring connection is described in the table below. + + +-------------+---------------+ + | J5 | it515xx_evb | + | Connector | J38 Connector | + +=============+===============+ + | 2 | C1 | + +-------------+---------------+ + | 3 | C2 | + +-------------+---------------+ + | 4 | GND | + +-------------+---------------+ + + For USB to UART cable, connect the evolution motherboard as below: + + +-------------+---------------+ + | USB to UART | Evolution | + | cable | motherboard | + | | UART0 | + | | Connector | + +=============+===============+ + | USB | UART0 | + +-------------+---------------+ + +Building +======== + +#. Build :zephyr:code-sample:`hello_world` application as you would normally do + (see :`Zephyr Getting Started Guide`_):. + + .. zephyr-app-commands:: + :board: it515xx_evb + :zephyr-app: samples/hello_world + :goals: build + +#. The file :file:`zephyr.bin` will be created by west. + +Flashing +======== + +Windows +-------- + +Use the winflash tool to program a zephyr application +to the it515xx board flash. + +#. Flashing steps as described in the link: `Flashing steps`_. + +#. Turn on the it515xx_evb board switch, you should see ``"Hello World! it515xx_evb"`` + sent by the board. If you don't see this message, press the Reset button and the + message should appear. + +Ubuntu +-------- + +#. Run your favorite terminal program to listen for output. + Under Linux the terminal should be :code:`/dev/ttyUSB0`. Do not close it. + + For example: + + .. code-block:: console + + $ minicom -D /dev/ttyUSB0 -b 115200 + +#. Open a second terminal window and use the Linux flash tool to flash your board. + + .. code-block:: console + + $ sudo ~/itetool/ite -f build/zephyr/zephyr.bin + + .. note:: The source code of ITE tool can be downloaded here: + https://www.ite.com.tw/upload/2024_01_23/6_20240123162336wu55j1Rjm4.bz2 + +#. Split first and second terminal windows to view both of them. + You should see ``"Hello World! it515xx_evb"`` in the first terminal window. + If you don't see this message, press the Reset button and the message should appear. + +Debugging +========= + +it515xx_evb board can be debugged by connecting USB to UART. We can write commands and +read messages through minicom in the Ubuntu terminal. + +Troubleshooting +=============== + +#. If the flash tool reports a failure, re-plug the 8390 Download board or + power cycle the it515xx_evb board and try again. + +References +========== + +.. target-notes:: + +.. _ITE's website: https://www.ite.com.tw/en +.. _Zephyr Getting Started Guide: https://docs.zephyrproject.org/latest/getting_started/index.html +.. _Flashing steps: https://docs.zephyrproject.org/latest/boards/ite/it82xx2_evb/doc/index.html#flashing diff --git a/boards/ite/it515xx_evb/doc/it515xx_evb_and_debug_card.webp b/boards/ite/it515xx_evb/doc/it515xx_evb_and_debug_card.webp new file mode 100644 index 0000000000000..d6d81db1aea6d Binary files /dev/null and b/boards/ite/it515xx_evb/doc/it515xx_evb_and_debug_card.webp differ diff --git a/boards/ite/it515xx_evb/doc/it515xx_evb_wiring.webp b/boards/ite/it515xx_evb/doc/it515xx_evb_wiring.webp new file mode 100644 index 0000000000000..c942044b55626 Binary files /dev/null and b/boards/ite/it515xx_evb/doc/it515xx_evb_wiring.webp differ diff --git a/boards/ite/it515xx_evb/it515xx_evb.dts b/boards/ite/it515xx_evb/it515xx_evb.dts new file mode 100644 index 0000000000000..df5e0b3e83c60 --- /dev/null +++ b/boards/ite/it515xx_evb/it515xx_evb.dts @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2025 ITE Corporation. All Rights Reserved. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include + +/ { + model = "IT515XX EV-Board"; + compatible = "ite,it515xx-evb"; + + aliases { + led0 = &led0; + watchdog0 = &twd0; + }; + + chosen { + zephyr,console = &uart1; + zephyr,shell-uart = &uart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,flash-controller = &flashctrl; + zephyr,code-partition = &slot0_partition; + }; + + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = <&gpioc 0 GPIO_ACTIVE_HIGH>; + label = "Green LED"; + }; + }; +}; + +&uart1 { + status = "okay"; + current-speed = <115200>; + clock-frequency = <1843200>; + pinctrl-0 = <&uart1_rx_gpc7_default + &uart1_tx_gpe6_default>; + pinctrl-names = "default"; +}; + +&ite_uart1_wrapper { + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x00000000 DT_SIZE_K(128)>; + }; + + slot1_partition: partition@20000 { + label = "image-1"; + reg = <0x00020000 DT_SIZE_K(128)>; + }; + + storage_partition: partition@40000 { + label = "storage"; + reg = <0x00040000 DT_SIZE_K(256)>; + }; + }; +}; + +&kbd { + status = "okay"; + pinctrl-0 = <&ksi0_default + &ksi1_default + &ksi2_default + &ksi3_default + &ksi4_default + &ksi5_default + &ksi6_default + &ksi7_default + &kso0_default + &kso1_default + &kso2_default + &kso3_default + &kso4_default + &kso5_default + &kso6_default + &kso7_default + &kso8_default + &kso9_default + &kso10_default + &kso11_default + &kso12_default + &kso13_default + &kso14_default + &kso15_default>; + pinctrl-names = "default"; + row-size = <8>; + col-size = <16>; +}; diff --git a/boards/ite/it515xx_evb/it515xx_evb.yaml b/boards/ite/it515xx_evb/it515xx_evb.yaml new file mode 100644 index 0000000000000..cddae71d22d71 --- /dev/null +++ b/boards/ite/it515xx_evb/it515xx_evb.yaml @@ -0,0 +1,14 @@ +identifier: it515xx_evb +name: ITE IT51XXX EVB +type: mcu +arch: riscv +toolchain: + - zephyr +ram: 128 +supported: + - flash + - gpio + - pinctrl + - pm + - uart +vendor: ite diff --git a/boards/ite/it515xx_evb/it515xx_evb_defconfig b/boards/ite/it515xx_evb/it515xx_evb_defconfig new file mode 100644 index 0000000000000..b14dac07519d2 --- /dev/null +++ b/boards/ite/it515xx_evb/it515xx_evb_defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2025 ITE Corporation. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +# General Kernel Options +CONFIG_XIP=y + +# UART Driver +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# Console Driver +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# GPIO Driver +CONFIG_GPIO=y + +# Clock Driver +CONFIG_CLOCK_CONTROL=y diff --git a/boards/ite/it82xx2_evb/Kconfig.defconfig b/boards/ite/it82xx2_evb/Kconfig.defconfig deleted file mode 100644 index a106a9d61514c..0000000000000 --- a/boards/ite/it82xx2_evb/Kconfig.defconfig +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2023 ITE Corporation. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_IT82XX2_EVB - -config INPUT - default y if KSCAN - -endif diff --git a/boards/ite/it82xx2_evb/doc/index.rst b/boards/ite/it82xx2_evb/doc/index.rst index d31b989f225c0..938264879b8e6 100644 --- a/boards/ite/it82xx2_evb/doc/index.rst +++ b/boards/ite/it82xx2_evb/doc/index.rst @@ -1,7 +1,4 @@ -.. _it82xx2_evb: - -ITE IT82XX2 series -###################### +.. zephyr:board:: it82xx2_evb Overview ******** @@ -40,63 +37,8 @@ Listing the IT82202 hardware features as following: Supported Features ================== -currently supports the following hardware features: - -.. list-table:: Supported Features - :header-rows: 1 - :widths: auto - - * - Interface - - Controller - - Driver/Component - * - NVIC - - on-chip - - interrupt controller - * - FLASH - - on-chip - - flash controller - * - PINCTRL - - on-chip - - pin controller - * - ESPI - - on-chip - - espi - * - PECI - - on-chip - - peci - * - UART - - on-chip - - serial - * - GPIO - - on-chip - - gpio - * - PWM - - on-chip - - pwm - * - ADC - - on-chip - - adc - * - TIMER - - on-chip - - timer - * - WATCHDOG - - on-chip - - watchdog - * - KSCAN - - on-chip - - kscan - * - SENSOR - - on-chip - - voltage comparator - * - I2C - - on-chip - - i2c - - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the -:zephyr_file:`boards/ite/it82xx2_evb/it82xx2_evb_defconfig` Kconfig file. + +.. zephyr:board-supported-hw:: Programming and debugging on it82202 ************************************ diff --git a/boards/ite/it82xx2_evb/it82xx2_evb.dts b/boards/ite/it82xx2_evb/it82xx2_evb.dts index 29e8ad721c88d..3aa16d53df1cc 100644 --- a/boards/ite/it82xx2_evb/it82xx2_evb.dts +++ b/boards/ite/it82xx2_evb/it82xx2_evb.dts @@ -17,7 +17,6 @@ i2c-0 = &i2c0; peci-0 = &peci0; led0 = &led0; - kscan0 = &kscan_input; watchdog0 = &twd0; pwm-0 = &pwm0; }; @@ -30,7 +29,6 @@ zephyr,flash = &flash0; zephyr,flash-controller = &flashctrl; zephyr,code-partition = &slot0_partition; - zephyr,keyboard-scan = &kscan_input; }; leds { @@ -196,10 +194,6 @@ pinctrl-names = "default"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { diff --git a/boards/ite/it82xx2_evb/it82xx2_evb.yaml b/boards/ite/it82xx2_evb/it82xx2_evb.yaml index 505c2d7d9101e..e4e0b9742647a 100644 --- a/boards/ite/it82xx2_evb/it82xx2_evb.yaml +++ b/boards/ite/it82xx2_evb/it82xx2_evb.yaml @@ -15,7 +15,6 @@ supported: - gpio - usb_device - i2c - - kscan - pm - pwm - tach diff --git a/boards/ite/it82xx2_evb/it82xx2_evb_defconfig b/boards/ite/it82xx2_evb/it82xx2_evb_defconfig index 2b174670d4836..2a244e464eba1 100644 --- a/boards/ite/it82xx2_evb/it82xx2_evb_defconfig +++ b/boards/ite/it82xx2_evb/it82xx2_evb_defconfig @@ -18,8 +18,3 @@ CONFIG_UART_CONSOLE=y # GPIO Driver CONFIG_GPIO=y - -# Power Management -CONFIG_PM=y -CONFIG_PM_DEVICE=y -CONFIG_PM_POLICY_CUSTOM=y diff --git a/boards/ite/it8xxx2_evb/Kconfig.defconfig b/boards/ite/it8xxx2_evb/Kconfig.defconfig index 57fc0404475f4..0c81c35776244 100644 --- a/boards/ite/it8xxx2_evb/Kconfig.defconfig +++ b/boards/ite/it8xxx2_evb/Kconfig.defconfig @@ -14,7 +14,4 @@ endchoice endif # PM -config INPUT - default y if KSCAN - endif # BOARD_IT8XXX2_EVB diff --git a/boards/ite/it8xxx2_evb/doc/index.rst b/boards/ite/it8xxx2_evb/doc/index.rst index 0e215fddf7efa..751294a77b683 100644 --- a/boards/ite/it8xxx2_evb/doc/index.rst +++ b/boards/ite/it8xxx2_evb/doc/index.rst @@ -1,7 +1,4 @@ -.. _it8xxx2_evb: - -ITE IT8XXX2 series -###################### +.. zephyr:board:: it8xxx2_evb Overview ******** @@ -37,42 +34,8 @@ Listing the IT81302 hardware features as following: Supported Features ================== -currently supports the following hardware features: - -.. list-table:: Supported Features - :header-rows: 1 - :widths: auto - - * - Interface - - Controller - - Driver/Component - * - NVIC - - on-chip - - interrupt controller - * - TIMER - - on-chip - - timer - * - UART - - on-chip - - serial - * - GPIO - - on-chip - - gpio - * - ADC - - on-chip - - adc - * - I2C - - on-chip - - i2c - * - KSCAN - - on-chip - - kscan - - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the -:zephyr_file:`boards/ite/it8xxx2_evb/it8xxx2_evb_defconfig` Kconfig file. + +.. zephyr:board-supported-hw:: Hardware reworks **************** diff --git a/boards/ite/it8xxx2_evb/it8xxx2_evb.dts b/boards/ite/it8xxx2_evb/it8xxx2_evb.dts index 0ee42f981f084..59b4af711c9fa 100644 --- a/boards/ite/it8xxx2_evb/it8xxx2_evb.dts +++ b/boards/ite/it8xxx2_evb/it8xxx2_evb.dts @@ -17,7 +17,6 @@ i2c-0 = &i2c0; peci-0 = &peci0; led0 = &led0; - kscan0 = &kscan_input; watchdog0 = &twd0; pwm-0 = &pwm0; }; @@ -30,7 +29,6 @@ zephyr,flash = &flash0; zephyr,flash-controller = &flashctrl; zephyr,code-partition = &slot0_partition; - zephyr,keyboard-scan = &kscan_input; }; leds { @@ -180,10 +178,6 @@ pinctrl-names = "default"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { status = "okay"; diff --git a/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml b/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml index 0a57a0937f7cf..31ef24d2811a1 100644 --- a/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml +++ b/boards/ite/it8xxx2_evb/it8xxx2_evb.yaml @@ -13,7 +13,6 @@ supported: - gpio - adc - i2c - - kscan - pwm - watchdog vendor: ite diff --git a/boards/khadas/edge2/doc/index.rst b/boards/khadas/edge2/doc/index.rst index 337ff3aa24e50..f0ac6de53f8e8 100644 --- a/boards/khadas/edge2/doc/index.rst +++ b/boards/khadas/edge2/doc/index.rst @@ -17,23 +17,7 @@ See `Hardware details`_ Supported Features ================== -The ``khadas_edge2`` board target supports the following -hardware features: - -+-----------+------------+--------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================================+ -| GIC-600 | on-chip | GICv3 interrupt controller | -+-----------+------------+--------------------------------------+ -| ARM TIMER | on-chip | System Clock | -+-----------+------------+--------------------------------------+ -| UART | on-chip | Synopsys DesignWare 8250 serial port | -+-----------+------------+--------------------------------------+ - -Other hardware features have not been enabled yet for this board. - -The default configuration can be found in (NON-SMP) -:zephyr_file:`boards/khadas/edge2/khadas_edge2_defconfig` +.. zephyr:board-supported-hw:: There are multiple serial ports on the board: Zephyr is using uart2 as serial console. @@ -41,6 +25,8 @@ uart2 as serial console. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Use the following configuration to run basic Zephyr applications and kernel tests on Khadas Edge2 board. For example, with the :zephyr:code-sample:`hello_world`: diff --git a/boards/khadas/edgev/doc/index.rst b/boards/khadas/edgev/doc/index.rst index 82294c07e994c..b645563e5b2a4 100644 --- a/boards/khadas/edgev/doc/index.rst +++ b/boards/khadas/edgev/doc/index.rst @@ -13,23 +13,7 @@ See Supported Features ================== -Khadas Edge-V board default configuration supports the following -hardware features: - -+-----------+------------+--------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================================+ -| GIC-500 | on-chip | GICv3 interrupt controller | -+-----------+------------+--------------------------------------+ -| ARM TIMER | on-chip | System Clock | -+-----------+------------+--------------------------------------+ -| UART | on-chip | Synopsys DesignWare 8250 serial port | -+-----------+------------+--------------------------------------+ - -Other hardware features have not been enabled yet for this board. - -The default configuration can be found in (NON-SMP) -:zephyr_file:`boards/khadas/edgev/khadas_edgev_defconfig` +.. zephyr:board-supported-hw:: There are multiple serial ports on the board: Zephyr is using uart2 as serial console. @@ -37,6 +21,8 @@ uart2 as serial console. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Use the following configuration to run basic Zephyr applications and kernel tests on Khadas Edge-V board. For example, with the :zephyr:code-sample:`hello_world`: diff --git a/boards/kincony/kincony_kc868_a32/doc/index.rst b/boards/kincony/kincony_kc868_a32/doc/index.rst index d88eec584c670..6a001bbfdd8e4 100644 --- a/boards/kincony/kincony_kc868_a32/doc/index.rst +++ b/boards/kincony/kincony_kc868_a32/doc/index.rst @@ -40,6 +40,8 @@ below to retrieve those files. Building & Flashing ------------------- +.. zephyr:board-supported-runners:: + Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/kws/common/pico_spe-pinctrl-common.dtsi b/boards/kws/common/pico_spe-pinctrl-common.dtsi new file mode 100644 index 0000000000000..bfdcff973f9fb --- /dev/null +++ b/boards/kws/common/pico_spe-pinctrl-common.dtsi @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2025 KWS Computersysteme Gmbh + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , ; + input-enable; + input-schmitt-enable; + }; + }; + + i2c1_default: i2c1_default { + group1 { + pinmux = , ; + input-enable; + input-schmitt-enable; + }; + }; + + spi0_default: spi0_default { + group1 { + pinmux = , , ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + spi1_default: spi1_default { + group1 { + pinmux = , , ; + }; + + group2 { + pinmux = ; + input-enable; + }; + }; + + pwm_ch4b_default: pwm_ch4b_default { + group1 { + pinmux = ; + }; + }; + + adc_default: adc_default { + group1 { + pinmux = , , , ; + input-enable; + }; + }; +}; diff --git a/boards/kws/index.rst b/boards/kws/index.rst new file mode 100644 index 0000000000000..0f8fc102b9457 --- /dev/null +++ b/boards/kws/index.rst @@ -0,0 +1,10 @@ +.. _boards-kws: + +KWS Computersysteme Gmbh +######################## + +.. toctree:: + :maxdepth: 1 + :glob: + + **/* diff --git a/boards/kws/pico2_spe/Kconfig.defconfig b/boards/kws/pico2_spe/Kconfig.defconfig new file mode 100644 index 0000000000000..3daadffce7882 --- /dev/null +++ b/boards/kws/pico2_spe/Kconfig.defconfig @@ -0,0 +1,34 @@ +# Copyright (c) 2025 KWS Computersysteme Gmbh +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_PICO2_SPE + +if I2C_DW + +config I2C_DW_CLOCK_SPEED + default 125 + +endif # I2C_DW + +config USB_SELF_POWERED + default n + +config PHY_INIT_PRIORITY + default 82 + depends on NET_L2_ETHERNET && ETH_DRIVER + +if NETWORKING + +config NET_L2_ETHERNET + default y + +if ETH_LAN865X + +config NET_IF_MAX_IPV4_COUNT + default 2 + +endif # ETH_LAN865X + +endif # NETWORKING + +endif # BOARD_PICO2_SPE diff --git a/boards/kws/pico2_spe/Kconfig.pico2_spe b/boards/kws/pico2_spe/Kconfig.pico2_spe new file mode 100644 index 0000000000000..9487cc1d81011 --- /dev/null +++ b/boards/kws/pico2_spe/Kconfig.pico2_spe @@ -0,0 +1,5 @@ +# Copyright (c) 2025 KWS Computersysteme Gmbh +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_PICO2_SPE + select SOC_RP2350A_M33 if BOARD_PICO2_SPE_RP2350A_M33 diff --git a/boards/kws/pico2_spe/board.cmake b/boards/kws/pico2_spe/board.cmake new file mode 100644 index 0000000000000..feae063129ac7 --- /dev/null +++ b/boards/kws/pico2_spe/board.cmake @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: Apache-2.0 + +if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "") + set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap") +endif() + +board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]") +board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]") + +# The adapter speed is expected to be set by interface configuration. +# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at +# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd +board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000") + +board_runner_args(uf2 "--board-id=RP2350") + +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake) diff --git a/boards/kws/pico2_spe/board.yml b/boards/kws/pico2_spe/board.yml new file mode 100644 index 0000000000000..e292243d1b01c --- /dev/null +++ b/boards/kws/pico2_spe/board.yml @@ -0,0 +1,6 @@ +board: + name: pico2_spe + full_name: Pico2-SPE + vendor: kws + socs: + - name: rp2350a diff --git a/boards/kws/pico2_spe/doc/img/pico2_spe.webp b/boards/kws/pico2_spe/doc/img/pico2_spe.webp new file mode 100644 index 0000000000000..1cf931ddf991b Binary files /dev/null and b/boards/kws/pico2_spe/doc/img/pico2_spe.webp differ diff --git a/boards/kws/pico2_spe/doc/index.rst b/boards/kws/pico2_spe/doc/index.rst new file mode 100644 index 0000000000000..48bccacea8679 --- /dev/null +++ b/boards/kws/pico2_spe/doc/index.rst @@ -0,0 +1,59 @@ +.. zephyr:board:: pico2_spe + +Overview +******** + +The Pico2-SPE is a small, low-cost, versatile boards from +KWS Computersysteme Gmbh. They are equipped with an RP2350a SoC, an on-board LED, +a USB connector, an SWD interface. The Pico2-SPE additionally contains an +Microchip LAN8651 10Base-T1S module. The USB bootloader allows the +ability to flash without any adapter, in a drag-and-drop manner. +It is also possible to flash and debug the boards with their SWD interface, +using an external adapter. + +Hardware +******** + +- Dual Cortex-M33 or Hazard3 processors at up to 150MHz +- 520KB of SRAM, and 4MB of on-board flash memory +- USB 1.1 with device and host support +- Low-power sleep and dormant modes +- Drag-and-drop programming using mass storage over USB +- 26 multi-function GPIO pins including 3 that can be used for ADC +- 1 SPI, 2 I2C, 2 UART, 3 12-bit 500ksps Analogue to Digital - Converter (ADC), 24 controllable PWM channels +- 2 Timer with 4 alarms, 1 AON Timer +- Temperature sensor +- Microchip LAN8651 10Base-T1S +- 3 Programmable IO (PIO) blocks, 12 state machines total for custom peripheral support + + - Flexible, user-programmable high-speed IO + - Can emulate interfaces such as SD Card and VGA + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Connections and IOs +=================== + +The default pin mapping is unchanged from the Pico-SPE. + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +As with the Pico-SPE, the SWD interface can be used to program and debug the +device, e.g. using OpenOCD with the `Raspberry Pi Debug Probe `_ . + +References +********** + +.. _Getting Started with Pico-SPE-Series: + https://kws-computer.de/go/pico-spe-getting-started + +.. _Pico2-SPE Documentation: + https://kws-computer.de/go/pico2-spe-datasheet + +.. target-notes:: diff --git a/boards/kws/pico2_spe/pico2_spe-pinctrl.dtsi b/boards/kws/pico2_spe/pico2_spe-pinctrl.dtsi new file mode 100644 index 0000000000000..889f287c642a7 --- /dev/null +++ b/boards/kws/pico2_spe/pico2_spe-pinctrl.dtsi @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2025 KWS Computersysteme Gmbh + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include "../common/pico_spe-pinctrl-common.dtsi" diff --git a/boards/kws/pico2_spe/pico2_spe.dtsi b/boards/kws/pico2_spe/pico2_spe.dtsi new file mode 100644 index 0000000000000..87211d91effb4 --- /dev/null +++ b/boards/kws/pico2_spe/pico2_spe.dtsi @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2025 KWS Computersysteme Gmbh + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#include "pico2_spe-pinctrl.dtsi" + +/ { + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,code-partition = &code_partition; + }; + + aliases { + watchdog0 = &wdt0; + }; + + pico_header: connector { + compatible = "raspberrypi,pico-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio0 0 0>, /* GP0 */ + <1 0 &gpio0 1 0>, /* GP1 */ + <2 0 &gpio0 2 0>, /* GP2 */ + <3 0 &gpio0 3 0>, /* GP3 */ + <4 0 &gpio0 4 0>, /* GP4 */ + <5 0 &gpio0 5 0>, /* GP5 */ + <6 0 &gpio0 6 0>, /* GP6 */ + <7 0 &gpio0 7 0>, /* GP7 */ + <8 0 &gpio0 8 0>, /* GP8 */ + <9 0 &gpio0 9 0>, /* GP9 */ + <10 0 &gpio0 10 0>, /* GP10 */ + <11 0 &gpio0 11 0>, /* GP11 */ + <12 0 &gpio0 12 0>, /* GP12 */ + <13 0 &gpio0 13 0>, /* GP13 */ + <14 0 &gpio0 14 0>, /* GP14 */ + <15 0 &gpio0 15 0>, /* GP15 */ + <16 0 &gpio0 16 0>, /* GP16 */ + <17 0 &gpio0 17 0>, /* GP17 */ + <18 0 &gpio0 18 0>, /* GP18 */ + <19 0 &gpio0 19 0>, /* GP19 */ + <20 0 &gpio0 20 0>, /* GP20 */ + <21 0 &gpio0 21 0>, /* GP21 */ + <22 0 &gpio0 22 0>, /* GP22 */ + <26 0 &gpio0 26 0>, /* GP26 */ + <27 0 &gpio0 27 0>, /* GP27 */ + <28 0 &gpio0 28 0>; /* GP28 */ + }; +}; + +&flash0 { + reg = <0x10000000 DT_SIZE_M(4)>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Reserved memory for an image definition block. The block is much + * smaller than 256 bytes, but in practice the linker places the vector + * table at a much larger alignment offset. + */ + image_def: partition@0 { + label = "image_def"; + reg = <0x00000000 0x100>; + read-only; + }; + + /* + * Usable flash. Starts at 0x100, after the image definition block. + * The partition size is 4MB minus the 0x100 bytes taken by the + * image definition. + */ + code_partition: partition@100 { + label = "code-partition"; + reg = <0x100 (DT_SIZE_M(4) - 0x100)>; + read-only; + }; + }; +}; + +&uart0 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&spi1 { + clock-frequency = ; + status = "okay"; + pinctrl-0 = <&spi1_default>; + pinctrl-names = "default"; + cs-gpios = <&pico_header 13 GPIO_ACTIVE_LOW>; + + lan8651: lan865x@0 { + compatible = "microchip,lan865x"; + reg = <0x0>; + spi-max-frequency = ; + int-gpios = <&gpio0 21 (GPIO_ACTIVE_LOW)>; + rst-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + status = "okay"; + + local-mac-address = [ CA 2F B7 10 23 79]; + + lan865x_mdio: lan865x_mdio { + compatible = "microchip,lan865x-mdio"; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + ethernet-phy@0 { + compatible = "microchip,t1s-phy"; + reg = <0x0>; + plca-enable; + plca-node-id = <0>; + plca-node-count = <8>; + plca-burst-count = <0>; + plca-burst-timer = <0x80>; + plca-to-timer = <0x20>; + status = "okay"; + }; + }; + }; +}; + +&i2c0 { + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + status = "okay"; +}; + +&i2c1 { + clock-frequency = ; + pinctrl-0 = <&i2c1_default>; + pinctrl-names = "default"; + status = "okay"; +}; + +&adc { + pinctrl-0 = <&adc_default>; + pinctrl-names = "default"; + status = "okay"; +}; + +&pwm { + pinctrl-0 = <&pwm_ch4b_default>; + pinctrl-names = "default"; + divider-int-0 = <255>; +}; + +&timer0 { + status = "okay"; +}; + +zephyr_udc0: &usbd { + status = "okay"; +}; + +pico_serial: &uart0 {}; diff --git a/boards/kws/pico2_spe/pico2_spe_rp2350a_m33.dts b/boards/kws/pico2_spe/pico2_spe_rp2350a_m33.dts new file mode 100644 index 0000000000000..4bebd86dbd0c7 --- /dev/null +++ b/boards/kws/pico2_spe/pico2_spe_rp2350a_m33.dts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 KWS Computersysteme Gmbh + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +/* The build system assumes that there's a cpucluster-specific file. + * + * This file provides composition of the device tree: + * 1. The common features of the SoC + * 2. Core-specific configuration. + * 3. Board-specific configuration. + */ +#include +#include + +/* there's nothing specific to the Cortex-M33 cores vs the (not yet + * implemented) Hazard3 cores. + */ +#include "pico2_spe.dtsi" diff --git a/boards/kws/pico2_spe/pico2_spe_rp2350a_m33.yaml b/boards/kws/pico2_spe/pico2_spe_rp2350a_m33.yaml new file mode 100644 index 0000000000000..acdaeafe3a6b0 --- /dev/null +++ b/boards/kws/pico2_spe/pico2_spe_rp2350a_m33.yaml @@ -0,0 +1,20 @@ +identifier: pico2_spe/rp2350a/m33 +name: KWS Pico2 SinglePairEthernet +type: mcu +arch: arm +flash: 4096 +ram: 520 +toolchain: + - zephyr + - gnuarmemb +supported: + - adc + - clock + - counter + - dma + - gpio + - hwinfo + - i2c + - pwm + - spi + - uart diff --git a/boards/kws/pico2_spe/pico2_spe_rp2350a_m33_defconfig b/boards/kws/pico2_spe/pico2_spe_rp2350a_m33_defconfig new file mode 100644 index 0000000000000..8bd68e3511391 --- /dev/null +++ b/boards/kws/pico2_spe/pico2_spe_rp2350a_m33_defconfig @@ -0,0 +1,14 @@ +# This configuration is orthogonal to whether the Cortex-M33 or Hazard3 cores +# are in use, but Zephyr does not support providing a qualifier-agnostic +# _defconfig file. +CONFIG_BUILD_OUTPUT_HEX=y +CONFIG_BUILD_OUTPUT_UF2=y +CONFIG_CLOCK_CONTROL=y +CONFIG_CONSOLE=y +CONFIG_GPIO=y +CONFIG_RESET=y +CONFIG_SERIAL=y +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=150000000 +CONFIG_UART_CONSOLE=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_USE_DT_CODE_PARTITION=y diff --git a/boards/kws/pico2_spe/support/openocd.cfg b/boards/kws/pico2_spe/support/openocd.cfg new file mode 100644 index 0000000000000..82666bb53314c --- /dev/null +++ b/boards/kws/pico2_spe/support/openocd.cfg @@ -0,0 +1,11 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +# Checking and set 'adapter speed'. +# Set the adaptor speed, if unset, and given as an argument. +proc set_adapter_speed_if_not_set { speed } { + puts "checking adapter speed..." + if { [catch {adapter speed} ret] } { + adapter speed $speed + } +} diff --git a/boards/kws/pico_spe/Kconfig b/boards/kws/pico_spe/Kconfig new file mode 100644 index 0000000000000..e1a877543e64a --- /dev/null +++ b/boards/kws/pico_spe/Kconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2024 KWS Computersysteme Gmbh +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_PICO_SPE + select RP2_FLASH_W25Q080 diff --git a/boards/kws/pico_spe/Kconfig.defconfig b/boards/kws/pico_spe/Kconfig.defconfig new file mode 100644 index 0000000000000..4f5d509016333 --- /dev/null +++ b/boards/kws/pico_spe/Kconfig.defconfig @@ -0,0 +1,34 @@ +# Copyright (c) 2024 KWS Computersysteme Gmbh +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_PICO_SPE + +if I2C_DW + +config I2C_DW_CLOCK_SPEED + default 125 + +endif # I2C_DW + +config USB_SELF_POWERED + default n + +config PHY_INIT_PRIORITY + default 82 + depends on NET_L2_ETHERNET && ETH_DRIVER + +if NETWORKING + +config NET_L2_ETHERNET + default y + +if ETH_LAN865X + +config NET_IF_MAX_IPV4_COUNT + default 2 + +endif # ETH_LAN865X + +endif # NETWORKING + +endif # BOARD_PICO_SPE diff --git a/boards/kws/pico_spe/Kconfig.pico_spe b/boards/kws/pico_spe/Kconfig.pico_spe new file mode 100644 index 0000000000000..1ecb279b3f66e --- /dev/null +++ b/boards/kws/pico_spe/Kconfig.pico_spe @@ -0,0 +1,5 @@ +# Copyright (c) 2024 KWS Computersysteme Gmbh +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_PICO_SPE + select SOC_RP2040 diff --git a/boards/kws/pico_spe/board.cmake b/boards/kws/pico_spe/board.cmake new file mode 100644 index 0000000000000..ff6f71a2c50af --- /dev/null +++ b/boards/kws/pico_spe/board.cmake @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: Apache-2.0 + +# This configuration allows selecting what debug adapter debugging Pico-SPE +# by a command-line argument. +# It is mainly intended to support both the 'picoprobe' and 'raspberrypi-swd' +# adapter described in "Getting started with Raspberry Pi Pico". +# And any other SWD debug adapter might also be usable with this configuration. + +# Set RPI_PICO_DEBUG_ADAPTER to select debug adapter by command-line arguments. +# e.g.) west build -b pico_spe -- -DRPI_PICO_DEBUG_ADAPTER=raspberrypi-swd +# The value is treated as a part of an interface file name that +# the debugger's configuration file. +# The value must be the 'stem' part of the name of one of the files +# in the openocd interface configuration file. +# The setting is store to CMakeCache.txt. +if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "") + set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap") +endif() + +board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]") +board_runner_args(openocd --cmd-pre-init "transport select swd") +board_runner_args(openocd --cmd-pre-init "source [find target/rp2040.cfg]") + +# The adapter speed is expected to be set by interface configuration. +# But if not so, set 2000 to adapter speed. +board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 2000") + +board_runner_args(jlink "--device=RP2040_M0_0") +board_runner_args(uf2 "--board-id=RPI-RP2") +board_runner_args(pyocd "--target=rp2040") + +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) +include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake) +include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) +include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) \ No newline at end of file diff --git a/boards/kws/pico_spe/board.yml b/boards/kws/pico_spe/board.yml new file mode 100644 index 0000000000000..5d80b878c0b30 --- /dev/null +++ b/boards/kws/pico_spe/board.yml @@ -0,0 +1,6 @@ +board: + name: pico_spe + full_name: Pico-SPE + vendor: kws + socs: + - name: rp2040 diff --git a/boards/kws/pico_spe/doc/img/pico_spe.webp b/boards/kws/pico_spe/doc/img/pico_spe.webp new file mode 100644 index 0000000000000..00e143500b49c Binary files /dev/null and b/boards/kws/pico_spe/doc/img/pico_spe.webp differ diff --git a/boards/kws/pico_spe/doc/index.rst b/boards/kws/pico_spe/doc/index.rst new file mode 100644 index 0000000000000..3246d36a972a6 --- /dev/null +++ b/boards/kws/pico_spe/doc/index.rst @@ -0,0 +1,235 @@ +.. zephyr:board:: pico_spe + +Overview +******** + +The Pico-SPE is a small, low-cost, versatile boards from +KWS Computersysteme Gmbh. They are equipped with an RP2040 SoC, an on-board LED, +a USB connector, an SWD interface. The Pico-SPE additionally contains an +Microchip LAN8651 10Base-T1S module. The USB bootloader allows the +ability to flash without any adapter, in a drag-and-drop manner. +It is also possible to flash and debug the boards with their SWD interface, +using an external adapter. + +Hardware +******** +- Dual core Arm Cortex-M0+ processor running up to 133MHz +- 264KB on-chip SRAM +- 16MB on-board QSPI flash with XIP capabilities +- 16 GPIO pins +- 3 Analog inputs +- 2 UART peripherals +- 2 I2C controllers +- 16 PWM channels +- USB 1.1 controller (host/device) +- 8 Programmable I/O (PIO) for custom peripherals +- On-board LED +- 1 Watchdog timer peripheral +- Microchip LAN8651 10Base-T1S + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Pin Mapping +=========== + +The peripherals of the RP2040 SoC can be routed to various pins on the board. +The configuration of these routes can be modified through DTS. Please refer to +the datasheet to see the possible routings for each peripheral. + +External pin mapping on the Pico-SPE is identical to the Pico, but note that internal +RP2040 GPIO lines 10, 11, 12, 13, 20, 21 are routed to the Microchip LAN8651 on the +Pico-SPE. + +Default Zephyr Peripheral Mapping: +---------------------------------- + +.. rst-class:: rst-columns + +- UART0_TX : P0 +- UART0_RX : P1 +- I2C0_SDA : P4 +- I2C0_SCL : P5 +- I2C1_SDA : P6 +- I2C1_SCL : P7 +- ADC_CH0 : P26 +- ADC_CH1 : P27 +- ADC_CH2 : P28 + +Programmable I/O (PIO) +********************** +The RP2040 SoC comes with two PIO periherals. These are two simple +co-processors that are designed for I/O operations. The PIOs run +a custom instruction set, generated from a custom assembly language. +PIO programs are assembled using :command:`pioasm`, a tool provided by Raspberry Pi. + +Zephyr does not (currently) assemble PIO programs. Rather, they should be +manually assembled and embedded in source code. An example of how this is done +can be found at :zephyr_file:`drivers/serial/uart_rpi_pico_pio.c`. + +Sample: SPI via PIO +==================== + +The :zephyr:code-sample:`bme280` sample includes a +demonstration of using the PIO SPI driver to communicate with an +environmental sensor. The PIO SPI driver supports using any +combination of GPIO pins for an SPI bus, as well as allowing up to +four independent SPI buses on a single board (using the two SPI +devices as well as both PIO devices). + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== + +Using SEGGER JLink +------------------ + +You can Flash the pico_spe with a SEGGER JLink debug probe as described in +:ref:`Building, Flashing and Debugging `. + +Here is an example of building and flashing the :zephyr:code-sample:`blinky` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: pico_spe + :goals: build + +.. code-block:: bash + + west flash --runner jlink + +Using OpenOCD +------------- + +To use CMSIS-DAP, you must configure **udev**. + +Create a file in /etc/udev.rules.d with any name, and write the line below. + +.. code-block:: bash + + ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000c", MODE="660", GROUP="plugdev", TAG+="uaccess" + +This example is valid for the case that the user joins to ``plugdev`` groups. + +The Pico-SPE has an SWD interface that can be used to program +and debug the on board RP2040. This interface can be utilized by OpenOCD. +To use it with the RP2040, OpenOCD version 0.12.0 or later is needed. + +If you are using a Debian based system (including RaspberryPi OS, Ubuntu. and more), +using the `pico_setup.sh`_ script is a convenient way to set up the forked version of OpenOCD. + +Depending on the interface used (such as JLink), you might need to +checkout to a branch that supports this interface, before proceeding. +Build and install OpenOCD as described in the README. + +Here is an example of building and flashing the :zephyr:code-sample:`blinky` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: pico_spe + :goals: build flash + :gen-args: -DOPENOCD=/usr/local/bin/openocd -DOPENOCD_DEFAULT_PATH=/usr/local/share/openocd/scripts -DRPI_PICO_DEBUG_ADAPTER=cmsis-dap + +Set the environment variables **OPENOCD** to :file:`/usr/local/bin/openocd` +and **OPENOCD_DEFAULT_PATH** to :file:`/usr/local/share/openocd/scripts`. This should work +with the OpenOCD that was installed with the default configuration. +This configuration also works with an environment that is set up by the `pico_setup.sh`_ script. + +**RPI_PICO_DEBUG_ADAPTER** specifies what debug adapter is used for debugging. + +If **RPI_PICO_DEBUG_ADAPTER** was not assigned, ``cmsis-dap`` is used by default. +The other supported adapters are ``raspberrypi-swd``, ``jlink`` and ``blackmagicprobe``. +How to connect ``cmsis-dap`` and ``raspberrypi-swd`` is described in `Getting Started with Pico-SPE-Series`_. +Any other SWD debug adapter maybe also work with this configuration. + +The value of **RPI_PICO_DEBUG_ADAPTER** is cached, so it can be omitted from +``west flash`` and ``west debug`` if it was previously set while running +``west build``. + +**RPI_PICO_DEBUG_ADAPTER** is used in an argument to OpenOCD as ``"source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]"``. +Thus, **RPI_PICO_DEBUG_ADAPTER** needs to be assigned the file name of the debug adapter. + +You can also flash the board with the following +command that directly calls OpenOCD (assuming a SEGGER JLink adapter is used): + +.. code-block:: console + + $ openocd -f interface/jlink.cfg -c 'transport select swd' -f target/rp2040.cfg -c "adapter speed 2000" -c 'targets rp2040.core0' -c 'program path/to/zephyr.elf verify reset exit' + +Using UF2 +--------- + +If you don't have an SWD adapter, you can flash the Pico-SPE with +a UF2 file. By default, building an app for this board will generate a +:file:`build/zephyr/zephyr.uf2` file. If the Pico is powered on with the ``BOOTSEL`` +button pressed, it will appear on the host as a mass storage device. The +UF2 file should be drag-and-dropped to the device, which will flash the Pico. + +Debugging +========= + +The SWD interface can also be used to debug the board. To achieve this, you can +either use SEGGER JLink or OpenOCD. + +Using SEGGER JLink +------------------ + +Use a SEGGER JLink debug probe and follow the instruction in +:ref:`Building, Flashing and Debugging`. + + +Using OpenOCD +------------- + +Install OpenOCD as described for flashing the board. + +Here is an example for debugging the :zephyr:code-sample:`blinky` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: pico_spe + :maybe-skip-config: + :goals: debug + :gen-args: -DOPENOCD=/usr/local/bin/openocd -DOPENOCD_DEFAULT_PATH=/usr/local/share/openocd/scripts -DRPI_PICO_DEBUG_ADAPTER=raspberrypi-swd + +As with flashing, you can specify the debug adapter by specifying **RPI_PICO_DEBUG_ADAPTER** +at ``west build`` time. No needs to specify it at ``west debug`` time. + +You can also debug with OpenOCD and gdb launching from command-line. +Run the following command: + +.. code-block:: console + + $ openocd -f interface/jlink.cfg -c 'transport select swd' -f target/rp2040.cfg -c "adapter speed 2000" -c 'targets rp2040.core0' + +On another terminal, run: + +.. code-block:: console + + $ gdb-multiarch + +Inside gdb, run: + +.. code-block:: console + + (gdb) tar ext :3333 + (gdb) file path/to/zephyr.elf + +You can then start debugging the board. + +.. target-notes:: + +.. _pico_setup.sh: + https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh + +.. _Getting Started with Pico-SPE-Series: + https://kws-computer.de/go/pico-spe-getting-started + +.. _Pico-SPE Documentation: + https://kws-computer.de/go/pico-spe-datasheet diff --git a/boards/kws/pico_spe/pico_spe-pinctrl.dtsi b/boards/kws/pico_spe/pico_spe-pinctrl.dtsi new file mode 100644 index 0000000000000..ba6d29bb19b9c --- /dev/null +++ b/boards/kws/pico_spe/pico_spe-pinctrl.dtsi @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 KWS Computersysteme Gmbh + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +#include "../common/pico_spe-pinctrl-common.dtsi" diff --git a/boards/kws/pico_spe/pico_spe.dts b/boards/kws/pico_spe/pico_spe.dts new file mode 100644 index 0000000000000..5a4e89ead5819 --- /dev/null +++ b/boards/kws/pico_spe/pico_spe.dts @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2024 KWS Computersysteme Gmbh + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include +#include + +#include "pico_spe-pinctrl.dtsi" + +/ { + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,flash-controller = &ssi; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,code-partition = &code_partition; + }; + + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + label = "LED"; + }; + }; + + pwm_leds { + compatible = "pwm-leds"; + status = "disabled"; + + pwm_led0: pwm_led_0 { + pwms = <&pwm 9 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM_LED"; + }; + }; + + aliases { + led0 = &led0; + pwm-led0 = &pwm_led0; + rtc = &rtc; + watchdog0 = &wdt0; + }; + + pico_header: connector { + compatible = "raspberrypi,pico-header"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio0 0 0>, /* GP0 */ + <1 0 &gpio0 1 0>, /* GP1 */ + <2 0 &gpio0 2 0>, /* GP2 */ + <3 0 &gpio0 3 0>, /* GP3 */ + <4 0 &gpio0 4 0>, /* GP4 */ + <5 0 &gpio0 5 0>, /* GP5 */ + <6 0 &gpio0 6 0>, /* GP6 */ + <7 0 &gpio0 7 0>, /* GP7 */ + <8 0 &gpio0 8 0>, /* GP8 */ + <9 0 &gpio0 9 0>, /* GP9 */ + <10 0 &gpio0 10 0>, /* GP10 */ + <11 0 &gpio0 11 0>, /* GP11 */ + <12 0 &gpio0 12 0>, /* GP12 */ + <13 0 &gpio0 13 0>, /* GP13 */ + <14 0 &gpio0 14 0>, /* GP14 */ + <15 0 &gpio0 15 0>, /* GP15 */ + <16 0 &gpio0 16 0>, /* GP16 */ + <17 0 &gpio0 17 0>, /* GP17 */ + <18 0 &gpio0 18 0>, /* GP18 */ + <19 0 &gpio0 19 0>, /* GP19 */ + <20 0 &gpio0 20 0>, /* GP20 */ + <21 0 &gpio0 21 0>, /* GP21 */ + <22 0 &gpio0 22 0>, /* GP22 */ + <26 0 &gpio0 26 0>, /* GP26 */ + <27 0 &gpio0 27 0>, /* GP27 */ + <28 0 &gpio0 28 0>; /* GP28 */ + }; +}; + +&flash0 { + reg = <0x10000000 DT_SIZE_M(2)>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Reserved memory for the second stage bootloader */ + second_stage_bootloader: partition@0 { + label = "second_stage_bootloader"; + reg = <0x00000000 0x100>; + read-only; + }; + + /* + * Usable flash. Starts at 0x100, after the bootloader. The partition + * size is 2MB minus the 0x100 bytes taken by the bootloader. + */ + code_partition: partition@100 { + label = "code-partition"; + reg = <0x100 (DT_SIZE_M(2) - 0x100)>; + read-only; + }; + }; +}; + +&uart0 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&i2c0 { + clock-frequency = ; + status = "okay"; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_default>; + pinctrl-names = "default"; + status = "disabled"; + clock-frequency = ; +}; + +&spi1 { + clock-frequency = ; + status = "okay"; + pinctrl-0 = <&spi1_default>; + pinctrl-names = "default"; + cs-gpios = <&pico_header 13 GPIO_ACTIVE_LOW>; + + lan8651: lan865x@0 { + compatible = "microchip,lan865x"; + reg = <0x0>; + spi-max-frequency = ; + int-gpios = <&gpio0 21 (GPIO_ACTIVE_LOW)>; + rst-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + status = "okay"; + local-mac-address = [ CA 2F B7 10 23 78]; + + lan865x_mdio: lan865x_mdio { + compatible = "microchip,lan865x-mdio"; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + ethernet-phy@0 { + compatible = "microchip,t1s-phy"; + reg = <0x0>; + plca-enable; + plca-node-id = <0>; + plca-node-count = <8>; + plca-burst-count = <0>; + plca-burst-timer = <0x80>; + plca-to-timer = <0x20>; + status = "okay"; + }; + }; + }; +}; + +&timer { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&rtc { + clocks = <&clocks RPI_PICO_CLKID_CLK_RTC>; + status = "okay"; +}; + +&adc { + status = "okay"; + pinctrl-0 = <&adc_default>; + pinctrl-names = "default"; +}; + +zephyr_udc0: &usbd { + status = "okay"; +}; + +&pwm { + pinctrl-0 = <&pwm_ch4b_default>; + pinctrl-names = "default"; +}; + +&vreg { + regulator-always-on; + regulator-allowed-modes = ; +}; + +pico_spi: &spi1 {}; +pico_i2c0: &i2c0 {}; +pico_i2c1: &i2c1 {}; +pico_serial: &uart0 {}; diff --git a/boards/kws/pico_spe/pico_spe.yaml b/boards/kws/pico_spe/pico_spe.yaml new file mode 100644 index 0000000000000..c0b383270f571 --- /dev/null +++ b/boards/kws/pico_spe/pico_spe.yaml @@ -0,0 +1,23 @@ +identifier: pico_spe +name: KWS Pico SinglePairEthernet +type: mcu +arch: arm +flash: 2048 +ram: 264 +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - uart + - gpio + - adc + - i2c + - spi + - hwinfo + - watchdog + - pwm + - flash + - dma + - counter + - clock diff --git a/boards/kws/pico_spe/pico_spe_defconfig b/boards/kws/pico_spe/pico_spe_defconfig new file mode 100644 index 0000000000000..df003531af9c8 --- /dev/null +++ b/boards/kws/pico_spe/pico_spe_defconfig @@ -0,0 +1,11 @@ +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=125000000 +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_USE_DT_CODE_PARTITION=y +CONFIG_BUILD_OUTPUT_UF2=y +CONFIG_BUILD_OUTPUT_HEX=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_RESET=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/kws/pico_spe/support/openocd.cfg b/boards/kws/pico_spe/support/openocd.cfg new file mode 100644 index 0000000000000..34ab592b1861d --- /dev/null +++ b/boards/kws/pico_spe/support/openocd.cfg @@ -0,0 +1,11 @@ +# Copyright (c) 2022 Tokita, Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +# Checking and set 'adapter speed'. +# Set the adaptor speed, if unset, and given as an argument. +proc set_adapter_speed_if_not_set { speed } { + puts "checking adapter speed..." + if { [catch {adapter speed} ret] } { + adapter speed $speed + } +} diff --git a/boards/lilygo/tdongle_s3/Kconfig b/boards/lilygo/tdongle_s3/Kconfig new file mode 100644 index 0000000000000..2da6bfecb7c9d --- /dev/null +++ b/boards/lilygo/tdongle_s3/Kconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2025 Stefan Golinschi +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BOARD_TDONGLE_S3_ESP32S3_PROCPU + default 256 if BOARD_TDONGLE_S3_ESP32S3_APPCPU diff --git a/boards/lilygo/tdongle_s3/Kconfig.sysbuild b/boards/lilygo/tdongle_s3/Kconfig.sysbuild new file mode 100644 index 0000000000000..420778b68b241 --- /dev/null +++ b/boards/lilygo/tdongle_s3/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2025 Stefan Golinschi +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/lilygo/tdongle_s3/Kconfig.tdongle_s3 b/boards/lilygo/tdongle_s3/Kconfig.tdongle_s3 new file mode 100644 index 0000000000000..12f013272e00c --- /dev/null +++ b/boards/lilygo/tdongle_s3/Kconfig.tdongle_s3 @@ -0,0 +1,7 @@ +# Copyright (c) 2025 Stefan Golinschi +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_TDONGLE_S3 + select SOC_ESP32S3_WROOM_N16R8 + select SOC_ESP32S3_PROCPU if BOARD_TDONGLE_S3_ESP32S3_PROCPU + select SOC_ESP32S3_APPCPU if BOARD_TDONGLE_S3_ESP32S3_APPCPU diff --git a/boards/lilygo/tdongle_s3/board.cmake b/boards/lilygo/tdongle_s3/board.cmake new file mode 100644 index 0000000000000..57d1a920ecd36 --- /dev/null +++ b/boards/lilygo/tdongle_s3/board.cmake @@ -0,0 +1,10 @@ +# Copyright (c) 2025 Stefan Golinschi +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/lilygo/tdongle_s3/board.yml b/boards/lilygo/tdongle_s3/board.yml new file mode 100644 index 0000000000000..ad92d0100c941 --- /dev/null +++ b/boards/lilygo/tdongle_s3/board.yml @@ -0,0 +1,6 @@ +board: + name: tdongle_s3 + full_name: T-Dongle S3 + vendor: lilygo + socs: + - name: esp32s3 diff --git a/boards/lilygo/tdongle_s3/doc/img/tdongle_s3.webp b/boards/lilygo/tdongle_s3/doc/img/tdongle_s3.webp new file mode 100644 index 0000000000000..b970f6b1b8d9c Binary files /dev/null and b/boards/lilygo/tdongle_s3/doc/img/tdongle_s3.webp differ diff --git a/boards/lilygo/tdongle_s3/doc/index.rst b/boards/lilygo/tdongle_s3/doc/index.rst new file mode 100644 index 0000000000000..b90f5a214172c --- /dev/null +++ b/boards/lilygo/tdongle_s3/doc/index.rst @@ -0,0 +1,189 @@ +.. zephyr:board:: tdongle_s3 + +Overview +******** + +Lilygo T-Dongle S3 is an IoT mini development board based on the +Espressif ESP32-S3 WiFi/Bluetooth dual-mode chip. + +It features the following integrated components: + +- ESP32-S3 chip (240MHz dual core, Bluetooth 5, WiFi) +- On-board antenna and IPEX connector +- USB-A connector with integrated TF Card slot +- MX 1.25mm 2-pin battery connector +- APA102 RGB LED +- JST SH 1.0mm 4-pin UART connector +- Transparent plastic case + +Functional Description +********************** +This board is based on the ESP32-S3 with 16MB of flash, WiFi and BLE support. It +has an USB-A port for programming and debugging, integrated battery charging +and an on-board antenna. The fitted U.FL external antenna connector can be +enabled by moving a 0-ohm resistor. + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Start Application Development +***************************** + +Before powering up your Lilygo T-Dongle T8-S3, please make sure that the board is in good +condition with no obvious signs of damage. + +System requirements +******************* + +Prerequisites +============= + +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command +below to retrieve those files. + +.. code-block:: console + + west blobs fetch hal_espressif + +.. note:: + + It is recommended running the command above after :file:`west update`. + +Building & Flashing +******************* + +.. zephyr:board-supported-runners:: + +Simple boot +=========== + +The board could be loaded using a single binary image, without 2nd stage bootloader. +It is the default option when building the application without additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +================== + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be built (and flashed) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code-block:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +======== + +The sysbuild makes it possible to build and flash all necessary images needed to +bootstrap the board with the ESP32 SoC. + +To build the sample application using sysbuild use the command: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/hello_world + :board: tdongle_s3/esp32s3/procpu + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │   └── zephyr + │   ├── zephyr.elf + │   └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` documentation. + +Manual build +============ + +During the development cycle, it is intended to build & flash as quickly possible. +For that reason, images can be built one at a time using traditional build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flashed at least once. + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: tdongle_s3/esp32s3/procpu + :goals: build + +The usual ``flash`` target will work with the ``tdongle_s3`` board target. +Here is an example for the :zephyr:code-sample:`hello_world` +application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: tdongle_s3/esp32s3/procpu + :goals: flash + +The default baud rate for the Lilygo T-Dongle S3 is set to 1500000bps. If experiencing issues when flashing, +try using different values by using ``--esp-baud-rate `` option during +``west flash`` (e.g. ``west flash --esp-baud-rate 115200``). + +You can also open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has automatically reset and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! tdongle_s3/esp32s3/procpu + +References +********** + +.. target-notes:: + +.. _`Lilygo T-Dongle S3 schematic`: https://github.com/Xinyuan-LilyGO/T-Dongle-S3/blob/main/shcematic/T-Dongle-S3.pdf +.. _`Lilygo github repo`: https://github.com/Xinyuan-LilyGO/T-Dongle-S3.git +.. _`ESP32-S3 Datasheet`: https://github.com/Xinyuan-LilyGO/T-Dongle-S3/blob/main/doc/esp32-s3_datasheet_en.pdf +.. _`ESP32-S3 Technical Reference Manual`: https://github.com/Xinyuan-LilyGO/T-Dongle-S3/blob/main/doc/esp32-s3_technical_reference_manual_en.pdf +.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases +.. _`JTAG debugging for ESP32-S3`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-debugging/ diff --git a/boards/lilygo/tdongle_s3/support/openocd.cfg b/boards/lilygo/tdongle_s3/support/openocd.cfg new file mode 100644 index 0000000000000..0b2c4909fe0e0 --- /dev/null +++ b/boards/lilygo/tdongle_s3/support/openocd.cfg @@ -0,0 +1,7 @@ +set ESP_RTOS none +set ESP32_ONLYCPU 1 + +source [find interface/esp_usb_jtag.cfg] + +source [find target/esp32s3.cfg] +adapter_khz 5000 diff --git a/boards/lilygo/tdongle_s3/tdongle_s3-pinctrl.dtsi b/boards/lilygo/tdongle_s3/tdongle_s3-pinctrl.dtsi new file mode 100644 index 0000000000000..a4bff2af2d280 --- /dev/null +++ b/boards/lilygo/tdongle_s3/tdongle_s3-pinctrl.dtsi @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Stefan Golinschi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + }; + + spim3_default: spim3_default { + group1 { + pinmux = , + ; + }; + }; + + sdhc0_default: sdhc0_default { + group1 { + pinmux = , + , + , + , + , + ; + bias-pull-up; + output-high; + }; + }; +}; diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_appcpu.dts b/boards/lilygo/tdongle_s3/tdongle_s3_appcpu.dts new file mode 100644 index 0000000000000..2d2422e11a9ef --- /dev/null +++ b/boards/lilygo/tdongle_s3/tdongle_s3_appcpu.dts @@ -0,0 +1,35 @@ +/* + * Copyright 2025 Stefan Golinschi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +/ { + model = "TDONGLE S3 APPCPU"; + compatible = "espressif,esp32s3"; + + chosen { + zephyr,sram = &sram0; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_appcpu_partition; + }; +}; + +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +&trng0 { + status = "okay"; +}; + +&ipm0 { + status = "okay"; +}; diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_appcpu.yaml b/boards/lilygo/tdongle_s3/tdongle_s3_appcpu.yaml new file mode 100644 index 0000000000000..b9bea7145c3e8 --- /dev/null +++ b/boards/lilygo/tdongle_s3/tdongle_s3_appcpu.yaml @@ -0,0 +1,27 @@ +identifier: tdongle_s3/esp32s3/appcpu +name: LILYGO T-DONGLE S3 APPCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - uart +testing: + ignore_tags: + - net + - bluetooth + - flash + - cpp + - posix + - watchdog + - logging + - kernel + - pm + - gpio + - crypto + - eeprom + - heap + - cmsis_rtos + - jwt + - zdsp +vendor: lilygo diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_appcpu_defconfig b/boards/lilygo/tdongle_s3/tdongle_s3_appcpu_defconfig new file mode 100644 index 0000000000000..6087787aad3d9 --- /dev/null +++ b/boards/lilygo/tdongle_s3/tdongle_s3_appcpu_defconfig @@ -0,0 +1,4 @@ +# Copyright (c) 2025 Stefan Golinschi +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CLOCK_CONTROL=y diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts new file mode 100644 index 0000000000000..d325c30273b88 --- /dev/null +++ b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.dts @@ -0,0 +1,160 @@ +/* + * Copyright 2025 Stefan Golinschi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "tdongle_s3-pinctrl.dtsi" +#include +#include +#include +#include + +/ { + model = "TDONGLE S3 PROCPU"; + compatible = "espressif,esp32s3"; + + aliases { + watchdog0 = &wdt0; + sdhc0 = &sdhc0; + uart-0 = &uart0; + sw0 = &button0; + led-strip = &apa102; + }; + + chosen { + zephyr,sram = &sram0; + /* console can be UART or USB CDC */ + /* zephyr,console = &uart0; */ + /* zephyr,shell-uart = &uart0; */ + zephyr,console = &usb_serial; + zephyr,shell-uart = &usb_serial; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + zephyr,display = &st7735r; + zephyr,sdhc = &sdhc0; + }; + + buttons { + compatible = "gpio-keys"; + status = "okay"; + + button0: button_0 { + gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "BOOT Button"; + zephyr,code = ; + }; + }; + + mipi_dbi { + compatible = "zephyr,mipi-dbi-spi"; + /* Enable D/C line for 4wire mode */ + dc-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + spi-dev = <&spi2>; + #address-cells = <1>; + #size-cells = <0>; + write-only; + status = "okay"; + + st7735r: st7735r@0 { + compatible = "sitronix,st7735r"; + mipi-max-frequency = <20000000>; + mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; + reg = <0>; + width = <160>; + height = <80>; + inversion-on; + rgb-is-inverted; + madctl = <0xBE>; + x-offset = <1>; + y-offset = <26>; + gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2B 39 00 01 03 10]; + gamctrn1 = [03 1d 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10]; + te-delay = <0x0A>; + vmctr1 = <0x0E>; + colmod = <0x05>; + caset = [00 02 00 81]; + raset = [00 01 00 A0]; + status = "okay"; + }; + }; +}; + +&uart0 { + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; + status = "okay"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + cs-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; + clock-frequency = <20000000>; + status = "okay"; +}; + +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&spim3_default>; + pinctrl-names = "default"; + clock-frequency = <20000000>; + status = "okay"; + + apa102: apa102@0 { + compatible = "apa,apa102"; + reg = <0>; + spi-max-frequency = <24000000>; + chain-length = <1>; + color-mapping = ; + status = "okay"; + }; +}; + +&usb_serial { + status = "okay"; +}; + +&timer0 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; + +&esp32_bt_hci { + status = "okay"; +}; + +&sdhc { + sdhc0: sdhc@0 { + pinctrl-0 = <&sdhc0_default>; + pinctrl-names = "default"; + power-delay-ms = <100>; + max-bus-freq = <52000000>; + bus-width = <4>; + status = "okay"; + + mmc { + compatible = "zephyr,sdmmc-disk"; + disk-name = "SD"; + status = "okay"; + }; + }; +}; diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_procpu.yaml b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.yaml new file mode 100644 index 0000000000000..5b01812a0bfd1 --- /dev/null +++ b/boards/lilygo/tdongle_s3/tdongle_s3_procpu.yaml @@ -0,0 +1,22 @@ +identifier: tdongle_s3/esp32s3/procpu +name: TDONGLE S3 PROCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - uart + - i2c + - i2s + - spi + - can + - counter + - watchdog + - entropy + - pwm + - dma + - input + - video + - display +vendor: lilygo diff --git a/boards/lilygo/tdongle_s3/tdongle_s3_procpu_defconfig b/boards/lilygo/tdongle_s3/tdongle_s3_procpu_defconfig new file mode 100644 index 0000000000000..fbb8fd6b9109c --- /dev/null +++ b/boards/lilygo/tdongle_s3/tdongle_s3_procpu_defconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Stefan Golinschi +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/lilygo/ttgo_lora32/doc/index.rst b/boards/lilygo/ttgo_lora32/doc/index.rst index fa6613d7414dc..1b662bb030c32 100644 --- a/boards/lilygo/ttgo_lora32/doc/index.rst +++ b/boards/lilygo/ttgo_lora32/doc/index.rst @@ -15,39 +15,13 @@ It's available in two versions supporting two different frequency ranges and fea Some of the ESP32 I/O pins are accessible on the board's pin headers. -Functional Description -********************** - -The following table below describes the key components, interfaces, and controls -of the Lilygo TTGO LoRa32 board. - -.. _SX127x: https://www.semtech.com/products/wireless-rf/lora-connect/sx1276#documentation -.. _ESP32-PICO-D4: https://www.espressif.com/sites/default/files/documentation/esp32-pico-d4_datasheet_en.pdf -.. _SSD1306: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf - -+------------------+-------------------------------------------------------------------------+ -| Key Component | Description | -+==================+=========================================================================+ -| ESP32-PICO-D4 | This `ESP32-PICO-D4`_ module provides complete Wi-Fi and Bluetooth | -| | functionalities and integrates a 4-MB SPI flash. | -+------------------+-------------------------------------------------------------------------+ -| Diagnostic LED | One user LED connected to the GPIO pin. | -+------------------+-------------------------------------------------------------------------+ -| USB Port | USB interface. Power supply for the board as well as the | -| | serial communication interface between a computer and the board. | -| | Micro-USB type connector. | -+------------------+-------------------------------------------------------------------------+ -| Power Switch | Sliding power switch. | -+------------------+-------------------------------------------------------------------------+ -| OLED display | Built-in OLED display \(`SSD1306`_, 0.96", 128x64 px\) controlled | -| | by I2C interface | -+------------------+-------------------------------------------------------------------------+ -| SX1276/SX1278 | LoRa radio frontend chip, connected via SPI. | -| | Use SX1276 for 433MHz and SX1276 for 868/915/923MHz. | -+------------------+-------------------------------------------------------------------------+ -| TF card slot | TF card slot wired to the SDHC interface of the MCU. | -+------------------+-------------------------------------------------------------------------+ +Hardware +******** + +Supported Features +================== +.. zephyr:board-supported-hw:: Start Application Development ***************************** @@ -61,7 +35,7 @@ System requirements Prerequisites ============= -Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run the command below to retrieve those files. .. code-block:: console @@ -75,10 +49,12 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== -The board could be loaded using the single binary image, without 2nd stage bootloader. +The board could be loaded using a single binary image, without 2nd stage bootloader. It is the default option when building the application without additional configuration. .. note:: @@ -108,7 +84,7 @@ There are two options to be used when building an application: Sysbuild ======== -The sysbuild makes possible to build and flash all necessary images needed to +The sysbuild makes it possible to build and flash all necessary images needed to bootstrap the board with the ESP32-PICO-D4 SoC. To build the sample application using sysbuild use the command: @@ -193,7 +169,7 @@ message in the monitor: .. code-block:: console ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** - Hello World! ttgo_lora32 + Hello World! ttgo_lora32/esp32/procpu Code samples ============ @@ -218,3 +194,5 @@ Related Documents - `ESP32-PICO-D4 Datasheet `_ (PDF) - `ESP32 Datasheet `_ (PDF) - `ESP32 Hardware Reference `_ +- `SX127x Datasheet `_ +- `SSD1306 Datasheet `_ (PDF) diff --git a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts index 6ae0dbeb0152e..42c3391f387d8 100644 --- a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts +++ b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts @@ -148,3 +148,7 @@ }; }; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/lilygo/ttgo_t7v1_5/doc/index.rst b/boards/lilygo/ttgo_t7v1_5/doc/index.rst index 13f5107cd80e5..57d12645c9aed 100644 --- a/boards/lilygo/ttgo_t7v1_5/doc/index.rst +++ b/boards/lilygo/ttgo_t7v1_5/doc/index.rst @@ -13,38 +13,17 @@ It features the following integrated components: - JST GH 2-pin battery connector - LED -Functional Description -********************** +Hardware +******** + This board is based on the ESP32-WROVER-E module with 4MB of flash (there are models 16MB as well), WiFi and BLE support. It has a Micro-USB port for programming and debugging, integrated battery charging and an on-board antenna. -Connections and IOs -=================== +Supported Features +================== -The ``ttgo_t7v1_5/esp32/procpu`` board target supports the following hardware features: - -+-----------+------------+------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==================+ -| CPU | ESP32 | arch/xtensa | -+-----------+------------+------------------+ -| GPIO | on-chip | gpio_esp32 | -+-----------+------------+------------------+ -| UART | on-chip | uart_esp32 | -+-----------+------------+------------------+ -| I2C | on-chip | i2c_esp32 | -+-----------+------------+------------------+ -| SPI | on-chip | spi_esp32_spim | -+-----------+------------+------------------+ -| LoRa | SX1276 | lora_sx127x | -+-----------+------------+------------------+ -| WiFi | on-chip | wifi_esp32 | -+-----------+------------+------------------+ -| BLE | on-chip | bluetooth_esp32 | -+-----------+------------+------------------+ -| Flash | on-chip | flash_esp32 | -+-----------+------------+------------------+ +.. zephyr:board-supported-hw:: System requirements ******************* @@ -52,7 +31,7 @@ System requirements Prerequisites ============= -Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run the command below to retrieve those files. .. code-block:: console @@ -66,10 +45,12 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== -The board could be loaded using the single binary image, without 2nd stage bootloader. +The board could be loaded using a single binary image, without 2nd stage bootloader. It is the default option when building the application without additional configuration. .. note:: @@ -80,7 +61,7 @@ MCUboot bootloader ================== User may choose to use MCUboot bootloader instead. In that case the bootloader -must be build (and flash) at least once. +must be built (and flashed) at least once. There are two options to be used when building an application: @@ -92,14 +73,14 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - .. code:: cfg + .. code-block:: cfg CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== -The sysbuild makes possible to build and flash all necessary images needed to +The sysbuild makes it possible to build and flash all necessary images needed to bootstrap the board with the ESP32 SoC. To build the sample application using sysbuild use the command: @@ -142,7 +123,7 @@ Manual build ============ During the development cycle, it is intended to build & flash as quickly possible. -For that reason, images can be build one at a time using traditional build. +For that reason, images can be built one at a time using traditional build. The instructions following are relevant for both manual build and sysbuild. The only difference is the structure of the build directory. diff --git a/boards/lilygo/ttgo_t8c3/doc/index.rst b/boards/lilygo/ttgo_t8c3/doc/index.rst index 4179528b6af57..33cab6415243e 100644 --- a/boards/lilygo/ttgo_t8c3/doc/index.rst +++ b/boards/lilygo/ttgo_t8c3/doc/index.rst @@ -14,39 +14,18 @@ It features the following integrated components: - JST GH 2-pin battery connector - LED -Functional Description -********************** +Hardware +******** + This board is based on the ESP32-C3 with 4MB of flash, WiFi and BLE support. It has an USB-C port for programming and debugging, integrated battery charging and an on-board antenna. The fitted U.FL external antenna connector can be enabled by moving a 0-ohm resistor. -Connections and IOs -=================== +Supported Features +================== -The ``ttgo_t8c3`` board target supports the following hardware features: - -+-----------+------------+------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==================+ -| PMP | on-chip | arch/riscv | -+-----------+------------+------------------+ -| INTMTRX | on-chip | intc_esp32c3 | -+-----------+------------+------------------+ -| PINMUX | on-chip | pinctrl_esp32 | -+-----------+------------+------------------+ -| USB UART | on-chip | serial_esp32_usb | -+-----------+------------+------------------+ -| GPIO | on-chip | gpio_esp32 | -+-----------+------------+------------------+ -| UART | on-chip | uart_esp32 | -+-----------+------------+------------------+ -| I2C | on-chip | i2c_esp32 | -+-----------+------------+------------------+ -| SPI | on-chip | spi_esp32_spim | -+-----------+------------+------------------+ -| TWAI | on-chip | can_esp32_twai | -+-----------+------------+------------------+ +.. zephyr:board-supported-hw:: Start Application Development ***************************** @@ -60,7 +39,7 @@ System requirements Prerequisites ============= -Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run the command below to retrieve those files. .. code-block:: console @@ -74,10 +53,12 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== -The board could be loaded using the single binary image, without 2nd stage bootloader. +The board could be loaded using a single binary image, without 2nd stage bootloader. It is the default option when building the application without additional configuration. .. note:: @@ -107,7 +88,7 @@ There are two options to be used when building an application: Sysbuild ======== -The sysbuild makes possible to build and flash all necessary images needed to +The sysbuild makes it possible to build and flash all necessary images needed to bootstrap the board with the ESP32-C3 SoC. To build the sample application using sysbuild use the command: diff --git a/boards/lilygo/ttgo_t8s3/doc/index.rst b/boards/lilygo/ttgo_t8s3/doc/index.rst index 09455ed19a605..fb29b2e5f7b60 100644 --- a/boards/lilygo/ttgo_t8s3/doc/index.rst +++ b/boards/lilygo/ttgo_t8s3/doc/index.rst @@ -15,51 +15,18 @@ It features the following integrated components: - JST SH 1.0mm 4-pin UART connector - SD card slot -Functional Description -********************** +Hardware +******** + This board is based on the ESP32-S3 with 16MB of flash, WiFi and BLE support. It has an USB-C port for programming and debugging, integrated battery charging and an on-board antenna. The fitted U.FL external antenna connector can be enabled by moving a 0-ohm resistor. -Connections and IOs -=================== - -The ``ttgo_t8s3`` board target supports the following hardware features: - -+------------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+============+============+=====================================+ -| UART | on-chip | serial port | -+------------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+------------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+------------+------------+-------------------------------------+ -| USB-JTAG | on-chip | hardware interface | -+------------+------------+-------------------------------------+ -| SPI Master | on-chip | spi, sdmmc | -+------------+------------+-------------------------------------+ -| TWAI/CAN | on-chip | can | -+------------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+------------+------------+-------------------------------------+ -| Timers | on-chip | counter | -+------------+------------+-------------------------------------+ -| Watchdog | on-chip | watchdog | -+------------+------------+-------------------------------------+ -| TRNG | on-chip | entropy | -+------------+------------+-------------------------------------+ -| LEDC | on-chip | pwm | -+------------+------------+-------------------------------------+ -| MCPWM | on-chip | pwm | -+------------+------------+-------------------------------------+ -| PCNT | on-chip | qdec | -+------------+------------+-------------------------------------+ -| GDMA | on-chip | dma | -+------------+------------+-------------------------------------+ -| USB-CDC | on-chip | serial | -+------------+------------+-------------------------------------+ +Supported Features +================== + +.. zephyr:board-supported-hw:: Start Application Development ***************************** @@ -73,7 +40,7 @@ System requirements Prerequisites ============= -Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run the command below to retrieve those files. .. code-block:: console @@ -87,10 +54,12 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== -The board could be loaded using the single binary image, without 2nd stage bootloader. +The board could be loaded using a single binary image, without 2nd stage bootloader. It is the default option when building the application without additional configuration. .. note:: @@ -120,7 +89,7 @@ There are two options to be used when building an application: Sysbuild ======== -The sysbuild makes possible to build and flash all necessary images needed to +The sysbuild makes it possible to build and flash all necessary images needed to bootstrap the board with the ESP32 SoC. To build the sample application using sysbuild use the command: diff --git a/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu.dts b/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu.dts index a034a9cb49a4e..0bc8b8470922f 100644 --- a/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu.dts +++ b/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu.dts @@ -144,3 +144,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/lilygo/ttgo_tbeam/Kconfig b/boards/lilygo/ttgo_tbeam/Kconfig new file mode 100644 index 0000000000000..c52379f257a07 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/Kconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BOARD_TTGO_TBEAM_ESP32_PROCPU + default 256 if BOARD_TTGO_TBEAM_ESP32_APPCPU diff --git a/boards/lilygo/ttgo_tbeam/Kconfig.sysbuild b/boards/lilygo/ttgo_tbeam/Kconfig.sysbuild new file mode 100644 index 0000000000000..3a2d17ac5cfd0 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/lilygo/ttgo_tbeam/Kconfig.ttgo_tbeam b/boards/lilygo/ttgo_tbeam/Kconfig.ttgo_tbeam new file mode 100644 index 0000000000000..3b3202cf8e427 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/Kconfig.ttgo_tbeam @@ -0,0 +1,7 @@ +# Copyright (c) 2024 Lothar Felten +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_TTGO_TBEAM + select SOC_ESP32_PICO_D4 + select SOC_ESP32_PROCPU if BOARD_TTGO_TBEAM_ESP32_PROCPU + select SOC_ESP32_APPCPU if BOARD_TTGO_TBEAM_ESP32_APPCPU diff --git a/boards/lilygo/ttgo_tbeam/board.cmake b/boards/lilygo/ttgo_tbeam/board.cmake new file mode 100644 index 0000000000000..91b3caa2c75d5 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/board.cmake @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) + +# the default ESP32 baud rate is not supported +board_runner_args(esp32 "--esp-baud-rate=1500000") diff --git a/boards/lilygo/ttgo_tbeam/board.yml b/boards/lilygo/ttgo_tbeam/board.yml new file mode 100644 index 0000000000000..fad0e34cdcad8 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/board.yml @@ -0,0 +1,6 @@ +board: + name: ttgo_tbeam + full_name: TTGO TBeam + vendor: lilygo + socs: + - name: esp32 diff --git a/boards/lilygo/ttgo_tbeam/doc/img/ttgo_tbeam.webp b/boards/lilygo/ttgo_tbeam/doc/img/ttgo_tbeam.webp new file mode 100644 index 0000000000000..eb488921e4a59 Binary files /dev/null and b/boards/lilygo/ttgo_tbeam/doc/img/ttgo_tbeam.webp differ diff --git a/boards/lilygo/ttgo_tbeam/doc/index.rst b/boards/lilygo/ttgo_tbeam/doc/index.rst new file mode 100644 index 0000000000000..fa6082abaa29d --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/doc/index.rst @@ -0,0 +1,204 @@ +.. zephyr:board:: ttgo_tbeam + +Overview +******** + +The Lilygo TTGO TBeam, is an ESP32-based development board for LoRa applications. + +It's available in two versions supporting two different frequency ranges and features the following integrated components: + +- ESP32-PICO-D4 chip (240MHz dual core, 600 DMIPS, 520KB SRAM, Wi-Fi) +- SSD1306, 128x64 px, 0.96" screen (optional) +- SX1278 (433MHz) or SX1276 (868/915/923MHz) LoRa radio frontend (optional, with SMA or IPEX connector) +- NEO-6M or NEO-M8N GNSS module +- X-Powers AXP2101 PMIC +- JST GH 2-pin battery connector +- 18650 Li-Ion battery clip + +Some of the ESP32 I/O pins are accessible on the board's pin headers. + +Hardware +******** + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Start Application Development +***************************** + +Before powering up your Lilygo TTGO TBeam, please make sure that the board is in good +condition with no obvious signs of damage. + +System requirements +******************* + +Prerequisites +============= + +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run the command +below to retrieve those files. + +.. code-block:: console + + west blobs fetch hal_espressif + +.. note:: + + It is recommended running the command above after :file:`west update`. + +Building & Flashing +******************* + +.. zephyr:board-supported-runners:: + +Simple boot +=========== + +The board could be loaded using a single binary image, without 2nd stage bootloader. +It is the default option when building the application without additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +================== + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be built (and flashed) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code-block:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +======== + +The sysbuild makes it possible to build and flash all necessary images needed to +bootstrap the board with the ESP32-PICO-D4 SoC. + +To build the sample application using sysbuild use the command: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/hello_world + :board: ttgo_tbeam/esp32/procpu + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32-PICO-D4 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │   └── zephyr + │   ├── zephyr.elf + │   └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` documentation. + +Manual build +============ + +During the development cycle, it is intended to build & flash as quickly possible. +For that reason, images can be built one at a time using traditional build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flash at least once. + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: ttgo_tbeam/esp32/procpu + :goals: build + +The usual ``flash`` target will work with the ``ttgo_tbeam`` board target. +Here is an example for the :zephyr:code-sample:`hello_world` +application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: ttgo_tbeam/esp32/procpu + :goals: flash + +The default baud rate for the Lilygo TTGO TBeam is set to 1500000bps. If experiencing issues when flashing, +try using different values by using ``--esp-baud-rate `` option during +``west flash`` (e.g. ``west flash --esp-baud-rate 115200``). + +You can also open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has automatically reset and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! ttgo_tbeam/esp32/procpu + +Code samples +============ + +The following sample applications will work out of the box with this board: + +* :zephyr:code-sample:`lora-send` +* :zephyr:code-sample:`lora-receive` +* :zephyr:code-sample:`gnss` +* :zephyr:code-sample:`wifi-shell` +* :zephyr:code-sample:`character-frame-buffer` +* :zephyr:code-sample:`blinky` + +Debugging +********* + +Lilygo TTGO TBeam debugging is not supported due to pinout limitations. + +Related Documents +***************** +- `Lilygo TTGO TBeam schematic `_ (PDF) +- `Lilygo TTGO TBeam documentation `_ +- `Lilygo github repo `_ +- `ESP32-PICO-D4 Datasheet `_ (PDF) +- `ESP32 Datasheet `_ (PDF) +- `ESP32 Hardware Reference `_ +- `SX127x Datasheet `_ +- `SSD1306 Datasheet `_ (PDF) +- `NEO-6M Datasheet `_ (PDF) +- `NEO-N8M Datasheet `_ (PDF) diff --git a/boards/lilygo/ttgo_tbeam/support/openocd.cfg b/boards/lilygo/ttgo_tbeam/support/openocd.cfg new file mode 100644 index 0000000000000..338e6e4e6eae9 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/support/openocd.cfg @@ -0,0 +1,5 @@ +set ESP_RTOS none +set ESP32_ONLYCPU 1 + +source [find interface/ftdi/esp32_devkitj_v1.cfg] +source [find target/esp32.cfg] diff --git a/boards/lilygo/ttgo_tbeam/ttgo_tbeam-pinctrl.dtsi b/boards/lilygo/ttgo_tbeam/ttgo_tbeam-pinctrl.dtsi new file mode 100644 index 0000000000000..a8a93a72bf8fb --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/ttgo_tbeam-pinctrl.dtsi @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 Lothar Felten + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart1_default: uart1_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + spim3_default: spim3_default { + group1 { + pinmux = , + ; + }; + + group2 { + pinmux = ; + output-low; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; +}; diff --git a/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu.dts b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu.dts new file mode 100644 index 0000000000000..3547f3e351ae4 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu.dts @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include + +/ { + model = "TTGO TBeam APPCPU"; + compatible = "espressif,esp32"; + + chosen { + zephyr,sram = &sram1; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_appcpu_partition; + }; +}; + +&ipm0 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; diff --git a/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu.yaml b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu.yaml new file mode 100644 index 0000000000000..8eca6127690f4 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu.yaml @@ -0,0 +1,28 @@ +identifier: ttgo_tbeam/esp32/appcpu +name: TTGO TBeam APPCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - uart +testing: + ignore_tags: + - net + - bluetooth + - flash + - cpp + - posix + - watchdog + - logging + - kernel + - pm + - gpio + - crypto + - eeprom + - heap + - cmsis_rtos + - jwt + - zdsp + - gnss +vendor: lilygo diff --git a/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu_defconfig b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu_defconfig new file mode 100644 index 0000000000000..48546641cadd6 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_appcpu_defconfig @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CLOCK_CONTROL=y diff --git a/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu.dts b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu.dts new file mode 100644 index 0000000000000..43143525fb54d --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu.dts @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2024 Lothar Felten + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include "ttgo_tbeam-pinctrl.dtsi" +#include +#include + +/ { + model = "TTGO TBeam PROCPU"; + compatible = "lilygo,ttgo-tbeam"; + + aliases { + led0 = &red_led; + uart-0 = &uart0; + i2c-0 = &i2c0; + watchdog0 = &wdt0; + lora0 = &lora0; + gnss = &gnss; + regulator0 = &axp2101; + }; + + chosen { + zephyr,sram = &sram1; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,display = &ssd1306_128x64; + }; + + leds { + compatible = "gpio-leds"; + + red_led: led_0 { + gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + label = "Red - LED0"; + }; + }; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&uart1 { + status = "okay"; + current-speed = <9600>; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; + + gnss: gnss-nmea-generic { + compatible = "gnss-nmea-generic"; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + sda-gpios = <&gpio0 21 GPIO_OPEN_DRAIN>; + scl-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + + ssd1306_128x64: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <64>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + prechargep = <0x22>; + }; + + axp2101: axp2101@34 { + status = "okay"; + reg = <0x34>; + compatible = "x-powers,axp2101"; + regulator { + compatible = "x-powers,axp2101-regulator"; + + vdd_mcu: DCDC1 { + regulator-min-microvolt = <3200000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd_lora: ALDO2 { + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <3000000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd_gnss: ALDO3 { + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2800000>; + regulator-boot-on; + }; + }; + }; +}; + +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim3_default>; + pinctrl-names = "default"; + cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + + lora0: lora@0 { + compatible = "semtech,sx1276"; + reg = <0>; + reset-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; + dio-gpios = + /* SX1276 D0 -> GPIO26 */ + <&gpio0 26 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, + /* SX1276 D1 -> GPIO33 */ + <&gpio1 1 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, + /* SX1276 D2 -> GPIO32 */ + <&gpio1 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; + spi-max-frequency = <1000000>; + power-amplifier-output = "pa-boost"; + }; +}; + +&timer0 { + status = "okay"; +}; + +&timer1 { + status = "okay"; +}; + +&timer2 { + status = "okay"; +}; + +&timer3 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; diff --git a/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu.yaml b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu.yaml new file mode 100644 index 0000000000000..6d2fe9c703a59 --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu.yaml @@ -0,0 +1,22 @@ +identifier: ttgo_tbeam/esp32/procpu +name: TTGO TBeam PROCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - i2c + - spi + - watchdog + - uart + - pinmux + - display + - lora + - nvs + - gnss +testing: + ignore_tags: + - net + - bluetooth +vendor: lilygo diff --git a/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu_defconfig b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu_defconfig new file mode 100644 index 0000000000000..6b1097cdb389a --- /dev/null +++ b/boards/lilygo/ttgo_tbeam/ttgo_tbeam_esp32_procpu_defconfig @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +CONFIG_GPIO=y +CONFIG_MFD=y +CONFIG_REGULATOR=y diff --git a/boards/lilygo/ttgo_toiplus/Kconfig b/boards/lilygo/ttgo_toiplus/Kconfig new file mode 100644 index 0000000000000..c6a99b1032dc7 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/Kconfig @@ -0,0 +1,6 @@ +# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 diff --git a/boards/lilygo/ttgo_toiplus/Kconfig.sysbuild b/boards/lilygo/ttgo_toiplus/Kconfig.sysbuild new file mode 100644 index 0000000000000..3a2d17ac5cfd0 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/lilygo/ttgo_toiplus/Kconfig.ttgo_toiplus b/boards/lilygo/ttgo_toiplus/Kconfig.ttgo_toiplus new file mode 100644 index 0000000000000..ddca709de7ad2 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/Kconfig.ttgo_toiplus @@ -0,0 +1,5 @@ +# Copyright 2025 aisuneko icecat +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_TTGO_TOIPLUS + select SOC_ESP32C3_FN4 diff --git a/boards/lilygo/ttgo_toiplus/board.cmake b/boards/lilygo/ttgo_toiplus/board.cmake new file mode 100644 index 0000000000000..2f04d1fe8861e --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/board.cmake @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/lilygo/ttgo_toiplus/board.yml b/boards/lilygo/ttgo_toiplus/board.yml new file mode 100644 index 0000000000000..e5295b2bec226 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/board.yml @@ -0,0 +1,6 @@ +board: + name: ttgo_toiplus + full_name: TTGO T-OI-PLUS + vendor: lilygo + socs: + - name: esp32c3 diff --git a/boards/lilygo/ttgo_toiplus/doc/img/ttgo_toiplus.webp b/boards/lilygo/ttgo_toiplus/doc/img/ttgo_toiplus.webp new file mode 100644 index 0000000000000..115cc04fa29fd Binary files /dev/null and b/boards/lilygo/ttgo_toiplus/doc/img/ttgo_toiplus.webp differ diff --git a/boards/lilygo/ttgo_toiplus/doc/index.rst b/boards/lilygo/ttgo_toiplus/doc/index.rst new file mode 100644 index 0000000000000..3ea6b50446fa3 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/doc/index.rst @@ -0,0 +1,199 @@ +.. zephyr:board:: ttgo_toiplus + +Overview +******** + +Lilygo TTGO T-OI-PLUS is an mini IoT development board based on +Espressif's ESP32-C3 WiFi/Bluetooth dual-mode chip. + +It features the following integrated components: + +- ESP32-C3 SoC (RISC-V 160MHz single core, 400KB SRAM, Wi-Fi, Bluetooth) +- on board Grove connector +- USB-C connector for power and communication (on board serial) +- optional 18340 Li-ion battery holder +- LED + +Functional Description +********************** +This board is based on the ESP32-C3 with 4MB of flash, WiFi and BLE support. It +has an USB-C port for programming and debugging, integrated battery charging +and an Grove connector. + +Connections and IOs +=================== + +.. zephyr:board-supported-hw:: + +(Note: the above UART interface also supports connecting through USB.) + +Start Application Development +***************************** + +Before powering up your Lilygo TTGO T-OI-PLUS, please make sure that the board is in good +condition with no obvious signs of damage. + +System requirements +******************* + +Prerequisites +============= + +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command +below to retrieve those files. + +.. code-block:: console + + west blobs fetch hal_espressif + +.. note:: + + It is recommended running the command above after :file:`west update`. + +Building & Flashing +******************* + +Simple boot +=========== + +The board could be loaded using the single binary image, without 2nd stage bootloader. +It is the default option when building the application without additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +================== + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be built (and flashed) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +======== + +The sysbuild makes possible to build and flash all necessary images needed to +bootstrap the board with the ESP32-C3 SoC. + +To build the sample application using sysbuild use the command: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/hello_world + :board: ttgo_toiplus + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32-C3 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │   └── zephyr + │   ├── zephyr.elf + │   └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-build and re-flash + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` documentation. + +Manual build +============ + +During the development cycle, it is intended to build & flash as quickly possible. +For that reason, images can be built one at a time using traditional build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flash at least once. + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: ttgo_toiplus + :goals: build + +The usual ``flash`` target will work with the ``ttgo_toiplus`` board target. +Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: ttgo_toiplus + :goals: flash + +You can also open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has automatically reset and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! ttgo_toiplus + +Sample applications +=================== + +The following samples will run out of the box on the TTGO T-OI-PLUS board. + +To build the blinky sample: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/basic/blinky + :board: ttgo_toiplus + :goals: build + +To build the bluetooth beacon sample: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/bluetooth/beacon + :board: ttgo_toiplus + :goals: build + + +Related Documents +***************** +.. _`Lilygo TTGO T-OI-PLUS schematic`: https://github.com/Xinyuan-LilyGO/LilyGo-T-OI-PLUS/blob/main/schematic/T-OI_PLUS_Schematic.pdf +.. _`Lilygo github repo`: https://github.com/Xinyuan-LilyGO +.. _`Espressif ESP32-C3 datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf +.. _`Espressif ESP32-C3 technical reference manual`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf +.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases diff --git a/boards/lilygo/ttgo_toiplus/support/openocd.cfg b/boards/lilygo/ttgo_toiplus/support/openocd.cfg new file mode 100644 index 0000000000000..02754ff2a73c1 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/support/openocd.cfg @@ -0,0 +1,6 @@ +set ESP_RTOS none + +source [find interface/esp_usb_jtag.cfg] + +source [find target/esp32c3.cfg] +adapter_khz 5000 diff --git a/boards/lilygo/ttgo_toiplus/ttgo_toiplus-pinctrl.dtsi b/boards/lilygo/ttgo_toiplus/ttgo_toiplus-pinctrl.dtsi new file mode 100644 index 0000000000000..874d3c94639bd --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/ttgo_toiplus-pinctrl.dtsi @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Lothar Felten + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + ; + }; + + /* GPIO6 is CS */ + + group2 { + pinmux = ; + output-low; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; + + twai_default: twai_default { + group1 { + pinmux = , + ; + }; + }; +}; diff --git a/boards/lilygo/ttgo_toiplus/ttgo_toiplus.dts b/boards/lilygo/ttgo_toiplus/ttgo_toiplus.dts new file mode 100644 index 0000000000000..6db7d4c16e6fe --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/ttgo_toiplus.dts @@ -0,0 +1,101 @@ +/* + * Copyright 2025 aisuneko icecat + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "ttgo_toiplus-pinctrl.dtsi" +#include + +/ { + model = "Lilygo TTGO T-OI-PLUS"; + compatible = "lilygo,ttgo-toiplus"; + + aliases { + led0 = &green_led; + i2c-0 = &i2c0; + watchdog0 = &wdt0; + }; + + chosen { + zephyr,sram = &sram1; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + zephyr,canbus = &twai; + }; + + leds { + compatible = "gpio-leds"; + + green_led: led_0 { + gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + label = "Green - LED0"; + }; + }; +}; + +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&trng0 { + status = "okay"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&timer0 { + status = "okay"; +}; + +&timer1 { + status = "okay"; +}; + +&twai { + status = "okay"; + pinctrl-0 = <&twai_default>; + pinctrl-names = "default"; +}; + +&wifi { + status = "okay"; +}; + +&esp32_bt_hci { + status = "okay"; +}; diff --git a/boards/lilygo/ttgo_toiplus/ttgo_toiplus.yaml b/boards/lilygo/ttgo_toiplus/ttgo_toiplus.yaml new file mode 100644 index 0000000000000..746472787cb24 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/ttgo_toiplus.yaml @@ -0,0 +1,14 @@ +identifier: ttgo_toiplus +name: TTGO T-OI-PLUS +type: mcu +arch: riscv +toolchain: + - zephyr +supported: + - gpio + - i2c + - spi + - uart + - watchdog + - can +vendor: lilygo diff --git a/boards/seeed/xiao_esp32c6/xiao_esp32c6_defconfig b/boards/lilygo/ttgo_toiplus/ttgo_toiplus_defconfig similarity index 100% rename from boards/seeed/xiao_esp32c6/xiao_esp32c6_defconfig rename to boards/lilygo/ttgo_toiplus/ttgo_toiplus_defconfig diff --git a/boards/lilygo/twatch_s3/Kconfig b/boards/lilygo/twatch_s3/Kconfig new file mode 100644 index 0000000000000..8d5a48cfc2c61 --- /dev/null +++ b/boards/lilygo/twatch_s3/Kconfig @@ -0,0 +1,7 @@ +# Copyright (c) 2025 BayLibre SAS +# SPDX-License-Identifier: Apache-2.0 + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 4096 if BOARD_TWATCH_S3_ESP32S3_PROCPU + default 256 if BOARD_TWATCH_S3_ESP32S3_APPCPU diff --git a/boards/lilygo/twatch_s3/Kconfig.defconfig b/boards/lilygo/twatch_s3/Kconfig.defconfig new file mode 100644 index 0000000000000..f7e4f32af3924 --- /dev/null +++ b/boards/lilygo/twatch_s3/Kconfig.defconfig @@ -0,0 +1,17 @@ +# Copyright 2025 BayLibre SAS +# SPDX-License-Identifier: Apache-2.0 + +if DISPLAY + +choice ST7789V_PIXEL_FORMAT + default ST7789V_BGR565 +endchoice + +if LVGL + +config LV_COLOR_16_SWAP + default y + +endif # LVGL + +endif # DISPLAY diff --git a/boards/lilygo/twatch_s3/Kconfig.sysbuild b/boards/lilygo/twatch_s3/Kconfig.sysbuild new file mode 100644 index 0000000000000..7d37de9b1aabc --- /dev/null +++ b/boards/lilygo/twatch_s3/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2025 BayLibre SAS +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/lilygo/twatch_s3/Kconfig.twatch_s3 b/boards/lilygo/twatch_s3/Kconfig.twatch_s3 new file mode 100644 index 0000000000000..338ccb6bec903 --- /dev/null +++ b/boards/lilygo/twatch_s3/Kconfig.twatch_s3 @@ -0,0 +1,7 @@ +# Copyright 2025 BayLibre SAS +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_TWATCH_S3 + select SOC_ESP32S3_WROOM_N16R8 + select SOC_ESP32S3_PROCPU if BOARD_TWATCH_S3_ESP32S3_PROCPU + select SOC_ESP32S3_APPCPU if BOARD_TWATCH_S3_ESP32S3_APPCPU diff --git a/boards/lilygo/twatch_s3/board.cmake b/boards/lilygo/twatch_s3/board.cmake new file mode 100644 index 0000000000000..2f04d1fe8861e --- /dev/null +++ b/boards/lilygo/twatch_s3/board.cmake @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/lilygo/twatch_s3/board.yml b/boards/lilygo/twatch_s3/board.yml new file mode 100644 index 0000000000000..e894af0d251c6 --- /dev/null +++ b/boards/lilygo/twatch_s3/board.yml @@ -0,0 +1,6 @@ +board: + name: twatch_s3 + full_name: T-Watch S3 + vendor: lilygo + socs: + - name: esp32s3 diff --git a/boards/lilygo/twatch_s3/doc/img/twatch_s3.webp b/boards/lilygo/twatch_s3/doc/img/twatch_s3.webp new file mode 100644 index 0000000000000..b79ef6813171a Binary files /dev/null and b/boards/lilygo/twatch_s3/doc/img/twatch_s3.webp differ diff --git a/boards/lilygo/twatch_s3/doc/index.rst b/boards/lilygo/twatch_s3/doc/index.rst new file mode 100644 index 0000000000000..3dc07e37673ea --- /dev/null +++ b/boards/lilygo/twatch_s3/doc/index.rst @@ -0,0 +1,198 @@ +.. zephyr:board:: twatch_s3 + +Overview +******** + +LILYGO T-Watch S3 is an ESP32-S3 based smartwatch with the following features: + +- ESP32-S3-R8 chip + + - Dual core Xtensa LX-7 up to 240MHz + - 8 MB of integrated PSRAM + - Bluetooth LE v5.0 + - Wi-Fi 802.11 b/g/n + +- 16 MB external QSPI flash (Winbond W25Q128JWPIQ) +- Power Management Unit (X-Powers AXP2101) which provides + + - Regulators (DC-DCs and LDOs) + - Battery charging + - Fuel gauge + +- 470 mAh battery +- RTC (NXP PCF8563) +- Haptic (Texas Instruments DRV2605) +- Accelerometer (Bosch BMA423) +- 240x240 pixels LCD with touchscreen + + - ST7789V LCD Controller + - Focaltech FT5336 touch sensor + +- Microphone (Knowles SPM1423HM4H-B) +- LoRA radio (Semtech SX1262) +- Audio amplifier (Maxim MAX98357A) + +The board features a single micro USB connector which can be used for serial +flashing, debugging and console thanks to the integrated JTAG support in the +chip. + +It does not have any GPIO that can easily be connected to something external. +There is only 1 physical button which is connected to the PMU and it's used +to turn on/off the device. + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Building & Flashing +******************* + +.. zephyr:board-supported-runners:: + +Prerequisites +============= + +Espressif HAL requires WiFi and Bluetooth binary blobs in order to work. Run the command +below to retrieve those files. + +.. code-block:: console + + west blobs fetch hal_espressif + +.. note:: + + It is recommended running the command above after :file:`west update`. + +Simple boot +=========== + +The board could be loaded using a single binary image, without 2nd stage bootloader. +It is the default option when building the application without additional configuration. + +.. note:: + + Simple boot does not provide any security features nor OTA updates. + +MCUboot bootloader +================== + +User may choose to use MCUboot bootloader instead. In that case the bootloader +must be built (and flashed) at least once. + +There are two options to be used when building an application: + +1. Sysbuild +2. Manual build + +.. note:: + + User can select the MCUboot bootloader by adding the following line + to the board default configuration file. + + .. code-block:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y + +Sysbuild +-------- + +The sysbuild makes it possible to build and flash all necessary images needed to +bootstrap the board with the ESP32 SoC. + +To build the sample application using sysbuild, use the command: + +.. zephyr-app-commands:: + :tool: west + :zephyr-app: samples/hello_world + :board: twatch_s3/esp32s3/procpu + :goals: build + :west-args: --sysbuild + :compact: + +By default, the ESP32-S3 sysbuild creates bootloader (MCUboot) and application +images. But it can be configured to create other kind of images. + +Build directory structure created by sysbuild is different from traditional +Zephyr build. Output is structured by the domain subdirectories: + +.. code-block:: + + build/ + ├── hello_world + │   └── zephyr + │   ├── zephyr.elf + │   └── zephyr.bin + ├── mcuboot + │ └── zephyr + │ ├── zephyr.elf + │ └── zephyr.bin + └── domains.yaml + +.. note:: + + With ``--sysbuild`` option the bootloader will be re-built and re-flashed + every time the pristine build is used. + +For more information about the system build please read the :ref:`sysbuild` documentation. + +Manual build +------------ + +During the development cycle, it is intended to build & flash as quickly as possible. +For that reason, images can be built one at a time using traditional build. + +The instructions following are relevant for both manual build and sysbuild. +The only difference is the structure of the build directory. + +.. note:: + + Remember that bootloader (MCUboot) needs to be flashed at least once. + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: twatch_s3/esp32s3/procpu + :goals: build + +The usual ``flash`` target will work with the ``twatch_s3`` board target +configuration. Here is an example for the :zephyr:code-sample:`hello_world` +application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: twatch_s3/esp32s3/procpu + :goals: flash + +The default baud rate is set to 1500000bps. If experiencing issues when flashing, +try using different values by using ``--esp-baud-rate `` option during +``west flash`` (e.g. ``west flash --esp-baud-rate 115200``). + +You can also open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has automatically reset and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! twatch_s3/esp32s3/procpu + +References +********** + +.. target-notes:: + +.. _`Lilygo Twatch S3 schematic`: https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library/blob/t-watch-s3/schematic/T_WATCH_S3.pdf +.. _`Lilygo T-Watch S3 repo`: https://github.com/Xinyuan-LilyGO/TTGO_TWatch_Library/tree/t-watch-s3 +.. _`Lilygo T-Watch Deps repo`: https://github.com/Xinyuan-LilyGO/T-Watch-Deps +.. _`ESP32-S3 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf +.. _`ESP32-S3 Technical Reference Manual`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf +.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases +.. _`JTAG debugging for ESP32-S3`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/jtag-debugging/ diff --git a/boards/lilygo/twatch_s3/support/openocd.cfg b/boards/lilygo/twatch_s3/support/openocd.cfg new file mode 100644 index 0000000000000..0b2c4909fe0e0 --- /dev/null +++ b/boards/lilygo/twatch_s3/support/openocd.cfg @@ -0,0 +1,7 @@ +set ESP_RTOS none +set ESP32_ONLYCPU 1 + +source [find interface/esp_usb_jtag.cfg] + +source [find target/esp32s3.cfg] +adapter_khz 5000 diff --git a/boards/lilygo/twatch_s3/twatch_s3-pinctrl.dtsi b/boards/lilygo/twatch_s3/twatch_s3-pinctrl.dtsi new file mode 100644 index 0000000000000..b62a16f797a85 --- /dev/null +++ b/boards/lilygo/twatch_s3/twatch_s3-pinctrl.dtsi @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2025 BayLibre SAS + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + drive-open-drain; + output-high; + }; + }; + + i2c1_default: i2c1_default { + group1 { + pinmux = , + ; + drive-open-drain; + output-high; + }; + }; + + spim3_default: spim3_default { + group1 { + pinmux = , + ; + }; + + group2 { + pinmux = ; + output-low; + }; + }; + + ledc0_default: ledc0_default { + group1 { + pinmux = ; + output-enable; + }; + }; +}; diff --git a/boards/lilygo/twatch_s3/twatch_s3_appcpu.dts b/boards/lilygo/twatch_s3/twatch_s3_appcpu.dts new file mode 100644 index 0000000000000..35d19fc17b1ca --- /dev/null +++ b/boards/lilygo/twatch_s3/twatch_s3_appcpu.dts @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025 BayLibre SAS + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include + +/ { + model = "T-Watch S3 APPCPU"; + compatible = "espressif,esp32s3"; + + chosen { + zephyr,sram = &sram0; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_appcpu_partition; + }; +}; + +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; + +&trng0 { + status = "okay"; +}; + +&ipm0 { + status = "okay"; +}; diff --git a/boards/lilygo/twatch_s3/twatch_s3_appcpu.yaml b/boards/lilygo/twatch_s3/twatch_s3_appcpu.yaml new file mode 100644 index 0000000000000..e834a090c9fc9 --- /dev/null +++ b/boards/lilygo/twatch_s3/twatch_s3_appcpu.yaml @@ -0,0 +1,27 @@ +identifier: twatch_s3/esp32s3/appcpu +name: T-Watch S3 APPCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - uart +testing: + ignore_tags: + - net + - bluetooth + - flash + - cpp + - posix + - watchdog + - logging + - kernel + - pm + - gpio + - crypto + - eeprom + - heap + - cmsis_rtos + - jwt + - zdsp +vendor: lilygo diff --git a/boards/lilygo/twatch_s3/twatch_s3_appcpu_defconfig b/boards/lilygo/twatch_s3/twatch_s3_appcpu_defconfig new file mode 100644 index 0000000000000..48546641cadd6 --- /dev/null +++ b/boards/lilygo/twatch_s3/twatch_s3_appcpu_defconfig @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CLOCK_CONTROL=y diff --git a/boards/lilygo/twatch_s3/twatch_s3_procpu.dts b/boards/lilygo/twatch_s3/twatch_s3_procpu.dts new file mode 100644 index 0000000000000..b78676a8b0a0b --- /dev/null +++ b/boards/lilygo/twatch_s3/twatch_s3_procpu.dts @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2025 BayLibre SAS + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include "twatch_s3-pinctrl.dtsi" +#include +#include + +/ { + model = "T-Watch S3 PROCPU"; + compatible = "espressif,esp32s3"; + + aliases { + i2c-0 = &i2c0; + i2c-1 = &i2c1; + watchdog0 = &wdt0; + rtc = &pfc8563_rtc; + pwm-led0 = &backlight_pwm; + }; + + chosen { + zephyr,sram = &sram0; + zephyr,console = &usb_serial; + zephyr,shell-uart = &usb_serial; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + zephyr,bt-hci = &esp32_bt_hci; + zephyr,display = &st7789v; + zephyr,touch = &ft5336; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + }; + + mipi_dbi { + compatible = "zephyr,mipi-dbi-spi"; + dc-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; + spi-dev = <&spi3>; + write-only; + #address-cells = <1>; + #size-cells = <0>; + + st7789v: st7789v@0 { + compatible = "sitronix,st7789v"; + mipi-max-frequency = <20000000>; + mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE"; + reg = <0>; + width = <240>; + height = <240>; + x-offset = <0>; + y-offset = <80>; + mdac = <0xc8>; + ram-param = [00 e0]; + colmod = <0x55>; + porch-param = [0c 0c 00 33 33]; + gctrl = <0x35>; + vcom = <0x28>; + lcm = <0x0c>; + vrhs = <0x10>; + vdvs = <0x20>; + pwctrl1-param = [a4 a1]; + pvgam-param = [d0 00 02 07 0a 28 32 44 42 06 0e 12 14 17]; + nvgam-param = [d0 00 02 07 0a 28 31 54 47 0e 1c 17 1b 1e]; + /* Values below are not set by the eTFT_SPI driver from + * LilyGO. Therefore let's keep ST7789V values. + */ + gamma = <0x01>; + cmd2en-param = [5a 69 02 00]; + rgb-param = [40 02 14]; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + + backlight_pwm: pwm_0 { + label = "LCD backlight PWM"; + pwms = <&ledc0 0 PWM_HZ(100) PWM_POLARITY_NORMAL>; + }; + }; + + lvgl_pointer { + compatible = "zephyr,lvgl-pointer-input"; + input = <&ft5336>; + swap-xy; + }; +}; + +&ledc0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&ledc0_default>; + pinctrl-names = "default"; + + channel0@0 { + reg = <0x0>; + timer = <0>; + }; +}; + +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim3_default>; + pinctrl-names = "default"; +}; + +&i2c0 { + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + status = "okay"; + + pfc8563_rtc: pfc8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + status = "okay"; + }; + + bma423: bma423@19 { + compatible = "bosch,bma4xx"; + reg = <0x19>; + status = "okay"; + int1-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + haptic: drv2605@5a { + compatible = "ti,drv2605"; + reg = <0x5a>; + status = "okay"; + actuator-mode = "ERM"; + }; + + axp2101@34 { + compatible = "x-powers,axp2101"; + reg = <0x34>; + + charger { + compatible = "x-powers,axp2101-charger"; + constant-charge-current-max-microamp = <300000>; + constant-charge-voltage-max-microvolt = <4200000>; + charge-term-current-microamp = <100000>; + vbackup-enable; + }; + + regulators { + compatible = "x-powers,axp2101-regulator"; + + dcdc1 { + regulator-min-microvolt = <3300000>; + regulator-init-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + dcdc2 { + regulator-boot-off; + }; + + dcdc3 { + regulator-min-microvolt = <3300000>; + regulator-init-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + dcdc4 { + regulator-boot-off; + }; + + dcdc5 { + regulator-boot-off; + }; + + aldo1 { + regulator-min-microvolt = <3300000>; + regulator-init-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + aldo2 { + regulator-min-microvolt = <3300000>; + regulator-init-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + aldo3 { + regulator-min-microvolt = <3300000>; + regulator-init-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + aldo4 { + regulator-min-microvolt = <3300000>; + regulator-init-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + bldo1 { + regulator-boot-off; + }; + + bldo2 { + regulator-min-microvolt = <3300000>; + regulator-init-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + cplusldo { + regulator-boot-off; + }; + + dldo1 { + regulator-boot-off; + }; + + dldo2 { + regulator-boot-off; + }; + }; + }; +}; + +&i2c1 { + clock-frequency = ; + pinctrl-0 = <&i2c1_default>; + pinctrl-names = "default"; + status = "okay"; + + ft5336: ft5336@38 { + compatible = "focaltech,ft5336"; + reg = <0x38>; + int-gpios = <&gpio0 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + reset-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + }; +}; + +&usb_serial { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&esp32_bt_hci { + status = "okay"; +}; + +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; + +&timer0 { + status = "okay"; +}; + +&ipm0 { + status = "okay"; +}; diff --git a/boards/lilygo/twatch_s3/twatch_s3_procpu.yaml b/boards/lilygo/twatch_s3/twatch_s3_procpu.yaml new file mode 100644 index 0000000000000..975c4750ac09f --- /dev/null +++ b/boards/lilygo/twatch_s3/twatch_s3_procpu.yaml @@ -0,0 +1,19 @@ +identifier: twatch_s3/esp32s3/procpu +name: T-Watch S3 PROCPU +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - i2c + - spi + - counter + - watchdog + - entropy + - pwm + - dma + - input + - video + - rtc +vendor: lilygo diff --git a/boards/lilygo/twatch_s3/twatch_s3_procpu_defconfig b/boards/lilygo/twatch_s3/twatch_s3_procpu_defconfig new file mode 100644 index 0000000000000..d8fbaa879257b --- /dev/null +++ b/boards/lilygo/twatch_s3/twatch_s3_procpu_defconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/lowrisc/opentitan_earlgrey/doc/index.rst b/boards/lowrisc/opentitan_earlgrey/doc/index.rst index b91c0700def27..bfc13c1218165 100644 --- a/boards/lowrisc/opentitan_earlgrey/doc/index.rst +++ b/boards/lowrisc/opentitan_earlgrey/doc/index.rst @@ -1,7 +1,4 @@ -.. _opentitan_earlgrey: - -OpenTitan Earl Grey -################### +.. zephyr:board:: opentitan_earlgrey Overview ******** @@ -51,6 +48,8 @@ Other hardware features are not yet supported on Zephyr porting. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + First, build and install Verilator as described in the `OpenTitan Verilator Setup`_ guide . diff --git a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi index f000b61f3162e..1b0a13b77dfeb 100644 --- a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi +++ b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core.dtsi @@ -96,3 +96,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi index 43ee4b452646f..fc3c57e1b9f0d 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi @@ -107,3 +107,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stack_atom_lite/doc/index.rst b/boards/m5stack/m5stack_atom_lite/doc/index.rst index 87e56a236774b..9b84f801fd6f7 100644 --- a/boards/m5stack/m5stack_atom_lite/doc/index.rst +++ b/boards/m5stack/m5stack_atom_lite/doc/index.rst @@ -16,39 +16,7 @@ It features the following integrated components: Supported Features ================== -The Zephyr m5stack_atom_lite board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | reset and clock control | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | rtc | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | independent watchdog | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+-----------+------------+-------------------------------------+ -| die-temp | on-chip | die temperature sensor | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Start Application Development ***************************** @@ -76,6 +44,8 @@ below to retrieve those files. Building & Flashing ------------------- +.. zephyr:board-supported-runners:: + Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts index 012c2b1f8fe7e..226b1d1a00407 100644 --- a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu.dts @@ -147,3 +147,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stack_atoms3/doc/index.rst b/boards/m5stack/m5stack_atoms3/doc/index.rst index 1b863cb08be5e..9cedbfb51805a 100644 --- a/boards/m5stack/m5stack_atoms3/doc/index.rst +++ b/boards/m5stack/m5stack_atoms3/doc/index.rst @@ -18,39 +18,7 @@ It features the following integrated components: Supported Features ================== -The Zephyr m5stack_atoms3 board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | reset and clock control | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | rtc | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | independent watchdog | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+-----------+------------+-------------------------------------+ -| die-temp | on-chip | die temperature sensor | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Start Application Development ***************************** @@ -78,6 +46,8 @@ below to retrieve those files. Building & Flashing ------------------- +.. zephyr:board-supported-runners:: + Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts index ed96340740748..bb81fbbb39ff9 100644 --- a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts +++ b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts @@ -158,3 +158,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stack_atoms3_lite/doc/index.rst b/boards/m5stack/m5stack_atoms3_lite/doc/index.rst index 23af62d96e670..8403358be1e4f 100644 --- a/boards/m5stack/m5stack_atoms3_lite/doc/index.rst +++ b/boards/m5stack/m5stack_atoms3_lite/doc/index.rst @@ -16,39 +16,7 @@ It features the following integrated components: Supported Features ================== -The Zephyr m5stack_atoms3_lite board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | reset and clock control | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | rtc | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | independent watchdog | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+-----------+------------+-------------------------------------+ -| die-temp | on-chip | die temperature sensor | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Start Application Development ***************************** @@ -76,6 +44,8 @@ below to retrieve those files. Building & Flashing ------------------- +.. zephyr:board-supported-runners:: + Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts index c5884a846a156..60bc3d6429a24 100644 --- a/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts +++ b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu.dts @@ -117,3 +117,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stack_core2/Kconfig.defconfig b/boards/m5stack/m5stack_core2/Kconfig.defconfig index c90a78870ba0e..1999b90c5b8d8 100644 --- a/boards/m5stack/m5stack_core2/Kconfig.defconfig +++ b/boards/m5stack/m5stack_core2/Kconfig.defconfig @@ -14,7 +14,7 @@ config GPIO_HOGS_INIT_PRIORITY config MFD_INIT_PRIORITY default 70 -config REGULATOR_AXP192_INIT_PRIORITY +config REGULATOR_AXP192_AXP2101_INIT_PRIORITY default 71 config GPIO_AXP192_INIT_PRIORITY diff --git a/boards/m5stack/m5stack_core2/doc/index.rst b/boards/m5stack/m5stack_core2/doc/index.rst index 9855ef1de5994..fb21227767c44 100644 --- a/boards/m5stack/m5stack_core2/doc/index.rst +++ b/boards/m5stack/m5stack_core2/doc/index.rst @@ -104,39 +104,7 @@ These voltages can be controlled via regulator api. Supported Features ================== -The Zephyr m5stack_core2 board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| CLOCK | on-chip | reset and clock control | -+-----------+------------+-------------------------------------+ -| COUNTER | on-chip | rtc | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | independent watchdog | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| DAC | on-chip | dac | -+-----------+------------+-------------------------------------+ -| die-temp | on-chip | die temperature sensor | -+-----------+------------+-------------------------------------+ - +.. zephyr:board-supported-hw:: Start Application Development ***************************** @@ -164,6 +132,8 @@ below to retrieve those files. Building & Flashing ------------------- +.. zephyr:board-supported-runners:: + Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts index 554e1885488e2..172fb1c6c5df5 100644 --- a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts +++ b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts @@ -87,8 +87,7 @@ }; &psram0 { - reg = <0x3f800000 DT_SIZE_M(8)>; - status = "disabled"; + size = ; }; &uart0 { @@ -191,7 +190,7 @@ ft5336_touch: ft5336@38 { compatible = "focaltech,ft5336"; reg = <0x38>; - int-gpios = <&gpio1 7 0>; + int-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; }; }; @@ -253,3 +252,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stack_core2/m5stack_core2_procpu_defconfig b/boards/m5stack/m5stack_core2/m5stack_core2_procpu_defconfig index 22e46419ab62b..0fcad2e5e26d2 100644 --- a/boards/m5stack/m5stack_core2/m5stack_core2_procpu_defconfig +++ b/boards/m5stack/m5stack_core2/m5stack_core2_procpu_defconfig @@ -1,11 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_ESP_HEAP_MEM_POOL_REGION_1_SIZE=0 - CONFIG_GPIO=y - CONFIG_REGULATOR=y - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/m5stack/m5stack_cores3/doc/index.rst b/boards/m5stack/m5stack_cores3/doc/index.rst index d9025e3f6d8af..2fdd042c38e67 100644 --- a/boards/m5stack/m5stack_cores3/doc/index.rst +++ b/boards/m5stack/m5stack_cores3/doc/index.rst @@ -52,6 +52,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi index 1f0bf306dfca1..842c8afcc5f09 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi @@ -156,3 +156,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stack_stamps3/doc/index.rst b/boards/m5stack/m5stack_stamps3/doc/index.rst index 3762fd49b1cba..4e006eca8a397 100644 --- a/boards/m5stack/m5stack_stamps3/doc/index.rst +++ b/boards/m5stack/m5stack_stamps3/doc/index.rst @@ -134,6 +134,8 @@ below to retrieve those files. Building & Flashing ------------------- +.. zephyr:board-supported-runners:: + Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts index f2733a5719548..d2aa01fa61c75 100644 --- a/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts +++ b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts @@ -156,3 +156,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stickc_plus/Kconfig.defconfig b/boards/m5stack/m5stickc_plus/Kconfig.defconfig index 86819dba82d3a..9399c4d1f328c 100644 --- a/boards/m5stack/m5stickc_plus/Kconfig.defconfig +++ b/boards/m5stack/m5stickc_plus/Kconfig.defconfig @@ -11,7 +11,7 @@ config GPIO_HOGS_INIT_PRIORITY config MFD_INIT_PRIORITY default 70 -config REGULATOR_AXP192_INIT_PRIORITY +config REGULATOR_AXP192_AXP2101_INIT_PRIORITY default 71 config GPIO_AXP192_INIT_PRIORITY diff --git a/boards/m5stack/m5stickc_plus/doc/index.rst b/boards/m5stack/m5stickc_plus/doc/index.rst index f40e21fbd5e63..e6e65a3e1d8f1 100644 --- a/boards/m5stack/m5stickc_plus/doc/index.rst +++ b/boards/m5stack/m5stickc_plus/doc/index.rst @@ -84,6 +84,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts index 6b1a2dd8ba216..2a85c2c0353d1 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts @@ -218,3 +218,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/stamp_c3/doc/index.rst b/boards/m5stack/stamp_c3/doc/index.rst index a953b595b2c79..704bacc6cad90 100644 --- a/boards/m5stack/stamp_c3/doc/index.rst +++ b/boards/m5stack/stamp_c3/doc/index.rst @@ -11,30 +11,7 @@ For more details see the `M5Stack STAMP-C3`_ page. Supported Features ================== -The STAMP-C3 board configuration supports the following hardware features: - -+-----------+------------+------------------+ -| Interface | Controller | Driver/Component | -+===========+============+==================+ -| PMP | on-chip | arch/riscv | -+-----------+------------+------------------+ -| INTMTRX | on-chip | intc_esp32c3 | -+-----------+------------+------------------+ -| PINMUX | on-chip | pinctrl_esp32 | -+-----------+------------+------------------+ -| USB UART | on-chip | serial_esp32_usb | -+-----------+------------+------------------+ -| GPIO | on-chip | gpio_esp32 | -+-----------+------------+------------------+ -| UART | on-chip | uart_esp32 | -+-----------+------------+------------------+ -| I2C | on-chip | i2c_esp32 | -+-----------+------------+------------------+ -| SPI | on-chip | spi_esp32_spim | -+-----------+------------+------------------+ -| TWAI | on-chip | can_esp32_twai | -+-----------+------------+------------------+ - +.. zephyr:board-supported-hw:: Prerequisites ************* @@ -53,6 +30,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== diff --git a/boards/m5stack/stamp_c3/stamp_c3.dts b/boards/m5stack/stamp_c3/stamp_c3.dts index cbd3a3fdd92dd..800ae9f36c05a 100644 --- a/boards/m5stack/stamp_c3/stamp_c3.dts +++ b/boards/m5stack/stamp_c3/stamp_c3.dts @@ -96,3 +96,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/madmachine/mm_feather/doc/index.rst b/boards/madmachine/mm_feather/doc/index.rst index 7c1b985fc7013..c717db21baa9f 100644 --- a/boards/madmachine/mm_feather/doc/index.rst +++ b/boards/madmachine/mm_feather/doc/index.rst @@ -44,33 +44,7 @@ Hardware Supported Features ================== -The mm_feather board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| DISPLAY | on-chip | display | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| I2S | on-chip | I2S | -+-----------+------------+-------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+-------------------------------------+ - - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -166,8 +140,10 @@ The Swift ID is not the same as the Zephyr driver ID. +-----------+---------------+----------+---------------+----------+---------------+ -Programming and Flash -************************* +Programming and Flashing +************************ + +.. zephyr:board-supported-runners:: Build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/madmachine/mm_feather/mm_feather.dts b/boards/madmachine/mm_feather/mm_feather.dts index 0b655edd1c292..ea9dd21d797a9 100644 --- a/boards/madmachine/mm_feather/mm_feather.dts +++ b/boards/madmachine/mm_feather/mm_feather.dts @@ -56,6 +56,7 @@ &flexspi { + status = "okay"; reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(8)>; is25wp064: is25wp064@0 { compatible = "nxp,imx-flexspi-nor"; diff --git a/boards/madmachine/mm_swiftio/doc/index.rst b/boards/madmachine/mm_swiftio/doc/index.rst index 6845fa1fa3602..80cff7d6c96f2 100644 --- a/boards/madmachine/mm_swiftio/doc/index.rst +++ b/boards/madmachine/mm_swiftio/doc/index.rst @@ -26,31 +26,7 @@ Hardware Supported Features ================== -The mm_swiftio board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| DISPLAY | on-chip | display | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| USB | on-chip | USB device | -+-----------+------------+-------------------------------------+ - - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -166,10 +142,12 @@ The Swift ID is not the same as the Zephyr driver ID. +-----------+---------------+----------+---------------+----------+---------------+ -Programming and Flash -************************* +Programming and Flashing +************************ + +.. zephyr:board-supported-runners:: -Build applications as usual (see :ref:`build_an_application` for more details). +Build applications as usual (see :ref:`build_an_application` for more details). Configuring a Debug Probe ========================= diff --git a/boards/madmachine/mm_swiftio/mm_swiftio.dts b/boards/madmachine/mm_swiftio/mm_swiftio.dts index cbdf85c3c12e6..814c448c1d86a 100644 --- a/boards/madmachine/mm_swiftio/mm_swiftio.dts +++ b/boards/madmachine/mm_swiftio/mm_swiftio.dts @@ -56,6 +56,7 @@ &flexspi { + status = "okay"; reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(8)>; is25wp064: is25wp064@0 { compatible = "nxp,imx-flexspi-nor"; diff --git a/boards/makerbase/mks_canable_v20/doc/index.rst b/boards/makerbase/mks_canable_v20/doc/index.rst index 0a86e6fa6fcc1..abc27df5189e7 100644 --- a/boards/makerbase/mks_canable_v20/doc/index.rst +++ b/boards/makerbase/mks_canable_v20/doc/index.rst @@ -30,27 +30,7 @@ More information about STM32G431KB can be found here: Supported Features ================== -The Zephyr ``mks_canable_v20`` board target supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| USB | on-chip | universal-serial-bus | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| FDCAN | on-chip | can | -+-----------+------------+-------------------------------------+ - -Other hardware features are not yet supported on this Zephyr port. - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/makerbase/mks_canable_v20/mks_canable_v20_defconfig` - +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -84,6 +64,8 @@ The FDCAN1 peripheral is driven by PLLQ, which has 80 MHz frequency. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + MKS CANable V2.0 board includes an SWDIO debug connector header J4. .. note:: diff --git a/boards/makerdiary/nrf52840_mdk_usb_dongle/board.cmake b/boards/makerdiary/nrf52840_mdk_usb_dongle/board.cmake index 1f43fd93827bd..895ec1a36bd93 100644 --- a/boards/makerdiary/nrf52840_mdk_usb_dongle/board.cmake +++ b/boards/makerdiary/nrf52840_mdk_usb_dongle/board.cmake @@ -2,6 +2,7 @@ board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/makerdiary/nrf52840_mdk_usb_dongle/doc/index.rst b/boards/makerdiary/nrf52840_mdk_usb_dongle/doc/index.rst index ac4743c77488c..83b5621bee84b 100644 --- a/boards/makerdiary/nrf52840_mdk_usb_dongle/doc/index.rst +++ b/boards/makerdiary/nrf52840_mdk_usb_dongle/doc/index.rst @@ -3,24 +3,40 @@ Overview ******** -The nRF52840 MDK USB Dongle is a small and low-cost development platform enabled -by the nRF5240 multiprotocol SoC in a convenient USB dongle form factor. +The nRF52840 MDK USB Dongle is a small and low-cost development platform +enabled by the nRF52840 multiprotocol SoC in a convenient USB dongle +form factor. -The design features a programmable user button, RGB LED, up to 12 GPIOs and 2.4G -Chip antenna on board. It can be used as a low-cost -Bluetooth5/Tread/802.15.4/ANT/2.4GHz multiprotocol node or development -board. Alternatively the USB Dongle can be used as a Network Co-Processor(NCP) -with a simple connection to a PC or other USB enabled device. +Hardware +******** + +The design features: + +* Programmable user button +* RGB LED +* Up to 12 GPIOs +* 2.4 GHz chip antenna -See `nrf52840-mdk-usb-dongle website`_ for more information about the development -board and `nRF52840 website`_ for the official reference on the IC itself. +The USB Dongle can be used as: +* A low-cost Bluetooth 5/Thread/802.15.4/ANT/2.4GHz multiprotocol node +* A development board +* A Network Co-Processor (NCP) with a simple connection to a PC or other USB enabled device + +For more information: + +* See the `nrf52840-mdk-usb-dongle website`_ for details about the development board +* See the `nRF52840 website`_ for the official reference on the IC itself +* See the `nrf52840-mdk-usb-dongle pinout diagram`_ for details about the pin usage of the board References ********** + .. target-notes:: .. _nRF52840 website: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52840 .. _nrf52840-mdk-usb-dongle website: https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/ +.. _nrf52840-mdk-usb-dongle pinout diagram: + https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/assets/attachments/nrf52840-mdk-usb-dongle-pinout_v1_1.pdf diff --git a/boards/mediatek/mt8186/afe-mt8186.dts b/boards/mediatek/mt8186/afe-mt8186.dts index c4d16826b81d4..e6bd2ac557ccc 100644 --- a/boards/mediatek/mt8186/afe-mt8186.dts +++ b/boards/mediatek/mt8186/afe-mt8186.dts @@ -1,7 +1,7 @@ afe_dl1: afe_dl1 { compatible = "mediatek,afe"; - afe_name = "DL1"; - dai_id = <0>; + afe-name = "DL1"; + dai-id = <0>; downlink; base = <0x11210050 0x11210054>; cur = <0x11210058 0x1121005c>; @@ -14,8 +14,8 @@ afe_dl2: afe_dl2 { compatible = "mediatek,afe"; - afe_name = "DL2"; - dai_id = <1>; + afe-name = "DL2"; + dai-id = <1>; downlink; base = <0x1121006c 0x11210070>; cur = <0x11210074 0x11210078>; @@ -28,22 +28,22 @@ afe_ul1: afe_ul1 { compatible = "mediatek,afe"; - afe_name = "UL1"; - dai_id = <2>; + afe-name = "UL1"; + dai-id = <2>; base = <0x11210378 0x1121037c>; cur = <0x11210380 0x11210384>; end = <0x11210388 0x1121038c>; fs = <0x11210374 24 4>; mono = <0x11210374 8 1>; - quad_ch = <0x11210374 11 1>; + quad-ch = <0x11210374 11 1>; enable = <0x11210010 31 1>; hd = <0x11210374 0 1>; }; afe_ul2: afe_ul2 { compatible = "mediatek,afe"; - afe_name = "UL2"; - dai_id = <3>; + afe-name = "UL2"; + dai-id = <3>; base = <0x11210860 0x11210864>; cur = <0x11210868 0x1121086c>; end = <0x11210870 0x11210874>; diff --git a/boards/mediatek/mt8188/afe-mt8188.dts b/boards/mediatek/mt8188/afe-mt8188.dts index 41daf54f62c79..fbe47f5a2b4dd 100644 --- a/boards/mediatek/mt8188/afe-mt8188.dts +++ b/boards/mediatek/mt8188/afe-mt8188.dts @@ -1,7 +1,7 @@ afe_dl2: afe_dl2 { compatible = "mediatek,afe"; - afe_name = "DL2"; - dai_id = <0>; + afe-name = "DL2"; + dai-id = <0>; downlink; base = <0x00000000 0x10b11250>; cur = <0x00000000 0x10b11254>; @@ -11,14 +11,14 @@ hd = <0x10b1125c 5 1>; msb = <0x10b1192c 18 1>; msb2 = <0x10b11930 18 1>; - agent_disable = <0x10b10014 18 1>; - ch_num = <0x10b1125c 0 5>; + agent-disable = <0x10b10014 18 1>; + ch-num = <0x10b1125c 0 5>; }; afe_dl3: afe_dl3 { compatible = "mediatek,afe"; - afe_name = "DL3"; - dai_id = <1>; + afe-name = "DL3"; + dai-id = <1>; downlink; base = <0x00000000 0x10b11260>; cur = <0x00000000 0x10b11264>; @@ -28,40 +28,40 @@ hd = <0x10b1126c 5 1>; msb = <0x10b1192c 19 1>; msb2 = <0x10b11930 19 1>; - agent_disable = <0x10b10014 19 1>; - ch_num = <0x10b1126c 0 5>; + agent-disable = <0x10b10014 19 1>; + ch-num = <0x10b1126c 0 5>; }; afe_ul4: afe_ul4 { compatible = "mediatek,afe"; - afe_name = "UL4"; - dai_id = <2>; + afe-name = "UL4"; + dai-id = <2>; base = <0x00000000 0x10b11330>; cur = <0x00000000 0x10b11334>; end = <0x00000000 0x10b11338>; fs = <0x10b115a8 15 5>; mono = <0x10b1133c 1 1>; - int_odd = <0x10b1133c 0 1>; + int-odd = <0x10b1133c 0 1>; enable = <0x10b11200 4 1>; hd = <0x10b1133c 5 1>; msb = <0x10b1192c 3 1>; msb2 = <0x10b11930 3 1>; - agent_disable = <0x10b10014 3 1>; + agent-disable = <0x10b10014 3 1>; }; afe_ul5: afe_ul5 { compatible = "mediatek,afe"; - afe_name = "UL5"; - dai_id = <3>; + afe-name = "UL5"; + dai-id = <3>; base = <0x00000000 0x10b11340>; cur = <0x00000000 0x10b11344>; end = <0x00000000 0x10b11348>; fs = <0x10b115a8 20 5>; mono = <0x10b1134c 1 1>; - int_odd = <0x10b1134c 0 1>; + int-odd = <0x10b1134c 0 1>; enable = <0x10b11200 5 1>; hd = <0x10b1134c 5 1>; msb = <0x10b1192c 4 1>; msb2 = <0x10b11930 4 1>; - agent_disable = <0x10b10014 4 1>; + agent-disable = <0x10b10014 4 1>; }; diff --git a/boards/mediatek/mt8195/afe-mt8195.dts b/boards/mediatek/mt8195/afe-mt8195.dts index f51f1a783e362..37b335754df4d 100644 --- a/boards/mediatek/mt8195/afe-mt8195.dts +++ b/boards/mediatek/mt8195/afe-mt8195.dts @@ -1,7 +1,7 @@ afe_dl2: afe_dl2 { compatible = "mediatek,afe"; - afe_name = "DL2"; - dai_id = <0>; + afe-name = "DL2"; + dai-id = <0>; downlink; base = <0x00000000 0x10891250>; cur = <0x00000000 0x10891254>; @@ -11,14 +11,14 @@ hd = <0x1089125c 5 1>; msb = <0x1089192c 18 1>; msb2 = <0x10891930 18 1>; - agent_disable = <0x10890014 18 1>; - ch_num = <0x1089125c 0 5>; + agent-disable = <0x10890014 18 1>; + ch-num = <0x1089125c 0 5>; }; afe_dl3: afe_dl3 { compatible = "mediatek,afe"; - afe_name = "DL3"; - dai_id = <1>; + afe-name = "DL3"; + dai-id = <1>; downlink; base = <0x00000000 0x10891260>; cur = <0x00000000 0x10891264>; @@ -28,14 +28,14 @@ hd = <0x1089126c 5 1>; msb = <0x1089192c 19 1>; msb2 = <0x10891930 19 1>; - agent_disable = <0x10890014 19 1>; - ch_num = <0x1089126c 0 5>; + agent-disable = <0x10890014 19 1>; + ch-num = <0x1089126c 0 5>; }; afe_ul4: afe_ul4 { compatible = "mediatek,afe"; - afe_name = "UL4"; - dai_id = <2>; + afe-name = "UL4"; + dai-id = <2>; base = <0x00000000 0x10891330>; cur = <0x00000000 0x10891334>; end = <0x00000000 0x10891338>; @@ -45,13 +45,13 @@ hd = <0x1089133c 5 1>; msb = <0x1089192c 3 1>; msb2 = <0x10891930 3 1>; - agent_disable = <0x10890014 3 1>; + agent-disable = <0x10890014 3 1>; }; afe_ul5: afe_ul5 { compatible = "mediatek,afe"; - afe_name = "UL5"; - dai_id = <3>; + afe-name = "UL5"; + dai-id = <3>; base = <0x00000000 0x10891340>; cur = <0x00000000 0x10891344>; end = <0x00000000 0x10891348>; @@ -61,5 +61,5 @@ hd = <0x1089134c 5 1>; msb = <0x1089192c 4 1>; msb2 = <0x10891930 4 1>; - agent_disable = <0x10890014 4 1>; + agent-disable = <0x10890014 4 1>; }; diff --git a/boards/mediatek/mt8196/afe-mt8196.dts b/boards/mediatek/mt8196/afe-mt8196.dts index fba314a61e37d..a28d9f658e168 100644 --- a/boards/mediatek/mt8196/afe-mt8196.dts +++ b/boards/mediatek/mt8196/afe-mt8196.dts @@ -1,7 +1,7 @@ afe_dl1: afe_dl1 { compatible = "mediatek,afe"; - afe_name = "DL1"; - dai_id = <1>; + afe-name = "DL1"; + dai-id = <1>; downlink; base = <0x1a114470 0x1a114474>; cur = <0x1a114478 0x1a11447c>; @@ -14,8 +14,8 @@ afe_dl_24ch: afe_dl_24ch { compatible = "mediatek,afe"; - afe_name = "DL_24CH"; - dai_id = <0>; + afe-name = "DL_24CH"; + dai-id = <0>; downlink; base = <0x1a114620 0x1a114624>; cur = <0x1a114628 0x1a11462c>; @@ -23,13 +23,13 @@ fs = <0x1a114640 8 5>; enable = <0x1a114640 31 1>; hd = <0x1a114640 0 1>; - ch_num = <0x1a114640 24 6>; + ch-num = <0x1a114640 24 6>; }; afe_ul0: afe_ul0 { compatible = "mediatek,afe"; - afe_name = "UL0"; - dai_id = <2>; + afe-name = "UL0"; + dai-id = <2>; base = <0x1a114d60 0x1a114d64>; cur = <0x1a114d68 0x1a114d6c>; end = <0x1a114d70 0x1a114d74>; @@ -41,8 +41,8 @@ afe_ul1: afe_ul1 { compatible = "mediatek,afe"; - afe_name = "UL1"; - dai_id = <3>; + afe-name = "UL1"; + dai-id = <3>; base = <0x1a114d90 0x1a114d94>; cur = <0x1a114d98 0x1a114d9c>; end = <0x1a114da0 0x1a114da4>; @@ -54,8 +54,8 @@ afe_ul2: afe_ul2 { compatible = "mediatek,afe"; - afe_name = "UL2"; - dai_id = <4>; + afe-name = "UL2"; + dai-id = <4>; base = <0x1a114dc0 0x1a114dc4>; cur = <0x1a114dc8 0x1a114dcc>; end = <0x1a114dd0 0x1a114dd4>; diff --git a/boards/microchip/ev11l78a/doc/index.rst b/boards/microchip/ev11l78a/doc/index.rst index 95d05add0c0e4..15661123062ab 100644 --- a/boards/microchip/ev11l78a/doc/index.rst +++ b/boards/microchip/ev11l78a/doc/index.rst @@ -20,51 +20,10 @@ Hardware Supported Features ================== -The ev11l78a board configuration supports the following hardware -features: - - -.. list-table:: - :header-rows: 1 - - * - Interface - - Controller - - Driver / Component - * - NVIC - - on-chip - - nested vector interrupt controller - * - Flash - - on-chip - - Can be used with LittleFS to store files - * - SYSTICK - - on-chip - - systick - * - WDT - - on-chip - - Watchdog - * - ADC - - on-chip - - Analog to Digital Converter - * - GPIO - - on-chip - - I/O ports - * - USART - - on-chip - - Serial ports - * - I2C - - on-chip - - I2C ports - * - SPI - - on-chip - - Serial Peripheral Interface ports - -Other hardware features are not currently supported by Zephyr. +.. zephyr:board-supported-hw:: Refer to the `EV11L78A Schematics`_ for a detailed hardware diagram. -The default configuration can be found in the Kconfig -:zephyr_file:`boards/microchip/ev11l78a/ev11l78a_defconfig`. - Serial Port =========== diff --git a/boards/microchip/m2gl025_miv/doc/index.rst b/boards/microchip/m2gl025_miv/doc/index.rst index 88a4fa2b9512a..d48d0bebcab33 100644 --- a/boards/microchip/m2gl025_miv/doc/index.rst +++ b/boards/microchip/m2gl025_miv/doc/index.rst @@ -11,6 +11,8 @@ More information can be found on Programming and debugging ************************* +.. zephyr:board-supported-runners:: + Building ======== diff --git a/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig b/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig index 0ca8a90ad4846..0b7eb516d7e8e 100644 --- a/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig +++ b/boards/microchip/mec1501modular_assy6885/Kconfig.defconfig @@ -3,40 +3,11 @@ if BOARD_MEC1501MODULAR_ASSY6885 -config INPUT - default y if KSCAN - #PS/2 driver is compiled in terms of this flag. config ESPI_PERIPHERAL_8042_KBC default y depends on ESPI_XEC -if RTOS_TIMER - -# XEC RTOS timer HW frequency is fixed at 32768 -# The driver requires tickless mode and ticks per -# second to be 32768 for accurate operation. - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 32768 - -config SYS_CLOCK_TICKS_PER_SEC - default 32768 - -endif # RTOS_TIMER - -if !RTOS_TIMER - -# If RTOS timer is not enabled we use ARM Cortex-M -# SYSTICK. SYSTICK frequency is 48MHz divided by -# SOC_MEC1501_PROC_CLK_DIV. - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 48000000 - -config SYS_CLOCK_TICKS_PER_SEC - default 1000 - if ESPI config ESPI_PERIPHERAL_UART_SOC_MAPPING @@ -44,6 +15,4 @@ config ESPI_PERIPHERAL_UART_SOC_MAPPING endif # ESPI -endif # RTOS_TIMER - endif # BOARD_MEC1501MODULAR_ASSY6885 diff --git a/boards/microchip/mec1501modular_assy6885/doc/index.rst b/boards/microchip/mec1501modular_assy6885/doc/index.rst index 910ba104da130..8a65f87136033 100644 --- a/boards/microchip/mec1501modular_assy6885/doc/index.rst +++ b/boards/microchip/mec1501modular_assy6885/doc/index.rst @@ -45,44 +45,7 @@ For more information about the SOC please see the `MEC152x Reference Manual`_ Supported Features ================== -The mec1501modular_assy6885 board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| ESPI | on-chip | espi | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| RTOS | on-chip | timer | -+-----------+------------+-------------------------------------+ -| TIMER | on-chip | counter | -+-----------+------------+-------------------------------------+ -| PWM | on-chip | pwm | -+-----------+------------+-------------------------------------+ -| ADC | on-chip | adc | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| PS2 | on-chip | ps2 | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr (at the moment) - -The default configuration can be found in the -:zephyr_file:`boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885_defconfig` -Kconfig file. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -225,6 +188,8 @@ Jumper location map Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Setup ===== diff --git a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts index c259a7a44cdcf..7c5c131cf52a5 100644 --- a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts +++ b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.dts @@ -17,7 +17,6 @@ zephyr,sram = &sram0; zephyr,console = &uart1; zephyr,flash = &flash0; - zephyr,keyboard-scan = &kscan_input; }; aliases { @@ -26,7 +25,6 @@ i2c0 = &i2c_smb_0; i2c1 = &i2c_smb_1; - kscan0 = &kscan_input; watchdog0 = &wdog; }; }; @@ -70,9 +68,9 @@ &espi0 { status = "okay"; - io_girq = <19>; - vw_girqs = <24 25>; - pc_girq = <15>; + io-girq = <19>; + vw-girqs = <24 25>; + pc-girq = <15>; pinctrl-0 = < &espi_reset_n_gpio061 &espi_cs_n_gpio066 &espi_alert_n_gpio063 &espi_clk_gpio065 &espi_io0_gpio070 &espi_io1_gpio071 @@ -120,10 +118,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { diff --git a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml index d78477f825f43..da7c46a8a545b 100644 --- a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml +++ b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885.yaml @@ -21,6 +21,5 @@ supported: - i2c - pwm - watchdog - - kscan - tach vendor: microchip diff --git a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885_defconfig b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885_defconfig index 3039d18174eb9..164cb7182e764 100644 --- a/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885_defconfig +++ b/boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885_defconfig @@ -7,12 +7,9 @@ # Make sure external power management setup is as indicated in documentation CONFIG_SOC_MEC1501_VTR3_1_8V=y CONFIG_SOC_MEC1501_VCI_PINS_AS_GPIOS=n -CONFIG_RTOS_TIMER=y CONFIG_CLOCK_CONTROL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_GPIO=y - -CONFIG_PM=y diff --git a/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig b/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig index 229ba41dff778..01a7081bcf412 100644 --- a/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig +++ b/boards/microchip/mec15xxevb_assy6853/Kconfig.defconfig @@ -3,40 +3,8 @@ if BOARD_MEC15XXEVB_ASSY6853 -config INPUT - default y if KSCAN - config ESPI_XEC default y depends on ESPI -if RTOS_TIMER - -# XEC RTOS timer HW frequency is fixed at 32768 -# The driver requires tickless mode and ticks per -# second to be 32768 for accurate operation. - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 32768 - -config SYS_CLOCK_TICKS_PER_SEC - default 32768 - -endif # RTOS_TIMER - -if !RTOS_TIMER - -# If RTOS timer is not enabled we use ARM Cortex-M -# SYSTICK. SYSTICK frequency is 48MHz divided by -# SOC_MEC1501_PROC_CLK_DIV. -# - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 48000000 - -config SYS_CLOCK_TICKS_PER_SEC - default 1000 - -endif # RTOS_TIMER - endif # BOARD_MEC15XXEVB_ASSY6853 diff --git a/boards/microchip/mec15xxevb_assy6853/doc/index.rst b/boards/microchip/mec15xxevb_assy6853/doc/index.rst index c712d74b563db..9a3c9e22aeb2f 100644 --- a/boards/microchip/mec15xxevb_assy6853/doc/index.rst +++ b/boards/microchip/mec15xxevb_assy6853/doc/index.rst @@ -42,38 +42,7 @@ For more information about the SOC's please see `MEC152x Reference Manual`_ Supported Features ================== -The mec15xxevb_assy6853 board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| PS/2 | on-chip | ps2 | -+-----------+------------+-------------------------------------+ -| KSCAN | on-chip | kscan | -+-----------+------------+-------------------------------------+ -| TACH | on-chip | tachometer | -+-----------+------------+-------------------------------------+ - - - - -Other hardware features are not currently supported by Zephyr (at the moment) - -The default configuration can be found in the -:zephyr_file:`boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853_defconfig` Kconfig file. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -233,6 +202,8 @@ in reference section below. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Setup ===== #. If you use Dediprog SF100 programmer, then setup it. diff --git a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts index 161536c867def..fbc1aa677af0a 100644 --- a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts +++ b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.dts @@ -16,7 +16,6 @@ zephyr,sram = &sram0; zephyr,console = &uart2; zephyr,flash = &flash0; - zephyr,keyboard-scan = &kscan_input; }; aliases { @@ -29,7 +28,6 @@ i2c-0 = &i2c_smb_0; i2c1 = &i2c_smb_1; i2c7 = &i2c_smb_2; - kscan0 = &kscan_input; watchdog0 = &wdog; }; @@ -123,9 +121,9 @@ &espi0 { status = "okay"; - io_girq = <19>; - vw_girqs = <24 25>; - pc_girq = <15>; + io-girq = <19>; + vw-girqs = <24 25>; + pc-girq = <15>; pinctrl-0 = < &espi_reset_n_gpio061 &espi_cs_n_gpio066 &espi_alert_n_gpio063 &espi_clk_gpio065 &espi_io0_gpio070 &espi_io1_gpio071 @@ -177,10 +175,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &peci0 { @@ -192,8 +186,8 @@ &spi0 { status = "okay"; - port_sel = <0>; - chip_select = <0>; + port-sel = <0>; + chip-select = <0>; lines = <1>; pinctrl-0 = < &shd_cs0_n_gpio055 &shd_clk_gpio056 diff --git a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml index 8b8190d20d81e..afd985cb020b8 100644 --- a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml +++ b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml @@ -21,5 +21,4 @@ supported: - i2c - pwm - watchdog - - kscan vendor: microchip diff --git a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853_defconfig b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853_defconfig index 51e8498df60ed..731a1c2d63fe8 100644 --- a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853_defconfig +++ b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853_defconfig @@ -5,13 +5,9 @@ # CONFIG_SOC_MEC1501_VTR3_1_8V=y -CONFIG_RTOS_TIMER=y CONFIG_CLOCK_CONTROL=y CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_GPIO=y - -# power management stuff -CONFIG_PM=y diff --git a/boards/microchip/mec172xevb_assy6906/Kconfig.defconfig b/boards/microchip/mec172xevb_assy6906/Kconfig.defconfig deleted file mode 100644 index 2c93b83e744df..0000000000000 --- a/boards/microchip/mec172xevb_assy6906/Kconfig.defconfig +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2021 Microchip Technology Inc. -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_MEC172XEVB_ASSY6906 - -config INPUT - default y if KSCAN - -if RTOS_TIMER - -# XEC RTOS timer HW frequency is fixed at 32768 Hz. -# The driver requires tickless mode and ticks per second to be 32768 for -# accurate operation. - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 32768 - -config SYS_CLOCK_TICKS_PER_SEC - default 32768 - -endif # RTOS_TIMER - -if !RTOS_TIMER - -# If RTOS timer is not enabled we use ARM Cortex-M -# SYSTICK. SYSTICK frequency is 96 MHz divided down by the MEC172x PCR -# processor clock divider register. We assume PCR processor clock divider -# is set to 1. Refer to SOC_MEC_PROC_CLK_DIV -# - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 96000000 - -config SYS_CLOCK_TICKS_PER_SEC - default 1000 - -endif # RTOS_TIMER - -endif # BOARD_MEC172XEVB_ASSY6906 diff --git a/boards/microchip/mec172xevb_assy6906/doc/index.rst b/boards/microchip/mec172xevb_assy6906/doc/index.rst index 0671beb414364..b05c4d5bd3ff5 100644 --- a/boards/microchip/mec172xevb_assy6906/doc/index.rst +++ b/boards/microchip/mec172xevb_assy6906/doc/index.rst @@ -36,37 +36,7 @@ For more information about the SOC's please see `MEC172x Reference Manual`_ Supported Features ================== -The mec172xevb_assy6906 board configuration supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| PS/2 | on-chip | ps2 | -+-----------+------------+-------------------------------------+ -| KSCAN | on-chip | kscan | -+-----------+------------+-------------------------------------+ -| TACH | on-chip | tachometer | -+-----------+------------+-------------------------------------+ -| RPMFAN | on-chip | Fan speed controller | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr. - -The default configuration can be found in the -:zephyr_file:`boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906_defconfig` Kconfig file. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -260,6 +230,8 @@ NOTE: ``JP121 3-4`` on base board also needs to be loaded. Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Setup ===== diff --git a/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts b/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts index 076e84eda6002..bc2ad391664a1 100644 --- a/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts +++ b/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts @@ -233,10 +233,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &ksi0_gpio017 { diff --git a/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906_defconfig b/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906_defconfig index d1aeaeaac581f..f2b72ae4282f4 100644 --- a/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906_defconfig +++ b/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906_defconfig @@ -4,8 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 # -CONFIG_RTOS_TIMER=y - CONFIG_CLOCK_CONTROL=y CONFIG_GPIO=y CONFIG_SERIAL=y diff --git a/boards/microchip/mec172xmodular_assy6930/CMakeLists.txt b/boards/microchip/mec172xmodular_assy6930/CMakeLists.txt index 92626f6319fb0..6e36ea0dec8e4 100644 --- a/boards/microchip/mec172xmodular_assy6930/CMakeLists.txt +++ b/boards/microchip/mec172xmodular_assy6930/CMakeLists.txt @@ -4,8 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library() - #Allow users to pre-specify the tool using '-DMEC172X_SPI_GEN=/toolname' if (NOT DEFINED MEC172X_SPI_GEN) set(MEC172X_SPI_GEN $ENV{MEC172X_SPI_GEN}) diff --git a/boards/microchip/mec172xmodular_assy6930/Kconfig.defconfig b/boards/microchip/mec172xmodular_assy6930/Kconfig.defconfig deleted file mode 100644 index c3487f561e992..0000000000000 --- a/boards/microchip/mec172xmodular_assy6930/Kconfig.defconfig +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2022 Microchip Technology Inc. -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_MEC172XMODULAR_ASSY6930 - -config INPUT - default y if KSCAN - -if RTOS_TIMER - -# XEC RTOS timer HW frequency is fixed at 32768 Hz. -# The driver requires tickless mode and ticks per second to be 32768 for -# accurate operation. - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 32768 - -config SYS_CLOCK_TICKS_PER_SEC - default 32768 - -endif # RTOS_TIMER - -if !RTOS_TIMER - -# If RTOS timer is not enabled we use ARM Cortex-M -# SYSTICK. SYSTICK frequency is 96 MHz divided down by the MEC172x PCR -# processor clock divider register. We assume PCR processor clock divider -# is set to 1. Refer to SOC_MEC_PROC_CLK_DIV -# - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 96000000 - -config SYS_CLOCK_TICKS_PER_SEC - default 1000 - -endif # RTOS_TIMER - -endif # BOARD_MEC172XMODULAR_ASSY6930 diff --git a/boards/microchip/mec172xmodular_assy6930/doc/mec172xmodular_assy6930.rst b/boards/microchip/mec172xmodular_assy6930/doc/mec172xmodular_assy6930.rst index a6bc75fc8fb89..18441232c41fc 100644 --- a/boards/microchip/mec172xmodular_assy6930/doc/mec172xmodular_assy6930.rst +++ b/boards/microchip/mec172xmodular_assy6930/doc/mec172xmodular_assy6930.rst @@ -46,36 +46,7 @@ The board is powered through the +5V USB micro-A connector or from the MECC conn Supported Features ================== -The mec172xmodular_assy6930 (Rev. B) board configuration supports the following hardware features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| SYSTICK | on-chip | systick | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| PS/2 | on-chip | ps2 | -+-----------+------------+-------------------------------------+ -| KSCAN | on-chip | kscan | -+-----------+------------+-------------------------------------+ -| TACH | on-chip | tachometer | -+-----------+------------+-------------------------------------+ -| RPMFAN | on-chip | Fan speed controller | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by Zephyr (at the moment) - -The default configuration can be found in the -:zephyr_file:`boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930_defconfig` Kconfig file. +.. zephyr:board-supported-hw:: Connections and IOs =================== @@ -150,6 +121,8 @@ or Master Attached Flash (MAF). Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Setup ===== diff --git a/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts b/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts index 24d600dd04043..e5d7e888baacb 100644 --- a/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts +++ b/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts @@ -211,10 +211,6 @@ pinctrl-names = "default", "sleep"; row-size = <8>; col-size = <16>; - - kscan_input: kscan-input { - compatible = "zephyr,kscan-input"; - }; }; &ksi0_gpio017 { diff --git a/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930_defconfig b/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930_defconfig index c191b0b1555ed..ec6ae819151f2 100644 --- a/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930_defconfig +++ b/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930_defconfig @@ -4,8 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 # -CONFIG_RTOS_TIMER=y - CONFIG_CLOCK_CONTROL=y CONFIG_GPIO=y CONFIG_SERIAL=y diff --git a/boards/microchip/mec_assy6941/CMakeLists.txt b/boards/microchip/mec_assy6941/CMakeLists.txt new file mode 100644 index 0000000000000..84b859f1f1764 --- /dev/null +++ b/boards/microchip/mec_assy6941/CMakeLists.txt @@ -0,0 +1,59 @@ +# +# Copyright (c) 2025 Microchip Technology Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +if(CONFIG_SOC_SERIES_MEC174X) + set(PART_PREFIX mec174x) +elseif(CONFIG_SOC_SERIES_MEC175X) + set(PART_PREFIX mec175x) +else() + message(NOTICE "Unknown SoC series! No SPI image will be generated") +endif() + +if(DEFINED ENV{MEC5_SPI_GEN}) + # Grab it from environment variable if defined + set(MEC5_SPI_GEN $ENV{MEC5_SPI_GEN}) +else() + # Else find the tool in PATH + if(CMAKE_HOST_APPLE) + # CMAKE_HOST_UNIX is also true for Apple, + # but there is no tool for Apple. So + # we need to skip it. + message(NOTICE "There is no SPI image generation tool for MacOS.") + elseif(CMAKE_HOST_UNIX) + set(MEC5_SPI_GEN_FILENAME ${PART_PREFIX}_spi_gen_linux_x86_64) + elseif(CMAKE_HOST_WIN32) + set(MEC5_SPI_GEN_FILENAME ${PART_PREFIX}_spi_gen.exe) + endif() + + find_file(MEC5_SPI_GEN_FINDFILE ${MEC5_SPI_GEN_FILENAME}) + if(MEC5_SPI_GEN_FINDFILE STREQUAL MEC5_SPI_GEN_FINDFILE-NOTFOUND) + message(WARNING "Microchip SPI Image Generation tool (${MEC5_SPI_GEN_FILENAME}) is not available. SPI Image will not be generated.") + else() + set(MEC5_SPI_GEN ${MEC5_SPI_GEN_FINDFILE}) + endif() + + unset(MEC5_SPI_GEN_FINDFILE) + unset(MEC5_SPI_GEN_FILENAME) +endif() + +if(DEFINED MEC5_SPI_GEN) + if(DEFINED ENV{MEC5_SPI_CFG}) + set(MEC5_SPI_CFG $ENV{MEC5_SPI_CFG}) + else() + set(MEC5_SPI_CFG ${BOARD_DIR}/support/${PART_PREFIX}_spi_cfg.txt) + endif() + + set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND ${MEC5_SPI_GEN} + -i ${MEC5_SPI_CFG} + -o ${PROJECT_BINARY_DIR}/${SPI_IMAGE_NAME} + ) + + unset(MEC5_SPI_GEN) + unset(MEC5_SPI_CFG) +endif() + +unset(PART_PREFIX) diff --git a/boards/microchip/mec_assy6941/Kconfig.mec_assy6941 b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941 new file mode 100644 index 0000000000000..85a094ac8d1d7 --- /dev/null +++ b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941 @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MEC_ASSY6941 + select SOC_MEC1743_QLJ if BOARD_MEC_ASSY6941_MEC1743_QLJ + select SOC_MEC1743_QSZ if BOARD_MEC_ASSY6941_MEC1743_QSZ + select SOC_MEC1753_QLJ if BOARD_MEC_ASSY6941_MEC1753_QLJ + select SOC_MEC1753_QSZ if BOARD_MEC_ASSY6941_MEC1753_QSZ diff --git a/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1743_qlj b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1743_qlj new file mode 100644 index 0000000000000..b58c53c2bcc56 --- /dev/null +++ b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1743_qlj @@ -0,0 +1,5 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MEC_ASSY6941_MEC1743_QLJ + select SOC_MEC1743_QLJ diff --git a/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1743_qsz b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1743_qsz new file mode 100644 index 0000000000000..951583698bddb --- /dev/null +++ b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1743_qsz @@ -0,0 +1,5 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MEC_ASSY6941_MEC1743_QSZ + select SOC_MEC1743_QSZ diff --git a/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1753_qlj b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1753_qlj new file mode 100644 index 0000000000000..0ea3dbcffa4b5 --- /dev/null +++ b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1753_qlj @@ -0,0 +1,5 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MEC_ASSY6941_MEC1753_QLJ + select SOC_MEC1753_QLJ diff --git a/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1753_qsz b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1753_qsz new file mode 100644 index 0000000000000..2d631fca2807d --- /dev/null +++ b/boards/microchip/mec_assy6941/Kconfig.mec_assy6941_mec1753_qsz @@ -0,0 +1,5 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MEC_ASSY6941_MEC1753_QSZ + select SOC_MEC1753_QSZ diff --git a/boards/microchip/mec_assy6941/board.cmake b/boards/microchip/mec_assy6941/board.cmake new file mode 100644 index 0000000000000..840168650d460 --- /dev/null +++ b/boards/microchip/mec_assy6941/board.cmake @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: Apache-2.0 + +set(SPI_IMAGE_NAME spi_image.bin) + +board_set_flasher_ifnset(dediprog) + +# --vcc=0 - use 3.5V to flash +board_finalize_runner_args(dediprog + "--spi-image=${PROJECT_BINARY_DIR}/${SPI_IMAGE_NAME}" + "--vcc=0" +) + +# This allows a custom script to be used for flashing the SPI chip. +include(${ZEPHYR_BASE}/boards/common/misc.board.cmake) diff --git a/boards/microchip/mec_assy6941/board.yml b/boards/microchip/mec_assy6941/board.yml new file mode 100644 index 0000000000000..2849b6b8a08f1 --- /dev/null +++ b/boards/microchip/mec_assy6941/board.yml @@ -0,0 +1,9 @@ +board: + name: mec_assy6941 + full_name: MEC17xxEVB ASSY6941 + vendor: microchip + socs: + - name: mec1743_qlj + - name: mec1743_qsz + - name: mec1753_qlj + - name: mec1753_qsz diff --git a/boards/microchip/mec_assy6941/doc/index.rst b/boards/microchip/mec_assy6941/doc/index.rst new file mode 100644 index 0000000000000..da25d132cef0c --- /dev/null +++ b/boards/microchip/mec_assy6941/doc/index.rst @@ -0,0 +1,394 @@ +.. zephyr:board:: mec_assy6941 + +Overview +******** + +The MEC5 Assembly 6941 EVB kit is a development platform to evaluate the Microchip +MEC174x and MEC175x series microcontrollers. This board requires a CPU daughter card: +DC 176WFBGA DC ASSY 6942 for MEC1743Q-LJ or MEC1753Q-LJ (176-pin package) + +Hardware +******** + +- MEC174xQ-LJ/SZ or MEC175xQ-LJ/SZ ARM Cortex-M4 Processor +- 480 KB total SRAM (416 KB code, 64 KB data) and 128 KB boot ROM +- Keyboard interface +- ADC & GPIO headers +- Four DB9 UART connectors +- FAN0, FAN1, FAN2 headers +- FAN PWM interface +- JTAG/SWD, ETM and MCHP Trace ports +- PECI interface 3.0 +- I2C voltage translator +- 10 SMBUS headers +- VCI interface +- Two Hardware Driven PS/2 Port +- eSPI header +- 2 Sockets for SPI NOR chips +- One reset and VCC_PWRDGD pushbuttons +- One external PCA9555 I/O port with jumper selectable I2C address. +- One external LTC2489 delta-sigma ADC with jumper selectable I2C address. +- Board power jumper selectable from +5V 2.1mm/5.5mm barrel connector or USB Micro A connector. +- MEC175x has one I3C Host controller and one I3C secondary controller each with multiple ports. + +For more information about the MEC174x please see `MEC174x Data Brief`_ +For more information about the MEC175x please see `MEC175x Data Brief`_ + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Connections and IOs +=================== + +This evaluation board kit is comprised of the following HW blocks: + +- MEC174x EVB ASSY 6941 Rev B +- MEC174x 176WFBGA SOLDER DC ASSY 6942 with MEC1743Q-LJ or MEC1753Q-LJ silicon +- SPI DONGLE ASSY 6791 + +System Clock +============ + +The MEC174x/MEC175x MCU is configured to use the 96Mhz internal oscillator with the +on-chip PLL to generate a resulting EC clock rate of 96 MHz. See Processor clock +control register in chapter 4 "4.0 POWER, CLOCKS, and RESETS" of the data sheet in +the references at the end of this document. + +Serial Port +=========== + +UART1 is configured for serial logs. + +Jumper settings +*************** + +Please follow the jumper settings below to properly demo this +board. Advanced users may deviate from this recommendation. + +Jumper settings for EVB Assy 6941 Rev B +======================================= + +Power-related jumpers +--------------------- + +If you wish to power from +5V power brick, then connect to barrel connector ``P1`` +(5.5mm OD, 2.1mm ID) and set the jumper ``J1 5-6``. + +If you wish to power from the Host USB micro-USB type A/B connector ``J62``, move the +jumper to ``J1 9-10`` ``J59 1-2`` and ``J61 1-2``. + + +.. note:: A single jumper is required in ``J1``. + +Required power jumpers on: + + * ``JP42 1-2``, ``JP43 1-2``, ``JP45 1-2``, ``JP47 1-2``, ``JP48 1-2`` + * ``JP50 1-2``, ``JP53 1-2``, ``JP56 1-2``, ``JP58 1-2``, ``JP60 1-2`` + * ``JP62 1-2``, ``JP65 1-2``, ``JP66 1-2``, ``JP68 1-2`` + +Select board +3.3V_STBY for: + + * ``JP161 1-2`` VBAT_CHIP power rail + * ``J67 1-2`` VCHIP_VTR_REG power rail + * ``JP157 1-2`` VCHIP_VTR_PLL power rail + * ``JP158 1-2`` VCHIP_VTR_ANALOG power rail + * ``JP159 1-2`` VCHIP_VTR1 power rail + +VCHIP_VTR2 power rail can be +3.3V or +1.8V affecting the pins on VTR2. +NOTE: QSPI shared port pins are on the VTR2 power rail. +Select one only: + + * ``J68 1-2`` VTR2 is connected to +3.3V_STBY + * ``J68 3-4`` VTR2 is connected to +1.8V_STBY + +VCHIP_VTR3 power rail in normal operation is connected to +1.8V. + * ``JP160 1-2`` VTR3 is connected to +1.8V_STBY + +Jumper selection for VCC_PWRGD +VCC_PWRGD is connected to a 4.75K pull-up to VTR1, switch S1 to ground it, +and reset generator U2. + + * ``JP17 3x7 19-20`` + * ``JP19 3x6 8-9`` + * ``JP36 1-2`` + * ``JP34 1-2`` + +Jumper selection for nRESET_IN +nRESET_IN is connected to a 4.75K pull-up to VTR1, switch S2 to ground it, +and reset generator U3. + + * ``JP37 1-2`` + * ``JP35 1-2`` + +Boot-ROM Straps +--------------- + +These jumpers configure MEC174x/MEC175x Boot-ROM straps. + + * ``JP1 1-2`` UART_BSTRAP Normal Boot + * ``JP2 1-2`` CR_STRAP Normal Boot + * ``JP3 2-3`` JTAG_STRAP JTAG/SWD interface is not held in reset + * ``JP4 2-3`` CMP_STRAP GPIO207 is available as a GPIO + * ``JP5 1-2`` PWRGD_STRAP + * ``JP7 1-2`` BSS_STRAP Select eSPI CAF vs G3 if enabled in OTP + * ``JP8 1-2`` BSS_STRAP Default BSS_STRAP. Select load from Shared SPI + * ``JP6 1-2`` VTR2_STRAP + * ``JP9 1-2`` CRISIS_RECOVERY_STRAP + +Peripheral Routing Jumpers +-------------------------- + +UART0 to P19A DB9(top) + + * ``JP89 No jumper`` RS-232 transceiver U8 not in reset. + * ``JP21 2-3, 8-9`` Select UART0_TX and UART0_RX from GPIOs. + * ``JP22 1-2, 4-5`` Select UART0_TX and UART0_RX to U8. + +UART1 to P19B DB9(bottom) + + * ``JP90 No jumper`` RS-232 transceiver U9 not in reset. + * ``JP91 1-2, 4-5`` Connect UART1_TX and UART1_RX to U9. + * ``JP24 2-3, 5-6`` Select UART1_TX and UART1_RX from GPIOs. + +Shared SPI on J18 2x10 header. + + * ``JP18 14-15`` Select SHD_nCS0. + * ``JP18 17-18`` Select SHD_CLK. + * ``JP18 2-3`` Select SHD_IO0. + * ``JP18 5-6`` Select SHD_IO1. + * ``JP18 8-9`` Select SHD_IO2(nWP). + * ``JP18 11-12`` Select SHD_IO3(nHOLD). + +Second chip select for accessing SPI dongle flash U7. + * ``JP18 20-12`` Select SHD_nCS1. + +JTAG/SWD ARM JTAG 2x10 J29. + + * ``JP80 1-2`` No jumper. This jumper holds JTAG/SWD interface in reset. + * ``JP12 2-3`` Select JTAG_TDO or SWO. + * ``JP12 5-6`` Select JTAG_TDI Not required for ARM SWD. + * ``JP12 8-9`` Select JTAG_TMS or SWDIO. + * ``JP12 11-12`` Select JTAG_CLK or SWCLK. + +NOTE: +ARM SWD is a two pin interface using JTAG_TMS as a bidirectional I/O pin and JTAG_CLK. +The ARM Serial Wire Output Trace feature is on a third pin, JTAG_TDO. +Configuration options are: + + 1. 4-pin JTAG or SWD plus SWO. Connect all four JP12 jumpers shown above. + 2. 2-pin SWD plus SWO. Connect JP12 jumpers for JTAG_TDO, JTAG_TMS, and JTAG_CLK. JTAG_TDI is available to use as GPIO145. + 3. 2-pin SWD only. Connect JP12 jumpers for JTAG_TMS and JTAG_CLK. JTAG_TDI and JTAG_TDO are available as GPIO145 and GPIO146 respectively + +Jumper settings for MEC174x/MEC175x 176WFBGA Socket DC Assy 6942 Rev A0p1 +========================================================================= + +The jumper configuration explained above covers the base board. The ASSY +6942 MEC174x/MEC175x CPU board provides capability for an optional, external 32KHz +clock source. The card includes a 32KHz crystal oscillator. The card can +also be configured to use an external 50% duty cycle 32KHz source on the +XTAL2/32KHZ_IN pin. Note, firmware must set the MEC174x/MEC175x clock enable +register to select the external source matching the jumper settings. If +using the MEC174x/MEC175x internal silicon oscillator then the 32K jumper settings +are don't cares. ``JP1`` on DC is for scoping test clock outputs. Please +refer to the schematic in reference section below. + +Parallel 32KHz crystal configuration +------------------------------------ +``JP1 1x2 ON`` +``JP2 1x3 2-3`` + +External 32KHz 50% duty cycle configuration +------------------------------------------- +``JP1 1x2 NC`` +``JP2 1x3 1-2`` + +NOTE: EVB ``JP117 3-4`` Connects 32KHz OSC U15 output to DC. + +Building +======== + +#. Build :zephyr:code-sample:'hello_world` application as you normally do. + +#. The file :file:`spi_image.bin` will be created if the build system + can find the image generation tool. This binary image can be used + to flash the SPI chip. + +Programming and Debugging +========================= + +Setup +===== + +#. Example programming the SPI flash on the Assy6791 SPI dongle. + +#. We use a low cost USB-to-GPIO device based on the FTDI FT232H device. + + The FT232H device used here is the `AdaFruit FT232H`_ + The AdaFruit FT232H supports both 5V and 3.3V parts. + + The linux flashrom tool supports FT232H USB-to-GPIO used as an SPI programmer. + + .. code-block:: console + + $ sudo /usr/sbin/flashrom -V -p ft2232_spi:type=232H,divisor=30 -w spi_image.bin + +#. Clone the `MEC174x SPI Image Gen`_ or `MEC175x SPI Image Gen`_ repository or download the + files within that directory. + +#. Make the image generation available for Zephyr, by making the tool + searchable by path, or by setting an environment variable + ``MEC5_SPI_GEN``, for example: + + .. code-block:: console + + export MEC5_SPI_GEN=/mec174x_spi_gen_linux_x86_64 + or + export MEC5_SPI_GEN=/mec175x_spi_gen_linux_x86_64 + + +#. The default configuration file is mec174x_spi_cfg.txt or mec175x_spi_cfg.txt located in + ${BOARD_DIR}/support. If needed, a custom SPI image configuration file can be specified + to override the default one. + + .. code-block:: console + + export MEC5_SPI_CFG=custom_spi_cfg.txt + +Wiring +======== + +#. Connect the SPI Dongle ASSY 6791 to ``J18`` in the EVB. + + .. image:: spi_dongle_assy6791.webp + :align: center + :alt: SPI DONGLE ASSY 6791 Connected + +#. IMPORTANT: Temporarily remove the jumper from JP87 to isolate SPI dongle power from EVB power rails. + This will prevent the SPI programmer from back driving voltage to the EVB. + +#. Connect programmer to the header J6 on the Assy6791 board, it will flash the SPI NOR chip + ``U3``. + + .. note:: The AdaFruit FT232H board supports +5V or +3.3V SPI flash devices. It has + separate +3V and +5V pins. You should connect the appropriate voltage rail to the + Assy6791 flash dongle's J6-1 power pin. It is recommended to remove the Assy6791 + dongle from the EVB when flashing. If the dongle is attached to an unpowered EVB then + then the SPI programmer will back drive all the components. Back driving voltage can + be avoided by removing the jumper on EVB JP87 disconnecting VTR1/VTR2 from the 2x10 + header J18. + + +------------+---------------+ + | AdaFruit | Assy6791 | + | Connector | J6 Connector | + +============+===============+ + | 3V or 5V | 1 | + +------------+---------------+ + | GND | 2 | + +------------+---------------+ + | D3 | 3 | + +------------+---------------+ + | D0 | 4 | + +------------+---------------+ + | D2 | 6 | + +------------+---------------+ + | D1 | 5 | + +------------+---------------+ + +#. The AdaFruit FT232H has USB type-C connector. Connect it to your + development system with the appropriate USB cable. The FT232H board and + Assy6791 dongle will be powered. + + +Flashing +======== + +#. Run your favorite terminal program + +#. Flash the SPI image created by Microchip SPI image generator during the + zephyr build process. The divisor option flashrom passes to the linux + FT232 driver divides down the 60 MHz SPI clock. You can read the current + SPI image by changing the '-w' option to '-r'. + + .. code-block:: console + + $ sudo /usr/sbin/flashrom -V -p ft2232_spi:type=232H,divisor=30 -w spi_image.bin + + +#. When flashrom completes. + Disconnect USB cable to remove power from the AdaFruit FT232H programmer. + Disconnect FT232H from Assy6791 dongle. + Replace the jumper on EVB JP87. + +# Power on the EVB. + +#. You should see ``"Hello World! "`` in the first terminal window. + If you don't see this message, press the Reset button and the message should appear. + +Debugging +========= + +This board comes with a Cortex ETM port which facilitates tracing and debugging +using a single physical connection. In addition, it comes with sockets for +JTAG only sessions. + +Troubleshooting +=============== + +#. In case you don't see your application running, please make sure ``LED1`` and ``LED2`` + are lit. If one of these is off, then check the power-related jumpers again. + +#. If you suspect the SPI image was not programmed remove the SPI dongle from the EVB + and try flashing it again. + +PCA9555 Enabling +================ +#. To enable PCA9555PW and test the I2C on mec172xevb_assy6906, additional works are needed: + + As the I2C slave device NXP pca95xx on mec172xevb_assy6906 is connected to I2C00 port, + however, I2C00 port is shared with UART2 RS232 to TTL converter used to catch serial log, + so it's not possible to use UART2 and I2C00 port simultaneously. We need to change to use + I2C01 port by making some jumpers setting as below: + + +---------+---------+------------------------------------------+ + | Pin 1 | Pin 2 | Comment | + +=========+=========+==========================================+ + | JP49.1 | JP49.2 | Connect PCA9555 VCC to +3.3V_STBY | + +---------+---------+------------------------------------------+ + | JP53.1 | JP53.2 | Select address 0100b, which means 0x26 | + +---------+---------+------------------------------------------+ + | JP12.13 | JP12.14 | Connect I2C01_SDA from CPU to header J20 | + +---------+---------+------------------------------------------+ + | JP12.4 | JP12.5 | Connect I2C01_SCL from CPU to header J20 | + +---------+---------+------------------------------------------+ + | JP77.7 | JP77.8 | External pull-up for I2C01_SDA | + +---------+---------+------------------------------------------+ + | JP77.9 | JP77.10 | External pull-up for I2C01_SCL | + +---------+---------+------------------------------------------+ + | JP58.1 | JP20.1 | Connect NXP PCA9555 SCL to I2C01 | + +---------+---------+------------------------------------------+ + | JP58.3 | JP20.3 | Connect NXP PCA9555 SDA to I2C01 | + +---------+---------+------------------------------------------+ + +References +********** + +.. target-notes:: + +.. _MEC174x Data Brief: + https://github.com/MicrochipTech/CPGZephyrDocs/blob/main/MEC174x/MEC174x_DataBrief.pdf +.. _MEC175x Data Brief: + https://github.com/MicrochipTech/CPGZephyrDocs/blob/main/MEC175x/MEC175x_DataBrief.pdf +.. _EVB Schematic: + https://github.com/MicrochipTech/CPGZephyrDocs/blob/main/schematics/EVB_Assy6941.pdf +.. _SOC Daughter Card Schematic: + https://github.com/MicrochipTech/CPGZephyrDocs/blob/main/schematics/MEC174x_176WFBGA_DC_6942.pdf +.. _SPI Dongle Schematic: + https://github.com/MicrochipTech/CPGZephyrDocs/blob/main/schematics/SPI_Flash_and_EEPROM_Dongle_Assy6791_Rev_B1p0.pdf +.. _MEC174x SPI Image Gen: + https://github.com/MicrochipTech/CPGZephyrDocs/tree/main/MEC174x/SPI_image_gen +.. _MEC175x SPI Image Gen: + https://github.com/MicrochipTech/CPGZephyrDocs/tree/main/MEC175x/SPI_image_gen +.. _AdaFruit FT232H: + https://www.adafruit.com/product/2264 diff --git a/boards/microchip/mec_assy6941/doc/mec_assy6941_evb.webp b/boards/microchip/mec_assy6941/doc/mec_assy6941_evb.webp new file mode 100644 index 0000000000000..950e721cea87a Binary files /dev/null and b/boards/microchip/mec_assy6941/doc/mec_assy6941_evb.webp differ diff --git a/boards/microchip/mec_assy6941/doc/spi_dongle_assy6791.webp b/boards/microchip/mec_assy6941/doc/spi_dongle_assy6791.webp new file mode 100644 index 0000000000000..f71375f869051 Binary files /dev/null and b/boards/microchip/mec_assy6941/doc/spi_dongle_assy6791.webp differ diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj.dts b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj.dts new file mode 100644 index 0000000000000..a2b52bd505c38 --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj.dts @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025, Microchip Technology Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +/ { + model = "Microchip MEC ASSY6941 MEC1743-QLJ evaluation board"; + compatible = "microchip,mec_assy6941-mec1743_qlj"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart1; + rtimer-busy-wait-timer = &timer5; + }; + + power-states { + idle: idle { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-idle"; + min-residency-us = <1000000>; + }; + + suspend_to_ram: suspend_to_ram { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-ram"; + min-residency-us = <2000000>; + }; + }; +}; + +&cpu0 { + clock-frequency = <96000000>; + status = "okay"; + cpu-power-states = <&idle &suspend_to_ram>; +}; + +/* Disable ARM SysTick kernel timer driver */ +&systick { + status = "disabled"; +}; + +/* Enable MCHP kernel timer driver using 32KHz RTOS timer and 1MHz basic timer */ +&rtimer { + compatible = "microchip,mec5-ktimer"; + status = "okay"; +}; + +/* We chose 32-bit basic timer 5 for use by ktimer */ +&timer5 { + status = "okay"; +}; + +&uart1 { + compatible = "microchip,mec5-uart"; + status = "okay"; + clock-frequency = <1843200>; + current-speed = <115200>; + pinctrl-0 = <&uart1_tx_gpio170 &uart1_rx_gpio171>; + pinctrl-names = "default"; +}; diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj.yaml b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj.yaml new file mode 100644 index 0000000000000..cfdc0564d2ffc --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj.yaml @@ -0,0 +1,27 @@ +# +# Copyright (c) 2025, Microchip Technology Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +identifier: mec_assy6941/mec1743_qlj +name: MEC174X EVB ASSY 6941 with MEC1743-QLJ +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 60 +flash: 416 +supported: + - gpio + - pinctrl + - i2c + - spi +testing: + binaries: + - spi_image.bin + ignore_tags: + - bluetooth + - net +vendor: microchip diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj_defconfig b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj_defconfig new file mode 100644 index 0000000000000..47eaa31ebd3f6 --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qlj_defconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_GPIO=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz.dts b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz.dts new file mode 100644 index 0000000000000..fc4eb98d5685e --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz.dts @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025, Microchip Technology Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +/ { + model = "Microchip MEC ASSY6941 MEC1743-QSZ evaluation board"; + compatible = "microchip,mec_assy6941-mec1743_qsz"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart1; + rtimer-busy-wait-timer = &timer5; + }; + + power-states { + idle: idle { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-idle"; + min-residency-us = <1000000>; + }; + + suspend_to_ram: suspend_to_ram { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-ram"; + min-residency-us = <2000000>; + }; + }; +}; + +&cpu0 { + clock-frequency = <96000000>; + status = "okay"; + cpu-power-states = <&idle &suspend_to_ram>; +}; + +/* Disable ARM SysTick kernel timer driver */ +&systick { + status = "disabled"; +}; + +/* Enable MCHP kernel timer driver using 32KHz RTOS timer and 1MHz basic timer */ +&rtimer { + compatible = "microchip,mec5-ktimer"; + status = "okay"; +}; + +/* We chose 32-bit basic timer 5 for use by ktimer */ +&timer5 { + status = "okay"; +}; + +&uart1 { + compatible = "microchip,mec5-uart"; + status = "okay"; + clock-frequency = <1843200>; + current-speed = <115200>; + pinctrl-0 = <&uart1_tx_gpio170 &uart1_rx_gpio171>; + pinctrl-names = "default"; +}; diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz.yaml b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz.yaml new file mode 100644 index 0000000000000..ae39df56b0465 --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz.yaml @@ -0,0 +1,27 @@ +# +# Copyright (c) 2025, Microchip Technology Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +identifier: mec_assy6941/mec1743_qsz +name: MEC174X EVB ASSY 6941 with MEC1743-QSZ +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 60 +flash: 416 +supported: + - gpio + - pinctrl + - i2c + - spi +testing: + binaries: + - spi_image.bin + ignore_tags: + - bluetooth + - net +vendor: microchip diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz_defconfig b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz_defconfig new file mode 100644 index 0000000000000..47eaa31ebd3f6 --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1743_qsz_defconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_GPIO=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj.dts b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj.dts new file mode 100644 index 0000000000000..1187fef8a072a --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj.dts @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025, Microchip Technology Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +/ { + model = "Microchip MEC ASSY6941 MEC1753-QLJ evaluation board"; + compatible = "microchip,mec_assy6941-mec1753_qlj"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart1; + rtimer-busy-wait-timer = &timer5; + }; + + power-states { + idle: idle { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-idle"; + min-residency-us = <1000000>; + }; + + suspend_to_ram: suspend_to_ram { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-ram"; + min-residency-us = <2000000>; + }; + }; +}; + +&cpu0 { + clock-frequency = <96000000>; + status = "okay"; + cpu-power-states = <&idle &suspend_to_ram>; +}; + +/* Disable ARM SysTick kernel timer driver */ +&systick { + status = "disabled"; +}; + +/* Enable MCHP kernel timer driver using 32KHz RTOS timer and 1MHz basic timer */ +&rtimer { + compatible = "microchip,mec5-ktimer"; + status = "okay"; +}; + +/* We chose 32-bit basic timer 5 for use by ktimer */ +&timer5 { + status = "okay"; +}; + +&uart1 { + compatible = "microchip,mec5-uart"; + status = "okay"; + clock-frequency = <1843200>; + current-speed = <115200>; + pinctrl-0 = <&uart1_tx_gpio170 &uart1_rx_gpio171>; + pinctrl-names = "default"; +}; diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj.yaml b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj.yaml new file mode 100644 index 0000000000000..ad4578718f43b --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj.yaml @@ -0,0 +1,27 @@ +# +# Copyright (c) 2025, Microchip Technology Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +identifier: mec_assy6941/mec1753_qlj +name: MEC174X EVB ASSY 6941 with MEC1753-QLJ +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 60 +flash: 416 +supported: + - gpio + - pinctrl + - i2c + - spi +testing: + binaries: + - spi_image.bin + ignore_tags: + - bluetooth + - net +vendor: microchip diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj_defconfig b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj_defconfig new file mode 100644 index 0000000000000..47eaa31ebd3f6 --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qlj_defconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_GPIO=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz.dts b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz.dts new file mode 100644 index 0000000000000..b2e7c570cc6ea --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz.dts @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025, Microchip Technology Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +/ { + model = "Microchip MEC ASSY6941 MEC1753-QSZ evaluation board"; + compatible = "microchip,mec_assy6941-mec1753_qsz"; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart1; + rtimer-busy-wait-timer = &timer5; + }; + + power-states { + idle: idle { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-idle"; + min-residency-us = <1000000>; + }; + + suspend_to_ram: suspend_to_ram { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-ram"; + min-residency-us = <2000000>; + }; + }; +}; + +&cpu0 { + clock-frequency = <96000000>; + status = "okay"; + cpu-power-states = <&idle &suspend_to_ram>; +}; + +/* Disable ARM SysTick kernel timer driver */ +&systick { + status = "disabled"; +}; + +/* Enable MCHP kernel timer driver using 32KHz RTOS timer and 1MHz basic timer */ +&rtimer { + compatible = "microchip,mec5-ktimer"; + status = "okay"; +}; + +/* We chose 32-bit basic timer 5 for use by ktimer */ +&timer5 { + status = "okay"; +}; + +&uart1 { + compatible = "microchip,mec5-uart"; + status = "okay"; + clock-frequency = <1843200>; + current-speed = <115200>; + pinctrl-0 = <&uart1_tx_gpio170 &uart1_rx_gpio171>; + pinctrl-names = "default"; +}; diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz.yaml b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz.yaml new file mode 100644 index 0000000000000..d825e2177d89c --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz.yaml @@ -0,0 +1,27 @@ +# +# Copyright (c) 2025, Microchip Technology Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +identifier: mec_assy6941/mec1753_qsz +name: MEC174X EVB ASSY 6941 with MEC1753-QSZ +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 60 +flash: 416 +supported: + - gpio + - pinctrl + - i2c + - spi +testing: + binaries: + - spi_image.bin + ignore_tags: + - bluetooth + - net +vendor: microchip diff --git a/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz_defconfig b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz_defconfig new file mode 100644 index 0000000000000..47eaa31ebd3f6 --- /dev/null +++ b/boards/microchip/mec_assy6941/mec_assy6941_mec1753_qsz_defconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2025, Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_GPIO=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/microchip/mec_assy6941/support/mec174x_spi_cfg.txt b/boards/microchip/mec_assy6941/support/mec174x_spi_cfg.txt new file mode 100644 index 0000000000000..62ddf14369118 --- /dev/null +++ b/boards/microchip/mec_assy6941/support/mec174x_spi_cfg.txt @@ -0,0 +1,51 @@ +; MEC174x SPI Image Generator configuration file +[SPI] +SPISizeMegabits = 128 + +[DEVICE] +TagAddr0 = 0 +TagAddr1 = 0 +; BoardID is used by a Boot-ROM feature named PlatformID. By default PlatformID +; is disabled. If PlatformID is enabled in OTP Boot-ROM will check the image +; BoardID value with an OTP PlatformID value. Load is aborted if the ID's do +; not match. +BoardID = 0x316 + +[IMAGE "0"] +ImageLocation = 0x2000 +SpiFreqMHz = 24 +SpiReadCommand = slow +SpiDriveStrength = 4 +SpiSlewFast = false +SpiSignalControl = 0x00 +IMG1BinFile = zephyr.bin +ImageRevision = 0 +FwOffset = 0 +IMG1LoadAddress = 0xB0000 +IMG1EntryAddress = 0 +UseECDSA = false +AuthenticateKeySelt = 5 +AutoKeyRevEn = true +KeyRevPermission = 0xff +AutoRollBackProtEn = false +RollbackProtPerm031000 = 0 +RollbackProtPerm063032 = 0 +RollbackProtPerm095063 = 0 +RollbackProtPerm127096 = 0 +ECDSAPrivKeyFile = ECC384r.pem +ECDSAPrivKeyPassword = MCHPECC384r +FwEncrypt = false +AesGenECPubKeyFile = ECC384r_crt.pem +TagBuildNumber= 0 +Comp0ProgDrvStrenEN = false +Comp0WritCmdTotByts = 0 +Comp0ReadCmdByte = 0 +Comp0WritCmdByte = 0 +Comp0DrvValue = 0 +Comp0DrvMask = 0 +Comp1ProgDrvStrenEN = false +Comp1WritCmdTotByts = 0 +Comp1ReadCmdByte = 0 +Comp1WritCmdByte = 0 +Comp1DrvValue = 0 +Comp1DrvMask = 0 diff --git a/boards/microchip/mec_assy6941/support/mec175x_spi_cfg.txt b/boards/microchip/mec_assy6941/support/mec175x_spi_cfg.txt new file mode 100644 index 0000000000000..b7428492fc6b7 --- /dev/null +++ b/boards/microchip/mec_assy6941/support/mec175x_spi_cfg.txt @@ -0,0 +1,52 @@ +; MEC175x SPI Image Generator configuration file +[SPI] +SPISizeMegabits = 128 + +[DEVICE] +DeviceSel = A +TagAddr0 = 0 +TagAddr1 = 0 +; BoardID is used by a Boot-ROM feature named PlatformID. By default PlatformID +; is disabled. If PlatformID is enabled in OTP Boot-ROM will check the image +; BoardID value with an OTP PlatformID value. Load is aborted if the ID's do +; not match. +BoardID = 0x316 + +[IMAGE "0"] +ImageLocation = 0x2000 +SpiFreqMHz = 24 +SpiReadCommand = slow +SpiDriveStrength = 4 +SpiSlewFast = false +SpiSignalControl = 0x00 +IMG1BinFile = zephyr.bin +ImageRevision = 0 +FwOffset = 0 +IMG1LoadAddress = 0xB0000 +IMG1EntryAddress = 0 +UseECDSA = false +AuthenticateKeySelt = 5 +AutoKeyRevEn = true +KeyRevPermission = 0xff +AutoRollBackProtEn = false +RollbackProtPerm031000 = 0 +RollbackProtPerm063032 = 0 +RollbackProtPerm095063 = 0 +RollbackProtPerm127096 = 0 +ECDSAPrivKeyFile = ECC384r.pem +ECDSAPrivKeyPassword = MCHPECC384r +FwEncrypt = false +AesGenECPubKeyFile = ECC384r_crt.pem +TagBuildNumber= 0 +Comp0ProgDrvStrenEN = false +Comp0WritCmdTotByts = 0 +Comp0ReadCmdByte = 0 +Comp0WritCmdByte = 0 +Comp0DrvValue = 0 +Comp0DrvMask = 0 +Comp1ProgDrvStrenEN = false +Comp1WritCmdTotByts = 0 +Comp1ReadCmdByte = 0 +Comp1WritCmdByte = 0 +Comp1DrvValue = 0 +Comp1DrvMask = 0 diff --git a/boards/microchip/mpfs_icicle/Kconfig.defconfig b/boards/microchip/mpfs_icicle/Kconfig.defconfig new file mode 100644 index 0000000000000..8c630afbfc01f --- /dev/null +++ b/boards/microchip/mpfs_icicle/Kconfig.defconfig @@ -0,0 +1,10 @@ +# Copyright 2025 Google LLC +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_MPFS_ICICLE + +choice SPI_NOR_SFDP + default SPI_NOR_SFDP_RUNTIME +endchoice + +endif diff --git a/boards/microchip/mpfs_icicle/doc/index.rst b/boards/microchip/mpfs_icicle/doc/index.rst index ee5d07b5bda0d..12c57e62029ef 100644 --- a/boards/microchip/mpfs_icicle/doc/index.rst +++ b/boards/microchip/mpfs_icicle/doc/index.rst @@ -10,6 +10,8 @@ More information can be found on the `Microchip website ; + }; + + group2 { + /* rx */ + psels = ; + }; + }; + + iic1_default: iic1_default { + group1 { + /* SCL1 SDA1 */ + psels = , + ; + drive-strength = "medium"; + }; + }; + + spi0_default: spi0_default { + group1 { + /* MISO MOSI RSPCK SSL */ + psels = , + , + , + ; + }; + }; +}; diff --git a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts index 5a626a783648d..d5fea8287b327 100644 --- a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts +++ b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts @@ -5,14 +5,15 @@ */ /dts-v1/; -#include +#include #include #include -#include + +#include "mikroe_clicker_ra4m1-pinctrl.dtsi" / { model = "Mikroe Clicker RA4M1"; - compatible = "renesas,r7fa4m1ab3cfm"; + compatible = "renesas,ra4m1", "renesas,ra"; chosen { zephyr,console = &uart0; @@ -27,6 +28,7 @@ gpios = <&ioport4 9 GPIO_ACTIVE_HIGH>; label = "User LED 1"; }; + ld2: led_2 { gpios = <&ioport4 8 GPIO_ACTIVE_HIGH>; label = "User LED 2"; @@ -40,6 +42,12 @@ label = "User Button 1"; zephyr,code = ; }; + + btn2: button_2 { + gpios = <&ioport3 1 GPIO_ACTIVE_LOW>; + label = "User Button 2"; + zephyr,code = ; + }; }; mikrobus_header: mikrobus-connector { @@ -69,19 +77,7 @@ led0 = &ld1; led1 = &ld2; sw0 = &btn1; - }; -}; - -&pinctrl { - sci0_default: sci0_default { - group1 { - /* tx */ - psels = ; - }; - group2 { - /* rx */ - psels = ; - }; + sw1 = &btn2; }; }; @@ -95,6 +91,25 @@ }; }; +&iic1 { + pinctrl-0 = <&iic1_default>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = ; + interrupts = <10 1>, <11 1>, <12 1>, <13 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + status = "okay"; +}; + +&spi0 { + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; + interrupts = <23 1>, <24 1>, <25 1>, <26 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + status = "okay"; +}; + &ioport0 { status = "okay"; }; @@ -115,7 +130,13 @@ status = "okay"; }; -&fcu { +&port_irq6 { + interrupts = <28 12>; + status = "okay"; +}; + +&port_irq9 { + interrupts = <27 12>; status = "okay"; }; @@ -129,6 +150,7 @@ }; &iclk { + clock-frequency = <12000000>; div = <1>; }; @@ -151,3 +173,7 @@ &fclk { div = <2>; }; + +mikrobus_serial: &uart0 {}; +mikrobus_i2c: &iic1 {}; +mikrobus_spi: &spi0 {}; diff --git a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig index 2e434ba45ea3c..1c187cb544cd2 100644 --- a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig +++ b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig @@ -1,10 +1,6 @@ # Copyright (c) 2024 Ian Morris # SPDX-License-Identifier: Apache-2.0 -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=12000000 - -CONFIG_BUILD_OUTPUT_HEX=y - # Enable uart driver CONFIG_SERIAL=y @@ -14,6 +10,3 @@ CONFIG_UART_CONSOLE=y # Enable GPIO CONFIG_GPIO=y - -# Enable Clocks -CONFIG_CLOCK_CONTROL=y diff --git a/boards/mikroe/mini_m4_for_stm32/doc/mikroe_mini_m4_for_stm32.rst b/boards/mikroe/mini_m4_for_stm32/doc/mikroe_mini_m4_for_stm32.rst index 02208b66bf329..02504c3bc9a33 100644 --- a/boards/mikroe/mini_m4_for_stm32/doc/mikroe_mini_m4_for_stm32.rst +++ b/boards/mikroe/mini_m4_for_stm32/doc/mikroe_mini_m4_for_stm32.rst @@ -49,37 +49,7 @@ The board can be flashed by using STLinkV2 with the following connections. Supported Features ================== -The MINI-M4 for STM32 board configuration supports the following hardware -features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CRYP | on-chip | crypto | -+-----------+------------+----------------------+ -| NVIC | on-chip | nested vectored | -| | | interrupt controller | -+-----------+------------+----------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+----------------------+ -| UART | on-chip | serial port | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C | on-chip | i2c | -+-----------+------------+----------------------+ -| SPI | on-chip | spi | -+-----------+------------+----------------------+ -| PWM | on-chip | PWM | -+-----------+------------+----------------------+ -| USB | on-chip | USB | -+-----------+------------+----------------------+ - - -Other hardware features have not been enabled yet for this board. - -The default configuration can be found in -:zephyr_file:`boards/mikroe/mini_m4_for_stm32/mikroe_mini_m4_for_stm32_defconfig` +.. zephyr:board-supported-hw:: Serial Port =========== @@ -89,6 +59,8 @@ The Zephyr console output is assigned to USART2. Default settings are 115200 8N1 Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Applications for the ``mikroe_mini_m4_for_stm32`` board configuration can be built and flashed in the usual way (see :ref:`build_an_application` and :ref:`application_run` for more details). diff --git a/boards/mikroe/stm32_m4_clicker/doc/index.rst b/boards/mikroe/stm32_m4_clicker/doc/index.rst index 8bddfd3f7aaa9..77f52fa96bf98 100644 --- a/boards/mikroe/stm32_m4_clicker/doc/index.rst +++ b/boards/mikroe/stm32_m4_clicker/doc/index.rst @@ -18,37 +18,13 @@ board see the `STM32 M4 Clicker website`_. Supported Features ================== -The ``mikroe_stm32_m4_clicker`` board target supports the following hardware -features: - -+-----------+------------+-------------------------------------+ -| Interface | Controller | Driver/Component | -+===========+============+=====================================+ -| NVIC | on-chip | nested vector interrupt controller | -+-----------+------------+-------------------------------------+ -| UART | on-chip | serial port-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| PINMUX | on-chip | pinmux | -+-----------+------------+-------------------------------------+ -| I2C | on-chip | i2c | -+-----------+------------+-------------------------------------+ -| SPI | on-chip | spi | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | GPIO output | -| | | GPIO input | -+-----------+------------+-------------------------------------+ -| USB | on-chip | USB | -+-----------+------------+-------------------------------------+ - -Other hardware features have not yet been enabled for this board. - -The default configuration can be found in the defconfig file: -:zephyr_file:`boards/mikroe/stm32_m4_clicker/mikroe_stm32_m4_clicker_defconfig`. +.. zephyr:board-supported-hw:: Programming and debugging ************************* +.. zephyr:board-supported-runners:: + Building & Flashing =================== diff --git a/boards/mxchip/az3166_iotdevkit/doc/index.rst b/boards/mxchip/az3166_iotdevkit/doc/index.rst index 230073f829556..8ea178b7f9306 100644 --- a/boards/mxchip/az3166_iotdevkit/doc/index.rst +++ b/boards/mxchip/az3166_iotdevkit/doc/index.rst @@ -34,25 +34,7 @@ The MXChip AZ3166 IoT DevKit has the following physical features: Supported Features ================== -The az3166_iotdevkit board configuration supports the following -hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| NVIC | on-chip | nested vector | -| | | interrupt controller | -+-----------+------------+----------------------+ -| SYSTICK | on-chip | system clock | -+-----------+------------+----------------------+ -| UART | on-chip | serial port | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C | on-chip | i2c | -+-----------+------------+----------------------+ -| SPI | on-chip | spi | -+-----------+------------+----------------------+ +.. zephyr:board-supported-hw:: .. note:: @@ -61,6 +43,8 @@ hardware features: Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== diff --git a/boards/native/doc/arch_soc.rst b/boards/native/doc/arch_soc.rst index 8906001f17763..6b6a5a5e10eb2 100644 --- a/boards/native/doc/arch_soc.rst +++ b/boards/native/doc/arch_soc.rst @@ -53,8 +53,8 @@ This port is designed and tested to run in Linux. .. note:: - You must have the 32-bit C library installed in your system - (in Ubuntu 16.04 install the gcc-multilib package) + To build for the 32bit targets you must have the 32-bit C library installed in your system + (in Debian/Ubuntu this is provided by the ``gcc-multilib`` package). .. note:: @@ -306,7 +306,7 @@ Architecture and design .. note:: - This section does not describe anymore the old :ref:`native_posix` or + This section does not describe anymore the old :kconfig:option:`CONFIG_NATIVE_APPLICATION` based architecture. It only describes the new native simulator based architecture used by targets built with the :kconfig:option:`CONFIG_NATIVE_LIBRARY` option. diff --git a/boards/native/native_posix/CMakeLists.txt b/boards/native/native_posix/CMakeLists.txt deleted file mode 100644 index b86941cc85428..0000000000000 --- a/boards/native/native_posix/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2017 Oticon A/S - -zephyr_library() - -zephyr_library_compile_definitions(NO_POSIX_CHEATS) -zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L _XOPEN_SOURCE=600 _XOPEN_SOURCE_EXTENDED) - -zephyr_library_sources( - hw_models_top.c - timer_model.c - native_rtc.c - irq_handler.c - irq_ctrl.c - main.c - tracing.c - cmdline_common.c - cmdline.c - cpu_wait.c - hw_counter.c - ) - -zephyr_library_include_directories( - ${ZEPHYR_BASE}/kernel/include - ${ZEPHYR_BASE}/arch/posix/include - ) - -if(CONFIG_HAS_SDL) - add_subdirectory(${ZEPHYR_BASE}/boards/native/common/sdl/ ${CMAKE_CURRENT_BINARY_DIR}/sdl) -endif() - -zephyr_ld_options( - -lm -) diff --git a/boards/native/native_posix/Kconfig b/boards/native/native_posix/Kconfig deleted file mode 100644 index b629778f4cbca..0000000000000 --- a/boards/native/native_posix/Kconfig +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2017 Oticon A/S -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NATIVE_POSIX - bool - imply NATIVE_POSIX_TIMER - select POSIX_ARCH_CONSOLE - select NATIVE_APPLICATION - select 64BIT if BOARD_NATIVE_POSIX_NATIVE_64 - help - Native POSIX - Will produce a console Linux process which can be executed natively. - It provides some minimal needed models: - An interrupt controller, timer (system tick), and redirects kernel prints to - stdout. - -if BOARD_NATIVE_POSIX - -comment "Native POSIX options" - -config NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME - bool "Slow down execution to real time" - default n if ARCH_POSIX_LIBFUZZER - default y if BT_USERCHAN || !TEST - help - When selected the execution of the process will be slowed down to real time. - (if there is a lot of load it may be slower than real time) - If deselected, the process will run as fast as possible. - Note that this only decouples simulated time from real/wall time. In either - case the zephyr kernel and application cannot tell the difference unless they - interact with some other driver/device which runs at real time. - -source "boards/native/common/sdl/Kconfig" - -endif # BOARD_NATIVE_POSIX diff --git a/boards/native/native_posix/Kconfig.defconfig b/boards/native/native_posix/Kconfig.defconfig deleted file mode 100644 index 2d896061f7835..0000000000000 --- a/boards/native/native_posix/Kconfig.defconfig +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2017 Oticon A/S -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NATIVE_POSIX - -config BOARD_DEPRECATED_RELEASE - default "v4.2.0" - -config BUILD_OUTPUT_BIN - default n - -config BUILD_OUTPUT_EXE - default y - -config OUTPUT_PRINT_MEMORY_USAGE - default n - -if NETWORKING - -config NET_L2_ETHERNET - default y if !NET_LOOPBACK && !NET_TEST - -config ETH_NATIVE_POSIX - default y if NET_L2_ETHERNET && ETH_DRIVER - -endif # NETWORKING - -if CONSOLE - -config POSIX_ARCH_CONSOLE - default y if !SERIAL - -config UART_CONSOLE - default y if SERIAL - -endif # CONSOLE - -endif # BOARD_NATIVE_POSIX diff --git a/boards/native/native_posix/Kconfig.native_posix b/boards/native/native_posix/Kconfig.native_posix deleted file mode 100644 index cb7c03889c425..0000000000000 --- a/boards/native/native_posix/Kconfig.native_posix +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NATIVE_POSIX - select SOC_POSIX diff --git a/boards/native/native_posix/board.cmake b/boards/native/native_posix/board.cmake deleted file mode 100644 index c3f7c89918dd9..0000000000000 --- a/boards/native/native_posix/board.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2017 Oticon A/S - -set(SUPPORTED_EMU_PLATFORMS native) - -board_set_debugger_ifnset(native) -board_set_flasher_ifnset(native) -board_finalize_runner_args(native) diff --git a/boards/native/native_posix/board.yml b/boards/native/native_posix/board.yml deleted file mode 100644 index 07defd4185bfc..0000000000000 --- a/boards/native/native_posix/board.yml +++ /dev/null @@ -1,8 +0,0 @@ -boards: -- name: native_posix - full_name: Native POSIX execution (native_posix) - vendor: zephyr - socs: - - name: native - variants: - - name: "64" diff --git a/boards/native/native_posix/board_irq.h b/boards/native/native_posix/board_irq.h deleted file mode 100644 index 21c29768c8ef7..0000000000000 --- a/boards/native/native_posix/board_irq.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2017 Oticon A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef BOARDS_POSIX_NATIVE_POSIX_BOARD_IRQ_H -#define BOARDS_POSIX_NATIVE_POSIX_BOARD_IRQ_H - -#include "../common/irq/board_irq.h" - -#endif /* BOARDS_POSIX_NATIVE_POSIX_BOARD_IRQ_H */ diff --git a/boards/native/native_posix/board_soc.h b/boards/native/native_posix/board_soc.h deleted file mode 100644 index 572617a073650..0000000000000 --- a/boards/native/native_posix/board_soc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017 Oticon A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * @file Extra definitions provided by the board to soc.h - * - * Background: - * The POSIX ARCH/SOC/board layering is different than in normal archs - * The "SOC" does not provide almost any of the typical SOC functionality - * but that is left for the "board" to define it - * Device code may rely on the soc.h defining some things (like the interrupts - * numbers) - * Therefore this file is included from the inf_clock soc.h to allow a board - * to define that kind of SOC related snippets - */ - -#ifndef _POSIX_SP_BOARD_SOC_H -#define _POSIX_SP_BOARD_SOC_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define TIMER_TICK_IRQ 0 -#define OFFLOAD_SW_IRQ 1 -#define COUNTER_EVENT_IRQ 2 - -/* - * This interrupt will awake the CPU if IRQs are not locked, - * This interrupt does not have an associated status bit or handler - */ -#define PHONY_WEAK_IRQ 0xFFFE -/* - * This interrupt will awake the CPU even if IRQs are locked, - * This interrupt does not have an associated status bit or handler - * (the lock is only ignored when the interrupt is raised from the HW models, - * SW threads should not try to use this) - */ -#define PHONY_HARD_IRQ 0xFFFF - - -#ifdef __cplusplus -} -#endif - -#endif /* _POSIX_SP_BOARD_SOC_H */ diff --git a/boards/native/native_posix/cmdline.c b/boards/native/native_posix/cmdline.c deleted file mode 100644 index aa0ef1e697488..0000000000000 --- a/boards/native/native_posix/cmdline.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2018 Oticon A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include "cmdline_common.h" -#include -#include "hw_models_top.h" -#include "timer_model.h" -#include "cmdline.h" -#include -#include -#include "native_tracing.h" - -static int s_argc, test_argc; -static char **s_argv, **test_argv; - -static struct args_struct_t *args_struct; -static int used_args; -static int args_aval; -#define ARGS_ALLOC_CHUNK_SIZE 20 - -void native_cleanup_cmd_line(void) -{ - if (args_struct != NULL) { /* LCOV_EXCL_BR_LINE */ - free(args_struct); - args_struct = NULL; - } -} - -/** - * Add a set of command line options to the program. - * - * Each option to be added is described in one entry of the input - * This input must be terminated with an entry containing ARG_TABLE_ENDMARKER. - */ -void native_add_command_line_opts(struct args_struct_t *args) -{ - int count = 0; - - while (args[count].option != NULL) { - count++; - } - count++; /*for the end marker*/ - - if (used_args + count >= args_aval) { - int growby = count; - /* reallocs are expensive let's do them only in big chunks */ - if (growby < ARGS_ALLOC_CHUNK_SIZE) { - growby = ARGS_ALLOC_CHUNK_SIZE; - } - - struct args_struct_t *new_args_struct = realloc(args_struct, - (args_aval + growby)* - sizeof(struct args_struct_t)); - args_aval += growby; - /* LCOV_EXCL_START */ - if (new_args_struct == NULL) { - posix_print_error_and_exit("Could not allocate memory"); - } else { - args_struct = new_args_struct; - } - /* LCOV_EXCL_STOP */ - } - - memcpy(&args_struct[used_args], args, - count*sizeof(struct args_struct_t)); - - used_args += count - 1; - /* - * -1 as the end marker should be overwritten next time something - * is added - */ -} - -void native_add_testargs_option(void) -{ - static struct args_struct_t testargs_options[] = { - /* - * Fields: - * manual, mandatory, switch, - * option_name, var_name ,type, - * destination, callback, - * description - */ - {true, false, false, - "testargs", "arg", 'l', - (void *)NULL, NULL, - "Any argument that follows will be ignored by the top level, " - "and made available for possible tests"}, - ARG_TABLE_ENDMARKER}; - - native_add_command_line_opts(testargs_options); -} - -static void print_invalid_opt_error(char *argv) -{ - posix_print_error_and_exit("Incorrect option '%s'. Did you misspell it?" - " Is that feature supported in this build?" - "\n", - argv); - -} - -/** - * Handle possible command line arguments. - * - * We also store them for later use by possible test applications - */ -void native_handle_cmd_line(int argc, char *argv[]) -{ - int i; - - native_add_tracing_options(); - native_add_testargs_option(); - - s_argv = argv; - s_argc = argc; - - cmd_args_set_defaults(args_struct); - - for (i = 1; i < argc; i++) { - - if ((cmd_is_option(argv[i], "testargs", 0))) { - test_argc = argc - i - 1; - test_argv = &argv[i+1]; - break; - } - - if (!cmd_parse_one_arg(argv[i], args_struct)) { - cmd_print_switches_help(args_struct); - print_invalid_opt_error(argv[i]); - } - } -} - -/** - * The application/test can use this function to inspect all the command line - * arguments - */ -void native_get_cmd_line_args(int *argc, char ***argv) -{ - *argc = s_argc; - *argv = s_argv; -} - -/** - * The application/test can use this function to inspect the command line - * arguments received after --testargs - */ -void native_get_test_cmd_line_args(int *argc, char ***argv) -{ - *argc = test_argc; - *argv = test_argv; -} diff --git a/boards/native/native_posix/cmdline.h b/boards/native/native_posix/cmdline.h deleted file mode 100644 index 05d445ddd1b7e..0000000000000 --- a/boards/native/native_posix/cmdline.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2018 Oticon A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef _NATIVE_POSIX_CMDLINE_H -#define _NATIVE_POSIX_CMDLINE_H - -#include "cmdline_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void native_handle_cmd_line(int argc, char *argv[]); -void native_get_cmd_line_args(int *argc, char ***argv); -void native_get_test_cmd_line_args(int *argc, char ***argv); -void native_add_command_line_opts(struct args_struct_t *args); -void native_cleanup_cmd_line(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _NATIVE_POSIX_CMDLINE_H */ diff --git a/boards/native/native_posix/cmdline_common.c b/boards/native/native_posix/cmdline_common.c deleted file mode 100644 index 8723505658ac8..0000000000000 --- a/boards/native/native_posix/cmdline_common.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright (c) 2018 Oticon A/S - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include -#include "posix_board_if.h" -#include -#include "cmdline_common.h" - -/** - * Check if is the option