diff --git a/.clang-format b/.clang-format index 940f22994b8..11054457bc3 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 835450cd507..2b6eb4cebb9 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 ba2dedb99e4..ffbaf1a6b62 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 00000000000..4076bfd99c5 --- /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 00000000000..6503a1fa80c --- /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 new file mode 100644 index 00000000000..fc85287baa7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,26 @@ +version: 2 +enable-beta-ecosystems: true +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci: github: " + labels: [] + groups: + 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 be3696c4d30..3e5988fc698 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 5e28332c2a2..3ecf66b17da 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 2d2c4fda6a8..a285113aad2 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 72608b36b24..1cb30f2cfa9 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@v6 + 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 66d47c68a1c..951adc4d267 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,16 +117,17 @@ 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: | - tests/bsim/bluetooth/ samples/bluetooth/ subsys/bluetooth/ + tests/bluetooth/common/testlib/ + tests/bsim/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 +140,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 +180,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 +193,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 +201,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 f10dc718b6e..e4cc5b7fdda 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 index 11d249cd937..2e085c2bb36 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -1,6 +1,12 @@ name: Build with Clang/LLVM - -on: pull_request_target +on: + push: + branches: + - main + - v*-branch + - collab-* +permissions: + contents: read concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} @@ -17,16 +23,14 @@ jobs: strategy: fail-fast: false matrix: - platform: ["native_sim"] + 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 - COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} BASE_REF: ${{ github.base_ref }} - outputs: - report_needed: ${{ steps.twister.outputs.report_needed }} steps: - name: Apply container owner mismatch workaround run: | @@ -49,9 +53,8 @@ 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 persist-credentials: false @@ -62,7 +65,6 @@ jobs: 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 @@ -107,18 +109,8 @@ jobs: export ZEPHYR_BASE=${PWD} export ZEPHYR_TOOLCHAIN_VARIANT=llvm - # check if we need to run a full twister or not based on files changed - python3 ./scripts/ci/test_plan.py --no-detailed-test-id --platform ${{ matrix.platform }} -c origin/${BASE_REF}.. - - # We can limit scope to just what has changed - if [ -s testplan.json ]; then - echo "report_needed=1" >> $GITHUB_OUTPUT - # Full twister but with options based on changes - ./scripts/twister --no-detailed-test-id --force-color --inline-logs -M -N -v --load-tests testplan.json --retry-failed 2 - else - # if nothing is run, skip reporting step - echo "report_needed=0" >> $GITHUB_OUTPUT - fi + ./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() @@ -126,31 +118,53 @@ jobs: ccache -s -vv - name: Upload Unit Test Results - if: always() && steps.twister.outputs.report_needed != 0 - uses: actions/upload-artifact@v4 + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: Unit Test Results (Subset ${{ matrix.platform }}) - path: twister-out/twister.xml + 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-22.04 - if: (success() || failure() ) && needs.clang-build.outputs.report_needed != 0 + 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@v4 + 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: | - pip install junitparser junit2html 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@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: HTML Unit Test Results if-no-files-found: ignore @@ -158,7 +172,7 @@ jobs: junit-clang.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 if: always() with: check_name: Unit Test Results diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index d03ced6e474..74ca259c91f 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@v4 + 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 00000000000..f9295f68cd7 --- /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 9ab2bc974b1..cf3d7182f18 100644 --- a/.github/workflows/coding_guidelines.yml +++ b/.github/workflows/coding_guidelines.yml @@ -2,34 +2,37 @@ 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: | sudo apt-get update sudo apt-get install coccinelle - - name: Run Coding Guildeines Checks + - name: Run Coding Guidelines Checks continue-on-error: true id: coding_guidelines env: diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 56927365550..0b80da96965 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,11 @@ 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 ClangFormat \ + ./scripts/ci/check_compliance.py --annotate -e KconfigBasic -e SysbuildKconfigBasic -e ClangFormat \ -e Kconfig -e KconfigBasicNoModules -e ModulesMaintainers -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 3a43ac64300..02eef3c776f 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 345eb5b7db0..00a498bbc45 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 b2bbefdc6fe..00000000000 --- a/.github/workflows/do_not_merge.yml +++ /dev/null @@ -1,20 +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, '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 69c7b787c45..144f872e5f5 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 --directory=doc/_build html + 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 786bd14aed2..54ac20d6ad4 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@v6 + 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 51c451c75ea..89afeb4ed1b 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@v6 + 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 d3fe1b0dcae..a035936216f 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 78f761cb545..c974b0ded25 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 5f62c03d6de..ae69fd5cc01 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 59d622149a2..8fb8b11597b 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 @@ -70,11 +73,11 @@ jobs: elif [ "${{ runner.os }}" = "Windows" ]; then EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out" fi - ./scripts/twister --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS + ./scripts/twister --runtime-artifact-cleanup --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS - 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 7d6ed6dfc3e..0ab24ef5f64 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 7d2d083faae..212c7636659 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 c3bdc4ff6c8..fdd6f75e38c 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' @@ -36,4 +52,4 @@ jobs: label-prefix: 'manifest-' verbosity-level: '1' labels: 'manifest' - dnm-labels: 'DNM' + dnm-labels: 'DNM (manifest)' diff --git a/.github/workflows/pinned-gh-actions.yml b/.github/workflows/pinned-gh-actions.yml new file mode 100644 index 00000000000..12ca5963221 --- /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 00000000000..3564c6352c8 --- /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 bf9d8289212..29cfd1a5273 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 897a6044522..01f08e8a4b6 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 002485b9d80..91f4037a2e2 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@v4 + 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 e2325da0a4a..d54e76cdcb8 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 06e12ada528..0664dbcebc5 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 ec1a4cc716f..f40d5b928da 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 f71e485ff8e..ec59d2641d9 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 0f86958e47b..bb79f772801 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 51bc771059d..00000000000 --- 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 3695d060726..ceac5a7736b 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@v6 + 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 8d3b29fa433..946cfff778e 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: | @@ -160,7 +258,7 @@ jobs: fi - if: github.event_name == 'schedule' - name: Run Tests with Twister (Daily) + name: Run Tests with Twister (Weekly) id: run_twister_sched run: | export ZEPHYR_BASE=${PWD} @@ -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,37 +310,76 @@ 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 + 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" comment_mode: off + + - name: Analyze Twister Reports + if: needs.twister-build.result == 'failure' + run: | + ./scripts/ci/twister_report_analyzer.py artifacts/*/*/twister.json --long-summary --platforms --output-md errors.md + if [[ -s "errors.md" ]]; then + echo '### Error Summary! 🚀' >> $GITHUB_STEP_SUMMARY + cat errors.md >> $GITHUB_STEP_SUMMARY + fi + + - name: Upload Twister Analysis Results + if: needs.twister-build.result == 'failure' + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: Twister Analysis Results + if-no-files-found: ignore + path: | + twister_report_summary.json + twister-status-check: if: always() name: "Check Twister Status" diff --git a/.github/workflows/twister_tests.yml b/.github/workflows/twister_tests.yml index 66409bce876..394936a29aa 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 cd24a2a39ae..1e9303e24dd 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 3d4802f0170..1756664303d 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 + 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/.gitignore b/.gitignore index b545443db31..aab3981f52f 100644 --- a/.gitignore +++ b/.gitignore @@ -104,5 +104,8 @@ Nits.txt Pylint.txt Ruff.txt SphinxLint.txt +SysbuildKconfig.txt +SysbuildKconfigBasic.txt +SysbuildKconfigBasicNoModules.txt TextEncoding.txt YAMLLint.txt diff --git a/.gitlint b/.gitlint index e83edce6b6e..16e9bdca9aa 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/.mailmap b/.mailmap index 050d05cce9f..27cc2a560e3 100644 --- a/.mailmap +++ b/.mailmap @@ -1,14 +1,14 @@ Alexandr Kolosov Alexandre d'Alton -Amir Kaplan -Anas Nashif +Amir Kaplan +Anas Nashif Andrzej Kuroś Anthony Smigielski Armand Ciejak Aska Wu -Bit Pathe +Bit Pathe Bjarki Arge Andreasen -Carles Cufi +Carles Cufi chao an Charles E. Youse Chen Xingyu @@ -16,32 +16,32 @@ Christoph Schnetzler Christoph Schramm Christopher Friedt Christopher Friedt -Chuck Jordan +Chuck Jordan Chunlin Han David B. Kinder David Komel David Leach -Dirk Brandewie -Douglas Su +Dirk Brandewie +Douglas Su Enjia Mai -Enjia Mai -Evan Couzens +Enjia Mai +Evan Couzens Evgeniy Paltsev Evgeniy Paltsev -Felipe Neves +Felipe Neves Findlay Feng Flavio Arieta Netto Francois Ramu -Gerardo Aceves +Gerardo Aceves Gregory Shue Gregory Shue HaiLong Yang James Johnson Jarno Lämsä Jędrzej Ciupis -Jeremie Garcia +Jeremie Garcia Jim Benjamin Luther -Johan Kruger +Johan Kruger Johann Fischer Jørgen Kvalvaag Juan Manuel Cruz Alcaraz @@ -51,11 +51,11 @@ Jun Li Justin Watson Kamil Sroka Katarzyna Giądła -Keren Siman-Tov +Keren Siman-Tov Krzysztof Chruściński -Kuo-Lang Tseng -Lei Liu -Leona Cook +Kuo-Lang Tseng +Lei Liu +Leona Cook Leona Cook Lixin Guo Łukasz Mazur @@ -72,14 +72,14 @@ Martí Bolívar Martí Bolívar Martí Bolívar Martí Bolívar -Martin Jäger <17674105+martinjaeger@users.noreply.github.com> +Martin Jäger <17674105+martinjaeger@users.noreply.github.com> Mateusz Hołenko Michael Rosen Michal Narajowski -Mike Hirst +Mike Hirst Ming Shao Mohan Kumar Kumar -Naga Raja Rao Tulasi +Naga Raja Rao Tulasi Navin Sankar Velliangiri NingX Zhao Nishikant Nayak @@ -100,21 +100,23 @@ Radosław Koppel Raja D. Singh Ricardo Salveti Ricardo Salveti -Ruud Derwig +Ruud Derwig Saku Rautio Scott Worley Sean Nyekjaer Sean Nyekjaer Sharron Liu Shilpashree L C -Shuang He +Shuang He Sigvart Hovland Stéphane D'Alu Stine Åkredalen -Thomas Heeley +Thomas Heeley Tim Sørensen Tim Sørensen -Vinayak Kariappa Chettimada +Vinayak Kariappa Chettimada +Vinayak Kariappa Chettimada +Vinayak Kariappa Chettimada Xiaorui Hu Yannis Damigos Yonattan Louise diff --git a/.ruff-excludes.toml b/.ruff-excludes.toml index ac26af8b3c8..276bdcdd546 100644 --- a/.ruff-excludes.toml +++ b/.ruff-excludes.toml @@ -436,26 +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 - "UP032", # https://docs.astral.sh/ruff/rules/f-string - "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 - "UP032", # https://docs.astral.sh/ruff/rules/f-string - "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 @@ -830,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 5bd9348cb57..196a87294ea 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. @@ -1109,17 +1129,15 @@ set_ifndef( TOPT "${COMPILER_TOPT}") set_ifndef( TOPT -Wl,-T) # Use this if the compiler driver doesn't set a value if(CONFIG_HAVE_CUSTOM_LINKER_SCRIPT) - set(LINKER_SCRIPT ${APPLICATION_SOURCE_DIR}/${CONFIG_CUSTOM_LINKER_SCRIPT}) + string(CONFIGURE ${APPLICATION_SOURCE_DIR}/${CONFIG_CUSTOM_LINKER_SCRIPT} LINKER_SCRIPT) if(NOT EXISTS ${LINKER_SCRIPT}) - set(LINKER_SCRIPT ${CONFIG_CUSTOM_LINKER_SCRIPT}) - assert_exists(CONFIG_CUSTOM_LINKER_SCRIPT) + string(CONFIGURE ${CONFIG_CUSTOM_LINKER_SCRIPT} LINKER_SCRIPT) + assert_exists(LINKER_SCRIPT) endif() 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) @@ -1990,7 +2026,6 @@ if (CONFIG_LLEXT AND CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID) --elf-file ${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME} --slid-listing ${PROJECT_BINARY_DIR}/slid_listing.txt ) - endif() if(NOT CMAKE_C_COMPILER_ID STREQUAL "ARMClang") @@ -2221,51 +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}) -add_custom_command( + 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( 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} - -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} - -DAPPLICATION_SOURCE_DIR=${APPLICATION_SOURCE_DIR} - -DINTERFACE_INCLUDE_DIRECTORIES="$" - -Dllext_edk_file=${llext_edk_file} - -Dllext_edk_cflags="${llext_edk_cflags}" - -Dllext_edk_name=${CONFIG_LLEXT_EDK_NAME} - -DWEST_TOPDIR=${WEST_TOPDIR} - -DZEPHYR_BASE=${ZEPHYR_BASE} - -DCONFIG_LLEXT_EDK_USERSPACE_ONLY=${CONFIG_LLEXT_EDK_USERSPACE_ONLY} -P ${ZEPHYR_BASE}/cmake/llext-edk.cmake - DEPENDS ${logical_target_for_zephyr_elf} + 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 @@ -2286,9 +2327,8 @@ add_subdirectory_ifdef( toolchain_linker_finalize() -yaml_context(EXISTS NAME build_info result) -if(result) - build_info(zephyr version VALUE ${PROJECT_VERSION_STR}) - build_info(zephyr zephyr-base VALUE ${ZEPHYR_BASE}) - yaml_save(NAME build_info) -endif() +# export build information +build_info(zephyr version VALUE ${PROJECT_VERSION_STR}) +build_info(zephyr zephyr-base VALUE ${ZEPHYR_BASE}) + +yaml_save(NAME build_info) diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000000..54110c3f9a5 --- /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 2d8031260ce..23f7507b432 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -215,12 +215,6 @@ config LINKER_SORT_BY_ALIGNMENT in decreasing size of symbols. This helps to minimize padding between symbols. -config SRAM_VECTOR_TABLE - bool "Place the vector table in SRAM instead of flash" - help - The option specifies that the vector table should be placed at the - start of SRAM instead of the start of flash. - config HAS_SRAM_OFFSET bool help @@ -621,6 +615,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 5eed35c70da..1d6ce194239 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -126,6 +126,20 @@ ACPI: tests: - acpi +Antmicro platforms: + status: maintained + maintainers: + - fkokosinski + - tgorochowik + collaborators: + - kgugala + files: + - boards/antmicro/ + - soc/antmicro/ + - dts/arm/antmicro/ + labels: + - "platform: Antmicro" + ARC arch: status: maintained maintainers: @@ -148,10 +162,19 @@ ARC arch: tests: - arch.arc +Arduino Platforms: + status: maintained + maintainers: + - pillo79 + collaborators: + - facchinm + files: + - boards/arduino/ + ARM arch: status: maintained maintainers: - - ithinuel + - wearyzen collaborators: - microbuilder - carlocaione @@ -159,7 +182,7 @@ ARM arch: - MaureenHelm - stephanosio - bbolen - - wearyzen + - ithinuel files: - arch/arm/ - arch/arm/core/offsets/ @@ -180,6 +203,9 @@ ARM64 arch: - npitre - povergoing - sgrrzhf + - wearyzen + - ithinuel + - JiafeiPan files: - arch/arm64/ - include/zephyr/arch/arm64/ @@ -195,9 +221,9 @@ ARM64 arch: ARM Platforms: status: maintained maintainers: - - ithinuel - collaborators: - wearyzen + collaborators: + - ithinuel files: - boards/arm/mps*/ - boards/arm/v2m_*/ @@ -265,6 +291,21 @@ Ambiq Platforms: labels: - "platform: Ambiq" +AndesTech Platforms: + status: maintained + maintainers: + - jimmyzhe + collaborators: + - kevinwang821020 + files: + - boards/andestech/ + - drivers/*/*andes* + - dts/bindings/*/*andestech* + - dts/riscv/andes/ + - soc/andestech/ + labels: + - "platform: Andes Technology" + BeagleBoard Platforms: status: maintained maintainers: @@ -273,6 +314,7 @@ BeagleBoard Platforms: - ayush1325 - con-pax - vaishnavachath + - glneo files: - boards/beagle/ labels: @@ -338,9 +380,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* @@ -408,11 +450,11 @@ Bluetooth Host: - samples/bluetooth/tmap*/ - samples/bluetooth/iso_*/ - samples/bluetooth/mesh*/ - - subsys/bluetooth/Kconfig.iso - subsys/bluetooth/host/iso.c - 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/ @@ -501,11 +543,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" @@ -524,7 +570,6 @@ Bluetooth ISO: - include/zephyr/bluetooth/iso.h - doc/connectivity/bluetooth/shell/host/iso.rst - samples/bluetooth/iso_*/ - - subsys/bluetooth/Kconfig.iso - subsys/bluetooth/host/iso.c - subsys/bluetooth/host/iso_internal.h - subsys/bluetooth/host/shell/iso.c @@ -856,7 +901,6 @@ Demand Paging: Device Driver Model: status: maintained maintainers: - - gmarull - tbursztyka collaborators: - dcpleung @@ -889,7 +933,9 @@ DFU: - dfu Devicetree: - status: odd fixes + status: maintained + maintainers: + - mbolivar collaborators: - decsny - galak @@ -946,6 +992,7 @@ Display drivers: collaborators: - jfischer-no - danieldegrasse + - VynDragon files: - drivers/display/ - dts/bindings/display/ @@ -1000,9 +1047,9 @@ Documentation: Documentation Infrastructure: status: maintained maintainers: - - gmarull - kartben collaborators: + - gmarull - carlescufi - nashif files: @@ -1017,8 +1064,8 @@ Documentation Infrastructure: Release Notes: status: maintained maintainers: - - fabiobaltieri - - kartben + - danieldegrasse + - dkalowsk collaborators: - kartben files: @@ -1231,6 +1278,8 @@ Release Notes: status: maintained maintainers: - ceolin + collaborators: + - valeriosetti files: - drivers/crypto/ - dts/bindings/crypto/ @@ -1385,12 +1434,14 @@ Release Notes: - drivers.espi "Drivers: Ethernet": - status: odd fixes + status: maintained + maintainers: + - maass-hamburg collaborators: - decsny - lmajewski - pdgendt - - maass-hamburg + - clamattia files: - drivers/ethernet/ - include/zephyr/dt-bindings/ethernet/ @@ -1492,6 +1543,7 @@ Release Notes: files: - doc/hardware/peripherals/gnss.rst - drivers/gnss/ + - include/zephyr/data/navigation.h - include/zephyr/drivers/gnss.h - include/zephyr/drivers/gnss/ - dts/bindings/gnss/ @@ -1618,6 +1670,9 @@ Release Notes: status: maintained maintainers: - carlocaione + collaborators: + - wearyzen + - ithinuel files: - include/zephyr/drivers/mbox.h - drivers/mbox/ @@ -1740,31 +1795,11 @@ 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: - Mani-Sadhasivam - simonguinot - collaborators: - - bbilas files: - drivers/led/ - include/zephyr/drivers/led/ @@ -1801,7 +1836,6 @@ Release Notes: "Drivers: MFD": status: odd fixes collaborators: - - gmarull - aasinclair files: - drivers/mfd/ @@ -1912,8 +1946,8 @@ Release Notes: - samples.drivers.peci "Drivers: Pin Control": - status: maintained - maintainers: + status: odd fixes + collaborators: - gmarull files: - doc/hardware/pinctrl/ @@ -2049,7 +2083,7 @@ Release Notes: labels: - "area: Sensors" tests: - - drivers.sensors + - drivers.sensor "Drivers: SMBus": status: maintained @@ -2094,12 +2128,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: @@ -2226,16 +2263,6 @@ Release Notes: labels: - "area: Wi-Fi" -"Drivers: Wi-Fi NXP": - status: maintained - maintainers: - - dleach02 - - MaochenWang1 - files: - - drivers/wifi/nxp/ - labels: - - "platform: NXP Drivers" - "Drivers: Memory Management": status: maintained maintainers: @@ -2295,11 +2322,9 @@ EC Host Commands: Xen Platform: status: maintained maintainers: - - povergoing + - firscity collaborators: - - SgrrZhf - lorc - - firscity - luca-fancellu files: - include/zephyr/xen/ @@ -2380,8 +2405,6 @@ Input: status: maintained maintainers: - fabiobaltieri - collaborators: - - gmarull files: - doc/services/input/ - drivers/input/ @@ -2432,7 +2455,8 @@ JSON Web Token: - sir-branch files: - subsys/jwt/ - - include/zephyr/data/ + - include/zephyr/data/json.h + - include/zephyr/data/jwt.h - lib/utils/json.c - tests/subsys/jwt/ - tests/lib/json/ @@ -2738,6 +2762,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: @@ -2783,7 +2822,7 @@ hawkBit: tests: - sample.net.updatehub -Native POSIX/Sim and POSIX arch: +Native_sim and POSIX arch: status: maintained maintainers: - aescolar @@ -2806,7 +2845,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 @@ -2838,7 +2877,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/ @@ -2891,7 +2929,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/ @@ -3048,7 +3085,7 @@ Networking: collaborators: - pdgendt - canisLupus1313 - - mariuszpos + - kkasperczyk-no - edmont - maciejbaczmanski files: @@ -3141,6 +3178,9 @@ Open AMP: status: maintained maintainers: - carlocaione + collaborators: + - uLipe + - iuliana-prodan files: - lib/open-amp/ - samples/subsys/ipc/openamp/ @@ -3163,6 +3203,20 @@ PHYTEC Platforms: labels: - "platform: PHYTEC" +PMCI: + status: maintained + maintainers: + - teburd + collaborators: + - nashif + - inteljiangwe1 + - kehintel + files: + - subsys/pmci/ + - samples/modules/pmci/ + labels: + - "area: PMCI" + POSIX API layer: status: maintained maintainers: @@ -3227,6 +3281,7 @@ RISCV arch: - carlocaione - npitre - ycsin + - VynDragon files: - arch/riscv/ - boards/enjoydigital/litex_vexriscv/ @@ -3336,7 +3391,7 @@ Settings: - subsys/settings/ - tests/subsys/settings/ - samples/subsys/settings/ - - doc/services/settings/ + - doc/services/storage/settings/ labels: - "area: Settings" tests: @@ -3424,26 +3479,44 @@ ADI Platforms: collaborators: - ozersa - ttmut + - yasinustunerg - galak - 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" +Bouffalolab Platforms: + status: maintained + maintainers: + - nandojve + files: + - boards/bouffalolab/ + - drivers/*/*bflb* + - dts/riscv/bouffalolab/ + - dts/bindings/*/bflb,* + - soc/bouffalolab/ + labels: + - "platform: bouffalolab" + Broadcom Platforms: status: odd fixes files: @@ -3456,7 +3529,6 @@ GD32 Platforms: maintainers: - nandojve collaborators: - - gmarull - soburi - cameled files: @@ -3553,10 +3625,18 @@ Raspberry Pi Pico Platforms: - soburi collaborators: - yonsch + - 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 @@ -3570,17 +3650,21 @@ Silabs Platforms: status: maintained maintainers: - jhedberg + - asmellby collaborators: - jerome-pouiller - - asmellby + - Martinhoff-maker files: - soc/silabs/ - boards/silabs/ - 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" @@ -3710,6 +3794,7 @@ NXP Drivers: - decsny - manuargue - dbaluta + - Raymond0225 files-regex: - ^drivers/.*nxp.* - ^drivers/.*mcux.* @@ -3727,18 +3812,34 @@ NXP Drivers: - include/zephyr/dt-bindings/inputmux/ - include/zephyr/dt-bindings/rdc/ - include/zephyr/drivers/*/*nxp* + - include/zephyr/drivers/*/*nxp*/ - include/zephyr/drivers/*/*mcux* - arch/arm/core/mpu/nxp_mpu.c - dts/bindings/*/nxp* files-exclude: - - drivers/wifi/nxp/ - - drivers/usb/*/*mcux* + - drivers/wifi/ + - drivers/bluetooth/ + - drivers/usb/ files-regex-exclude: - .*s32.* labels: - "platform: NXP Drivers" description: NXP Drivers +NXP Wireless: + status: maintained + maintainers: + - dleach02 + collaborators: + - MaochenWang1 + - axelnxp + files: + - drivers/wifi/nxp/ + - drivers/bluetooth/hci/*nxp* + - drivers/ieee802154/ieee802154_kw41z.c + labels: + - "platform: NXP Drivers" + NXP MCUX USB: status: maintained maintainers: @@ -3746,6 +3847,7 @@ NXP MCUX USB: - MarkWangChinese files: - drivers/usb/*/*mcux* + - boards/nxp/usb_kw24d512/ labels: - "platform: NXP Drivers" description: NXP MCUX USB shim drivers @@ -3757,7 +3859,6 @@ NXP Platforms (MCU): - mmahadevan108 collaborators: - DerekSnell - - yvanderv - EmilioCBen - decsny - butok @@ -3766,8 +3867,11 @@ NXP Platforms (MCU): - boards/nxp/frdm*/ - boards/nxp/lpcxpress*/ - boards/nxp/twr_*/ - - boards/nxp/vmu*/ - boards/nxp/*rw*/ + - boards/nxp/hexiwear/ + - boards/nxp/common/ + - boards/nxp/* + - soc/nxp/common/ - soc/nxp/imxrt/ - soc/nxp/kinetis/ - soc/nxp/lpc/ @@ -3788,13 +3892,9 @@ NXP Platforms (S32): maintainers: - manuargue collaborators: - - PetervdPerk-NXP - - bperseghetti - Dat-NguyenDuy files: - - boards/nxp/s32*/ - - boards/nxp/mr_canhubk3/ - - boards/nxp/ucans32k1sic/ + - boards/nxp/*s32*/ - boards/common/*nxp_s32* - soc/nxp/s32/ - drivers/*/*nxp_s32* @@ -3817,12 +3917,12 @@ NXP Platforms (MPU): - dleach02 - dbaluta - iuliana-prodan - - yvanderv files: - dts/arm64/nxp/ - dts/arm/nxp/nxp_imx* - soc/nxp/imx/ - soc/nxp/layerscape/ + - boards/nxp/ls1046ardb/ files-regex: - boards/nxp/m?imx[^(rt)].*/ labels: @@ -3842,6 +3942,19 @@ NXP Platforms (Xtensa): - "platform: NXP Xtensa" description: NXP Xtensa platforms +NXP Platforms (Robotics Products): + status: maintained + maintainers: + - bperseghetti + - PetervdPerk-NXP + files: + - boards/nxp/vmu*/ + - boards/nxp/rddrone_fmuk66/ + - boards/nxp/mr_canhubk3/ + labels: + - "platform: NXP Robotics" + description: NXP Robotics Module Platform Products + Microchip MEC Platforms: status: maintained maintainers: @@ -3916,6 +4029,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: @@ -3973,6 +4099,7 @@ Renesas RA Platforms: collaborators: - duynguyenxa - thaoluonguw + - thenguyenyf files: - boards/arduino/uno_r4/ - boards/renesas/*ra*/ @@ -3981,6 +4108,7 @@ Renesas RA Platforms: - dts/arm/renesas/ra/ - dts/bindings/*/*renesas,ra* - soc/renesas/ra/ + - samples/boards/renesas/ labels: - "platform: Renesas RA" description: >- @@ -3991,13 +4119,18 @@ Renesas RZ Platforms: status: maintained maintainers: - tgorochowik + - binhnguyen2434 + collaborators: + - nhutnguyenkc files: - - boards/renesas/rzt2m_*/ + - boards/renesas/rz*/ - drivers/*/*rzt2m* + - drivers/*/*renesas_rz* - drivers/pinctrl/renesas/rz/ - dts/arm/renesas/rz/ - dts/bindings/*/*rzt2m* - - soc/renesas/rzt2m/ + - dts/bindings/*/*renesas,rz* + - soc/renesas/rz/ labels: - "platforms: Renesas RZ" description: >- @@ -4080,6 +4213,17 @@ STM32 Wireless Platforms: STM32WB SOCs, dts files and related drivers. STM32WB development boards and ST bluetooth shields. +Enclustra Platforms: + status: maintained + maintainers: + - fkokosinski + collaborators: + - tgorochowik + files: + - boards/enclustra/ + labels: + - "platform: Enclustra" + Espressif Platforms: status: maintained maintainers: @@ -4153,8 +4297,11 @@ TI K3 Platforms: collaborators: - gramsay0 - dnltz + - glneo files: - boards/ti/*am62*/ + - drivers/*/*davinci* + - drivers/*/*omap* - drivers/*/*ti_k3* - dts/bindings/*/ti,k3* - soc/ti/k3/ @@ -4266,13 +4413,24 @@ Secure storage: - 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: @@ -4340,8 +4498,13 @@ Task Watchdog: TDK Sensors: status: maintained maintainers: + - afontaine-invn + - rbuisson-invn + collaborators: - teburd - MaureenHelm + - sriccardi-invn + - gjabouley-invn files: - drivers/sensor/tdk/ labels: @@ -4404,6 +4567,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: @@ -4702,10 +4877,10 @@ West: "West project: cmsis_6": status: maintained maintainers: - - ithinuel + - wearyzen collaborators: - tomi-font - - wearyzen + - ithinuel files: [] labels: - "area: CMSIS_6" @@ -4737,6 +4912,7 @@ West: collaborators: - ozersa - ttmut + - yasinustunerg files: [] labels: - "platform: ADI" @@ -4772,6 +4948,15 @@ West: labels: - "platform: Microchip SAM" +"West project: hal_bouffalolab": + status: maintained + maintainers: + - nandojve + files: + - modules/hal_bouffalolab/ + labels: + - "platform: Bouffalo Lab" + "West project: hal_cypress": status: maintained maintainers: @@ -4800,9 +4985,9 @@ West: status: maintained maintainers: - kristofer-jonsson-arm - - ithinuel - collaborators: - wearyzen + collaborators: + - ithinuel files: - drivers/misc/ethos_u/ - modules/hal_ethos_u/ @@ -4814,7 +4999,6 @@ West: maintainers: - nandojve collaborators: - - gmarull - soburi files: - modules/hal_gigadevice/ @@ -4881,9 +5065,6 @@ West: - bperseghetti files: - modules/hal_nxp/ - - modules/Kconfig.imx - - modules/Kconfig.mcux - - modules/Kconfig.nxp_s32 labels: - "platform: NXP" @@ -4926,6 +5107,8 @@ West: - soburi collaborators: - yonsch + - threeeights + - ajf58 files: - modules/hal_rpi_pico/ labels: @@ -4935,13 +5118,14 @@ West: status: maintained maintainers: - jhedberg + - asmellby collaborators: - jerome-pouiller - - asmellby - sateeshkotapati - yonsch - mnkp - rettichschnidi + - Martinhoff-maker files: - modules/hal_silabs/ labels: @@ -5005,6 +5189,8 @@ West: maintainers: - nzmichaelh - kholia + collaborators: + - VynDragon files: - modules/hal_wch/ @@ -5047,6 +5233,17 @@ West: labels: - "area: Rust" +"West project: libmctp": + status: maintained + maintainers: + - teburd + collaborators: + - nashif + - inteljiangwe1 + files: [] + labels: + - "area: MCTP" + "West project: libmetal": status: odd fixes collaborators: @@ -5117,10 +5314,10 @@ West: - d3zd3z - ceolin collaborators: - - ithinuel - wearyzen - valeriosetti - tomi-font + - ithinuel files: - modules/mbedtls/ - tests/crypto/mbedtls/ @@ -5204,6 +5401,8 @@ West: status: odd fixes collaborators: - carlocaione + - uLipe + - iuliana-prodan files: - modules/Kconfig.open-amp labels: @@ -5270,7 +5469,9 @@ West: - "area: Audio" "West project: tflite-micro": - status: odd fixes + status: maintained + maintainers: + - XenuIsWatching collaborators: - laurenmurphyx64 files: @@ -5306,10 +5507,10 @@ West: - d3zd3z collaborators: - Vge0rge - - ithinuel - wearyzen - valeriosetti - tomi-font + - ithinuel files: - modules/trusted-firmware-m/ - samples/tfm_integration/ @@ -5326,8 +5527,8 @@ West: - d3zd3z collaborators: - Vge0rge - - ithinuel - wearyzen + - ithinuel files: [] labels: - "area: TF-M" @@ -5339,8 +5540,8 @@ West: - sgrrzhf collaborators: - carlocaione - - ithinuel - wearyzen + - ithinuel files: - modules/trusted-firmware-a/ labels: @@ -5352,8 +5553,8 @@ West: - d3zd3z collaborators: - Vge0rge - - ithinuel - wearyzen + - ithinuel files: [] labels: - "area: TF-M" @@ -5516,6 +5717,31 @@ Random: labels: - "area: Random" +Peregrine Platforms: + status: maintained + maintainers: + - nandojve + files: + - boards/peregrine/ + 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 @@ -5526,8 +5752,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" @@ -5557,6 +5783,7 @@ zbus: - cmake/llext-edk.cmake - samples/subsys/llext/ - include/zephyr/llext/ + - tests/misc/llext-edk/ - tests/subsys/llext/ - subsys/llext/ - doc/services/llext/ diff --git a/VERSION b/VERSION index b170abf44be..9749142466b 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 94e9a540a08..916351ae605 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. @@ -573,6 +573,15 @@ config IRQ_OFFLOAD run in interrupt context. Only useful for test cases that need to validate the correctness of kernel objects in IRQ context. +config SRAM_VECTOR_TABLE + bool "Place the vector table in SRAM instead of flash" + depends on ARCH_HAS_VECTOR_TABLE_RELOCATION + depends on XIP + depends on !ROMSTART_RELOCATION_ROM + help + When XiP is enabled, this option will result in the vector table being + relocated from Flash to SRAM. + config IRQ_OFFLOAD_NESTED bool "irq_offload() supports nested IRQs" depends on IRQ_OFFLOAD @@ -671,6 +680,9 @@ config ARCH_HAS_NOCACHE_MEMORY_SUPPORT config ARCH_HAS_RAMFUNC_SUPPORT bool +config ARCH_HAS_VECTOR_TABLE_RELOCATION + bool + config ARCH_HAS_NESTED_EXCEPTION_DETECTION bool @@ -1134,9 +1146,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 d76acba59a3..00000000000 --- 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 19db8d46246..00000000000 --- 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 6ba748b3455..f33bd638d77 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 9f9f1073431..db2a74e164e 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/arc/core/fault.c b/arch/arc/core/fault.c index 6f9da3cd1e0..adbd6da12bb 100644 --- a/arch/arc/core/fault.c +++ b/arch/arc/core/fault.c @@ -346,7 +346,7 @@ static void dump_exception_info(uint32_t vector, uint32_t cause, uint32_t parame * invokes the user provided routine k_sys_fatal_error_handler() which is * responsible for implementing the error handling policy. */ -void _Fault(struct arch_esf *esf, uint32_t old_sp) +void z_arc_fault(struct arch_esf *esf, uint32_t old_sp) { uint32_t vector, cause, parameter; uint32_t exc_addr = z_arc_v2_aux_reg_read(_ARC_V2_EFA); diff --git a/arch/arc/core/fault_s.S b/arch/arc/core/fault_s.S index d89f3fe6a82..69fb03082a5 100644 --- a/arch/arc/core/fault_s.S +++ b/arch/arc/core/fault_s.S @@ -19,7 +19,7 @@ #include #include -GTEXT(_Fault) +GTEXT(z_arc_fault) GTEXT(__reset) GTEXT(__memory_error) GTEXT(__instruction_error) @@ -99,11 +99,11 @@ _exc_entry: _save_exc_regs_into_stack - /* sp is parameter of _Fault */ + /* sp is parameter of z_arc_fault */ MOVR r0, sp /* ilink is the thread's original sp */ MOVR r1, ilink - jl _Fault + jl z_arc_fault _exc_return: /* the exception cause must be fixed in exception handler when exception returns diff --git a/arch/arm/core/Kconfig b/arch/arm/core/Kconfig index 2573ca2cac6..5505eee4e19 100644 --- a/arch/arm/core/Kconfig +++ b/arch/arm/core/Kconfig @@ -16,6 +16,7 @@ config CPU_CORTEX_M select ARCH_HAS_USERSPACE if ARM_MPU select ARCH_HAS_NOCACHE_MEMORY_SUPPORT if ARM_MPU && CPU_HAS_ARM_MPU && CPU_HAS_DCACHE select ARCH_HAS_RAMFUNC_SUPPORT + select ARCH_HAS_VECTOR_TABLE_RELOCATION if CPU_CORTEX_M_HAS_VTOR select ARCH_HAS_NESTED_EXCEPTION_DETECTION select SWAP_NONATOMIC select ARCH_HAS_EXTRA_EXCEPTION_INFO diff --git a/arch/arm/core/cortex_a_r/Kconfig b/arch/arm/core/cortex_a_r/Kconfig index 409968ca6c7..a6176bbe5c0 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 31cf27a08e6..07c5b32bf32 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 78414fcd0a1..ecf7bab57f0 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 daf1d2345ca..eac07cbf9b2 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 48c9ede3327..5303d1d7178 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 b5cea619f09..d721baceda2 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 ff5e443759b..1467dbca3a4 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 a41e1ab5942..04b19f0b046 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 e74b6a41c8d..d5d95272548 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/CMakeLists.txt b/arch/arm/core/cortex_m/CMakeLists.txt index 05723811929..54bca650084 100644 --- a/arch/arm/core/cortex_m/CMakeLists.txt +++ b/arch/arm/core/cortex_m/CMakeLists.txt @@ -61,3 +61,13 @@ zephyr_linker_sources( vt_pointer_section.ld ) endif() + +if (CONFIG_CPU_CORTEX_M_HAS_VTOR) +zephyr_linker_sources_ifdef(CONFIG_SRAM_VECTOR_TABLE + RAM_SECTIONS + # Maybe need to be changed in order to be placed at the beginning of RAM + # (conflict with code relocation script) + SORT_KEY 0 + ram_vector_table.ld +) +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 aac96472ecf..163a9d0cdd2 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 c688c91d981..ddb539c4e34 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 5f373a88c9d..47eff95090a 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 61fb6814535..47141d913dd 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/exc_exit.c b/arch/arm/core/cortex_m/exc_exit.c index 450b3972361..a919fd8bbd7 100644 --- a/arch/arm/core/cortex_m/exc_exit.c +++ b/arch/arm/core/cortex_m/exc_exit.c @@ -55,13 +55,8 @@ FUNC_ALIAS(z_arm_exc_exit, z_arm_int_exit, void); Z_GENERIC_SECTION(.text._HandlerModeExit) void z_arm_exc_exit(void) { #ifdef CONFIG_PREEMPT_ENABLED - /* If thread is preemptible */ - if (_kernel.cpus->current->base.prio >= 0) { - /* and cached thread is not current thread */ - if (_kernel.ready_q.cache != _kernel.cpus->current) { - /* trigger a context switch */ - SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk; - } + if (_kernel.ready_q.cache != _kernel.cpus->current) { + SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk; } #endif /* CONFIG_PREEMPT_ENABLED */ diff --git a/arch/arm/core/cortex_m/fault.c b/arch/arm/core/cortex_m/fault.c index 56d5be60f4c..27ce260dad5 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 a9c964d14d1..b937d725c28 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 b6b128e3368..edd1f519677 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 cc62386e8ac..6d1c8917c4d 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 46aac160c3b..f75963c413f 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/prep_c.c b/arch/arm/core/cortex_m/prep_c.c index cadf9a9a867..632fc142003 100644 --- a/arch/arm/core/cortex_m/prep_c.c +++ b/arch/arm/core/cortex_m/prep_c.c @@ -23,27 +23,27 @@ #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 +#ifdef CONFIG_SRAM_VECTOR_TABLE +#define VECTOR_ADDRESS ((uintptr_t)_sram_vector_start) +#else #define VECTOR_ADDRESS ((uintptr_t)_vector_start) +#endif /* In some Cortex-M3 implementations SCB_VTOR bit[29] is called the TBLBASE bit */ #ifdef SCB_VTOR_TBLBASE_Msk @@ -54,6 +54,12 @@ void *_vector_table_pointer; void __weak relocate_vector_table(void) { +#ifdef CONFIG_SRAM_VECTOR_TABLE + /* Copy vector table to its location in SRAM */ + size_t vector_size = (size_t)_vector_end - (size_t)_vector_start; + + z_early_memcpy(_sram_vector_start, _vector_start, vector_size); +#endif SCB->VTOR = VECTOR_ADDRESS & VTOR_MASK; barrier_dsync_fence_full(); barrier_isync_fence_full(); @@ -64,8 +70,8 @@ void __weak 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 +79,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 +104,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 +174,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/ram_vector_table.ld b/arch/arm/core/cortex_m/ram_vector_table.ld new file mode 100644 index 00000000000..0c2353ab114 --- /dev/null +++ b/arch/arm/core/cortex_m/ram_vector_table.ld @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Silicon Laboratories Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Vector table is not necessarily at the start of the RAM region: in the case where Zephyr code + * relocation is used, the vector table is placed after the relocated code. + * Relocated code is always placed at the start of the RAM SECTION because of the hard-coded value + * generated by "gen_relocate_app.py" in the file. It can create quite a big gap and lose about the + * size of alignment in RAM space. + */ + +SECTION_PROLOGUE(.sram_vt,,) +{ + /* Heritage of vector table alignment in flash (see vector_table.ld in arch/arm/core/) */ +#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) + . = ALIGN( 1 << LOG2CEIL(4 * 64) ); +#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) + . = ALIGN( 1 << LOG2CEIL(4 * 32) ); +#else +#error "Unsupported architecture variant" +#endif + + . = ALIGN( 1 << LOG2CEIL(4 * (16 + CONFIG_NUM_IRQS)) ); + + _sram_vector_start = .; + . += _vector_end - _vector_start; + MPU_ALIGN(_sram_vector_size); + _sram_vector_end = .; +} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) +_sram_vector_size = _sram_vector_end - _sram_vector_start; diff --git a/arch/arm/core/cortex_m/scb.c b/arch/arm/core/cortex_m/scb.c index a511a8de9b1..957c66dcc9f 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 2a8c6d55a05..51ecd1f478c 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/swap_helper.S b/arch/arm/core/cortex_m/swap_helper.S index f1bbbfa2a13..40f00fc0056 100644 --- a/arch/arm/core/cortex_m/swap_helper.S +++ b/arch/arm/core/cortex_m/swap_helper.S @@ -159,9 +159,13 @@ SECTION_FUNC(TEXT, z_arm_pendsv) #if defined(CONFIG_THREAD_LOCAL_STORAGE) /* Grab the TLS pointer */ +#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) ldr r4, =_thread_offset_to_tls adds r4, r2, r4 ldr r0, [r4] +#else + ldr r0, [r2, #_thread_offset_to_tls] +#endif /* For Cortex-M, store TLS pointer in a global variable, * as it lacks the process ID or thread ID register diff --git a/arch/arm/core/cortex_m/thread.c b/arch/arm/core/cortex_m/thread.c index c88fd8e41a0..f1fc2019d9c 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 6cb157552ac..2ce7f64552b 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 19c67476e40..aac4f651619 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 5fdc5471a6b..d44e7dd2e2c 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 f37b4354d46..62ef1492557 100644 --- a/arch/arm/core/mmu/arm_mmu.c +++ b/arch/arm/core/mmu/arm_mmu.c @@ -304,13 +304,15 @@ static struct arm_mmu_perms_attrs arm_mmu_convert_attr_flags(uint32_t attrs) perms_attrs.cacheable = 0; perms_attrs.domain = ARM_MMU_DOMAIN_DEVICE; - if (attrs & MATTR_SHARED) { - perms_attrs.tex = 0; - perms_attrs.bufferable = 1; - } else { - perms_attrs.tex = 2; - perms_attrs.bufferable = 0; - } + /* + * ARM deprecates the marking of Device memory with a + * shareability attribute other than Outer Shareable + * or Shareable. This means ARM strongly recommends + * that Device memory is never assigned a shareability + * attribute of Non-shareable or Inner Shareable. + */ + perms_attrs.tex = 0; + perms_attrs.bufferable = 1; } else if (attrs & MT_NORMAL) { /* * TEX[2] is always 1. TEX[1:0] contain the outer cache attri- @@ -803,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 0c1fbbf4c0f..ff48692ec65 100644 --- a/arch/arm/core/mpu/Kconfig +++ b/arch/arm/core/mpu/Kconfig @@ -1,54 +1,15 @@ # 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 -config ARM_MPU - bool "ARM MPU Support" - select MPU - select SRAM_REGION_PERMISSIONS - select THREAD_STACK_INFO - select ARCH_HAS_EXECUTABLE_PAGE_BIT - select MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT if !(CPU_HAS_NXP_SYSMPU || ARMV8_M_BASELINE || ARMV8_M_MAINLINE || AARCH32_ARMV8_R) - select MPU_REQUIRES_NON_OVERLAPPING_REGIONS if CPU_HAS_ARM_MPU && (ARMV8_M_BASELINE || ARMV8_M_MAINLINE || AARCH32_ARMV8_R) - select MPU_GAP_FILLING if AARCH32_ARMV8_R - select ARCH_MEM_DOMAIN_SUPPORTS_ISOLATED_STACKS - select MEM_DOMAIN_ISOLATED_STACKS - help - MCU implements Memory Protection Unit. - - Notes: - The ARMv6-M and ARMv7-M MPU architecture requires a power-of-two - alignment of MPU region base address and size. - - The NXP MPU as well as the ARMv8-M MPU do not require MPU regions - to have power-of-two alignment for base address and region size. - - The ARMv8-M MPU requires the active MPU regions be non-overlapping. - As a result of this, the ARMv8-M MPU needs to fully partition the - memory map when programming dynamic memory regions (e.g. PRIV stack - guard, user thread stack, and application memory domains), if the - system requires PRIV access policy different from the access policy - of the ARMv8-M background memory map. The application developer may - enforce full PRIV (kernel) memory partition by enabling the - CONFIG_MPU_GAP_FILLING option. - By not enforcing full partition, MPU may leave part of kernel - SRAM area covered only by the default ARMv8-M memory map. This - is fine for User Mode, since the background ARM map does not - allow nPRIV access at all. However, since the background map - policy allows instruction fetches by privileged code, forcing - this Kconfig option off prevents the system from directly - triggering MemManage exceptions upon accidental attempts to - execute code from SRAM in XIP builds. - Since this does not compromise User Mode, we make the skipping - of full partitioning the default behavior for the ARMv8-M MPU - driver. - config ARM_MPU_REGION_MIN_ALIGN_AND_SIZE int default 256 if ARM_MPU && ARMV6_M_ARMV8_M_BASELINE && !ARMV8_M_BASELINE + default 128 if ARM_MPU && FPU_SHARING && MPU_STACK_GUARD default 64 if ARM_MPU && AARCH32_ARMV8_R default 32 if ARM_MPU default 4 @@ -108,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 dde98c0b07f..2426b85aacb 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 */ @@ -62,55 +63,80 @@ extern char __ram_text_reloc_start[]; extern char __ram_text_reloc_size[]; #endif +#if defined(CONFIG_SRAM_VECTOR_TABLE) +extern char _sram_vector_start[]; +extern char _sram_vector_size[]; +#endif + 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_SRAM_VECTOR_TABLE) + { + /* Vector table in SRAM */ + .start = (uint32_t)&_sram_vector_start, + .size = (uint32_t)&_sram_vector_size, +#if defined(CONFIG_ARM_MPU_PXN) && defined(CONFIG_USERSPACE) + .attr = K_MEM_PARTITION_P_R_U_RX, +#else + .attr = K_MEM_PARTITION_P_RO_U_RO, +#endif + }, +#endif /* CONFIG_SRAM_VECTOR_TABLE */ #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 f121e57e392..f9a5397da46 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 */ @@ -42,7 +43,8 @@ BUILD_ASSERT((DT_FOREACH_STATUS_OKAY_NODE_VARGS( (DT_REG_SIZE(node_id) >= CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION_PAGE_SIZE)) || #define DT_NULL_PAGE_DETECT_NODE_EXIST \ - (DT_FOREACH_STATUS_OKAY_NODE_VARGS(NULL_PAGE_DETECT_NODE_FINDER, zephyr_memory_attr) false) + (DT_FOREACH_STATUS_OKAY_VARGS(zephyr_memory_region, NULL_PAGE_DETECT_NODE_FINDER, \ + zephyr_memory_attr) false) /* * Global status variable holding the number of HW MPU region indices, which @@ -92,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. */ @@ -110,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); @@ -157,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. */ @@ -458,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 51ab093d17c..0716c017ff9 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 b0fe24c6bf6..ae893086901 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 9b731286c7d..0dc21285a91 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 ff5e5120d8d..ca997220dbd 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 ed0df44dfde..947b35dca92 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 c021d59d764..0800a16436f 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 2a24103a32d..5abe5870762 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 feeaf719a88..6b534a3ea5b 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 51ed5eb1ca9..dd6dcb4c22e 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/Kconfig b/arch/arm64/core/Kconfig index 29f2cb6105b..35a480a24fd 100644 --- a/arch/arm64/core/Kconfig +++ b/arch/arm64/core/Kconfig @@ -143,17 +143,6 @@ config ARM64_SAFE_EXCEPTION_STACK used for user stack overflow checking, because kernel stack support the checking work. -config ARM64_ENABLE_FRAME_POINTER - bool - depends on OVERRIDE_FRAME_POINTER_DEFAULT && !OMIT_FRAME_POINTER - depends on !FRAME_POINTER - select DEPRECATED - help - Deprecated. Use CONFIG_FRAME_POINTER instead. - Hidden option to simplify access to OVERRIDE_FRAME_POINTER_DEFAULT - and OMIT_FRAME_POINTER. It is automatically enabled when the frame - pointer unwinding is enabled. - config ARM64_EXCEPTION_STACK_TRACE bool default y diff --git a/arch/arm64/core/cortex_r/Kconfig b/arch/arm64/core/cortex_r/Kconfig index 41353789515..e7008cce5ef 100644 --- a/arch/arm64/core/cortex_r/Kconfig +++ b/arch/arm64/core/cortex_r/Kconfig @@ -7,39 +7,6 @@ if CPU_HAS_MPU -config ARM_MPU - bool "ARM MPU Support" - select THREAD_STACK_INFO - select MPU - select SRAM_REGION_PERMISSIONS - select ARCH_MEM_DOMAIN_SYNCHRONOUS_API if USERSPACE - default y - help - MPU implements Memory Protection Unit. - - Notes: - The ARMv8-R MPU architecture requires a power-of-two alignment - of MPU region base address and size(64 bytes aligned). - - The ARMv8-R MPU requires the active MPU regions be non-overlapping. - As a result of this, the ARMv8-R MPU needs to fully partition the - memory map when programming dynamic memory regions (e.g. PRIV stack - guard, user thread stack, and application memory domains), if the - system requires PRIV access policy different from the access policy - of the ARMv8-R background memory map. The application developer may - enforce full PRIV (kernel) memory partition by enabling the - CONFIG_MPU_GAP_FILLING option. - By not enforcing full partition, MPU may leave part of kernel - SRAM area covered only by the default ARMv8-R memory map. This - is fine for User Mode, since the background ARM map does not - allow nPRIV access at all. However, since the background map - policy allows instruction fetches by privileged code, forcing - this Kconfig option off prevents the system from directly - triggering MemManage exceptions upon accidental attempts to - execute code from SRAM in XIP builds. - Since this does not compromise User Mode, we make the skipping - of full partitioning the default behavior for the ARMv8-R MPU - driver. config ARM_MPU_REGION_MIN_ALIGN_AND_SIZE int diff --git a/arch/arm64/core/cortex_r/arm_mpu.c b/arch/arm64/core/cortex_r/arm_mpu.c index 2bd6d265c9a..3053d90cb75 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 66e9f21fc06..c60c99fad46 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 7955b6f7d6d..e7480c9de15 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 a01139ad700..235156f9a1c 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 18f49945eda..c48672a5f07 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 632304b7029..1c2f4218ff1 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 48685151ab1..6f84bb96351 100644 --- a/arch/common/CMakeLists.txt +++ b/arch/common/CMakeLists.txt @@ -27,8 +27,6 @@ zephyr_library_sources_ifdef( multilevel_irq.c ) -zephyr_library_sources_ifdef(CONFIG_LEGACY_MULTI_LEVEL_TABLE_GENERATION multilevel_irq_legacy.c) - zephyr_library_sources_ifdef(CONFIG_SHARED_INTERRUPTS shared_irq.c) if(NOT CONFIG_ARCH_HAS_TIMING_FUNCTIONS AND @@ -58,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 @@ -76,9 +83,8 @@ zephyr_linker_sources_ifdef(CONFIG_NOCACHE_MEMORY nocache.ld ) -# Only ARM, X86 and OPENISA_RV32M1_RISCV32 use ROM_START_OFFSET. -if (DEFINED CONFIG_ARM OR DEFINED CONFIG_X86 OR DEFINED CONFIG_ARM64 - OR DEFINED CONFIG_SOC_OPENISA_RV32M1) +# Only ARM, X86 and RISCV use ROM_START_OFFSET. +if (DEFINED CONFIG_ARM OR DEFINED CONFIG_X86 OR DEFINED CONFIG_ARM64 OR DEFINED CONFIG_RISCV) # Exclamation mark is printable character with lowest number in ASCII table. # We are sure that this file will be included as a first. zephyr_linker_sources(ROM_START SORT_KEY ! rom_start_address.ld) diff --git a/arch/common/Kconfig b/arch/common/Kconfig index 2dcf2f5791b..1cc91d7c25b 100644 --- a/arch/common/Kconfig +++ b/arch/common/Kconfig @@ -16,24 +16,53 @@ config SEMIHOST This option is compatible with hardware and with QEMU, through the (automatic) use of the -semihosting-config switch when invoking it. -config LEGACY_MULTI_LEVEL_TABLE_GENERATION - bool "Auto generates the multi-level interrupt LUT (deprecated)" - default y - select DEPRECATED - depends on MULTI_LEVEL_INTERRUPTS - depends on !PLIC - depends on !NXP_IRQSTEER - depends on !RV32M1_INTMUX - depends on !CAVS_ICTL - depends on !DW_ICTL_ACE - depends on !DW_ICTL - help - A make-shift Kconfig to continue generating the multi-level interrupt LUT - with the legacy way using DT macros. - config ISR_TABLE_SHELL bool "Shell command to dump the ISR tables" depends on GEN_SW_ISR_TABLE depends on SHELL help This option enables a shell command to dump the ISR tables. + + +config ARM_MPU + bool "ARM MPU Support" + select MPU + select SRAM_REGION_PERMISSIONS + select THREAD_STACK_INFO + select ARCH_HAS_EXECUTABLE_PAGE_BIT if (CPU_AARCH32_CORTEX_R || CPU_CORTEX_M) + select MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT if !(CPU_HAS_NXP_SYSMPU || ARMV8_M_BASELINE || ARMV8_M_MAINLINE || AARCH32_ARMV8_R) + select MPU_REQUIRES_NON_OVERLAPPING_REGIONS if CPU_HAS_ARM_MPU && (ARMV8_M_BASELINE || ARMV8_M_MAINLINE || AARCH32_ARMV8_R) + select MPU_GAP_FILLING if AARCH32_ARMV8_R + select ARCH_MEM_DOMAIN_SUPPORTS_ISOLATED_STACKS if (CPU_AARCH32_CORTEX_R || CPU_CORTEX_M) + select ARCH_MEM_DOMAIN_SYNCHRONOUS_API if USERSPACE && CPU_AARCH64_CORTEX_R + default y if CPU_AARCH64_CORTEX_R + depends on CPU_HAS_MPU + help + MCU implements Memory Protection Unit. + + Notes: + The ARMv6-M, ARMv7-M, and ARMv8-R MPU MPU architecture requires a power-of-two + alignment of MPU region base address and size. + + The NXP MPU as well as the ARMv8-M MPU do not require MPU regions + to have power-of-two alignment for base address and region size. + + The ARMv8-M and ARMv8-R MPU requires the active MPU regions be non-overlapping. + As a result of this, both respective MPUs needs to fully partition the + memory map when programming dynamic memory regions (e.g. PRIV stack + guard, user thread stack, and application memory domains), if the + system requires PRIV access policy different from the access policy + of the ARMv8-M or ARMv8-R background memory map. The application developer may + enforce full PRIV (kernel) memory partition by enabling the + MPU_GAP_FILLING option. + By not enforcing full partition, MPU may leave part of kernel + SRAM area covered only by the default ARMv8-M or ARMv8-R memory map. This + is fine for User Mode, since the background ARM map does not + allow nPRIV access at all. However, since the background map + policy allows instruction fetches by privileged code, forcing + this Kconfig option off prevents the system from directly + triggering MemManage exceptions upon accidental attempts to + execute code from SRAM in XIP builds. + Since this does not compromise User Mode, we make the skipping + of full partitioning the default behavior for the ARMv8-M and ARMv8-R MPU + driver. diff --git a/arch/common/multilevel_irq_legacy.c b/arch/common/multilevel_irq_legacy.c deleted file mode 100644 index dd4fe68b5ac..00000000000 --- a/arch/common/multilevel_irq_legacy.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2018 Intel Corporation. - * Copyright (c) 2024 Meta. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -/** - * @file - * @brief This file houses the deprecated legacy macros-generated multi-level interrupt lookup - * table code, compiled when `CONFIG_LEGACY_MULTI_LEVEL_TABLE_GENERATION` is enabled. - */ - -/* - * Insert code if the node_id is an interrupt controller - */ -#define Z_IF_DT_IS_INTC(node_id, code) \ - IF_ENABLED(DT_NODE_HAS_PROP(node_id, interrupt_controller), (code)) - -/* - * Expands to node_id if its IRQN is equal to `_irq`, nothing otherwise - * This only works for `_irq` between 0 & 4095, see `IS_EQ` - */ -#define Z_IF_DT_INTC_IRQN_EQ(node_id, _irq) IF_ENABLED(IS_EQ(DT_IRQ(node_id, irq), _irq), (node_id)) - -/* - * Expands to node_id if it's an interrupt controller & its IRQN is `irq`, or nothing otherwise - */ -#define Z_DT_INTC_GET_IRQN(node_id, _irq) \ - Z_IF_DT_IS_INTC(node_id, Z_IF_DT_INTC_IRQN_EQ(node_id, _irq)) - -/** - * Loop through child of "/soc" and get root interrupt controllers with `_irq` as IRQN, - * this assumes only one device has the IRQN - * @param _irq irq number - * @return node_id(s) that has the `_irq` number, or empty if none of them has the `_irq` - */ -#define INTC_DT_IRQN_GET(_irq) \ - DT_FOREACH_CHILD_STATUS_OKAY_VARGS(DT_PATH(soc), Z_DT_INTC_GET_IRQN, _irq) - -#define INIT_IRQ_PARENT_OFFSET_2ND(n, d, i, o) \ - IRQ_PARENT_ENTRY_DEFINE(intc_l2_##n, DEVICE_DT_GET_OR_NULL(d), i, o, 2) - -#define IRQ_INDEX_TO_OFFSET(i, base) (base + i * CONFIG_MAX_IRQ_PER_AGGREGATOR) - -#define CAT_2ND_LVL_LIST(i, base) \ - INIT_IRQ_PARENT_OFFSET_2ND(i, INTC_DT_IRQN_GET(CONFIG_2ND_LVL_INTR_0##i##_OFFSET), \ - CONFIG_2ND_LVL_INTR_0##i##_OFFSET, \ - IRQ_INDEX_TO_OFFSET(i, base)) - -LISTIFY(CONFIG_NUM_2ND_LEVEL_AGGREGATORS, CAT_2ND_LVL_LIST, (;), CONFIG_2ND_LVL_ISR_TBL_OFFSET); - -#ifdef CONFIG_3RD_LEVEL_INTERRUPTS - -BUILD_ASSERT((CONFIG_NUM_3RD_LEVEL_AGGREGATORS * CONFIG_MAX_IRQ_PER_AGGREGATOR) <= - BIT(CONFIG_3RD_LEVEL_INTERRUPT_BITS), - "L3 bits not enough to cover the number of L3 IRQs"); - -#define INIT_IRQ_PARENT_OFFSET_3RD(n, d, i, o) \ - IRQ_PARENT_ENTRY_DEFINE(intc_l3_##n, DEVICE_DT_GET_OR_NULL(d), i, o, 3) - -#define CAT_3RD_LVL_LIST(i, base) \ - INIT_IRQ_PARENT_OFFSET_3RD(i, INTC_DT_IRQN_GET(CONFIG_3RD_LVL_INTR_0##i##_OFFSET), \ - CONFIG_3RD_LVL_INTR_0##i##_OFFSET, \ - IRQ_INDEX_TO_OFFSET(i, base)) - -LISTIFY(CONFIG_NUM_3RD_LEVEL_AGGREGATORS, CAT_3RD_LVL_LIST, (;), CONFIG_3RD_LVL_ISR_TBL_OFFSET); - -#endif /* CONFIG_3RD_LEVEL_INTERRUPTS */ diff --git a/arch/common/nocache.ld b/arch/common/nocache.ld index a4e500e8b17..749e88c9aed 100644 --- a/arch/common/nocache.ld +++ b/arch/common/nocache.ld @@ -8,7 +8,7 @@ /* Copied from linker.ld */ /* Non-cached region of RAM */ -SECTION_DATA_PROLOGUE(_NOCACHE_SECTION_NAME,(NOLOAD),) +SECTION_DATA_PROLOGUE(_NOCACHE_SECTION_NAME,,) { #if defined(CONFIG_MMU) MMU_ALIGN; @@ -27,5 +27,6 @@ SECTION_DATA_PROLOGUE(_NOCACHE_SECTION_NAME,(NOLOAD),) MPU_ALIGN(_nocache_ram_size); #endif _nocache_ram_end = .; -} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) +} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) _nocache_ram_size = _nocache_ram_end - _nocache_ram_start; +_nocache_load_start = LOADADDR(_NOCACHE_SECTION_NAME); diff --git a/arch/common/timing.c b/arch/common/timing.c index 8a4f65caa33..642ba79659f 100644 --- a/arch/common/timing.c +++ b/arch/common/timing.c @@ -22,13 +22,21 @@ void arch_timing_stop(void) timing_t arch_timing_counter_get(void) { +#if CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER + return k_cycle_get_64(); +#else return k_cycle_get_32(); +#endif } uint64_t arch_timing_cycles_get(volatile timing_t *const start, volatile timing_t *const end) { +#if CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER return (*end - *start); +#else + return ((uint32_t)*end - (uint32_t)*start); +#endif } diff --git a/arch/mips/core/fatal.c b/arch/mips/core/fatal.c index a53e5bb0f5e..aee7a597d4d 100644 --- a/arch/mips/core/fatal.c +++ b/arch/mips/core/fatal.c @@ -84,7 +84,7 @@ static char *cause_str(unsigned long cause) } } -void _Fault(struct arch_esf *esf) +void z_mips_fault(struct arch_esf *esf) { unsigned long cause; diff --git a/arch/mips/core/isr.S b/arch/mips/core/isr.S index f2f2f342053..1532d06fe5e 100644 --- a/arch/mips/core/isr.S +++ b/arch/mips/core/isr.S @@ -66,7 +66,7 @@ addi sp, sp, __struct_arch_esf_SIZEOF ; /* imports */ -GTEXT(_Fault) +GTEXT(z_mips_fault) GTEXT(_k_neg_eagain) GTEXT(z_thread_mark_switched_in) @@ -125,7 +125,7 @@ SECTION_FUNC(exception.other, _mips_interrupt) unhandled: move a0, sp - jal _Fault + jal z_mips_fault eret is_kernel_syscall: diff --git a/arch/nios2/core/exception.S b/arch/nios2/core/exception.S index ab2d3463dd4..8dd7e0b9b9b 100644 --- a/arch/nios2/core/exception.S +++ b/arch/nios2/core/exception.S @@ -12,7 +12,7 @@ GTEXT(_exception) /* import */ -GTEXT(_Fault) +GTEXT(z_nios2_fault) GTEXT(arch_swap) #ifdef CONFIG_IRQ_OFFLOAD GTEXT(z_irq_do_offload) @@ -171,12 +171,12 @@ not_interrupt: _exception_enter_fault: /* If we get here, the exception wasn't in interrupt or an - * invocation of irq_oflload(). Let _Fault() handle it in + * invocation of irq_offload(). Let z_nios2_fault() handle it in * C domain */ mov r4, sp - call _Fault + call z_nios2_fault jmpi _exception_exit no_reschedule: diff --git a/arch/nios2/core/fatal.c b/arch/nios2/core/fatal.c index b531bb41e17..3f34c1e8fc7 100644 --- a/arch/nios2/core/fatal.c +++ b/arch/nios2/core/fatal.c @@ -102,7 +102,7 @@ static char *cause_str(uint32_t cause_code) } #endif -FUNC_NORETURN void _Fault(const struct arch_esf *esf) +FUNC_NORETURN void z_nios2_fault(const struct arch_esf *esf) { #if defined(CONFIG_PRINTK) || defined(CONFIG_LOG) /* Unfortunately, completely unavailable on Nios II/e cores */ diff --git a/arch/posix/CMakeLists.txt b/arch/posix/CMakeLists.txt index 8dfc696bc6d..21b6bf7f197 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 1ed79b38976..f7ed30cf175 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 00000000000..4ec8dcdc4a5 --- /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 d8307df0ef8..fa62dc2a2aa 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 983f80a3abd..8f72a267389 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 00000000000..e2f3d5f0eb3 --- /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/Kconfig b/arch/riscv/Kconfig index 83e3ef86d07..72907a41fee 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -220,9 +220,20 @@ config RISCV_HAS_PLIC config RISCV_HAS_CLIC bool depends on RISCV_PRIVILEGED + select RISCV_ALWAYS_SWITCH_THROUGH_ECALL if MULTITHREADING + select CLIC_SUPPORT_INTERRUPT_LEVEL if !NRFX_CLIC help Does the SOC provide support for a Core-Local Interrupt Controller (CLIC). +config CLIC_SUPPORT_INTERRUPT_LEVEL + bool + depends on RISCV_HAS_CLIC + help + For CLIC implementations with extended interrupt level, where + higher-numbered interrupt levels can preempt lower-numbered interrupt + levels. This option handles interrupt level in ISR to ensure proper + nested ISR exits. + config RISCV_SOC_EXCEPTION_FROM_IRQ bool help diff --git a/arch/riscv/Kconfig.isa b/arch/riscv/Kconfig.isa index 70599843c48..7ac915865d1 100644 --- a/arch/riscv/Kconfig.isa +++ b/arch/riscv/Kconfig.isa @@ -33,6 +33,8 @@ config RISCV_ISA_EXT_M config RISCV_ISA_EXT_A bool + imply RISCV_ISA_EXT_ZAAMO + imply RISCV_ISA_EXT_ZLRSC help (A) - Standard Extension for Atomic Instructions @@ -111,6 +113,20 @@ config RISCV_ISA_EXT_ZIFENCEI provides explicit synchronization between writes to instruction memory and instruction fetches on the same hart. +config RISCV_ISA_EXT_ZAAMO + bool + help + (Zaamo) - Atomic memory operation subset of the A extension + + The Zaamo extension enables support for AMO*.W/D-style instructions. + +config RISCV_ISA_EXT_ZLRSC + bool + help + (Zlrsc) - Load-Reserved/Store-Conditional subset of the A extension + + The Zlrsc extension enables support for LR.W/D and SC.W/D-style instructions. + config RISCV_ISA_EXT_ZBA bool help diff --git a/arch/riscv/core/cpu_idle.c b/arch/riscv/core/cpu_idle.c index 413b911a53e..6991da40905 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 4f981083b94..2ae4b50d132 100644 --- a/arch/riscv/core/elf.c +++ b/arch/riscv/core/elf.c @@ -8,6 +8,9 @@ */ #include #include +#include +#include + #include #include @@ -43,6 +46,13 @@ LOG_MODULE_REGISTER(elf, CONFIG_LLEXT_LOG_LEVEL); static inline int riscv_relocation_fits(long long jump_target, long long max_distance, elf_word reloc_type) { + /* + * two's complement encoding + * e.g., [-128=0b10000000, 127=0b01111111] encodable with 8 bits + */ + if (jump_target < 0) { + max_distance++; + } if (llabs(jump_target) > max_distance) { LOG_ERR("%lld byte relocation is not possible for type %" PRIu64 " (max %lld)!", jump_target, (uint64_t)reloc_type, max_distance); @@ -52,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 @@ -61,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: * @@ -92,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, @@ -169,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/riscv/core/fatal.c b/arch/riscv/core/fatal.c index 879ffab9a80..3bf4e57d874 100644 --- a/arch/riscv/core/fatal.c +++ b/arch/riscv/core/fatal.c @@ -203,7 +203,7 @@ static bool bad_stack_pointer(struct arch_esf *esf) return false; } -void _Fault(struct arch_esf *esf) +void z_riscv_fault(struct arch_esf *esf) { #ifdef CONFIG_USERSPACE /* diff --git a/arch/riscv/core/isr.S b/arch/riscv/core/isr.S index 11787d3b324..dad96974dcc 100644 --- a/arch/riscv/core/isr.S +++ b/arch/riscv/core/isr.S @@ -72,7 +72,7 @@ GDATA(_sw_isr_table) GTEXT(__soc_is_irq) #endif GTEXT(__soc_handle_irq) -GTEXT(_Fault) +GTEXT(z_riscv_fault) #ifdef CONFIG_RISCV_SOC_CONTEXT_SAVE GTEXT(__soc_save_context) GTEXT(__soc_restore_context) @@ -198,6 +198,12 @@ SECTION_FUNC(exception.entry, _isr_wrapper) sr s0, __struct_arch_esf_s0_OFFSET(sp) get_current_cpu s0 +#ifdef CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL + /* Save mcause register */ + csrr t0, mcause + sr t0, __struct_arch_esf_mcause_OFFSET(sp) +#endif /* CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL */ + /* Save MEPC register */ csrr t0, mepc sr t0, __struct_arch_esf_mepc_OFFSET(sp) @@ -336,7 +342,7 @@ no_fp: /* increment _current->arch.exception_depth */ /* * If the exception is the result of an ECALL, check whether to - * perform a context-switch or an IRQ offload. Otherwise call _Fault + * perform a context-switch or an IRQ offload. Otherwise call z_riscv_fault * to report the exception. */ csrr t0, mcause @@ -375,15 +381,15 @@ no_fp: /* increment _current->arch.exception_depth */ #endif /* CONFIG_USERSPACE */ /* - * Call _Fault to handle exception. + * Call z_riscv_fault to handle exception. * Stack pointer is pointing to a struct_arch_esf structure, pass it - * to _Fault (via register a0). - * If _Fault shall return, set return address to + * to z_riscv_fault (via register a0). + * If z_riscv_fault shall return, set return address to * no_reschedule to restore stack. */ mv a0, sp la ra, no_reschedule - tail _Fault + tail z_riscv_fault is_kernel_syscall: /* @@ -737,6 +743,13 @@ fp_trap_exit: /* Restore MEPC and MSTATUS registers */ lr t0, __struct_arch_esf_mepc_OFFSET(sp) lr t2, __struct_arch_esf_mstatus_OFFSET(sp) + +#ifdef CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL + /* Restore MCAUSE register for previous interrupt level. */ + lr t1, __struct_arch_esf_mcause_OFFSET(sp) + csrw mcause, t1 +#endif /* CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL */ + csrw mepc, t0 csrw mstatus, t2 diff --git a/arch/riscv/core/offsets/offsets.c b/arch/riscv/core/offsets/offsets.c index 99eba096824..c526ffbaed0 100644 --- a/arch/riscv/core/offsets/offsets.c +++ b/arch/riscv/core/offsets/offsets.c @@ -112,6 +112,10 @@ GEN_OFFSET_STRUCT(arch_esf, a7); GEN_OFFSET_STRUCT(arch_esf, mepc); GEN_OFFSET_STRUCT(arch_esf, mstatus); +#ifdef CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL +GEN_OFFSET_STRUCT(arch_esf, mcause); +#endif /* CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL */ + GEN_OFFSET_STRUCT(arch_esf, s0); #ifdef CONFIG_USERSPACE diff --git a/arch/riscv/core/stacktrace.c b/arch/riscv/core/stacktrace.c index 361e152f00c..74f94d4eb86 100644 --- a/arch/riscv/core/stacktrace.c +++ b/arch/riscv/core/stacktrace.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -90,9 +91,7 @@ static bool in_stack_bound(uintptr_t addr, const struct k_thread *const thread, static inline bool in_text_region(uintptr_t addr) { - extern uintptr_t __text_region_start, __text_region_end; - - return (addr >= (uintptr_t)&__text_region_start) && (addr < (uintptr_t)&__text_region_end); + return (addr >= (uintptr_t)__text_region_start) && (addr < (uintptr_t)__text_region_end); } #ifdef CONFIG_FRAME_POINTER diff --git a/arch/riscv/core/thread.c b/arch/riscv/core/thread.c index 896f8e5199d..ab2cbfe0036 100644 --- a/arch/riscv/core/thread.c +++ b/arch/riscv/core/thread.c @@ -110,6 +110,11 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack, SOC_ISR_STACKING_ESR_INIT; #endif +#ifdef CONFIG_CLIC_SUPPORT_INTERRUPT_LEVEL + /* Clear the previous interrupt level. */ + stack_init->mcause = 0; +#endif + thread->callee_saved.sp = (unsigned long)stack_init; /* where to go when returning from z_riscv_switch() */ diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 46f32f92728..a9a883a3104 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -43,7 +43,16 @@ config CPU_APOLLO_LAKE help This option signifies the use of a CPU from the Apollo Lake family. -config CPU_LAKEMONT +config CPU_LAKEMONT_VALUE + bool + select CPU_HAS_FPU + select ARCH_HAS_STACK_PROTECTION if X86_MMU + select ARCH_HAS_USERSPACE if X86_MMU + select CPU_HAS_DCACHE + help + This option signifies the use of a CPU from the Lakemont Value family. + +config CPU_LAKEMONT_PERF bool select CPU_HAS_FPU select ARCH_HAS_STACK_PROTECTION if X86_MMU @@ -55,7 +64,7 @@ config CPU_LAKEMONT select X86_CPU_HAS_SSSE3 select CPU_HAS_DCACHE help - This option signifies the use of a CPU from the Lakemont family. + This option signifies the use of a CPU from the Lakemont Performance family. # # Configuration common to both IA32 and Intel64 sub-architectures. @@ -74,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 e8055c6fae2..abbc052a624 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 00000000000..5ae4c2b0f95 --- /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 64faeb9efa5..e5470e6d8a3 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/fatal.c b/arch/x86/core/fatal.c index d43499a08d2..6511f531e3d 100644 --- a/arch/x86/core/fatal.c +++ b/arch/x86/core/fatal.c @@ -458,6 +458,7 @@ void z_x86_page_fault_handler(struct arch_esf *esf) * the page is present in the kernel's page tables and the * instruction will just be re-tried, producing another fault. */ + was_valid_access = true; if (was_user && !z_x86_kpti_is_access_ok(virt, get_ptables(esf))) { was_valid_access = false; diff --git a/arch/x86/core/ia32/float.c b/arch/x86/core/ia32/float.c index c89bf7accd5..9b6f4daa18e 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 af104fdff47..6103e4bbe53 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 1e0aeb3e443..90bd9724667 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 b6112b75f82..06d03c7b807 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 2dfbb5c38ef..dcbf3d7d680 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/core/reboot_rst_cnt.c b/arch/x86/core/reboot_rst_cnt.c index e20b5b7ae33..3eafcf9709c 100644 --- a/arch/x86/core/reboot_rst_cnt.c +++ b/arch/x86/core/reboot_rst_cnt.c @@ -27,12 +27,22 @@ static inline void cold_reboot(void) sys_out8(reset_value, X86_RST_CNT_REG); } +static inline void warm_reboot(void) +{ + uint8_t reset_value = X86_RST_CNT_CPU_RST | X86_RST_CNT_SYS_RST; + + sys_out8(reset_value, X86_RST_CNT_REG); +} + void __weak sys_arch_reboot(int type) { switch (type) { case SYS_REBOOT_COLD: cold_reboot(); break; + case SYS_REBOOT_WARM: + warm_reboot(); + break; default: /* do nothing */ break; diff --git a/arch/x86/ia32.cmake b/arch/x86/ia32.cmake index 5bf5018a32a..90546924af1 100644 --- a/arch/x86/ia32.cmake +++ b/arch/x86/ia32.cmake @@ -3,7 +3,10 @@ # Find out if we are optimizing for size get_target_property(zephyr_COMPILE_OPTIONS zephyr_interface INTERFACE_COMPILE_OPTIONS) -if ("-Os" IN_LIST zephyr_COMPILE_OPTIONS) +#Any -Os is (or may be) wraped in $ guards +list(FILTER zephyr_COMPILE_OPTIONS INCLUDE REGEX "-Os") +list(LENGTH zephyr_COMPILE_OPTIONS have_os) +if (${have_os} GREATER 0) zephyr_cc_option(-mpreferred-stack-boundary=2) else() zephyr_compile_definitions(PERF_OPT) diff --git a/arch/x86/include/ia32/offsets_short_arch.h b/arch/x86/include/ia32/offsets_short_arch.h index cb5cdb218f0..b818cf60b55 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/x86/include/x86_mmu.h b/arch/x86/include/x86_mmu.h index ed6bb59b37c..1a733485e37 100644 --- a/arch/x86/include/x86_mmu.h +++ b/arch/x86/include/x86_mmu.h @@ -139,7 +139,7 @@ extern uint8_t z_shared_kernel_page_start; /* Called from page fault handler. ptables here is the ptage tables for the * faulting user thread and not the current set of page tables */ -extern bool z_x86_kpti_is_access_ok(void *virt, pentry_t *ptables) +extern bool z_x86_kpti_is_access_ok(void *virt, pentry_t *ptables); #endif /* CONFIG_DEMAND_PAGING */ #endif /* CONFIG_X86_KPTI */ #endif /* CONFIG_USERSPACE */ diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index b69d8bcf02b..19ce69b011b 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 7d7e260ca0b..f3a4419f32c 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 17337f4a7bc..6b83a9c0c61 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 6d9a228303f..8cb8a713019 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 c1073ac0247..dd20136427a 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 69df38275bf..f0b75c999cc 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 6dbab69f50f..771ad7e4230 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 c02ecc64b0d..fa7d4fb0f70 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 f9673e67814..9e14a560e7e 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 f9b8179173d..2bf1a7e11d3 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 3db5d8cea8d..be143ed1f3a 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 11b18013033..6892831f52a 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 5e735dedfff..8e0641f9d4b 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 f19750dc0ac..80ece2b1dee 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 d5593d7adbc..ac13a611c67 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 150df82c35c..198f04f80e8 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 608cbac9c46..b4491ff0bc3 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 29fcfc78615..801e8651cfa 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/01space/esp32c3_042_oled/esp32c3_042_oled_defconfig b/boards/01space/esp32c3_042_oled/esp32c3_042_oled_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/01space/esp32c3_042_oled/esp32c3_042_oled_defconfig +++ b/boards/01space/esp32c3_042_oled/esp32c3_042_oled_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/96boards/aerocore2/96b_aerocore2.yaml b/boards/96boards/aerocore2/96b_aerocore2.yaml index 6e704190fdd..01b0b6502fc 100644 --- a/boards/96boards/aerocore2/96b_aerocore2.yaml +++ b/boards/96boards/aerocore2/96b_aerocore2.yaml @@ -9,7 +9,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - pwm diff --git a/boards/96boards/argonkey/96b_argonkey.yaml b/boards/96boards/argonkey/96b_argonkey.yaml index c0e086b60f2..272af0c82ff 100644 --- a/boards/96boards/argonkey/96b_argonkey.yaml +++ b/boards/96boards/argonkey/96b_argonkey.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 256 flash: 1024 supported: diff --git a/boards/96boards/avenger96/96b_avenger96.yaml b/boards/96boards/avenger96/96b_avenger96.yaml index ef14d1b879d..83b5f6af343 100644 --- a/boards/96boards/avenger96/96b_avenger96.yaml +++ b/boards/96boards/avenger96/96b_avenger96.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - shell diff --git a/boards/96boards/carbon/96b_carbon_nrf51822.yaml b/boards/96boards/carbon/96b_carbon_nrf51822.yaml index 135d5aa461b..daa4501a13f 100644 --- a/boards/96boards/carbon/96b_carbon_nrf51822.yaml +++ b/boards/96boards/carbon/96b_carbon_nrf51822.yaml @@ -7,7 +7,6 @@ flash: 256 toolchain: - zephyr - gnuarmemb - - xtools supported: - ble vendor: seeed diff --git a/boards/96boards/carbon/96b_carbon_stm32f401xe.yaml b/boards/96boards/carbon/96b_carbon_stm32f401xe.yaml index 4b0c56dc5a4..a0254053ca3 100644 --- a/boards/96boards/carbon/96b_carbon_stm32f401xe.yaml +++ b/boards/96boards/carbon/96b_carbon_stm32f401xe.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - ble diff --git a/boards/96boards/meerkat96/96b_meerkat96_mcimx7d_m4.yaml b/boards/96boards/meerkat96/96b_meerkat96_mcimx7d_m4.yaml index 39f57323369..d214e696cad 100644 --- a/boards/96boards/meerkat96/96b_meerkat96_mcimx7d_m4.yaml +++ b/boards/96boards/meerkat96/96b_meerkat96_mcimx7d_m4.yaml @@ -13,7 +13,6 @@ flash: 32 toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - shell diff --git a/boards/96boards/neonkey/96b_neonkey.yaml b/boards/96boards/neonkey/96b_neonkey.yaml index 614eca9d249..0afdd5a7181 100644 --- a/boards/96boards/neonkey/96b_neonkey.yaml +++ b/boards/96boards/neonkey/96b_neonkey.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 128 flash: 512 supported: diff --git a/boards/96boards/nitrogen/96b_nitrogen.yaml b/boards/96boards/nitrogen/96b_nitrogen.yaml index 12b1f6c73e1..43875e92ed9 100644 --- a/boards/96boards/nitrogen/96b_nitrogen.yaml +++ b/boards/96boards/nitrogen/96b_nitrogen.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - ble - gpio diff --git a/boards/96boards/stm32_sensor_mez/96b_stm32_sensor_mez.yaml b/boards/96boards/stm32_sensor_mez/96b_stm32_sensor_mez.yaml index 160bb802380..ae6db8a8159 100644 --- a/boards/96boards/stm32_sensor_mez/96b_stm32_sensor_mez.yaml +++ b/boards/96boards/stm32_sensor_mez/96b_stm32_sensor_mez.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - uart - gpio diff --git a/boards/Kconfig b/boards/Kconfig index 40e8e5006e1..71b3b9571ad 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 c98bd27d2db..00000000000 --- 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/acn52832.yaml b/boards/aconno/acn52832/acn52832.yaml index 72e04b829f9..be2495a5a49 100644 --- a/boards/aconno/acn52832/acn52832.yaml +++ b/boards/aconno/acn52832/acn52832.yaml @@ -5,6 +5,5 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 64 flash: 512 diff --git a/boards/acrn/acrn/Kconfig b/boards/acrn/acrn/Kconfig index 7d7b97605a4..857bd347075 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 00000000000..c105411cede --- /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 00000000000..c13054d3891 --- /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 00000000000..4bb5438c97c --- /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 00000000000..de5dfe547e7 --- /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 dce367c0f96..6efec2b876e 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/actinius_icarus_nrf9160_1_4_0.yaml b/boards/actinius/icarus/actinius_icarus_nrf9160_1_4_0.yaml index 119745e52ed..1dda7976354 100644 --- a/boards/actinius/icarus/actinius_icarus_nrf9160_1_4_0.yaml +++ b/boards/actinius/icarus/actinius_icarus_nrf9160_1_4_0.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 88 flash: 256 diff --git a/boards/actinius/icarus/actinius_icarus_nrf9160_2_0_0.yaml b/boards/actinius/icarus/actinius_icarus_nrf9160_2_0_0.yaml index f017d9c6f3c..2c09e3c40aa 100644 --- a/boards/actinius/icarus/actinius_icarus_nrf9160_2_0_0.yaml +++ b/boards/actinius/icarus/actinius_icarus_nrf9160_2_0_0.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 88 flash: 256 diff --git a/boards/actinius/icarus/actinius_icarus_nrf9160_ns_1_4_0.yaml b/boards/actinius/icarus/actinius_icarus_nrf9160_ns_1_4_0.yaml index 07338249661..fd25e54d37f 100644 --- a/boards/actinius/icarus/actinius_icarus_nrf9160_ns_1_4_0.yaml +++ b/boards/actinius/icarus/actinius_icarus_nrf9160_ns_1_4_0.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/actinius/icarus/actinius_icarus_nrf9160_ns_2_0_0.yaml b/boards/actinius/icarus/actinius_icarus_nrf9160_ns_2_0_0.yaml index a6a5ecc7738..3d6cdb5b10c 100644 --- a/boards/actinius/icarus/actinius_icarus_nrf9160_ns_2_0_0.yaml +++ b/boards/actinius/icarus/actinius_icarus_nrf9160_ns_2_0_0.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160.yaml b/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160.yaml index 8fd851899ba..af041509705 100644 --- a/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160.yaml +++ b/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 88 flash: 256 diff --git a/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160_ns.yaml b/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160_ns.yaml index 89b21ece170..a2d50d9dd27 100644 --- a/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160_ns.yaml +++ b/boards/actinius/icarus_bee/actinius_icarus_bee_nrf9160_ns.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/actinius/icarus_som/actinius_icarus_som_nrf9160.yaml b/boards/actinius/icarus_som/actinius_icarus_som_nrf9160.yaml index 1eab5025340..1a6ac77ff8c 100644 --- a/boards/actinius/icarus_som/actinius_icarus_som_nrf9160.yaml +++ b/boards/actinius/icarus_som/actinius_icarus_som_nrf9160.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 88 flash: 256 diff --git a/boards/actinius/icarus_som/actinius_icarus_som_nrf9160_ns.yaml b/boards/actinius/icarus_som/actinius_icarus_som_nrf9160_ns.yaml index 0a6968beec2..e49b377cab1 100644 --- a/boards/actinius/icarus_som/actinius_icarus_som_nrf9160_ns.yaml +++ b/boards/actinius/icarus_som/actinius_icarus_som_nrf9160_ns.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160.yaml b/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160.yaml index 3b7d7377caa..56eebadfab1 100644 --- a/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160.yaml +++ b/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 88 flash: 256 diff --git a/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160_ns.yaml b/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160_ns.yaml index b41972384ba..cd0a90c222b 100644 --- a/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160_ns.yaml +++ b/boards/actinius/icarus_som_dk/actinius_icarus_som_dk_nrf9160_ns.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/adafruit/feather_esp32s2/CMakeLists.txt b/boards/adafruit/feather_esp32s2/CMakeLists.txt new file mode 100644 index 00000000000..218a0602483 --- /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 00000000000..272e4c39ee9 --- /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 00000000000..63f45c11300 --- /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 00000000000..e54cad03d42 --- /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 00000000000..1d470f87490 --- /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 00000000000..734863a6654 --- /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 00000000000..3a2d17ac5cf --- /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 00000000000..a6c67847bbb --- /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 00000000000..e7e3f8efb7b --- /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 00000000000..096357d93eb --- /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 00000000000..7246420988f --- /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 00000000000..94550a53acd --- /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 00000000000..86ca59f5965 --- /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 00000000000..257ea650a29 --- /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 00000000000..d8fbaa87925 --- /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 00000000000..c57ebdc8b8b --- /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 00000000000..99ca5778e7a --- /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 00000000000..d8fbaa87925 --- /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 00000000000..fbb4b0993ae --- /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 00000000000..f5c673e211b --- /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 00000000000..d8fbaa87925 --- /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 00000000000..e7f65a4ba53 --- /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 00000000000..2f04d1fe886 --- /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 00000000000..fda3bf5e855 --- /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 00000000000..a5fb76324d9 --- /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 00000000000..6f44363ca4b --- /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 00000000000..fcbb6352205 --- /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 00000000000..b63d6c73977 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 00000000000..a1b9d091218 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 00000000000..8b607c89f85 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 00000000000..8414fbbfb10 --- /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 00000000000..3a2eb8c3e0d --- /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 00000000000..2f740b4a36a --- /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 00000000000..e56e7f846c4 --- /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 00000000000..a96fe929308 --- /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 00000000000..8d3acb9e11d --- /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 00000000000..dc41eaae541 --- /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 00000000000..8b9f9953792 --- /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 00000000000..329bcd7fa92 --- /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 00000000000..9abf2ff0430 --- /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 00000000000..b745820ddaa --- /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 00000000000..6ca1ba6ae3c --- /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 00000000000..d789bab1824 --- /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 00000000000..2f04d1fe886 --- /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 00000000000..89db0bb116c --- /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 00000000000..5d6575dca11 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 00000000000..17332ba68fa --- /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 00000000000..49671be660c --- /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 00000000000..2f740b4a36a --- /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 00000000000..218a0602483 --- /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 00000000000..86f1012ae0d --- /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 00000000000..cd78387ff88 --- /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 00000000000..2c3e9c9cfa7 --- /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 00000000000..8d3acb9e11d --- /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 00000000000..0cf040eeb87 --- /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 00000000000..f4662f4b0a3 --- /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 00000000000..baed9f8ff70 --- /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 00000000000..9abf2ff0430 --- /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 00000000000..b09b6262aa1 --- /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 00000000000..bed1ac8ba70 --- /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 00000000000..d789bab1824 --- /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 00000000000..88aa3b0b354 --- /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 00000000000..2f04d1fe886 --- /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 00000000000..86f7b9293c8 --- /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 00000000000..796170908e7 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 00000000000..f46daa99688 --- /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 00000000000..9a4dd731e8c --- /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 00000000000..2f740b4a36a --- /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/adafruit_feather_m0_basic_proto.yaml b/boards/adafruit/feather_m0_basic_proto/adafruit_feather_m0_basic_proto.yaml index 859ae9feb17..e8777b1a070 100644 --- a/boards/adafruit/feather_m0_basic_proto/adafruit_feather_m0_basic_proto.yaml +++ b/boards/adafruit/feather_m0_basic_proto/adafruit_feather_m0_basic_proto.yaml @@ -7,5 +7,4 @@ flash: 232 toolchain: - zephyr - gnuarmemb - - xtools vendor: adafruit diff --git a/boards/adafruit/feather_m0_basic_proto/doc/index.rst b/boards/adafruit/feather_m0_basic_proto/doc/index.rst index 20d1cd4750a..69abd4bb9ac 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/adafruit_feather_m0_lora.yaml b/boards/adafruit/feather_m0_lora/adafruit_feather_m0_lora.yaml index de9b44f8820..a448a5e177b 100644 --- a/boards/adafruit/feather_m0_lora/adafruit_feather_m0_lora.yaml +++ b/boards/adafruit/feather_m0_lora/adafruit_feather_m0_lora.yaml @@ -7,5 +7,4 @@ flash: 232 toolchain: - zephyr - gnuarmemb - - xtools vendor: adafruit diff --git a/boards/adafruit/feather_m0_lora/doc/index.rst b/boards/adafruit/feather_m0_lora/doc/index.rst index 7a3e9fc78bf..1e85f48b1f5 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/adafruit_feather_m4_express.yaml b/boards/adafruit/feather_m4_express/adafruit_feather_m4_express.yaml index a8d50925d9f..654b2eb902a 100644 --- a/boards/adafruit/feather_m4_express/adafruit_feather_m4_express.yaml +++ b/boards/adafruit/feather_m4_express/adafruit_feather_m4_express.yaml @@ -7,7 +7,6 @@ flash: 512 toolchain: - zephyr - gnuarmemb - - xtools supported: - dma - gpio diff --git a/boards/adafruit/feather_m4_express/doc/index.rst b/boards/adafruit/feather_m4_express/doc/index.rst index a4178626eee..a44c75808aa 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/adafruit_feather_nrf52840.yaml b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840.yaml index 761f378dcaa..31369a0280c 100644 --- a/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840.yaml +++ b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense.yaml b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense.yaml index e4a94b6bb36..236e5aafd07 100644 --- a/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense.yaml +++ b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2.yaml b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2.yaml index a5f095b336b..3756dc3c2a4 100644 --- a/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2.yaml +++ b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_sense_uf2.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_uf2.yaml b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_uf2.yaml index ebb7a399f0c..c61e5ae36f9 100644 --- a/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_uf2.yaml +++ b/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_nrf52840_uf2.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/adafruit/feather_nrf52840/doc/index.rst b/boards/adafruit/feather_nrf52840/doc/index.rst index 6f2477e673f..b136a30ba49 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/adafruit_feather_stm32f405.yaml b/boards/adafruit/feather_stm32f405/adafruit_feather_stm32f405.yaml index 858b4fcf6db..31454fe1660 100644 --- a/boards/adafruit/feather_stm32f405/adafruit_feather_stm32f405.yaml +++ b/boards/adafruit/feather_stm32f405/adafruit_feather_stm32f405.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 128 flash: 1024 supported: diff --git a/boards/adafruit/feather_stm32f405/doc/index.rst b/boards/adafruit/feather_stm32f405/doc/index.rst index 0cc6c327760..656f96f8a8f 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 4bab8889967..d85b2e922e0 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/adafruit_itsybitsy_nrf52840.yaml b/boards/adafruit/itsybitsy/adafruit_itsybitsy_nrf52840.yaml index 9bf0ea72176..79072d2d015 100644 --- a/boards/adafruit/itsybitsy/adafruit_itsybitsy_nrf52840.yaml +++ b/boards/adafruit/itsybitsy/adafruit_itsybitsy_nrf52840.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble diff --git a/boards/adafruit/itsybitsy/doc/index.rst b/boards/adafruit/itsybitsy/doc/index.rst index 3fbcb918adb..3dac6fea3b8 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/adafruit_itsybitsy_m4_express.yaml b/boards/adafruit/itsybitsy_m4_express/adafruit_itsybitsy_m4_express.yaml index 7de6fd7a3f2..6a39f7553b2 100644 --- a/boards/adafruit/itsybitsy_m4_express/adafruit_itsybitsy_m4_express.yaml +++ b/boards/adafruit/itsybitsy_m4_express/adafruit_itsybitsy_m4_express.yaml @@ -7,7 +7,6 @@ flash: 512 toolchain: - zephyr - gnuarmemb - - xtools supported: - dma - gpio diff --git a/boards/adafruit/itsybitsy_m4_express/doc/index.rst b/boards/adafruit/itsybitsy_m4_express/doc/index.rst index 31e19cb8a99..19b5cdf2906 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/adafruit_kb2040.yaml b/boards/adafruit/kb2040/adafruit_kb2040.yaml index 40511a77633..9fb45644828 100644 --- a/boards/adafruit/kb2040/adafruit_kb2040.yaml +++ b/boards/adafruit/kb2040/adafruit_kb2040.yaml @@ -7,7 +7,6 @@ ram: 264 toolchain: - zephyr - gnuarmemb - - xtools supported: - uart - gpio diff --git a/boards/adafruit/kb2040/doc/index.rst b/boards/adafruit/kb2040/doc/index.rst index f1b5d998dc8..0db8c71653e 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/Kconfig b/boards/adafruit/macropad_rp2040/Kconfig new file mode 100644 index 00000000000..fcfac0d53f7 --- /dev/null +++ b/boards/adafruit/macropad_rp2040/Kconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Benjamin Cabé +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_MACROPAD_RP2040 + select RP2_FLASH_W25Q080 diff --git a/boards/adafruit/macropad_rp2040/Kconfig.adafruit_macropad_rp2040 b/boards/adafruit/macropad_rp2040/Kconfig.adafruit_macropad_rp2040 new file mode 100644 index 00000000000..dfa06268eae --- /dev/null +++ b/boards/adafruit/macropad_rp2040/Kconfig.adafruit_macropad_rp2040 @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Benjamin Cabé +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ADAFRUIT_MACROPAD_RP2040 + select SOC_RP2040 diff --git a/boards/adafruit/macropad_rp2040/Kconfig.defconfig b/boards/adafruit/macropad_rp2040/Kconfig.defconfig new file mode 100644 index 00000000000..d9ef74ce3e0 --- /dev/null +++ b/boards/adafruit/macropad_rp2040/Kconfig.defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2025 Benjamin Cabé +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_ADAFRUIT_MACROPAD_RP2040 + +if I2C_DW + +config I2C_DW_CLOCK_SPEED + default 125 + +endif # I2C_DW + +config USB_SELF_POWERED + default n + +endif # BOARD_ADAFRUIT_MACROPAD_RP2040 diff --git a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040-pinctrl.dtsi b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040-pinctrl.dtsi new file mode 100644 index 00000000000..1a1953adb0f --- /dev/null +++ b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040-pinctrl.dtsi @@ -0,0 +1,49 @@ +#include + +&pinctrl { + uart1_default: uart1_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = ; + input-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + spi1_default: spi1_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + input-enable; + }; + group3 { + pinmux = ; + }; + }; + + ws2812_pio1_default: ws2812_pio1_default { + ws2812 { + pinmux = ; + }; + }; + + pwm_ch0a_default: pwm_ch0a_default { + group1 { + pinmux = ; + }; + }; +}; diff --git a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts new file mode 100644 index 00000000000..6181fbdd94d --- /dev/null +++ b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts @@ -0,0 +1,239 @@ +/dts-v1/; + +#include +#include "adafruit_macropad_rp2040-pinctrl.dtsi" +#include +#include +#include + + +/ { + model = "Adafruit MacroPad RP2040"; + compatible = "adafruit,macropad-rp2040"; + + chosen { + zephyr,console = &uart1; + zephyr,shell-uart = &uart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,flash-controller = &ssi; + zephyr,code-partition = &code_partition; + zephyr,display = &oled; + }; + + aliases { + watchdog0 = &wdt0; + led-strip = &ws2812; + led0 = &led0; + }; + + speaker_reg: speaker-reg { + compatible = "regulator-fixed"; + regulator-name = "Speaker"; + enable-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; + }; + + keys { + compatible = "gpio-keys"; + + key0: key_0 { + gpios = <&gpio0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key1: key_1 { + gpios = <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key2: key_2 { + gpios = <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key3: key_3 { + gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key4: key_4 { + gpios = <&gpio0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key5: key_5 { + gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key6: key_6 { + gpios = <&gpio0 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key7: key_7 { + gpios = <&gpio0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key8: key_8 { + gpios = <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key9: key_9 { + gpios = <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key10: key_10 { + gpios = <&gpio0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + key11: key_11 { + gpios = <&gpio0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + + encoder_button: encoder_button { + gpios = <&gpio0 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + label = "LED 0"; + }; + }; + + encoder { + compatible = "gpio-qdec"; + gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&gpio0 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + zephyr,axis = ; + steps-per-period = <4>; + sample-time-us = <2000>; + idle-timeout-ms = <200>; + }; + + 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 21 0>, + <1 0 &gpio0 20 0>; + }; +}; + +&flash0 { + reg = <0x10000000 DT_SIZE_M(8)>; + + 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 8MB minus the 0x100 bytes taken by the bootloader. + */ + code_partition: partition@100 { + label = "code-partition"; + reg = <0x100 (DT_SIZE_M(8) - 0x100)>; + read-only; + }; + }; +}; + +&uart1 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; +}; + +/* You need to disable uart1 to use i2c0 */ +&i2c0 { + clock-frequency = <400000>; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&spi1 { + status = "okay"; + pinctrl-0 = <&spi1_default>; + pinctrl-names = "default"; + cs-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; + + oled: ssd1306@0 { + compatible = "sinowealth,sh1106"; + reg = <0>; + spi-max-frequency = <10000000>; + width = <128>; + height = <64>; + segment-offset = <2>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + prechargep = <0x1F>; + segment-remap; + com-invdir; + inversion-on; + reset-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; + data-cmd-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>; + ready-time-ms = <100>; /* SH1106G needs 100ms delay after init */ + }; +}; + +&gpio0 { + status = "okay"; +}; + +&pwm { + pinctrl-0 = <&pwm_ch0a_default>; + pinctrl-names = "default"; + divider-int-0 = <255>; +}; + +&wdt0 { + status = "okay"; +}; + +zephyr_udc0: &usbd { + status = "okay"; +}; + +&pio1 { + status = "okay"; + + pio-ws2812 { + compatible = "worldsemi,ws2812-rpi_pico-pio"; + status = "okay"; + pinctrl-0 = <&ws2812_pio1_default>; + pinctrl-names = "default"; + bit-waveform = <3>, <3>, <4>; + + ws2812: ws2812 { + status = "okay"; + gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; + chain-length = <12>; + color-mapping = ; + reset-delay = <280>; + frequency = <800000>; + }; + }; +}; diff --git a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.yaml b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.yaml new file mode 100644 index 00000000000..2d0030dd519 --- /dev/null +++ b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.yaml @@ -0,0 +1,25 @@ +identifier: adafruit_macropad_rp2040 +name: Adafruit MacroPad RP2040 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 264 +flash: 8192 +supported: + - uart + - gpio + - i2c + - spi + - hwinfo + - watchdog + - pwm + - flash + - dma + - counter + - clock + - usbd + - display + - qdec + - led_strip diff --git a/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040_defconfig b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040_defconfig new file mode 100644 index 00000000000..2fb65b60022 --- /dev/null +++ b/boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040_defconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2025 Benjamin Cabé +# SPDX-License-Identifier: Apache-2.0 + +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_UART_INTERRUPT_DRIVEN=y +CONFIG_RESET=y +CONFIG_CLOCK_CONTROL=y diff --git a/boards/adafruit/macropad_rp2040/board.cmake b/boards/adafruit/macropad_rp2040/board.cmake new file mode 100644 index 00000000000..4103e36e635 --- /dev/null +++ b/boards/adafruit/macropad_rp2040/board.cmake @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(uf2 "--board-id=RPI-RP2") + +include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake) diff --git a/boards/adafruit/macropad_rp2040/board.yml b/boards/adafruit/macropad_rp2040/board.yml new file mode 100644 index 00000000000..3b0daf408e0 --- /dev/null +++ b/boards/adafruit/macropad_rp2040/board.yml @@ -0,0 +1,6 @@ +board: + name: adafruit_macropad_rp2040 + full_name: Adafruit MacroPad RP2040 + vendor: adafruit + socs: + - name: rp2040 diff --git a/boards/adafruit/macropad_rp2040/doc/adafruit_macropad_rp2040.webp b/boards/adafruit/macropad_rp2040/doc/adafruit_macropad_rp2040.webp new file mode 100644 index 00000000000..86f128d85ab Binary files /dev/null and b/boards/adafruit/macropad_rp2040/doc/adafruit_macropad_rp2040.webp differ diff --git a/boards/adafruit/macropad_rp2040/doc/index.rst b/boards/adafruit/macropad_rp2040/doc/index.rst new file mode 100644 index 00000000000..74f9e14fa1d --- /dev/null +++ b/boards/adafruit/macropad_rp2040/doc/index.rst @@ -0,0 +1,66 @@ +.. zephyr:board:: adafruit_macropad_rp2040 + +Adafruit MacroPad RP2040 +######################## + +Overview +******** + +The Adafruit MacroPad RP2040 is a 3x4 mechanical keyboard development board featuring +the Raspberry Pi RP2040 microcontroller. It includes 12 mechanical key switches with +individual RGB NeoPixels, a rotary encoder with push button, a 128x64 OLED display, +and a small speaker for audio feedback. + +Hardware +******** + +- Dual core Cortex-M0+ at up to 133MHz +- 264KB of SRAM +- 8MB of QSPI flash memory +- 12 mechanical key switches (Cherry MX compatible) +- 12 RGB NeoPixel LEDs (one per key) +- 128x64 monochrome OLED display (SH1106) +- Rotary encoder with push button +- Small speaker with Class D amplifier +- STEMMA QT / Qwiic I2C connector +- USB Type-C connector +- Reset button +- 4x M3 mounting holes + +Supported Features +****************** + +.. 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). + +Building and Flashing +********************* + +The MacroPad RP2040 has a built-in UF2 bootloader which can be entered by holding down the rotary +encoder button (BOOT) and, while continuing to hold it, pressing and releasing the reset button. +A "RPI-RP2" drive should appear on your host machine. + +Here is an example for building and flashing the :zephyr:code-sample:`blinky` sample application +using UF2. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: adafruit_macropad_rp2040 + :goals: build flash + :flash-args: --runner uf2 + +References +********** + +.. target-notes:: + +- `Adafruit MacroPad RP2040 Product Page `_ +- `Adafruit MacroPad RP2040 Learn Guide `_ diff --git a/boards/adafruit/nrf52_adafruit_feather/doc/index.rst b/boards/adafruit/nrf52_adafruit_feather/doc/index.rst index c84bc73f62b..4e318acd793 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/nrf52_adafruit_feather/nrf52_adafruit_feather.yaml b/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.yaml index 0bfa59a6c1b..0f6b58a4163 100644 --- a/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.yaml +++ b/boards/adafruit/nrf52_adafruit_feather/nrf52_adafruit_feather.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 64 flash: 512 supported: diff --git a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_defconfig b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_defconfig +++ b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 ac1ec4af1b1..58eaee33a2b 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 ac757645e5b..5d8b14a96a6 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_defconfig b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu_defconfig index 6539bd42e59..187793c76e8 100644 --- a/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu_defconfig +++ b/boards/adafruit/qt_py_esp32s3/adafruit_qt_py_esp32s3_procpu_defconfig @@ -1,6 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y 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 5ab0be63c3f..cd9ca5f1dcf 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 1c1f6e04eee..8ad715a673c 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 3f87e4188b2..a6eaf30bbe6 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/adafruit_qt_py_rp2040.yaml b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.yaml index 2348e9cec55..132cfe81087 100644 --- a/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.yaml +++ b/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.yaml @@ -7,7 +7,6 @@ ram: 264 toolchain: - zephyr - gnuarmemb - - xtools supported: - uart - gpio diff --git a/boards/adafruit/qt_py_rp2040/doc/index.rst b/boards/adafruit/qt_py_rp2040/doc/index.rst index 0db8b4e4034..253ab615ac2 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/adafruit_trinket_m0.yaml b/boards/adafruit/trinket_m0/adafruit_trinket_m0.yaml index f1d21a5c63d..cc4b9bc3738 100644 --- a/boards/adafruit/trinket_m0/adafruit_trinket_m0.yaml +++ b/boards/adafruit/trinket_m0/adafruit_trinket_m0.yaml @@ -7,7 +7,6 @@ flash: 256 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - counter diff --git a/boards/adafruit/trinket_m0/doc/index.rst b/boards/adafruit/trinket_m0/doc/index.rst index 224f9aa4c6d..ceaa0fd0ca2 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 00000000000..b8b2e0fed81 --- /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 00000000000..d46ad87c1cf --- /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 00000000000..495481a989d --- /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 00000000000..9428e5334a0 --- /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 00000000000..716d8121461 --- /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 00000000000..f458ef3b9e8 --- /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 00000000000..6b734dc80b4 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 00000000000..42ef89a467f --- /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/apard32690_max32690_m4.yaml b/boards/adi/apard32690/apard32690_max32690_m4.yaml index bc040f86855..bf6486d175b 100644 --- a/boards/adi/apard32690/apard32690_max32690_m4.yaml +++ b/boards/adi/apard32690/apard32690_max32690_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - arduino_gpio - arduino_serial diff --git a/boards/adi/apard32690/board.cmake b/boards/adi/apard32690/board.cmake index 409b85f0bc1..d388c9a7497 100644 --- a/boards/adi/apard32690/board.cmake +++ b/boards/adi/apard32690/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32690.cfg]") board_runner_args(jlink "--device=MAX32690" "--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/apard32690/doc/index.rst b/boards/adi/apard32690/doc/index.rst index 8223f2b88e9..318d34b361e 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 ======== @@ -190,7 +167,8 @@ SWD port. SWD debug can be accessed through the Cortex 10-pin connector, P9. Logic levels are either 1.8V or 3.3V (based on P51 selection). 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: @@ -209,7 +187,7 @@ instead of ``west flash``. References ********** -- `AD-APARD32690-SL web page`_ +- `AD-APARD32690-SL solution center`_ -.. _AD-APARD32690-SL web page: - https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/ad-apard32690-sl.html +.. _AD-APARD32690-SL solution center: + https://developer.analog.com/solutions/max32690 diff --git a/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.yaml b/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.yaml index c7e9a79567a..c7746597fa4 100644 --- a/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.yaml +++ b/boards/adi/eval_adin1110ebz/adi_eval_adin1110ebz.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 640 flash: 2048 supported: diff --git a/boards/adi/eval_adin1110ebz/doc/index.rst b/boards/adi/eval_adin1110ebz/doc/index.rst index 4f38e78faf0..ed1db60a4ee 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/adi_eval_adin2111ebz.yaml b/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.yaml index bddea6e4a76..c0c48cce543 100644 --- a/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.yaml +++ b/boards/adi/eval_adin2111ebz/adi_eval_adin2111ebz.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 640 flash: 2048 supported: diff --git a/boards/adi/eval_adin2111ebz/doc/index.rst b/boards/adi/eval_adin2111ebz/doc/index.rst index 7579c85b0cd..9c65a86ce36 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 00000000000..accb9f0e0f3 --- /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 00000000000..716d8121461 --- /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 00000000000..24e70315fb5 --- /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 00000000000..1300e5e44b9 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 00000000000..d66d875a782 --- /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 00000000000..2292bfd8b8a --- /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 00000000000..8e3ced3c437 --- /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 00000000000..9428e5334a0 --- /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 00000000000..cf8acafe85d --- /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 00000000000..716d8121461 --- /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 00000000000..46dee2be233 --- /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 00000000000..065de009e8c 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 00000000000..de4a139081d --- /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 00000000000..b471e2523ce --- /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 00000000000..f967621e702 --- /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 00000000000..9428e5334a0 --- /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/board.cmake b/boards/adi/max32655evkit/board.cmake index 965de9e4de2..12e0bc56765 100644 --- a/boards/adi/max32655evkit/board.cmake +++ b/boards/adi/max32655evkit/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2023-2024 Analog Devices, Inc. +# Copyright (c) 2023-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32655.cfg]") board_runner_args(jlink "--device=MAX32655" "--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/max32655evkit/doc/index.rst b/boards/adi/max32655evkit/doc/index.rst index 649df3bde37..9c72155a4d9 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 ======== @@ -169,7 +137,8 @@ SWD port. SWD debug can be accessed through the Cortex 10-pin connector, JH3. 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: diff --git a/boards/adi/max32655evkit/max32655evkit_max32655_m4.dts b/boards/adi/max32655evkit/max32655evkit_max32655_m4.dts index a14953606ea..ae822ce9db1 100644 --- a/boards/adi/max32655evkit/max32655evkit_max32655_m4.dts +++ b/boards/adi/max32655evkit/max32655evkit_max32655_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 */ @@ -10,7 +10,6 @@ #include #include #include -#include / { model = "Analog Devices MAX32655EVKIT"; @@ -133,3 +132,34 @@ &rtc_counter { status = "okay"; }; + +&spi0_mosi_p0_5 { + power-source = ; +}; + +&spi0_miso_p0_6 { + power-source = ; +}; + +&spi0_sck_p0_7 { + power-source = ; +}; + +&spi0 { + status = "okay"; + pinctrl-0 = <&spi0_mosi_p0_5 &spi0_miso_p0_6 &spi0_sck_p0_7>; + pinctrl-names = "default"; + cs-gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>; + + spi0_cs0_flash: w25q128@0 { + compatible = "jedec,spi-nor"; + /* 134217728 bits = 16 Mbytes */ + size = <0x8000000>; + reg = <0>; + spi-max-frequency = <10000000>; + jedec-id = [ef 40 18]; + hold-gpios = <&gpio0 9 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>; + wp-gpios = <&gpio0 8 (GPIO_ACTIVE_HIGH | MAX32_GPIO_VSEL_VDDIOH)>; + status = "okay"; + }; +}; diff --git a/boards/adi/max32655evkit/max32655evkit_max32655_m4.yaml b/boards/adi/max32655evkit/max32655evkit_max32655_m4.yaml index f3a7fac43ba..141223a8db1 100644 --- a/boards/adi/max32655evkit/max32655evkit_max32655_m4.yaml +++ b/boards/adi/max32655evkit/max32655evkit_max32655_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial diff --git a/boards/adi/max32655fthr/board.cmake b/boards/adi/max32655fthr/board.cmake index d2353452cbe..281834ae50a 100644 --- a/boards/adi/max32655fthr/board.cmake +++ b/boards/adi/max32655fthr/board.cmake @@ -1,7 +1,5 @@ -# Copyright (c) 2023-2024 Analog Devices, Inc. +# Copyright (c) 2023-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32655.cfg]") - +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adi/max32655fthr/doc/index.rst b/boards/adi/max32655fthr/doc/index.rst index 839365066cc..648133f2142 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 ======== @@ -191,7 +161,8 @@ The MAX32625 microcontroller on the board is flashed with DAPLink firmware at th It allows debugging and flashing the MAX32655 Arm Core over USB. Once the USB cable is connected to your host computer, then you can simply run the -``west flash`` command to write a firmware image into flash. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. Debugging ========= diff --git a/boards/adi/max32655fthr/max32655fthr_max32655_m4.dts b/boards/adi/max32655fthr/max32655fthr_max32655_m4.dts index 2f82dc09022..7d09e565217 100644 --- a/boards/adi/max32655fthr/max32655fthr_max32655_m4.dts +++ b/boards/adi/max32655fthr/max32655fthr_max32655_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 */ @@ -10,7 +10,6 @@ #include #include #include -#include / { model = "Analog Devices MAX32655FTHR"; @@ -162,3 +161,35 @@ &rtc_counter { status = "okay"; }; + +&spi0_mosi_p0_5 { + power-source = ; +}; + +&spi0_miso_p0_6 { + power-source = ; +}; + +&spi0_sck_p0_7 { + power-source = ; +}; + +&spi0 { + status = "okay"; + pinctrl-0 = <&spi0_mosi_p0_5 &spi0_miso_p0_6 &spi0_sck_p0_7>; + pinctrl-names = "default"; + cs-gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>, + <&gpio0 11 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>; + + spi0_cs1_flash: w25q128jv@1 { + compatible = "jedec,spi-nor"; + /* 134217728 bits = 16 Mbytes */ + size = <0x8000000>; + reg = <1>; + spi-max-frequency = <10000000>; + jedec-id = [ef 70 18]; + hold-gpios = <&gpio0 9 (GPIO_ACTIVE_LOW | MAX32_GPIO_VSEL_VDDIOH)>; + wp-gpios = <&gpio0 8 (GPIO_ACTIVE_HIGH | MAX32_GPIO_VSEL_VDDIOH)>; + status = "okay"; + }; +}; diff --git a/boards/adi/max32655fthr/max32655fthr_max32655_m4.yaml b/boards/adi/max32655fthr/max32655fthr_max32655_m4.yaml index 37c8b01e02e..66c3d05382d 100644 --- a/boards/adi/max32655fthr/max32655fthr_max32655_m4.yaml +++ b/boards/adi/max32655fthr/max32655fthr_max32655_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial diff --git a/boards/adi/max32660evsys/Kconfig.max32660evsys b/boards/adi/max32660evsys/Kconfig.max32660evsys new file mode 100644 index 00000000000..2e936397761 --- /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 00000000000..617eecca8f8 --- /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 00000000000..5e7e264b04c --- /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 00000000000..b3043a033a2 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 00000000000..c556fcbfeb9 --- /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 00000000000..f06645f94a1 --- /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 00000000000..da963ef091c --- /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 00000000000..9428e5334a0 --- /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/board.cmake b/boards/adi/max32662evkit/board.cmake index 48ee0fa505f..66bc1b70c0c 100644 --- a/boards/adi/max32662evkit/board.cmake +++ b/boards/adi/max32662evkit/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32662.cfg]") board_runner_args(jlink "--device=MAX32662" "--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/max32662evkit/doc/index.rst b/boards/adi/max32662evkit/doc/index.rst index b343fb6ed99..cc3d42c03a9 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 ======== @@ -212,7 +182,8 @@ the UART1A port can also be accessed through J3. 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: diff --git a/boards/adi/max32662evkit/max32662evkit.dts b/boards/adi/max32662evkit/max32662evkit.dts index 5f204b91bef..e8cdc4ddb94 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/max32662evkit/max32662evkit.yaml b/boards/adi/max32662evkit/max32662evkit.yaml index eebab96b676..9866e12e0dc 100644 --- a/boards/adi/max32662evkit/max32662evkit.yaml +++ b/boards/adi/max32662evkit/max32662evkit.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - dma - gpio diff --git a/boards/adi/max32666evkit/board.cmake b/boards/adi/max32666evkit/board.cmake index 80033d85bdc..024f4a0b7a7 100644 --- a/boards/adi/max32666evkit/board.cmake +++ b/boards/adi/max32666evkit/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32665.cfg]") board_runner_args(jlink "--device=MAX32666" "--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/max32666evkit/doc/index.rst b/boards/adi/max32666evkit/doc/index.rst index f71b1a69bb6..1569615621d 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 ======== @@ -296,7 +265,8 @@ SWD port. SWD debug can be accessed through the Cortex 10-pin connector, J6. Logic levels are fixed to VDDIOH (1.8V or 3.3V). 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: diff --git a/boards/adi/max32666evkit/max32666evkit_max32666_cpu0.yaml b/boards/adi/max32666evkit/max32666evkit_max32666_cpu0.yaml index 7d5f8699970..f43f703e894 100644 --- a/boards/adi/max32666evkit/max32666evkit_max32666_cpu0.yaml +++ b/boards/adi/max32666evkit/max32666evkit_max32666_cpu0.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - dma - i2c diff --git a/boards/adi/max32666fthr/board.cmake b/boards/adi/max32666fthr/board.cmake index b2315d05907..e7077922b36 100644 --- a/boards/adi/max32666fthr/board.cmake +++ b/boards/adi/max32666fthr/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2023-2024 Analog Devices, Inc. +# Copyright (c) 2023-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32665.cfg]") board_runner_args(jlink "--device=MAX32666" "--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/max32666fthr/doc/index.rst b/boards/adi/max32666fthr/doc/index.rst index 1cd8a999de1..5136bf58986 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 ======== @@ -216,7 +184,8 @@ SWD debug can be accessed through the Cortex 10-pin connector, JH2. 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: diff --git a/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.dts b/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.dts index 02b45bda3db..5aa45a1c5ce 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 c40294e0ae3..9b924a56a6d 100644 --- a/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.yaml +++ b/boards/adi/max32666fthr/max32666fthr_max32666_cpu0.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - dma - i2c @@ -21,5 +20,6 @@ supported: - pwm - w1 - flash + - sdhc ram: 560 flash: 1024 diff --git a/boards/adi/max32670evkit/board.cmake b/boards/adi/max32670evkit/board.cmake index fc69d3635f1..b370a18f9f3 100644 --- a/boards/adi/max32670evkit/board.cmake +++ b/boards/adi/max32670evkit/board.cmake @@ -1,7 +1,5 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32670.cfg]") - +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adi/max32670evkit/doc/index.rst b/boards/adi/max32670evkit/doc/index.rst index a5b10ef8d9e..4f5b57da3a6 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 ======== @@ -185,7 +157,8 @@ The MAX32670 EVKIT integrates a MAX32625PICO based debugger for DAPLink function 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. Debugging ========= diff --git a/boards/adi/max32670evkit/max32670evkit.yaml b/boards/adi/max32670evkit/max32670evkit.yaml index d040a09de49..266d1584aaf 100644 --- a/boards/adi/max32670evkit/max32670evkit.yaml +++ b/boards/adi/max32670evkit/max32670evkit.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial diff --git a/boards/adi/max32672evkit/board.cmake b/boards/adi/max32672evkit/board.cmake index 454ec897d2a..76eb5154734 100644 --- a/boards/adi/max32672evkit/board.cmake +++ b/boards/adi/max32672evkit/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32672.cfg]") board_runner_args(jlink "--device=MAX32672" "--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/max32672evkit/doc/index.rst b/boards/adi/max32672evkit/doc/index.rst index c706898a353..745adcd8a72 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 ======== @@ -327,7 +292,8 @@ is supplied externally. Be sure to remove jumper JP15 (LDO_DUT_EN) to disconnect LDO if supplying VDD and VDDA externally. 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: diff --git a/boards/adi/max32672evkit/max32672evkit.dts b/boards/adi/max32672evkit/max32672evkit.dts index 581a9723c1d..737b2e33370 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/max32672evkit/max32672evkit.yaml b/boards/adi/max32672evkit/max32672evkit.yaml index e6dae70435c..a8c835774e5 100644 --- a/boards/adi/max32672evkit/max32672evkit.yaml +++ b/boards/adi/max32672evkit/max32672evkit.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial diff --git a/boards/adi/max32672fthr/board.cmake b/boards/adi/max32672fthr/board.cmake index 815111de6b7..b370a18f9f3 100644 --- a/boards/adi/max32672fthr/board.cmake +++ b/boards/adi/max32672fthr/board.cmake @@ -1,7 +1,5 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32672.cfg]") - +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adi/max32672fthr/doc/index.rst b/boards/adi/max32672fthr/doc/index.rst index 76033bf97ec..c772136a8bd 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 ======== @@ -204,7 +173,8 @@ The MAX32625 microcontroller on the board is flashed with DAPLink firmware at th It allows debugging and flashing the MAX32672 Arm Core over USB. 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. Debugging ========= diff --git a/boards/adi/max32672fthr/max32672fthr.yaml b/boards/adi/max32672fthr/max32672fthr.yaml index f98839246c8..28bb5414e07 100644 --- a/boards/adi/max32672fthr/max32672fthr.yaml +++ b/boards/adi/max32672fthr/max32672fthr.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial diff --git a/boards/adi/max32675evkit/board.cmake b/boards/adi/max32675evkit/board.cmake index 42caa77e95b..4d691b5106c 100644 --- a/boards/adi/max32675evkit/board.cmake +++ b/boards/adi/max32675evkit/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32675.cfg]") board_runner_args(jlink "--device=MAX32675" "--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/max32675evkit/doc/index.rst b/boards/adi/max32675evkit/doc/index.rst index a9de574eb21..6c66e204e0c 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 ======== @@ -379,7 +355,8 @@ is supplied externally. Be sure to remove jumper JP15 (LDO_DUT_EN) to disconnect the 3.3V LDO if supplying VDD and VDDA externally. 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: diff --git a/boards/adi/max32675evkit/max32675evkit.yaml b/boards/adi/max32675evkit/max32675evkit.yaml index 023a35465f3..86bee190d25 100644 --- a/boards/adi/max32675evkit/max32675evkit.yaml +++ b/boards/adi/max32675evkit/max32675evkit.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - dma - gpio diff --git a/boards/adi/max32680evkit/board.cmake b/boards/adi/max32680evkit/board.cmake index bd318bb200d..b370a18f9f3 100644 --- a/boards/adi/max32680evkit/board.cmake +++ b/boards/adi/max32680evkit/board.cmake @@ -1,7 +1,5 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32680.cfg]") - +include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/adi/max32680evkit/doc/index.rst b/boards/adi/max32680evkit/doc/index.rst index 13c6d7d06b6..a3c7d909efd 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 ======== @@ -327,7 +297,8 @@ SWD port. SWD debug can be accessed through the Cortex 10-pin connector, JH10. Logic levels are set to 1.8V (VDDIO_AUX). 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. Debugging ========= diff --git a/boards/adi/max32680evkit/max32680evkit_max32680_m4.dts b/boards/adi/max32680evkit/max32680evkit_max32680_m4.dts index 4547da3459d..d3459098a11 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/max32680evkit/max32680evkit_max32680_m4.yaml b/boards/adi/max32680evkit/max32680evkit_max32680_m4.yaml index 1fc90758f49..84f75d376d8 100644 --- a/boards/adi/max32680evkit/max32680evkit_max32680_m4.yaml +++ b/boards/adi/max32680evkit/max32680evkit_max32680_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial diff --git a/boards/adi/max32690evkit/board.cmake b/boards/adi/max32690evkit/board.cmake index 443c84cc5e8..1c5aa42735d 100644 --- a/boards/adi/max32690evkit/board.cmake +++ b/boards/adi/max32690evkit/board.cmake @@ -1,9 +1,8 @@ -# Copyright (c) 2023-2024 Analog Devices, Inc. +# Copyright (c) 2023-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32690.cfg]") board_runner_args(jlink "--device=MAX32690" "--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/max32690evkit/doc/index.rst b/boards/adi/max32690evkit/doc/index.rst index d976048dcb6..796bbeb1839 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 ======== @@ -284,7 +251,8 @@ 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: @@ -303,7 +271,7 @@ instead of ``west flash``. References ********** -- `MAX32690EVKIT web page`_ +- `MAX32690EVKIT solution center`_ -.. _MAX32690EVKIT web page: - https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/MAX32690EVKIT.html +.. _MAX32690EVKIT solution center: + https://developer.analog.com/solutions/max32690 diff --git a/boards/adi/max32690evkit/max32690evkit_max32690_m4.dts b/boards/adi/max32690evkit/max32690evkit_max32690_m4.dts index d04a91852cd..132f29f3041 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 b6a5a9a5d7a..8278d3fe168 100644 --- a/boards/adi/max32690evkit/max32690evkit_max32690_m4.yaml +++ b/boards/adi/max32690evkit/max32690evkit_max32690_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial @@ -21,5 +20,6 @@ supported: - pwm - w1 - flash + - usbd ram: 1024 flash: 3072 diff --git a/boards/adi/max32690fthr/board.cmake b/boards/adi/max32690fthr/board.cmake index 443c84cc5e8..43b3efb7b59 100644 --- a/boards/adi/max32690fthr/board.cmake +++ b/boards/adi/max32690fthr/board.cmake @@ -1,9 +1,8 @@ # Copyright (c) 2023-2024 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max32690.cfg]") board_runner_args(jlink "--device=MAX32690" "--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/max32690fthr/doc/index.rst b/boards/adi/max32690fthr/doc/index.rst index fdce08e32e8..ffbc67d9320 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 ======== @@ -97,7 +79,8 @@ Logic levels are fixed to VDDIO (1.8V). Once the debug probe is connected to your host computer, then you can run the ``west flash`` command to write a firmware image into flash. Here is an example -for the :zephyr:code-sample:`hello_world` application. +for the :zephyr:code-sample:`hello_world` application. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. zephyr-app-commands:: :zephyr-app: samples/hello_world @@ -127,7 +110,7 @@ session. Here is an example for the :zephyr:code-sample:`hello_world` applicatio References ********** -- `MAX32690 product page`_ +- `MAX32690 solution center`_ -.. _MAX32690 product page: - https://www.analog.com/en/products/max32690.html +.. _MAX32690 solution center: + https://developer.analog.com/solutions/max32690 diff --git a/boards/adi/max32690fthr/max32690fthr_max32690_m4.yaml b/boards/adi/max32690fthr/max32690fthr_max32690_m4.yaml index d81738ee742..7b802ab4795 100644 --- a/boards/adi/max32690fthr/max32690fthr_max32690_m4.yaml +++ b/boards/adi/max32690fthr/max32690fthr_max32690_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial diff --git a/boards/adi/max78000evkit/Kconfig.max78000evkit b/boards/adi/max78000evkit/Kconfig.max78000evkit new file mode 100644 index 00000000000..67f6980da06 --- /dev/null +++ b/boards/adi/max78000evkit/Kconfig.max78000evkit @@ -0,0 +1,7 @@ +# MAX78000EVKIT boards configuration + +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MAX78000EVKIT + select SOC_MAX78000_M4 if BOARD_MAX78000EVKIT_MAX78000_M4 diff --git a/boards/adi/max78000evkit/board.cmake b/boards/adi/max78000evkit/board.cmake new file mode 100644 index 00000000000..c4b66dade5a --- /dev/null +++ b/boards/adi/max78000evkit/board.cmake @@ -0,0 +1,8 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=MAX78000" "--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/max78000evkit/board.yml b/boards/adi/max78000evkit/board.yml new file mode 100644 index 00000000000..d1b1e370036 --- /dev/null +++ b/boards/adi/max78000evkit/board.yml @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board: + name: max78000evkit + full_name: MAX78000EVKIT + vendor: adi + socs: + - name: max78000 diff --git a/boards/adi/max78000evkit/doc/img/max78000evkit.webp b/boards/adi/max78000evkit/doc/img/max78000evkit.webp new file mode 100644 index 00000000000..691efe7cec7 Binary files /dev/null and b/boards/adi/max78000evkit/doc/img/max78000evkit.webp differ diff --git a/boards/adi/max78000evkit/doc/index.rst b/boards/adi/max78000evkit/doc/index.rst new file mode 100644 index 00000000000..18986d881cf --- /dev/null +++ b/boards/adi/max78000evkit/doc/index.rst @@ -0,0 +1,271 @@ +.. zephyr:board:: max78000evkit + +Overview +******** +The MAX78000 evaluation kit (EV kit) provides a platform for leveraging the capabilities of the MAX78000 to build +new generations of artificial intelligence (AI) devices. Onboard hardware includes a digital microphone, a gyroscope/accelerometer, parallel camera module support +and a 3.5in touch-enabled color TFT display. A secondary display is driven by a power accumulator for tracking +device power consumption over time. Uncommitted GPIO as well as analog inputs are readily accessible through +0.1in pin headers. Primary system power as well as UART access is provided by a USB Micro-B connector. A USB +to SPI bridge provides rapid access to onboard memory, allowing large networks or images to load quickly + +The Zephyr port is running on the MAX78000 MCU. + +Hardware +******** + +- MAX78000 MCU: + + - Dual-Core, Low-Power Microcontroller + + - Arm Cortex-M4 Processor with FPU up to 100MHz + - 512KB Flash and 128KB SRAM + - Optimized Performance with 16KB Instruction Cache + - Optional Error Correction Code (ECC-SEC-DED) for SRAM + - 32-Bit RISC-V Coprocessor up to 60MHz + - Up to 52 General-Purpose I/O Pins + - 12-Bit Parallel Camera Interface + - One I2S Master/Slave for Digital Audio Interface + + - Neural Network Accelerator + + - Highly Optimized for Deep Convolutional Neural Networks + - 442k 8-Bit Weight Capacity with 1,2,4,8-Bit Weights + - Programmable Input Image Size up to 1024 x 1024 pixels + - Programmable Network Depth up to 64 Layers + - Programmable per Layer Network Channel Widths up to 1024 Channels + - 1 and 2 Dimensional Convolution Processing + - Streaming Mode + - Flexibility to Support Other Network Types, Including MLP and Recurrent Neural Networks + + - Power Management Maximizes Operating Time for Battery Applications + + - Integrated Single-Inductor Multiple-Output (SIMO) Switch-Mode Power Supply (SMPS) + - 2.0V to 3.6V SIMO Supply Voltage Range + - Dynamic Voltage Scaling Minimizes Active Core Power Consumption + - 22.2μA/MHz While Loop Execution at 3.0V from Cache (CM4 Only) + - Selectable SRAM Retention in Low-Power Modes with Real-Time Clock (RTC) Enabled + + - Security and Integrity + + - Available Secure Boot + - AES 128/192/256 Hardware Acceleration Engine + - True Random Number Generator (TRNG) Seed Generator + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Connections and IOs +=================== + ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| Name | Name | Settings | Description | ++===========+===================+===================+==============================================================================================+ +| JP1 | LED1 EN | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables auxiliary LED1 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables auxiliary LED1 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP2 | LED2 EN | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables auxiliary LED2 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables auxiliary LED2 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP3 | TRIG1 | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables power monitor event trigger 1 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables power monitor event trigger 1 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP4 | TRIG2 | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables power monitor event trigger 2 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables power monitor event trigger 2 | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP5 | VREGI | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables 3V3 VREGI power | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables 3V3 VREGI power | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP6 | VREGIA | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables 3V3 VREGIA power | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables 3V3 VREGIA power | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP7 | CNN BOOST | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables 1V1 boost LDO power | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables 1V1 boost LDO power | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP8 | VDDA | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Internal SIMO powers VDDA | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | External LDO powers VDDA | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP9 | VDDIO | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Internal SIMO powers VDDIO | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | External LDO powers VDDIO | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP10 | VDDIOH | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | DUT LDO powers VDDIOH | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | AUX LDO powers VDDIOH | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP11 | VCOREB | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Internal SIMO powers VCOREB | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | External LDO powers VCOREB | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP12 | VCOREA | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Internal SIMO powers VCOREA | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | External LDO powers VCOREA | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP13 | VREGI PM BYPASS | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Bypasses power monitor shunt | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Enables power monitoring using power accumulator | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP14 | CNN 1V1 | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Connects 1V1 boost LDO to VCOREA | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables 1V1 boost LDO | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP15 | VCOREA PM BYPASS | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Bypasses power monitor shunt | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Enables power monitoring using power accumulator | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP16 | VCOREB PM BYPASS | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Bypasses power monitor shunt | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Enables power monitoring using power accumulator | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP17 | VREG_A PM BYPASS | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Bypasses power monitor shunt | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Enables power monitoring using power accumulator | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP18 | RESET EN | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables RV JTAG adapter to perform full system reset | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables system reset by RV JTAG adapter | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP19 | TFT BL | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables main TFT screen backlight | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables main TFT screen backlight | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP20 | I2S CLK SEL | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Onboard 12.288MHz oscillator drives I2S clock | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | External 1V8 CMOS LEVEL source drives I2S clock | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP21 | DUT I | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | DUT 3V3 total current monitor point | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Open to insert current meter | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JP22 | USB-SPI/CAM | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables USB-SPI bridge | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | Enables camera | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JH1 | UART 0 EN | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2, 3-4 | | | Enables USB-UART0 bridge, software flow control | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | All Open | | | Disables USB-UART0 bridge, allows reuse of port pins | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ +| JH2 | UART 1 EN | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | |All installed | | | Enables USB-UART1 bridge | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | All Open | | | Disables USB-UART1 bridge, allows reuse of port pins | | +| | | +---------------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+-------------------+----------------------------------------------------------------------------------------------+ + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== + +The MAX78000 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, JH5. +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. To perform a full erase, +pass the ``--erase`` option when executing ``west 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 (JH5) 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 +********** + +- `MAX78000EVKIT web page`_ + +.. _MAX78000EVKIT web page: + https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/max78000evkit.html diff --git a/boards/adi/max78000evkit/max78000evkit_max78000_m4.dts b/boards/adi/max78000evkit/max78000evkit_max78000_m4.dts new file mode 100644 index 00000000000..44e888a24c9 --- /dev/null +++ b/boards/adi/max78000evkit/max78000evkit_max78000_m4.dts @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include + +/ { + model = "Analog Devices MAX78000EVKIT"; + compatible = "adi,max78000evkit"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,sram = &sram2; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + label = "Green LED"; + }; + + led2: led_2 { + gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + label = "Red LED"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + pb1: pb1 { + gpios = <&gpio2 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW2"; + zephyr,code = ; + }; + + pb2: pb2 { + gpios = <&gpio2 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW3"; + zephyr,code = ; + }; + + pb_wakeup: pb_wakeup { + gpios = <&gpio3 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW + | MAX32_GPIO_VSEL_VDDIOH)>; + label = "Wakeup"; + zephyr,code = ; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led1; + led1 = &led2; + sw0 = &pb1; + sw1 = &pb2; + watchdog0 = &wdt0; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0a_tx_p0_1 &uart0a_rx_p0_0>; + pinctrl-names = "default"; + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + status = "okay"; +}; + +&clk_ipo { + status = "okay"; +}; + +&clk_ibro { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&trng { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + pinctrl-0 = <&i2c0_scl_p0_10 &i2c0_sda_p0_11>; + pinctrl-names = "default"; +}; + +&spi0 { + status = "okay"; + pinctrl-0 = <&spi0_mosi_p0_5 &spi0_miso_p0_6 &spi0_sck_p0_7 &spi0_ss0_p0_4>; + pinctrl-names = "default"; +}; + +&dma0 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&w1 { + pinctrl-0 = <&owm_io_p0_18 &owm_pe_p0_19>; + pinctrl-names = "default"; +}; diff --git a/boards/adi/max78000evkit/max78000evkit_max78000_m4.yaml b/boards/adi/max78000evkit/max78000evkit_max78000_m4.yaml new file mode 100644 index 00000000000..5f7f5225041 --- /dev/null +++ b/boards/adi/max78000evkit/max78000evkit_max78000_m4.yaml @@ -0,0 +1,23 @@ +identifier: max78000evkit/max78000/m4 +name: max78000evkit m4 +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - adc + - counter + - dma + - flash + - gpio + - i2c + - pwm + - serial + - spi + - trng + - w1 + - watchdog +ram: 128 +flash: 512 diff --git a/boards/adi/max78000evkit/max78000evkit_max78000_m4_defconfig b/boards/adi/max78000evkit/max78000evkit_max78000_m4_defconfig new file mode 100644 index 00000000000..9428e5334a0 --- /dev/null +++ b/boards/adi/max78000evkit/max78000evkit_max78000_m4_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/max78000fthr/Kconfig.max78000fthr b/boards/adi/max78000fthr/Kconfig.max78000fthr new file mode 100644 index 00000000000..07efd3aa4be --- /dev/null +++ b/boards/adi/max78000fthr/Kconfig.max78000fthr @@ -0,0 +1,7 @@ +# MAX78000FTHR boards configuration + +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MAX78000FTHR + select SOC_MAX78000_M4 if BOARD_MAX78000FTHR_MAX78000_M4 diff --git a/boards/adi/max78000fthr/board.cmake b/boards/adi/max78000fthr/board.cmake new file mode 100644 index 00000000000..617eecca8f8 --- /dev/null +++ b/boards/adi/max78000fthr/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/max78000fthr/board.yml b/boards/adi/max78000fthr/board.yml new file mode 100644 index 00000000000..365e84d1ad8 --- /dev/null +++ b/boards/adi/max78000fthr/board.yml @@ -0,0 +1,9 @@ +# Copyright (c) 2025 Analog Devices, Inc. +# SPDX-License-Identifier: Apache-2.0 + +board: + name: max78000fthr + full_name: MAX78000FTHR + vendor: adi + socs: + - name: max78000 diff --git a/boards/adi/max78000fthr/doc/img/max78000fthr.webp b/boards/adi/max78000fthr/doc/img/max78000fthr.webp new file mode 100644 index 00000000000..57f08575845 Binary files /dev/null and b/boards/adi/max78000fthr/doc/img/max78000fthr.webp differ diff --git a/boards/adi/max78000fthr/doc/index.rst b/boards/adi/max78000fthr/doc/index.rst new file mode 100644 index 00000000000..1960a00257e --- /dev/null +++ b/boards/adi/max78000fthr/doc/index.rst @@ -0,0 +1,173 @@ +.. zephyr:board:: max78000fthr + +Overview +******** +The MAX78000FTHR is a rapid development platform to help engineers quickly implement ultra low-power, artificial +intelligence (AI) solutions using the MAX78000 Arm® Cortex®-M4F processor with an integrated Convolutional Neural Network +accelerator. The board also includes the MAX20303 PMIC for battery and power management. The form factor is 0.9in x 2.6in +dual-row header footprint that is compatible with Adafruit Feather Wing peripheral expansion boards. The board includes a +variety of peripherals, such as a CMOS VGA image sensor, digital microphone, low-power stereo audio CODEC, 1MB QSPI +SRAM, micro SD card connector, RGB indicator LED, and pushbutton. The MAX78000FTHR provides a poweroptimized flexible +platform for quick proof-of-concepts and early software development to enhance time to market. + +The Zephyr port is running on the MAX78000 MCU. + +Hardware +******** + +- MAX78000 MCU: + + - Dual-Core, Low-Power Microcontroller + + - Arm Cortex-M4 Processor with FPU up to 100MHz + - 512KB Flash and 128KB SRAM + - Optimized Performance with 16KB Instruction Cache + - Optional Error Correction Code (ECC-SEC-DED) for SRAM + - 32-Bit RISC-V Coprocessor up to 60MHz + - Up to 52 General-Purpose I/O Pins + - 12-Bit Parallel Camera Interface + - One I2S Master/Slave for Digital Audio Interface + + - Neural Network Accelerator + + - Highly Optimized for Deep Convolutional Neural Networks + - 442k 8-Bit Weight Capacity with 1,2,4,8-Bit Weights + - Programmable Input Image Size up to 1024 x 1024 pixels + - Programmable Network Depth up to 64 Layers + - Programmable per Layer Network Channel Widths up to 1024 Channels + - 1 and 2 Dimensional Convolution Processing + - Streaming Mode + - Flexibility to Support Other Network Types, Including MLP and Recurrent Neural Networks + + - Power Management Maximizes Operating Time for Battery Applications + + - Integrated Single-Inductor Multiple-Output (SIMO) Switch-Mode Power Supply (SMPS) + - 2.0V to 3.6V SIMO Supply Voltage Range + - Dynamic Voltage Scaling Minimizes Active Core Power Consumption + - 22.2μA/MHz While Loop Execution at 3.0V from Cache (CM4 Only) + - Selectable SRAM Retention in Low-Power Modes with Real-Time Clock (RTC) Enabled + + - Security and Integrity + + - Available Secure Boot + - AES 128/192/256 Hardware Acceleration Engine + - True Random Number Generator (TRNG) Seed Generator + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Connections and IOs +=================== + +J8 Pinout +********** + ++---------+----------+-------------------------------------------------------------------------------------------------+ +| Pin | Name | Description | ++=========+==========+=================================================================================================+ +| 1 | RST | Master Reset Signal | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 2 | 3V3 | 3.3V Output. Typically used to provide 3.3V to peripherals connected to the expansion headers. | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 3 | 1V8 | 1.8V Output. Typically used to provide 1.8V to peripherals connected to the expansion headers. | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 4 | GND | Ground | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 5 | P2_3 | GPIO or Analog Input (AIN3 channel). | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 6 | P2_4 | GPIO or Analog Input (AIN4 channel). | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 7 | P1_1 | GPIO or UART2 Tx signal | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 8 | P1_0 | GPIO or UART2 Rx signal | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 9 | MPC1 | GPIO controlled by PMIC through I2C interface. Open drain or push-pull programmable | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 10 | MPC2 | GPIO controlled by PMIC through I2C interface. Open drain or push-pull programmable | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 11 | P0_7 | GPIO or QSPI0 clock signal. Shared with SD card and on-board QSPI SRAM | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 12 | P0_5 | GPIO or QSPI0 MOSI signal. Shared with SD card and on-board QSPI SRAM | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 13 | P0_6 | GPIO or QSPI0 MISO signal. Shared with SD card and on-board QSPI SRAM | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 14 | P2_6 | GPIO or LPUART Rx signal | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 15 | P2_7 | GPIO or LPUART Tx signal | ++---------+----------+-------------------------------------------------------------------------------------------------+ +| 16 | GND | Ground | ++---------+----------+-------------------------------------------------------------------------------------------------+ + +J4 Pinout +********** + ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| Pin | Name | Description | ++=========+==========+===========================================================================================================+ +| 1 | SYS | SYS Switched Connection to the Battery. This is the primary system power supply and automatically | +| | | switches between the battery voltage and the USB supply when available. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 2 | PWR | Turns off the PMIC if shorted to Ground for 13 seconds. Hard power-down button. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 3 | VBUS | USB VBUS Signal. This can be used as a 5V supply when connected to USB. This pin can also be | +| | | used as an input to power the board. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 4 | P1_6 | GPIO | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 5 | MPC3 | GPIO controlled by PMIC through the I2C interface. Open drain or push-pull programmable. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 6 | P0_9 | GPIO or QSPI0 SDIO3 signal. Shared with SD card and on-board QSPI SRAM. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 7 | P0_8 | GPIO or QSPI0 SDIO2 signal. Shared with SD Card and on-board QSPI SRAM. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 8 | P0_11 | GPIO or QSPI0 slave select signal | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 9 | P0_19 | GPIO | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 10 | P3_1 | GPIO or Wake-up signal. This pin is 3.3V only. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 11 | P0_16 | GPIO or I2C1 SCL signal. An on-board level shifter allows selecting 1.8V or 3.3V operation through | +| | | R15 or R20 resistors. Do not populate both. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ +| 12 | P0_17 | GPIO or I2C1 SDA signal. An on-board level shifter allows selecting 1.8V or 3.3V operation through | +| | | R15 or R20 resistors. Do not populate both. | ++---------+----------+-----------------------------------------------------------------------------------------------------------+ + +Programming and Debugging +************************* + +.. zephyr:board-supported-runners:: + +Flashing +======== + +The MAX32625 microcontroller on the board is preprogrammed with DAPLink firmware. +It allows debugging and programming of the MAX78000 Arm core over USB. + +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. To perform a full erase, +pass the ``--erase`` option when executing ``west 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 (JH5) 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 +********** + +- `MAX78000FTHR web page`_ + +.. _MAX78000FTHR web page: + https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/max78000fthr.html diff --git a/boards/adi/max78000fthr/max78000fthr_max78000_m4.dts b/boards/adi/max78000fthr/max78000fthr_max78000_m4.dts new file mode 100644 index 00000000000..0c62d5e4e4e --- /dev/null +++ b/boards/adi/max78000fthr/max78000fthr_max78000_m4.dts @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2025 Analog Devices, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include + +/ { + model = "Analog Devices MAX78000FTHR"; + compatible = "adi,max78000fthr"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,sram = &sram2; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + + led1: led_1 { + gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; + label = "Red LED"; + }; + + led2: led_2 { + gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; + label = "Green LED"; + }; + + led3: led_3 { + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + label = "Blue LED"; + }; + }; + + buttons { + compatible = "gpio-keys"; + + pb1: pb1 { + gpios = <&gpio0 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW1"; + zephyr,code = ; + }; + + pb2: pb2 { + gpios = <&gpio1 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW2"; + zephyr,code = ; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led1; + led1 = &led2; + sw0 = &pb1; + sw1 = &pb2; + watchdog0 = &wdt0; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0a_tx_p0_1 &uart0a_rx_p0_0>; + pinctrl-names = "default"; + current-speed = <115200>; + data-bits = <8>; + parity = "none"; + status = "okay"; +}; + +&clk_ipo { + status = "okay"; +}; + +&clk_ibro { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&trng { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + pinctrl-0 = <&i2c0_scl_p0_10 &i2c0_sda_p0_11>; + pinctrl-names = "default"; +}; + +&spi0 { + status = "okay"; + pinctrl-0 = <&spi0_mosi_p0_5 &spi0_miso_p0_6 &spi0_sck_p0_7 &spi0_ss0_p0_4>; + pinctrl-names = "default"; +}; + +&dma0 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&w1 { + pinctrl-0 = <&owm_io_p0_6 &owm_pe_p0_7>; + pinctrl-names = "default"; +}; diff --git a/boards/adi/max78000fthr/max78000fthr_max78000_m4.yaml b/boards/adi/max78000fthr/max78000fthr_max78000_m4.yaml new file mode 100644 index 00000000000..116fa9051c5 --- /dev/null +++ b/boards/adi/max78000fthr/max78000fthr_max78000_m4.yaml @@ -0,0 +1,23 @@ +identifier: max78000fthr/max78000/m4 +name: max78000fthr m4 +vendor: adi +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +supported: + - adc + - counter + - dma + - flash + - gpio + - i2c + - pwm + - serial + - spi + - trng + - w1 + - watchdog +ram: 128 +flash: 512 diff --git a/boards/adi/max78000fthr/max78000fthr_max78000_m4_defconfig b/boards/adi/max78000fthr/max78000fthr_max78000_m4_defconfig new file mode 100644 index 00000000000..9428e5334a0 --- /dev/null +++ b/boards/adi/max78000fthr/max78000fthr_max78000_m4_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/max78002evkit/board.cmake b/boards/adi/max78002evkit/board.cmake index b7d321b2f84..42001337f58 100644 --- a/boards/adi/max78002evkit/board.cmake +++ b/boards/adi/max78002evkit/board.cmake @@ -1,7 +1,8 @@ -# Copyright (c) 2024 Analog Devices, Inc. +# Copyright (c) 2024-2025 Analog Devices, Inc. # SPDX-License-Identifier: Apache-2.0 -board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]") -board_runner_args(openocd --cmd-pre-init "source [find target/max78002.cfg]") +board_runner_args(jlink "--device=MAX78002" "--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/max78002evkit/doc/index.rst b/boards/adi/max78002evkit/doc/index.rst index a5bd4acf09b..ffb55415bf4 100644 --- a/boards/adi/max78002evkit/doc/index.rst +++ b/boards/adi/max78002evkit/doc/index.rst @@ -42,7 +42,7 @@ Hardware - MIPI Camera Serial Interface 2 (MIPI CSI-2) Controller V2.1 - Support for Two Data Lanes - 12-Bit Parallel Camera Interface - - I 2S Controller/Target for Digital Audio Interface + - I2S Controller/Target for Digital Audio Interface - Secure Digital Interface Supports SD 3.0/SDIO 3.0/eMMC 4.51 - Convolutional Neural Network (CNN) Accelerator @@ -71,51 +71,6 @@ Hardware - AES 128/192/256 Hardware Acceleration Engine - True Random Number Generator (TRNG) Seed Generator - - Ultra-Low-Power Wireless Microcontroller - - - Internal 100MHz Oscillator - - Flexible Low-Power Modes with 7.3728MHz System Clock Option - - 512KB Flash and 128KB SRAM (Optional ECC on One 32KB SRAM Bank) - - 16KB Instruction Cache - - - Bluetooth 5.2 LE Radio - - - Dedicated, Ultra-Low-Power, 32-Bit RISC-V Coprocessor to Offload Timing-Critical Bluetooth Processing - - Fully Open-Source Bluetooth 5.2 Stack Available - - Supports AoA, AoD, LE Audio, and Mesh - - High-Throughput (2Mbps) Mode - - Long-Range (125kbps and 500kbps) Modes - - Rx Sensitivity: -97.5dBm; Tx Power: +4.5dBm - - Single-Ended Antenna Connection (50Ω) - - - Power Management Maximizes Battery Life - - - 2.0V to 3.6V Supply Voltage Range - - Integrated SIMO Power Regulator - - Dynamic Voltage Scaling (DVS) - - 23.8μA/MHz Active Current at 3.0V - - 4.4μA at 3.0V Retention Current for 32KB - - Selectable SRAM Retention + RTC in Low-Power Modes - - - Multiple Peripherals for System Control - - - Up to Two High-Speed SPI Master/Slave - - Up to Three High-Speed I2C Master/Slave (3.4Mbps) - - Up to Four UART, One I2S Master/Slave - - Up to 8-Input, 10-Bit Sigma-Delta ADC 7.8ksps - - Up to Four Micro-Power Comparators - - Timers: Up to Two Four 32-Bit, Two LP, TwoWatchdog Timers - - 1-Wire® Master - - Up to Four Pulse Train (PWM) Engines - - RTC with Wake-Up Timer - - Up to 52 GPIOs - - - Security and Integrity​ - - - Available Secure Boot - - TRNG Seed Generator - - AES 128/192/256 Hardware Acceleration Engine - - External devices connected to the MAX78002 EVKIT: - Color TFT Display @@ -126,142 +81,335 @@ 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 =================== -+-----------+-------------------+----------------------------------------------------------------------------------+ -| Name | Signal | Usage | -+===========+===================+==================================================================================+ -| JP1 | 3V3 MON | Normal operation in conjunction with JP3 jumpered 1-2 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP2 | 3V3 SW PM BYPASS | Power monitor shunts for main 3.3 V system power are bypassed | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP3 | CNN MON | Normal operation in conjunction with JP6 jumpered 1-2 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP4 | VCOREA PM BYPASS | Power monitor shunts for U4's share of VCOREA + CNN loads are bypassed | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP5 | VCOREB PM BYPASS | Power monitor shunts for VCOREB are bypassed | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP6 | VREGO_A PM BYPASS | Power monitor shunts for VREGO_A are bypassed | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP7 | VBAT | Enable/Disable 3V3 VBAT power | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP8 | VREGI | Enable/Disable 3V3 VREGI power | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP9 | VREGI/VBAT | Onboard 3V3_PM / external source at TP10 supplies VREGI/VBAT | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP10 | VDDIOH | Onboard 3V3_PM/3V3_SW supplies VDDIOH | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP11 | VDDA | VREGO_A_PM powers VDDA | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP12 | VDDIO | VREGO_A_PM powers VDDIO | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP13 | VCOREB | VREGO_B powers VCOREB | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP14 | VCOREA | VREGO_C ties to net VCOREA | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP15 | VREF | DUT ADC VREF is supplied by precision external reference | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP16 | I2C1 SDA | I2C1 DATA pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP17 | I2C1 SCL | I2C1 CLOCK pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP18 | TRIG1 | PWR accumulator trigger signal 1 ties to port 1.6 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP19 | TRIG2 | PWR accumulator trigger signal 2 ties to port 1.7 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP20 | UART0 EN | Connect/Disconnect USB-UART bridge to UART0 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP21 | I2C0_SDA | I2C0 DATA pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP22 | I2C0_SCL | I2C0 CLOCK pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP23 | UART1 EN | Connect/Disconnect USB-UART bridge to UART1 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP24 | EXT I2C0 EN | Enable/Disable QWIIC interface for I2C0 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP25 | PB1 PU | Enable/Disable 100kΩ pull-up for pushbutton mode, port 2.6 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP26 | PB2 PU | Enable/Disable 100kΩ pull-up for pushbutton mode, port 2.7 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP27 | I2C2 SDA | I2C2 DATA pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP28 | I2C2 SCL | I2C2 CLOCK pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP29 | VDDB | USB XCVR VDDB powered from VBUS / powered full time by system 3V3_PM | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP30 | EXT I2C2 EN | Enable/Disable QWIIC interface for I2C2 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP31 | L/R SEL | Select MIC ON R/L CH, I2S microphone data stream | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP32 | MIC-I2S I/O | External I2S/MIC data from I2S I/O / MIC header connected to I2S SDI | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP33 | MIC-I2S/CODEC | Onboard CODEC data / external I2S data from header connects to I2S SDI | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP34 | I2S VDD | Select 1.8V/3.3V for external MIC and DATA I2S interface | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP35 | I2C1 SDA | I2C1 DATA pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP36 | I2C1 SCL | I2C1 CLOCK pull-up | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP37 | I2S CK SEL | Select SMA connector J6 / onboard crystal oscillator for I2S master clock source | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP38 | DVP CAM PWR | Enable/Disable OVM7692 for DVP camera PWDN input | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP39 | SW CAM PWUP | Camera reset and power up under port pin control | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP40 | HW PWUP / SW PWUP | Camera will reset and power up as soon as 3.3V reaches a valid level | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP41 | CSI CAM I2C EN | Connect/Disconnect I2C1 to CSI camera Digilent P5C I2C | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP42 | TFT DC | TFT data/command select connects to port 2.2 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP43 | TFT CS | Select port 0.3 / port 1.7 to drive TFT CS | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP44 | LED1 EN | Enable/Disable LED1 | -+-----------+-------------------+----------------------------------------------------------------------------------+ -| JP45 | LED2 EN | Enable/Disable LED2 | -+-----------+-------------------+----------------------------------------------------------------------------------+ ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| Name | Name | Settings | Description | ++===========+===================+===============+==================================================================================================+ +| JP1 | 3V3 MON | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Normal operation in conjunction with JP3 jumpered 1-2 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Test access point for current measurement | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP2 | 3V3 SW PM BYPASS | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Power monitor shunts for main 3.3 V system power are bypassed | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Main 3.3V input routes through shunts for power accumulator measurements | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP3 | CNN MON | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Normal operation in conjunction with JP6 jumpered 1-2 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Test access point for current measurement of U4's share of VCOREA and CNN loads | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP4 | VCOREA PM BYPASS | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Power monitor shunts for U4's share of VCOREA + CNN loads are bypassed | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | VCOREA + CNN loads route through shunts for power accumulator | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP5 | VCOREB PM BYPASS | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Power monitor shunts for VCOREB are bypassed | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | VCOREB power routes through shunts for power accumulator | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP6 | VREGO_A PM BYPASS | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Power monitor shunts for VREGO_A are bypassed | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | VREGO_A power routes through shunts for power accumulator | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP7 | VBAT | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables 3V3 VBAT power | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables 3V3 VBAT power | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP8 | VREGI | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Enables 3V3 VREGI power | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Disables 3V3 VREGI power | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP9 | VREGI/VBAT | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-1 | | | Onboard 3V3_PM supplies VREGI/VBAT | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | External source at TP10 supplies VREGI/VBAT | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP10 | VDDIOH | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-1 | | | Onboard 3V3_PM supplies VDDIOH | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | Onboard 3V3_SW supplies VDDIOH | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP11 | VDDA | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | VREGO_A_PM powers VDDA | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | VDDA may be powered using TP6 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP12 | VDDIO | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | VREGO_A_PM powers VDDIO | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | VDDIO may be powered using TP7 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP13 | VCOREB | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | VREGO_B powers VCOREB | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | VCOREB may be powered using TP8 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP14 | VCOREA | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | VREGO_C ties to net VCOREA | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Net VCOREA may be powered using TP9; JP17 may also be used as a current test point | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP15 | VREF | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | DUT ADC VREF is supplied by precision external reference | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | External ADC VREF disabled; ref voltage may be injected at JP18.1 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP16 | I2C1 SDA | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C1 DATA pullup | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP17 | I2C1 SCL | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C1 CLOCK pullup | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP18 | TRIG1 | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | PWR accumulator trigger signal 1 ties to port 1.6 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | TRIG1 is disabled, so DVP camera PCIF_D10 may be used instead | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP19 | TRIG2 | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | PWR accumulator trigger signal 2 ties to port 1.7 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | TRIG2 is disabled, so DVP camera PCIF_D11 may be used instead | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP20 | UART0 EN | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Closed | | | USB-UART bridge connected to DUT UART0 (RTS and CTS are supported) | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | USB-UART bridge disconnected from DUT UART0 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP21 | I2C0_SDA | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C0 DATA pull-up | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP22 | I2C0_SCL | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C0 CLOCK pull-up | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP23 | UART1 EN | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Closed | | | USB-UART bridge connected to DUT UART1 (no HW flow control) | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | USB-UART bridge disconnected from DUT UART1 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP24 | EXT I2C0 EN | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | QWIIC interface for I2C0 enabled by default | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Open this jumper to place the QWIIC level translator into a high-Z state | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP25 | PB1 PU | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | 100kΩ pull-up enabled for pushbutton mode, port 2.6 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Pull-up disabled, allowing port pin to be repurposed (this port shared with AIN6) | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP26 | PB2 PU | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | 100kΩ pull-up enabled for pushbutton mode, port 2.7 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Pull-up disabled, allowing port pin to be repurposed (this port shared with AIN7) | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP27 | I2C2 SDA | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C2 DATA pull-up | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP28 | I2C2 SCL | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C2 CLOCK pull-up | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP29 | VDDB | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-1 | | | DUT USB XCVR VDDB powered from VBUS regulated with dedicated 3.3V LDO | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | USB XCVR VDDB powered full time by system 3V3_PM | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP30 | EXT I2C2 EN | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | QWIIC interface for I2C2 enabled by default | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Open this jumper to place the QWIIC level translator into a high-Z state | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP31 | L/R SEL | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | MIC ON R CH, I2S microphone data stream | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | MIC ON L CH, I2S microphone data stream | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP32 | MIC-I2S I/O | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | External I2S data from I2S I/O header connected to I2S SDI. | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | External MIC data from I2S MIC header connected to I2S SDI | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP33 | MIC-I2S/CODEC | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Onboard CODEC data connects to I2S SDI | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | External I2S data (mic or slave I2S) from header connects to I2S SDI | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP34 | I2S VDD | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-1 | | | External MIC and DATA I2S interface headers run at 1.8V | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | External MIC and DATA I2S interface headers run at 3.3V | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP35 | I2C1 SDA | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C1 DATA pull-up | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP36 | I2C1 SCL | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2C1 CLOCK pull-up | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Close this jumper as needed to assure proper termination | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP37 | I2S CK SEL | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | I2S master clock sourced from SMA connector J6 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | I2S master clock sourced from onboard crystal oscillator | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP38 | DVP CAM PWR | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-1 | | | Sets state of DVP camera PWDN input; default is OFF for OVM7692 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | Sets state of DVP camera PWDN input; 2-3 will power up OVM7692 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP39 | SW CAM PWUP | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Camera reset and power up under port pin control | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Digilent P5C camera powered down, JP39 can over ride this condition | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP40 | HW PWUP / SW PWUP | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | Camera will reset and power up as soon as 3.3V reaches a valid level | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Camera reset and power up under port pin control if JP39 is installed; else, camera off | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP41 | CSI CAM I2C EN | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | CSI camera Digilent P5C I2C connects to I2C1 for register setup | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Level translator and I2C PU are in high-Z state; I2C1 disconnected from P5C registers | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP42 | TFT DC | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | TFT data/command select connects to port 2.2 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Pull jumper if using AIN2 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP43 | TFT CS | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-1 | | | TFT CS driven by port 0.3, shared with UART0 RTS | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 2-3 | | | TFT CS driven by port 1.7, shared with DVP DATA 11 and TRIG2 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP44 | LED1 EN | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | LED0 illuminates when port 2.4 is high | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Pull jumper if using AIN4 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ +| JP45 | LED2 EN | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | 1-2 | | | LED1 illuminates when port 2.5 is high | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | Open | | | Pull jumper if using AIN5 | | +| | | +-----------+ | +-----------------------------------------------------------------------------------------+ | +| | | | | ++-----------+-------------------+---------------+--------------------------------------------------------------------------------------------------+ Programming and Debugging ************************* +.. zephyr:board-supported-runners:: + Flashing ======== @@ -270,7 +418,8 @@ SWD port. SWD debug can be accessed through the Cortex 10-pin connector, JH8. 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. +``west flash`` command to write a firmware image into flash. To perform a full erase, +pass the ``--erase`` option when executing ``west flash``. .. note:: diff --git a/boards/adi/max78002evkit/max78002evkit_max78002_m4.dts b/boards/adi/max78002evkit/max78002evkit_max78002_m4.dts index 8b6df6c28c1..6ba9ded8d4a 100644 --- a/boards/adi/max78002evkit/max78002evkit_max78002_m4.dts +++ b/boards/adi/max78002evkit/max78002evkit_max78002_m4.dts @@ -125,3 +125,7 @@ pinctrl-0 = <&owm_io_p0_6 &owm_pe_p0_7>; pinctrl-names = "default"; }; + +&rtc_counter { + status = "okay"; +}; diff --git a/boards/adi/max78002evkit/max78002evkit_max78002_m4.yaml b/boards/adi/max78002evkit/max78002evkit_max78002_m4.yaml index 4631e4e276b..ffe89807e7a 100644 --- a/boards/adi/max78002evkit/max78002evkit_max78002_m4.yaml +++ b/boards/adi/max78002evkit/max78002evkit_max78002_m4.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - serial @@ -17,6 +16,7 @@ supported: - spi - adc - counter + - rtc_counter - pwm - w1 - flash diff --git a/boards/adi/sdp_k1/adi_sdp_k1.yaml b/boards/adi/sdp_k1/adi_sdp_k1.yaml index 800bedab7de..b794e9be8f2 100644 --- a/boards/adi/sdp_k1/adi_sdp_k1.yaml +++ b/boards/adi/sdp_k1/adi_sdp_k1.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 384 flash: 2048 supported: diff --git a/boards/adi/sdp_k1/doc/index.rst b/boards/adi/sdp_k1/doc/index.rst index 680852f53dd..d684c53374c 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 d976ee7740f..671570b6409 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/alientek/pandora_stm32l475/pandora_stm32l475.yaml b/boards/alientek/pandora_stm32l475/pandora_stm32l475.yaml index d0f6adfdbf8..8a1ac762770 100644 --- a/boards/alientek/pandora_stm32l475/pandora_stm32l475.yaml +++ b/boards/alientek/pandora_stm32l475/pandora_stm32l475.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 128 flash: 512 supported: diff --git a/boards/altr/max10/doc/index.rst b/boards/altr/max10/doc/index.rst index 0c16aa329e8..1e5064b0f0d 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 26cf5e58063..39db2783c37 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 30828d729c5..b6cf18bc1c6 100644 --- a/boards/ambiq/apollo3_evb/apollo3_evb.dts +++ b/boards/ambiq/apollo3_evb/apollo3_evb.dts @@ -139,23 +139,25 @@ status = "okay"; }; -&spi0 { - compatible = "ambiq,spi"; - 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 { - compatible = "ambiq,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"; +&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 { @@ -196,7 +198,6 @@ }; &adc0 { - compatible = "ambiq,adc"; pinctrl-0 = <&adc0_default>; pinctrl-names = "default"; status = "disabled"; diff --git a/boards/ambiq/apollo3_evb/apollo3_evb_connector.dtsi b/boards/ambiq/apollo3_evb/apollo3_evb_connector.dtsi index 77e22c5bbb5..7a6ad127efa 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 429d973d378..c8d56b0443b 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 3eea582a372..f8821a4c2f8 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 88b3cefbb2f..a40767bd371 100644 --- a/boards/ambiq/apollo3p_evb/apollo3p_evb.dts +++ b/boards/ambiq/apollo3p_evb/apollo3p_evb.dts @@ -117,23 +117,25 @@ status = "okay"; }; -&spi0 { - compatible = "ambiq,spi"; - 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 { - compatible = "ambiq,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"; +&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 { @@ -174,7 +176,6 @@ }; &adc0 { - compatible = "ambiq,adc"; pinctrl-0 = <&adc0_default>; pinctrl-names = "default"; status = "disabled"; diff --git a/boards/ambiq/apollo3p_evb/apollo3p_evb_connector.dtsi b/boards/ambiq/apollo3p_evb/apollo3p_evb_connector.dtsi index fc85edb4a63..73b8d42e107 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 a5f848c4f2c..1aa477d785d 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 63595ffddbd..2bcd67ff17c 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 f8c20b0fad9..2cf596eadcd 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 cdcbcee689b..a4e8fdd6b43 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,29 +89,33 @@ status = "okay"; }; -&i2c0 { - compatible = "ambiq,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"; + }; }; -&spi1 { - compatible = "ambiq,spi"; - 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 81158fba6db..b6e891ef53f 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 dbbb233485e..ccfdfd72974 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 71ccc5399fd..cdac604591c 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 { @@ -76,7 +77,6 @@ }; &adc0 { - compatible = "ambiq,adc"; pinctrl-0 = <&adc0_default>; pinctrl-names = "default"; status = "okay"; @@ -95,23 +95,25 @@ status = "okay"; }; -&iom0_i2c { - compatible = "ambiq,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 { - compatible = "ambiq,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 { @@ -153,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 e083db991e2..690ed85437d 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 d2cc43e5bb4..ab8ccfd456a 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/ambiq/apollo510_evb/CMakeLists.txt b/boards/ambiq/apollo510_evb/CMakeLists.txt new file mode 100644 index 00000000000..218a0602483 --- /dev/null +++ b/boards/ambiq/apollo510_evb/CMakeLists.txt @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_library() +zephyr_library_sources(board.c) diff --git a/boards/ambiq/apollo510_evb/Kconfig b/boards/ambiq/apollo510_evb/Kconfig new file mode 100644 index 00000000000..6929d894103 --- /dev/null +++ b/boards/ambiq/apollo510_evb/Kconfig @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2025 Ambiq Micro Inc. + +config BOARD_APOLLO510_EVB + select BOARD_EARLY_INIT_HOOK diff --git a/boards/ambiq/apollo510_evb/Kconfig.apollo510_evb b/boards/ambiq/apollo510_evb/Kconfig.apollo510_evb new file mode 100644 index 00000000000..38315f5fd69 --- /dev/null +++ b/boards/ambiq/apollo510_evb/Kconfig.apollo510_evb @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2025 Ambiq Micro Inc. + +config BOARD_APOLLO510_EVB + select SOC_APOLLO510 diff --git a/boards/ambiq/apollo510_evb/Kconfig.defconfig b/boards/ambiq/apollo510_evb/Kconfig.defconfig new file mode 100644 index 00000000000..9f9c9b2a196 --- /dev/null +++ b/boards/ambiq/apollo510_evb/Kconfig.defconfig @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2025 Ambiq Micro Inc. + +if BOARD_APOLLO510_EVB + +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 32768 if AMBIQ_STIMER_TIMER + default 96000000 if CORTEX_M_SYSTICK + +config LOG_BACKEND_SWO_FREQ_HZ + default 1000000 + depends on LOG_BACKEND_SWO + +endif # BOARD_APOLLO510_EVB diff --git a/boards/ambiq/apollo510_evb/apollo510_evb-pinctrl.dtsi b/boards/ambiq/apollo510_evb/apollo510_evb-pinctrl.dtsi new file mode 100644 index 00000000000..3f173b61a03 --- /dev/null +++ b/boards/ambiq/apollo510_evb/apollo510_evb-pinctrl.dtsi @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Ambiq Micro Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + swo_default: swo_default { + group0 { + pinmux = ; + }; + }; +}; diff --git a/boards/ambiq/apollo510_evb/apollo510_evb.dts b/boards/ambiq/apollo510_evb/apollo510_evb.dts new file mode 100644 index 00000000000..2303e43e125 --- /dev/null +++ b/boards/ambiq/apollo510_evb/apollo510_evb.dts @@ -0,0 +1,128 @@ +/dts-v1/; +#include +#include "apollo510_evb-pinctrl.dtsi" +#include + +/ { + model = "Ambiq Apollo510 evaluation board"; + compatible = "ambiq,apollo510_evb"; + + chosen { + zephyr,itcm = &itcm; + zephyr,dtcm = &dtcm; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,uart-pipe = &uart0; + ambiq,xo32m = &xo32m_xtal; + ambiq,xo32k = &xo32k_xtal; + ambiq,extrefclk = &extrefclk; + }; + + aliases { + watchdog0 = &wdt0; + led0 = &led0; + led1 = &led1; + led2 = &led2; + sw0 = &button0; + sw1 = &button1; + }; + + sram0: memory@SSRAM_BASE_NAME { + compatible = "mmio-sram"; + reg = ; + }; + + sram_no_cache: memory@20280000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x20280000 0x100000>; + zephyr,memory-region = "SRAM_NO_CACHE"; + zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio160_191 5 GPIO_ACTIVE_LOW>; + label = "LED 0"; + }; + led1: led_1 { + gpios = <&gpio64_95 25 GPIO_ACTIVE_LOW>; + label = "LED 1"; + }; + led2: led_2 { + gpios = <&gpio64_95 28 GPIO_ACTIVE_LOW>; + label = "LED 2"; + }; + }; + + buttons { + compatible = "gpio-keys"; + polling-mode; + button0: button_0 { + gpios = <&gpio64_95 29 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "BTN0"; + zephyr,code = ; + status = "okay"; + }; + button1: button_1 { + gpios = <&gpio64_95 30 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "BTN1"; + zephyr,code = ; + status = "okay"; + }; + }; +}; + +&xo32m_xtal { + clock-frequency = ; +}; + +&itm { + pinctrl-0 = <&swo_default>; + pinctrl-names = "default"; +}; + +&uart0 { + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; + status = "okay"; +}; + +&stimer0 { + clk-source = <3>; +}; + +&wdt0 { + status = "okay"; +}; + +&gpio0_31 { + status = "okay"; +}; + +&gpio32_63 { + status = "okay"; +}; + +&gpio64_95 { + status = "okay"; +}; + +&gpio96_127 { + status = "okay"; +}; + +&gpio128_159 { + status = "okay"; +}; + +&gpio160_191 { + status = "okay"; +}; + +&gpio192_223 { + status = "okay"; +}; diff --git a/boards/ambiq/apollo510_evb/apollo510_evb.yaml b/boards/ambiq/apollo510_evb/apollo510_evb.yaml new file mode 100644 index 00000000000..704c2c00208 --- /dev/null +++ b/boards/ambiq/apollo510_evb/apollo510_evb.yaml @@ -0,0 +1,19 @@ +identifier: apollo510_evb +name: Apollo510 EVB +type: mcu +arch: arm +ram: 3072 +flash: 4096 +toolchain: + - zephyr + - gnuarmemb +supported: + - uart + - watchdog + - gpio + - clock_control +testing: + ignore_tags: + - net + - bluetooth +vendor: ambiq diff --git a/boards/ambiq/apollo510_evb/apollo510_evb_defconfig b/boards/ambiq/apollo510_evb/apollo510_evb_defconfig new file mode 100644 index 00000000000..de397a65fbd --- /dev/null +++ b/boards/ambiq/apollo510_evb/apollo510_evb_defconfig @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2025 Ambiq Micro Inc. + +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_HW_STACK_PROTECTION=y +CONFIG_ARM_MPU=y +CONFIG_PM=y +CONFIG_PM_DEVICE=y +CONFIG_PM_DEVICE_RUNTIME=y diff --git a/boards/ambiq/apollo510_evb/board.c b/boards/ambiq/apollo510_evb/board.c new file mode 100644 index 00000000000..b3cc847698c --- /dev/null +++ b/boards/ambiq/apollo510_evb/board.c @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Ambiq Micro Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#if DT_HAS_CHOSEN(ambiq_xo32m) +#define XTAL_HS_FREQ DT_PROP(DT_CHOSEN(ambiq_xo32m), clock_frequency) +#if DT_SAME_NODE(DT_CHOSEN(ambiq_xo32m), DT_NODELABEL(xo32m_xtal)) +#define XTAL_HS_MODE AM_HAL_CLKMGR_XTAL_HS_MODE_XTAL +#elif DT_SAME_NODE(DT_CHOSEN(ambiq_xo32m), DT_NODELABEL(xo32m_ext)) +#define XTAL_HS_MODE AM_HAL_CLKMGR_XTAL_HS_MODE_EXT +#endif +#else +#define XTAL_HS_FREQ 0 +#define XTAL_HS_MODE AM_HAL_CLKMGR_XTAL_HS_MODE_XTAL +#endif + +#if DT_HAS_CHOSEN(ambiq_xo32k) +#define XTAL_LS_FREQ DT_PROP(DT_CHOSEN(ambiq_xo32k), clock_frequency) +#if DT_SAME_NODE(DT_CHOSEN(ambiq_xo32k), DT_NODELABEL(xo32k_xtal)) +#define XTAL_LS_MODE AM_HAL_CLKMGR_XTAL_LS_MODE_XTAL +#elif DT_SAME_NODE(DT_CHOSEN(ambiq_xo32k), DT_NODELABEL(xo32k_ext)) +#define XTAL_LS_MODE AM_HAL_CLKMGR_XTAL_LS_MODE_EXT +#endif +#else +#define XTAL_LS_FREQ 0 +#define XTAL_LS_MODE AM_HAL_CLKMGR_XTAL_LS_MODE_XTAL +#endif + +#if DT_HAS_CHOSEN(ambiq_extrefclk) +#define EXTREFCLK_FREQ DT_PROP(DT_CHOSEN(ambiq_extrefclk), clock_frequency) +#else +#define EXTREFCLK_FREQ 0 +#endif + +void board_early_init_hook(void) +{ + /* Set board related info into clock manager */ + am_hal_clkmgr_board_info_t sClkmgrBoardInfo = {.sXtalHs.eXtalHsMode = XTAL_HS_MODE, + .sXtalHs.ui32XtalHsFreq = XTAL_HS_FREQ, + .sXtalLs.eXtalLsMode = XTAL_LS_MODE, + .sXtalLs.ui32XtalLsFreq = XTAL_LS_FREQ, + .ui32ExtRefClkFreq = EXTREFCLK_FREQ}; + am_hal_clkmgr_board_info_set(&sClkmgrBoardInfo); + + /* Default HFRC and HFRC2 to Free Running clocks */ + am_hal_clkmgr_clock_config(AM_HAL_CLKMGR_CLK_ID_HFRC, + AM_HAL_CLKMGR_HFRC_FREQ_FREE_RUN_APPROX_48MHZ, NULL); + am_hal_clkmgr_clock_config(AM_HAL_CLKMGR_CLK_ID_HFRC2, + AM_HAL_CLKMGR_HFRC2_FREQ_FREE_RUN_APPROX_250MHZ, NULL); + +} diff --git a/boards/ambiq/apollo510_evb/board.cmake b/boards/ambiq/apollo510_evb/board.cmake new file mode 100644 index 00000000000..f4ec9988f02 --- /dev/null +++ b/boards/ambiq/apollo510_evb/board.cmake @@ -0,0 +1,6 @@ +# Copyright (c) 2025 Ambiq Micro Inc. +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=AP510NFA-CBR" "--iface=swd" "--speed=1000") + +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ambiq/apollo510_evb/board.yml b/boards/ambiq/apollo510_evb/board.yml new file mode 100644 index 00000000000..b42efb3b452 --- /dev/null +++ b/boards/ambiq/apollo510_evb/board.yml @@ -0,0 +1,6 @@ +board: + name: apollo510_evb + full_name: Apollo510 SOC Evaluation Board + vendor: ambiq + socs: + - name: apollo510 diff --git a/boards/ambiq/apollo510_evb/doc/apollo510-soc-eval-board.jpg b/boards/ambiq/apollo510_evb/doc/apollo510-soc-eval-board.jpg new file mode 100644 index 00000000000..906b08bae26 Binary files /dev/null and b/boards/ambiq/apollo510_evb/doc/apollo510-soc-eval-board.jpg differ diff --git a/boards/ambiq/apollo510_evb/doc/index.rst b/boards/ambiq/apollo510_evb/doc/index.rst new file mode 100644 index 00000000000..82916942776 --- /dev/null +++ b/boards/ambiq/apollo510_evb/doc/index.rst @@ -0,0 +1,75 @@ +.. zephyr:board:: apollo510_evb + +Apollo510 EVB is a board by Ambiq featuring their ultra-low power Apollo510 SoC. + +Hardware +******** + +- Apollo510 SoC with up to 250 MHz operating frequency +- ARM® Cortex® M55 core +- 64 kB Instruction Cache and 64 kB Data Cache +- Up to 4 MB of non-volatile memory (NVM) for code/data +- Up to 3 MB of low leakage / low power RAM for code/data +- 256 kB Instruction Tightly Coupled RAM (ITCM) +- 512 kB Data Tightly Coupled RAM (DTCM) + +For more information about the Apollo510 SoC and Apollo510 EVB board: + +- `Apollo510 Website`_ +- `Apollo510 Datasheet`_ +- `Apollo510 EVB Website`_ + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and Debugging +========================= + +.. zephyr:board-supported-runners:: + +Flashing an application +----------------------- + +Connect your device to your host computer using the JLINK USB port. +The sample application :zephyr:code-sample:`hello_world` is used for this example. +Build the Zephyr kernel and application, then flash it to the device: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: apollo510_evb + :goals: flash + +.. note:: + ``west flash`` requires `SEGGER J-Link software`_ and `pylink`_ Python module + to be installed on you host computer. + +Open a serial terminal (minicom, putty, etc.) with the following settings: + +- Speed: 115200 +- Data: 8 bits +- Parity: None +- Stop bits: 1 + +Reset the board and you should be able to see on the corresponding Serial Port +the following message: + +.. code-block:: console + + Hello World! apollo510_evb + +.. _Apollo510 Website: + https://ambiq.com/apollo510/ + +.. _Apollo510 Datasheet: + https://contentportal.ambiq.com/documents/20123/2877485/Apollo510-SoC-Datasheet.pdf + +.. _Apollo510 EVB Website: + For more information, please reach out to Sales and FAE. + +.. _SEGGER J-Link software: + https://www.segger.com/downloads/jlink + +.. _pylink: + https://github.com/Square/pylink 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 fcc9221eafc..2812516f28e 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 9383dbd9df6..d939718e58a 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 85fb1c26891..53ec1923e5d 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 9cc92025e91..aa13a0350d5 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 4b86de20d6b..f1bfa8f6707 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 00000000000..192725829db --- /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 00000000000..a624cc396d3 --- /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 00000000000..6135a69a6ab --- /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 00000000000..35d3ea5f22d --- /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 00000000000..087ed4c85c1 --- /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 00000000000..73d034e20cb --- /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 00000000000..eccdf0ae37b --- /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 00000000000..4aec6a299f3 --- /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 3e290dd2f28..42767445c55 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 new file mode 100644 index 00000000000..d7393218659 --- /dev/null +++ b/boards/antmicro/index.rst @@ -0,0 +1,10 @@ +.. _boards-antmicro: + +Antmicro +######## + +.. toctree:: + :maxdepth: 1 + :glob: + + **/* diff --git a/boards/antmicro/myra_sip_baseboard/Kconfig.defconfig b/boards/antmicro/myra_sip_baseboard/Kconfig.defconfig new file mode 100644 index 00000000000..21533cc29e9 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/Kconfig.defconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_MYRA_SIP_BASEBOARD + +config SPI_STM32_INTERRUPT + default y + depends on SPI + +endif # BOARD_MYRA_SIP_BASEBOARD diff --git a/boards/antmicro/myra_sip_baseboard/Kconfig.myra_sip_baseboard b/boards/antmicro/myra_sip_baseboard/Kconfig.myra_sip_baseboard new file mode 100644 index 00000000000..5fce139d966 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/Kconfig.myra_sip_baseboard @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_MYRA_SIP_BASEBOARD + select SOC_MYRA diff --git a/boards/antmicro/myra_sip_baseboard/board.cmake b/boards/antmicro/myra_sip_baseboard/board.cmake new file mode 100644 index 00000000000..7595428a879 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/board.cmake @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +set(SUPPORTED_EMU_PLATFORMS renode) +set(RENODE_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/support/myra_sip_baseboard.resc) +set(RENODE_UART sysbus.lpuart1) + +board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_myra_sip_baseboard.cfg") + +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/antmicro/myra_sip_baseboard/board.yml b/boards/antmicro/myra_sip_baseboard/board.yml new file mode 100644 index 00000000000..71575059420 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/board.yml @@ -0,0 +1,6 @@ +board: + name: myra_sip_baseboard + full_name: Myra SiP Baseboard + vendor: antmicro + socs: + - name: myra diff --git a/boards/antmicro/myra_sip_baseboard/doc/img/myra_sip_baseboard.webp b/boards/antmicro/myra_sip_baseboard/doc/img/myra_sip_baseboard.webp new file mode 100644 index 00000000000..c521ce0c462 Binary files /dev/null and b/boards/antmicro/myra_sip_baseboard/doc/img/myra_sip_baseboard.webp differ diff --git a/boards/antmicro/myra_sip_baseboard/doc/index.rst b/boards/antmicro/myra_sip_baseboard/doc/index.rst new file mode 100644 index 00000000000..0eb273c5245 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/doc/index.rst @@ -0,0 +1,221 @@ +.. zephyr:board:: myra_sip_baseboard + +Overview +******** + +The Myra SiP Baseboard features Antmicro's **Myra** SiP, which integrates the **STM32G491REI6** MCU, +128kB FRAM, and FTDI FT231XQ USB to UART converter. The board is equipped with temperature, +humidity, and pressure sensors, designed to help monitor conditions in server rooms. + +The sensors are placed on a separate island that is detachable from the main PCB and can be +installed directly in the required place. It provides local storage for data logging and a battery +backup for protection against data loss. The board can be used as a building block for PoC solutions +for monitoring environmental parameters. + +Key features include: + +- STM32G491REI6 MCU (Cortex-M4, 170 MHz) +- 128 KB Fujitsu FRAM +- FTDI FT231XQ USB to UART converter +- 50 mm x 26.5 mm PCB +- USB-C Connector for data and power +- SHT45 temperature + humidity sensor +- BME280 temperature + humidity + pressure sensor +- QWIIC connectors for peripheral expansion +- RTC with battery backup + +More information about the board can be found on `Antmicro's Open Hardware Portal `_. + +Hardware +******** + +Myra SiP provides the following hardware: + +- **STM32G491REI6 MCU**: + + - ARM Cortex-M4 CPU with FPU, up to 170 MHz + - Clock Sources: + + - 4 to 48 MHz external crystal oscillator (HSE) + - 32 kHz crystal oscillator for RTC (LSE) + - Internal 16 MHz RC (±1%) + - Internal low-power 32 kHz RC (±5%) + - 2 PLLs for system clock, USB, audio, ADC + - RTC: Real-time clock with hardware calendar, alarms, and calibration + - Timers: + + - 1x 32-bit timer and 2x 16-bit timers with up to 4x IC/OC/PWM or pulse counter and quadrature + (incremental) encoder input + - 3x 16-bit advanced motor control timers with up to 8x PWM channels, dead time generation, + emergency stop + - 1x 16-bit timer with 2x IC/OC, one OCN/PWM, dead time generation, emergency stop + - 2x watchdog timers (independent, window) + - 2x 16-bit basic timers + - SysTick timer + - 1x low-power timer + - I/Os: Up to 86 fast I/Os, most 5V tolerant + - Memory: + + - 512 KB Flash memory with ECC and PCROP protection + - 96 KB SRAM including 32 KB with hardware parity check + - Analog peripherals: + + - 3x 16-bit ADCs with up to 36 channels, hardware oversampling, and resolution up to 16-bit + - 4x 12-bit DAC channels + - 4x ultra-fast rail-to-rail analog comparators + - 4x operational amplifiers with built-in PGA + - Internal temperature sensor and voltage reference with support for three output voltages + (2.048 V, 2.5 V, 2.9 V) + - Communication Interfaces: + + - 2x FDCAN controllers supporting flexible data rate + - 3x I2C Fast Mode Plus (1 Mbit/s) with 20 mA current sink, SMBus/PMBus support + - 5x USART/UART (ISO 7816, LIN, IrDA, modem control) + - 1x LPUART + - 3x SPI interfaces (2x with multiplexed half-duplex I²S) + - 1x SAI (serial audio interface) + - USB 2.0 full-speed with LPM and BCD support + - IRTIM (infrared interface) + - USB Type-C™ / USB Power Delivery (UCPD) + - Other Peripherals: + + - 16-channel DMA controller + - True Random Number Generator (RNG) + - CRC calculation unit, 96-bit unique ID + - Development support: SWD, JTAG, Embedded Trace Macrocell™ + - ECOPACK2® compliant packages + +- **128 KB Fujitsu MB85RS1MT FRAM**: Local storage for data logging, allowing non-volatile memory storage. + +- **FTDI FT231XQ USB to UART converter**: Provides a reliable USB to UART interface. + + +More information about STM32G491RE can be found here: + +- `STM32G491RE on www.st.com`_ + +Other board's peripherals: +-------------------------- + +- USB-C Connector: For data and power. +- SHT45 sensor: + + - Relative humidity accuracy: ±1.0% RH + - Operating humidity range: 0-100% RH + - Temperature accuracy: ±0.1°C + - Operating temperature range: -40°C to 125°C +- BME280 sensor: + + - Relative humidity accuracy: ±3% RH + - Temperature accuracy: ±1°C + - Pressure accuracy: ±1 hPa + - Operating temperature range: -40°C to 85°C + - Pressure range: 300-1100 hPa +- QWIIC connectors: For easy peripheral expansion. + +Supported Features +------------------ + +.. zephyr:board-supported-hw:: + +Connections and IOs +------------------- + +Antmicro's Myra SiP Baseboard provides the following default pin mappings for peripherals: + +.. rst-class:: rst-columns + +- LPUART_1_TX : PA2 +- LPUART_1_RX : PA3 +- I2C_1_SCL : PB8 +- I2C_1_SDA : PB9 +- SPI_CS2 : PB2 +- SPI_CS3 : PA7 +- SPI_2_SCK : PB13 +- SPI_2_MISO : PB14 +- SPI_2_MOSI : PB15 +- PWM_2_CH1 : PA5 +- USER_PB : PC13 +- LD2 : PA5 +- ADC1_IN1 : PA0 +- DAC1_OUT1 : PA4 +- USB_MCU_N : PA11 +- USB_MCU_P : PA12 +- SWDIO-JMTS : PA13 +- SWCLK-JTCK : PA14 +- JTDI : PA15 +- JTDO : PB3 +- JTRST : PB4 +- FRAM_HOLD (ACTIVE LOW) : PB10 +- FRAM_WP (ACTIVE LOW) : PB11 +- FRAM_CS (ACTIVE LOW) : PB12 +- GPIO_PC10 : PC10 +- GPIO_PC11 : PC11 +- GPIO_PC12 : PC12 +- PF0_OSC : PF0 + +System Clock +------------ + +System clock can be driven by an internal or an external oscillator, as well as by the main PLL +clock. By default, system clock is driven by PLL clock at 170MHz (boost mode selected), which in +turn, is driven by the 8MHz high speed external oscillator (HSE). While the HSE oscillator is +capable of operating at frequencies up to 48 MHz by default, in this configuration, it is +specifically set to 8 MHz. + +Serial Port +----------- + +The Myra SiP Baseboard has 5 U(S)ARTs. The Zephyr console output is assigned to LPUART1. The default +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 +******** + +This board has a USB-JTAG interface and can be used with OpenOCD. + +Connect the Myra SiP Baseboard to your host computer using the USB port, then build and flash +the application. Here is an example for :zephyr:code-sample:`hello_world`. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: myra_sip_baseboard + :goals: build flash + +Then run a serial host program to connect with the Myra SiP Baseboard, e.g. using picocom: + +.. code-block:: console + + $ picocom /dev/ttyUSB0 -b 115200 + +.. warning:: + The board has only one port that is used for both programming and the console. For this reason, it is + recommended to set ``CONFIG_BOOT_DELAY`` to an arbitrary value. This is especially important when + running twister tests on the device. You should then also use the ``--flash-before`` and + ``--device-flash-timeout=120`` options: + + .. code-block:: console + + $ scripts/twister --device-testing --device-serial /dev/ttyUSB0 --device-serial-baud 115200 -p myra_sip_baseboard --flash-before --device-flash-timeout=120 -v + +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: myra_sip_baseboard + :maybe-skip-config: + :goals: debug + +.. _STM32G491RE on www.st.com: + https://www.st.com/en/microcontrollers-microprocessors/stm32g491re.html diff --git a/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.dts b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.dts new file mode 100644 index 00000000000..fc815cd352b --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.dts @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2024 Antmicro + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include + +/ { + compatible = "antmicro,myra-sip-baseboard"; + model = "Myra SiP Baseboard"; + + chosen { + zephyr,console = &lpuart1; + zephyr,shell-uart = &lpuart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,canbus = &fdcan1; + zephyr,code-partition = &slot0_partition; + }; + + leds: leds { + compatible = "gpio-leds"; + green_led: led_0 { + gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>; + label = "User LD2"; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + + green_pwm_led: green_pwm_led { + pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + user_button: button { + label = "User"; + gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; + zephyr,code = ; + }; + }; + + aliases { + led0 = &green_led; + mcuboot-led0 = &green_led; + pwm-led0 = &green_pwm_led; + sw0 = &user_button; + watchdog0 = &iwdg; + volt-sensor0 = &vref; + volt-sensor1 = &vbat; + rtc = &rtc; + eeprom-0 = &mb85rs1mt; + }; +}; + +&clk_lse { + status = "okay"; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hsi48 { + status = "okay"; +}; + +&clk_hse { + clock-frequency = ; + status = "okay"; +}; + +&pll { + div-m = <2>; + mul-n = <85>; + div-p = <7>; + div-q = <2>; + div-r = <2>; + clocks = <&clk_hse>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <1>; + apb2-prescaler = <1>; +}; + +&lpuart1 { + pinctrl-0 = <&lpuart1_tx_pa2 &lpuart1_rx_pa3>; + pinctrl-1 = <&analog_pa2 &analog_pa3>; + pinctrl-names = "default", "sleep"; + current-speed = <115200>; + status = "okay"; +}; + +&i2c1 { + pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>; + pinctrl-names = "default"; + status = "okay"; + + bme280@76 { + compatible = "bosch,bme280"; + reg = <0x76>; + }; + + sht4x@44 { + compatible = "sensirion,sht4x"; + repeatability = <2>; + reg = <0x44>; + }; +}; + +&timers2 { + status = "okay"; + + pwm2: pwm { + status = "okay"; + pinctrl-0 = <&tim2_ch1_pa5>; + pinctrl-names = "default"; + }; +}; + +stm32_lp_tick_source: &lptim1 { + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>, + <&rcc STM32_SRC_LSI LPTIM1_SEL(1)>; + status = "okay"; +}; + +&rtc { + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>, + <&rcc STM32_SRC_LSE RTC_SEL(1)>; + status = "okay"; +}; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(34)>; + }; + slot0_partition: partition@8800 { + label = "image-0"; + reg = <0x00008800 DT_SIZE_K(240)>; + }; + slot1_partition: partition@44800 { + label = "image-1"; + reg = <0x00044800 DT_SIZE_K(234)>; + }; + /* Set 4Kb of storage at the end of the 512Kb of flash */ + storage_partition: partition@7f000 { + label = "storage"; + reg = <0x0007f000 DT_SIZE_K(4)>; + }; + }; +}; + +&iwdg { + status = "okay"; +}; + +&rng { + status = "okay"; +}; + +&adc1 { + pinctrl-0 = <&adc1_in1_pa0>; + pinctrl-names = "default"; + st,adc-clock-source = "SYNC"; + st,adc-prescaler = <4>; + status = "okay"; +}; + +&die_temp { + status = "okay"; +}; + +&dac1 { + pinctrl-0 = <&dac1_out1_pa4>; + pinctrl-names = "default"; + status = "okay"; +}; + +&fdcan1 { + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x02000000>, + <&rcc STM32_SRC_HSE FDCAN_SEL(0)>; + pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>; + pinctrl-names = "default"; + status = "okay"; +}; + +&vref { + status = "okay"; +}; + +&vbat { + status = "okay"; +}; + +&timers6 { + status = "okay"; + st,prescaler = <1>; +}; + +&timers7 { + status = "okay"; + st,prescaler = <1>; +}; diff --git a/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.yaml b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.yaml new file mode 100644 index 00000000000..77fe8017c5d --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard.yaml @@ -0,0 +1,28 @@ +identifier: myra_sip_baseboard +name: Myra SiP Baseboard +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 128 +flash: 512 +supported: + - nvs + - pwm + - i2c + - gpio + - usb device + - spi + - watchdog + - dma + - can + - rtc + - sensors + - eeprom +testing: + timeout_multiplier: 3 + renode: + uart: sysbus.lpuart1 + resc: boards/antmicro/myra_sip_baseboard/support/myra_sip_baseboard.resc +vendor: antmicro diff --git a/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard_defconfig b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard_defconfig new file mode 100644 index 00000000000..163b6236b23 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/myra_sip_baseboard_defconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Antmicro +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SERIAL=y +CONFIG_GPIO=y +CONFIG_CLOCK_CONTROL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/antmicro/myra_sip_baseboard/support/myra_sip_baseboard.repl b/boards/antmicro/myra_sip_baseboard/support/myra_sip_baseboard.repl new file mode 100644 index 00000000000..7d0aab51693 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/support/myra_sip_baseboard.repl @@ -0,0 +1,87 @@ +flash0: Memory.MappedMemory @ sysbus 0x8000000 + size: 0x80000 + +sram0: Memory.MappedMemory @ sysbus 0x20000000 + size: 0x1c000 + +timers2: Timers.STM32_Timer @ sysbus <0x40000000, +0x400> + frequency: 10000000 + initialLimit: 0xffffffff + ->nvic0@28 + +timers6: Timers.STM32_Timer @ sysbus <0x40001000, +0x400> + frequency: 10000000 + initialLimit: 0xffffffff + ->nvic0@54 + +timers7: Timers.STM32_Timer @ sysbus <0x40001400, +0x400> + frequency: 10000000 + initialLimit: 0xffffffff + ->nvic0@55 + +clk_lse: Python.PythonPeripheral @ sysbus 0x40007000 + size: 0x4 + initable: true + filename: "scripts/pydev/rolling-bit.py" + +gpioa: GPIOPort.STM32_GPIOPort @ sysbus <0x48000000, +0x400> + +gpiob: GPIOPort.STM32_GPIOPort @ sysbus <0x48000400, +0x400> + +gpioc: GPIOPort.STM32_GPIOPort @ sysbus <0x48000800, +0x400> + +gpiod: GPIOPort.STM32_GPIOPort @ sysbus <0x48000c00, +0x400> + +gpioe: GPIOPort.STM32_GPIOPort @ sysbus <0x48001000, +0x400> + +gpiof: GPIOPort.STM32_GPIOPort @ sysbus <0x48001400, +0x400> + +gpiog: GPIOPort.STM32_GPIOPort @ sysbus <0x48001800, +0x400> + +greenled: Miscellaneous.LED @ gpioa 0x5 + +gpioa: + 5 -> greenled@0 + +nvic0: IRQControllers.NVIC @ { + sysbus new Bus.BusPointRegistration { address: 0xe000e000; cpu: cpu0 } +} + -> cpu0@0 + +cpu0: CPU.CortexM @ sysbus + cpuType: "cortex-m4f" + nvic: nvic0 + +i2c1: I2C.STM32F7_I2C @ sysbus 0x40005400 + EventInterrupt->nvic0@31 + ErrorInterrupt->nvic0@32 + +sht4x: I2C.SHT45 @ i2c1 0x44 + +adc1: Analog.STM32_ADC @ sysbus 0x50000000 + IRQ->nvic0@18 + +lpuart1: UART.STM32F7_USART @ sysbus 0x40008000 + frequency: 200000000 + lowPowerMode: true + IRQ->nvic0@91 + +rcc: Python.PythonPeripheral @ sysbus 0x40021000 + size: 0x400 + initable: true + filename: "scripts/pydev/flipflop.py" + +rng: Miscellaneous.STM32F4_RNG @ sysbus 0x50060800 + ->nvic0@90 + +rtc: Timers.STM32F4_RTC @ sysbus 0x40002800 + AlarmIRQ->nvic0@41 + +spi2: SPI.STM32SPI @ sysbus 0x40003800 + IRQ->nvic0@36 + +iwdg: Timers.STM32_IndependentWatchdog @ sysbus 0x40003000 + frequency: 32000 + +dwt: Miscellaneous.DWT @ sysbus 0xE0001000 + frequency: 72000000 diff --git a/boards/antmicro/myra_sip_baseboard/support/myra_sip_baseboard.resc b/boards/antmicro/myra_sip_baseboard/support/myra_sip_baseboard.resc new file mode 100644 index 00000000000..2d794d7c7f5 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/support/myra_sip_baseboard.resc @@ -0,0 +1,17 @@ +:name: Myra SiP Baseboard +:description: This script is prepared to run Zephyr on the Myra SiP Baseboard. + +$name?="Myra SiP Baseboard" + +using sysbus +mach create $name +machine LoadPlatformDescription $ORIGIN/myra_sip_baseboard.repl + +showAnalyzer lpuart1 + +macro reset +""" + sysbus LoadELF $elf + cpu0 VectorTableOffset `sysbus GetSymbolAddress "_vector_table"` +""" +runMacro $reset diff --git a/boards/antmicro/myra_sip_baseboard/support/openocd_myra_sip_baseboard.cfg b/boards/antmicro/myra_sip_baseboard/support/openocd_myra_sip_baseboard.cfg new file mode 100644 index 00000000000..dc278051fc9 --- /dev/null +++ b/boards/antmicro/myra_sip_baseboard/support/openocd_myra_sip_baseboard.cfg @@ -0,0 +1,13 @@ +adapter driver ft232r +adapter speed 1000 + +ft232r vid_pid 0x0403 0x6015 +ft232r tck_num RTS +ft232r tms_num DTR +ft232r tdi_num RI +ft232r tdo_num CTS +ft232r trst_num DSR +ft232r srst_num DCD + +ft232r restore_serial 0x0015 +source [find target/stm32g4x.cfg] diff --git a/boards/arduino/due/arduino_due-pinctrl.dtsi b/boards/arduino/due/arduino_due-pinctrl.dtsi index 08f369eed7d..410df4f7eea 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 bbfc92b110c..0e9c4693abe 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 21a71527ffe..12f9ba82ad4 100644 --- a/boards/arduino/due/arduino_due.yaml +++ b/boards/arduino/due/arduino_due.yaml @@ -5,10 +5,10 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools 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 00000000000..16fcfa2674f --- /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 e1eda346744..9bce2aa68e3 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_m4.yaml b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m4.yaml index 3917682bd21..bdabab68a16 100644 --- a/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m4.yaml +++ b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m4.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 288 flash: 1024 supported: 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 5d6e0dd7d88..7505ba0f2df 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/arduino_giga_r1_stm32h747xx_m7.yaml b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.yaml index b637d14017b..285330d8b01 100644 --- a/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.yaml +++ b/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 512 flash: 1024 supported: diff --git a/boards/arduino/giga_r1/doc/index.rst b/boards/arduino/giga_r1/doc/index.rst index 696844a71fa..508f6363151 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/arduino_mkrzero-pinctrl.dtsi b/boards/arduino/mkrzero/arduino_mkrzero-pinctrl.dtsi index df09f3aed8f..f4eadc39c95 100644 --- a/boards/arduino/mkrzero/arduino_mkrzero-pinctrl.dtsi +++ b/boards/arduino/mkrzero/arduino_mkrzero-pinctrl.dtsi @@ -6,6 +6,18 @@ #include &pinctrl { + adc_default: adc_default { + group1 { + pinmux = , + , + , + , + , + , + ; + }; + }; + dac_default: dac_default { group1 { pinmux = ; @@ -18,6 +30,7 @@ ; }; }; + sercom1_spi_default: sercom1_spi_default { group1 { pinmux = , diff --git a/boards/arduino/mkrzero/arduino_mkrzero.dts b/boards/arduino/mkrzero/arduino_mkrzero.dts index a0f26d57fa0..6a30c3be9d7 100644 --- a/boards/arduino/mkrzero/arduino_mkrzero.dts +++ b/boards/arduino/mkrzero/arduino_mkrzero.dts @@ -106,6 +106,13 @@ pinctrl-names = "default"; }; +&adc { + status = "okay"; + + pinctrl-0 = <&adc_default>; + pinctrl-names = "default"; +}; + &dac0 { status = "okay"; diff --git a/boards/arduino/mkrzero/arduino_mkrzero.yaml b/boards/arduino/mkrzero/arduino_mkrzero.yaml index 9b695e86097..ed631fb6262 100644 --- a/boards/arduino/mkrzero/arduino_mkrzero.yaml +++ b/boards/arduino/mkrzero/arduino_mkrzero.yaml @@ -7,7 +7,6 @@ flash: 256 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - counter diff --git a/boards/arduino/mkrzero/doc/index.rst b/boards/arduino/mkrzero/doc/index.rst index b6f92d96930..3e528152131 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/arduino_nano_33_ble.yaml b/boards/arduino/nano_33_ble/arduino_nano_33_ble.yaml index 385d3bd1559..70e0d6999a9 100644 --- a/boards/arduino/nano_33_ble/arduino_nano_33_ble.yaml +++ b/boards/arduino/nano_33_ble/arduino_nano_33_ble.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble diff --git a/boards/arduino/nano_33_ble/arduino_nano_33_ble_nrf52840_sense.yaml b/boards/arduino/nano_33_ble/arduino_nano_33_ble_nrf52840_sense.yaml index 6a80eaecf48..56f57856eef 100644 --- a/boards/arduino/nano_33_ble/arduino_nano_33_ble_nrf52840_sense.yaml +++ b/boards/arduino/nano_33_ble/arduino_nano_33_ble_nrf52840_sense.yaml @@ -1,11 +1,10 @@ -identifier: arduino_nano_33_ble//sense +identifier: arduino_nano_33_ble/nrf52840/sense name: Arduino Nano 33 BLE Sense type: mcu arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble diff --git a/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi b/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi index 21a98b50407..af20cc6c755 100644 --- a/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi +++ b/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi @@ -16,8 +16,8 @@ <4 0 &gpio1 15 0>, /* D4 */ <5 0 &gpio1 13 0>, /* D5 */ <6 0 &gpio1 14 0>, /* D6 */ - <7 0 &gpio0 9 0>, /* D7 */ - <8 0 &gpio0 10 0>, /* D8 */ + <7 0 &gpio0 23 0>, /* D7 */ + <8 0 &gpio0 21 0>, /* D8 */ <9 0 &gpio0 27 0>, /* D9 */ <10 0 &gpio1 2 0>, /* D10 */ <11 0 &gpio1 1 0>, /* D11 / SPI-MOSI */ @@ -27,10 +27,10 @@ <15 0 &gpio0 5 0>, /* D15 / A1 */ <16 0 &gpio0 30 0>, /* D16 / A2 */ <17 0 &gpio0 29 0>, /* D17 / A3 */ - <18 0 &gpio0 14 0>, /* D18 / A4 / I2C-SDA */ - <19 0 &gpio0 15 0>, /* D19 / A5 / I2C-SCL */ + <18 0 &gpio0 31 0>, /* D18 / A4 / I2C-SDA */ + <19 0 &gpio0 2 0>, /* D19 / A5 / I2C-SCL */ <20 0 &gpio0 28 0>, /* D20 / A6 */ - <21 0 &gpio1 3 0>; /* D21 / A7 */ + <21 0 &gpio0 3 0>; /* D21 / A7 */ }; }; diff --git a/boards/arduino/nano_33_ble/board.c b/boards/arduino/nano_33_ble/board.c index 10fd95e74cc..5f6b14645f1 100644 --- a/boards/arduino/nano_33_ble/board.c +++ b/boards/arduino/nano_33_ble/board.c @@ -29,7 +29,7 @@ static int board_init(void) return res; } - return gpio_pin_configure_dt(&user_led, GPIO_OUTPUT_INACTIVE); + return gpio_pin_configure_dt(&user_led, GPIO_OUTPUT_HIGH); } SYS_INIT(board_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arduino/nano_33_ble/doc/index.rst b/boards/arduino/nano_33_ble/doc/index.rst index 2b5ede0ea11..753209f349d 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/arduino_nano_33_iot-pinctrl.dtsi b/boards/arduino/nano_33_iot/arduino_nano_33_iot-pinctrl.dtsi index 73ac01e1296..438eaaf80b9 100644 --- a/boards/arduino/nano_33_iot/arduino_nano_33_iot-pinctrl.dtsi +++ b/boards/arduino/nano_33_iot/arduino_nano_33_iot-pinctrl.dtsi @@ -6,6 +6,18 @@ #include &pinctrl { + adc_default: adc_default { + group1 { + pinmux = , + , + , + , + , + , + ; + }; + }; + pwm_default: pwm_default { group1 { pinmux = ; diff --git a/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts b/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts index f5fc56c015f..7a8e3b7e745 100644 --- a/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts +++ b/boards/arduino/nano_33_iot/arduino_nano_33_iot.dts @@ -48,6 +48,13 @@ clock-frequency = <48000000>; }; +&adc { + status = "okay"; + + pinctrl-0 = <&adc_default>; + pinctrl-names = "default"; +}; + &sercom1 { status = "okay"; compatible = "atmel,sam0-spi"; diff --git a/boards/arduino/nano_33_iot/arduino_nano_33_iot.yaml b/boards/arduino/nano_33_iot/arduino_nano_33_iot.yaml index f7ded1f5239..b75847ab383 100644 --- a/boards/arduino/nano_33_iot/arduino_nano_33_iot.yaml +++ b/boards/arduino/nano_33_iot/arduino_nano_33_iot.yaml @@ -7,7 +7,6 @@ flash: 256 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - counter diff --git a/boards/arduino/nano_33_iot/doc/index.rst b/boards/arduino/nano_33_iot/doc/index.rst index 419c02a5cea..14c76bc9e25 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/arduino_nicla_sense_me.yaml b/boards/arduino/nicla_sense_me/arduino_nicla_sense_me.yaml index 74e8cab3c6b..a138ec5596c 100644 --- a/boards/arduino/nicla_sense_me/arduino_nicla_sense_me.yaml +++ b/boards/arduino/nicla_sense_me/arduino_nicla_sense_me.yaml @@ -7,7 +7,6 @@ flash: 512 toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - i2c diff --git a/boards/arduino/nicla_sense_me/doc/index.rst b/boards/arduino/nicla_sense_me/doc/index.rst index 1bf984f23f4..826fb2f4201 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/arduino_nicla_vision_stm32h747xx_m4.yaml b/boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m4.yaml index 727622952e5..8b179806eb2 100644 --- a/boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m4.yaml +++ b/boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m4.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 288 flash: 1024 supported: diff --git a/boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m7.yaml b/boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m7.yaml index 006cd2b35b4..0310b5dce89 100644 --- a/boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m7.yaml +++ b/boards/arduino/nicla_vision/arduino_nicla_vision_stm32h747xx_m7.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 512 flash: 1024 supported: diff --git a/boards/arduino/nicla_vision/doc/index.rst b/boards/arduino/nicla_vision/doc/index.rst index 73b2d7cd733..f9cc62c6ee1 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_m4.yaml b/boards/arduino/opta/arduino_opta_stm32h747xx_m4.yaml index e7495a72ea1..c510be86b80 100644 --- a/boards/arduino/opta/arduino_opta_stm32h747xx_m4.yaml +++ b/boards/arduino/opta/arduino_opta_stm32h747xx_m4.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 288 flash: 512 supported: diff --git a/boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts b/boards/arduino/opta/arduino_opta_stm32h747xx_m7.dts index d1b63e91e52..9580656581f 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/arduino_opta_stm32h747xx_m7.yaml b/boards/arduino/opta/arduino_opta_stm32h747xx_m7.yaml index 5ce1e815a74..6169f1b3364 100644 --- a/boards/arduino/opta/arduino_opta_stm32h747xx_m7.yaml +++ b/boards/arduino/opta/arduino_opta_stm32h747xx_m7.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 512 flash: 768 supported: diff --git a/boards/arduino/opta/doc/index.rst b/boards/arduino/opta/doc/index.rst index 8c6aa788487..4b131659355 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 580288b2382..8036df3c65e 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 b2a4abd35e7..3a59127ffa7 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 7a61e830e52..d7489b77d26 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_m4.yaml b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m4.yaml index 352ae2b3cce..445d14b7809 100644 --- a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m4.yaml +++ b/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m4.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 288 flash: 1024 supported: 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 3a3745c5a7d..001d8509059 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 ee73966dbfe..00000000000 --- a/boards/arduino/portenta_h7/arduino_portenta_h7_stm32h747xx_m7.yaml +++ /dev/null @@ -1,13 +0,0 @@ -identifier: arduino_portenta_h7/stm32h747xx/m7 -name: Arduino Portenta H7 (M7) -type: mcu -arch: arm -toolchain: - - zephyr - - gnuarmemb - - xtools -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 00000000000..7dc36b14190 --- /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 00000000000..456ae5871e3 --- /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 acc978d70c9..a67b6f27c00 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 2d1d167065e..85d3212a616 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 00000000000..67a9f951d67 --- /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 2fae481238c..00000000000 --- 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 840ead804a4..00000000000 --- 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 00000000000..b54c4d8cfbb --- /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 00000000000..09ce3664f1d --- /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 f9fff37eaab..00000000000 --- 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 00000000000..17e55274274 --- /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 863d9e6030a..63940405a7d 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 d80ca6d4f1f..00000000000 --- 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 00000000000..504b1597372 --- /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 81f3a94866a..7e60cd09528 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_minima.yaml +++ b/boards/arduino/uno_r4/arduino_uno_r4_minima.yaml @@ -1,12 +1,14 @@ -identifier: arduino_uno_r4_minima +identifier: arduino_uno_r4@minima name: Arduino Uno R4 Minima type: mcu arch: arm toolchain: - zephyr - gnuarmemb - - xtools 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 3c655ea376e..00000000000 --- 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 9add47e4723..47f94cc3a0e 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 a3a2019990e..00000000000 --- 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 00000000000..f411487d080 --- /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 bfe5bc8cdcd..e2e101e93ab 100644 --- a/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml +++ b/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml @@ -1,12 +1,14 @@ -identifier: arduino_uno_r4_wifi +identifier: arduino_uno_r4@wifi name: Arduino Uno R4 WiFi type: mcu arch: arm toolchain: - zephyr - gnuarmemb - - xtools 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 48137e86d7a..00000000000 --- 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 9c168c300c2..ee0f51c47d4 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 00000000000..c42a9e389e4 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 1b2b28385ba..71dcd0d94e4 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 00000000000..f148e05dd0a --- /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/arduino_zero-pinctrl.dtsi b/boards/arduino/zero/arduino_zero-pinctrl.dtsi index 52b04cd64a5..573e05ea0cd 100644 --- a/boards/arduino/zero/arduino_zero-pinctrl.dtsi +++ b/boards/arduino/zero/arduino_zero-pinctrl.dtsi @@ -6,6 +6,17 @@ #include &pinctrl { + adc_default: adc_default { + group1 { + pinmux = , + , + , + , + , + ; + }; + }; + dac_default: dac_default { group1 { pinmux = ; diff --git a/boards/arduino/zero/arduino_zero.dts b/boards/arduino/zero/arduino_zero.dts index 841e7ab7620..1109ea58b89 100644 --- a/boards/arduino/zero/arduino_zero.dts +++ b/boards/arduino/zero/arduino_zero.dts @@ -102,6 +102,13 @@ pinctrl-names = "default"; }; +&adc { + status = "okay"; + + pinctrl-0 = <&adc_default>; + pinctrl-names = "default"; +}; + &dac0 { status = "okay"; diff --git a/boards/arduino/zero/arduino_zero.yaml b/boards/arduino/zero/arduino_zero.yaml index 771199f1e8f..60e0772e289 100644 --- a/boards/arduino/zero/arduino_zero.yaml +++ b/boards/arduino/zero/arduino_zero.yaml @@ -7,7 +7,6 @@ flash: 256 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - counter diff --git a/boards/arduino/zero/doc/index.rst b/boards/arduino/zero/doc/index.rst index 9e665aa75cd..150c864b3f9 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 8fcc4d07b0e..080d316e6b7 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 724ee182cc9..0f9a28d0a81 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 2f6cea861c6..7a2209df8f8 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/Kconfig b/boards/arm/mps2/Kconfig index 4beda641d53..0170bebb4d9 100644 --- a/boards/arm/mps2/Kconfig +++ b/boards/arm/mps2/Kconfig @@ -1,6 +1,7 @@ # Copyright (c) 2017 Linaro Limited +# Copyright 2024 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 config BOARD_MPS2 - select QEMU_TARGET select HAS_COVERAGE_SUPPORT + select QEMU_TARGET if BOARD_MPS2_AN385 || BOARD_MPS2_AN521_CPU0 || BOARD_MPS2_AN521_CPU0_NS || BOARD_MPS2_AN521_CPU1 diff --git a/boards/arm/mps2/Kconfig.defconfig b/boards/arm/mps2/Kconfig.defconfig index b14613b4880..367e09c2a9a 100644 --- a/boards/arm/mps2/Kconfig.defconfig +++ b/boards/arm/mps2/Kconfig.defconfig @@ -1,7 +1,8 @@ # Copyright (c) 2017 Linaro Limited +# Copyright 2024 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 -if BOARD_MPS2_AN385 +if BOARD_MPS2_AN383 || BOARD_MPS2_AN385 || BOARD_MPS2_AN386 || BOARD_MPS2_AN500 if SERIAL diff --git a/boards/arm/mps2/Kconfig.mps2 b/boards/arm/mps2/Kconfig.mps2 index 0731c5d2855..c350ffeb8cb 100644 --- a/boards/arm/mps2/Kconfig.mps2 +++ b/boards/arm/mps2/Kconfig.mps2 @@ -1,8 +1,12 @@ # Copyright (c) 2017 Linaro Limited +# Copyright 2024 Arm Limited and/or its affiliates # SPDX-License-Identifier: Apache-2.0 config BOARD_MPS2 + select SOC_MPS2_AN383 if BOARD_MPS2_AN383 select SOC_MPS2_AN385 if BOARD_MPS2_AN385 + select SOC_MPS2_AN386 if BOARD_MPS2_AN386 + select SOC_MPS2_AN500 if BOARD_MPS2_AN500 select SOC_MPS2_AN521_CPU0 if BOARD_MPS2_AN521_CPU0 select SOC_MPS2_AN521_CPU0 if BOARD_MPS2_AN521_CPU0_NS select SOC_MPS2_AN521_CPU1 if BOARD_MPS2_AN521_CPU1 diff --git a/boards/arm/mps2/board.cmake b/boards/arm/mps2/board.cmake index 6f38d01281b..98e34a99748 100644 --- a/boards/arm/mps2/board.cmake +++ b/boards/arm/mps2/board.cmake @@ -1,8 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 - -set(SUPPORTED_EMU_PLATFORMS qemu) +# Copyright 2024-2025 Arm Limited and/or its affiliates if(CONFIG_BOARD_MPS2_AN385) + set(SUPPORTED_EMU_PLATFORMS qemu armfvp) set(QEMU_CPU_TYPE_${ARCH} cortex-m3) set(QEMU_FLAGS_${ARCH} -cpu ${QEMU_CPU_TYPE_${ARCH}} @@ -10,7 +10,23 @@ if(CONFIG_BOARD_MPS2_AN385) -nographic -vga none ) + set(ARMFVP_BIN_NAME FVP_MPS2_Cortex-M3) +elseif(CONFIG_BOARD_MPS2_AN383) + set(SUPPORTED_EMU_PLATFORMS armfvp) + set(ARMFVP_BIN_NAME FVP_MPS2_Cortex-M0plus) + set(ARMFVP_FLAGS + -C armcortexm0plusct.NUM_MPU_REGION=8 + -C armcortexm0plusct.USER=1 + -C armcortexm0plusct.VTOR=1 + ) +elseif(CONFIG_BOARD_MPS2_AN386) + set(SUPPORTED_EMU_PLATFORMS armfvp) + set(ARMFVP_BIN_NAME FVP_MPS2_Cortex-M4) +elseif(CONFIG_BOARD_MPS2_AN500) + set(SUPPORTED_EMU_PLATFORMS armfvp) + set(ARMFVP_BIN_NAME FVP_MPS2_Cortex-M7) elseif(CONFIG_BOARD_MPS2_AN521_CPU0 OR CONFIG_BOARD_MPS2_AN521_CPU0_NS OR CONFIG_BOARD_MPS2_AN521_CPU1) + set(SUPPORTED_EMU_PLATFORMS qemu) set(QEMU_CPU_TYPE_${ARCH} cortex-m33) set(QEMU_FLAGS_${ARCH} -cpu ${QEMU_CPU_TYPE_${ARCH}} @@ -19,11 +35,7 @@ elseif(CONFIG_BOARD_MPS2_AN521_CPU0 OR CONFIG_BOARD_MPS2_AN521_CPU0_NS OR CONFIG -m 16 -vga none ) -endif() - -board_set_debugger_ifnset(qemu) -if(CONFIG_BOARD_MPS2_AN521_CPU0 OR CONFIG_BOARD_MPS2_AN521_CPU0_NS OR CONFIG_BOARD_MPS2_AN521_CPU1) # To enable a host tty switch between serial and pty # -chardev serial,path=/dev/ttyS0,id=hostS0 # pty is not available on Windows. @@ -36,6 +48,8 @@ if(CONFIG_BOARD_MPS2_AN521_CPU0 OR CONFIG_BOARD_MPS2_AN521_CPU0_NS OR CONFIG_BOA # 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) @@ -44,3 +58,18 @@ if(CONFIG_BOARD_MPS2_AN521_CPU0 OR CONFIG_BOARD_MPS2_AN521_CPU0_NS OR CONFIG_BOA list(APPEND QEMU_EXTRA_FLAGS "-device;loader,file=${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME}") endif() endif() + +board_set_debugger_ifnset(qemu) + +set(ARMFVP_FLAGS ${ARMFVP_FLAGS} +-C fvp_mps2.telnetterminal0.start_telnet=0 +-C fvp_mps2.telnetterminal1.start_telnet=0 +-C fvp_mps2.telnetterminal2.start_telnet=0 +-C fvp_mps2.UART0.out_file=- +-C fvp_mps2.UART0.unbuffered_output=1 +-C fvp_mps2.UART1.out_file=- +-C fvp_mps2.UART1.unbuffered_output=1 +-C fvp_mps2.UART2.out_file=- +-C fvp_mps2.UART2.unbuffered_output=1 +-C fvp_mps2.mps2_visualisation.disable-visualisation=1 +) diff --git a/boards/arm/mps2/board.yml b/boards/arm/mps2/board.yml index 779a8ed21cc..5548cd05b17 100644 --- a/boards/arm/mps2/board.yml +++ b/boards/arm/mps2/board.yml @@ -3,7 +3,10 @@ board: full_name: V2M MPS2 vendor: arm socs: + - name: an383 - name: an385 + - name: an386 + - name: an500 - name: an521 variants: - name: ns diff --git a/boards/arm/mps2/doc/img/mps2_an521.jpg b/boards/arm/mps2/doc/img/mps2.jpg similarity index 100% rename from boards/arm/mps2/doc/img/mps2_an521.jpg rename to boards/arm/mps2/doc/img/mps2.jpg diff --git a/boards/arm/mps2/doc/img/mps2_an385.jpg b/boards/arm/mps2/doc/img/mps2_an385.jpg deleted file mode 100644 index 58e42290939..00000000000 Binary files a/boards/arm/mps2/doc/img/mps2_an385.jpg and /dev/null differ diff --git a/boards/arm/mps2/doc/index.rst b/boards/arm/mps2/doc/index.rst new file mode 100644 index 00000000000..b102b37fd80 --- /dev/null +++ b/boards/arm/mps2/doc/index.rst @@ -0,0 +1,10 @@ +.. zephyr:board:: mps2 + +ARM Ltd. +######## + +.. toctree:: + :maxdepth: 1 + :glob: + + * diff --git a/boards/arm/mps2/doc/mps2_an385.rst b/boards/arm/mps2/doc/mps2_an385.rst deleted file mode 100644 index 79f01dc9c53..00000000000 --- a/boards/arm/mps2/doc/mps2_an385.rst +++ /dev/null @@ -1,281 +0,0 @@ -.. _mps2_an385_board: - -ARM V2M MPS2 -############ - -Overview -******** - -The mps2/an385 board configuration is used by Zephyr applications that run on -the V2M MPS2 board. It provides support for the ARM Cortex-M3 (AN385) CPU and -the following devices: - -- Nested Vectored Interrupt Controller (NVIC) -- System Tick System Clock (SYSTICK) -- Cortex-M System Design Kit UART - -.. image:: img/mps2_an385.jpg - :align: center - :alt: ARM V2M MPS2 - -In addition to enabling actual hardware usage, this board configuration can -also use QEMU to emulate the AN385 platform running on the MPS2+. - -More information about the board can be found at the `V2M MPS2 Website`_. - -The Application Note AN385 can be found at `Application Note AN385`_. - -.. note:: - This board configuration makes no claims about its suitability for use - with actual MPS2 hardware systems using AN385, or any other hardware - system. It has been tested on actual hardware, but its primary purpose is - for use with QEMU and unit tests. - -Hardware -******** - -ARM V2M MPS2 provides the following hardware components: - -- ARM Cortex-M3 (AN385) -- ARM IoT Subsystem for Cortex-M -- Form factor: 140x120cm -- ZBTSRAM: 8MB single cycle SRAM, 16MB PSRAM -- Video: QSVGA touch screen panel, 4bit RGB VGA connector -- Audio: Audio Codec -- Debug: - - - ARM JTAG20 connector - - ARM parallel trace connector (MICTOR38) - - 20 pin Cortex debug connector - - 10 pin Cortex debug connector - - ILA connector for FPGA debug - -- Expansion - - - GPIO - - SPI - -.. note:: - 4 MB of flash memory (in ZBTSRAM 1, starting at address 0x00400000) and 4 MB of RAM - (in ZBTSRAM 2 & 3, starting at address 0x20000000) are available. - -Supported Features -================== - -The mps2/an385 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-polling; | -| | | serial port-interrupt | -+-----------+------------+-------------------------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+-------------------------------------+ -| WATCHDOG | on-chip | watchdog | -+-----------+------------+-------------------------------------+ -| TIMER | on-chip | counter | -+-----------+------------+-------------------------------------+ -| DUALTIMER | on-chip | counter | -+-----------+------------+-------------------------------------+ - -Other hardware features are not currently supported by the port. -See the `V2M MPS2 Website`_ for a complete list of V2M MPS2 board hardware -features. - -The default configuration can be found in -:zephyr_file:`boards/arm/mps2/mps2_an385_defconfig` - -Interrupt Controller -==================== - -MPS2 is a Cortex-M3 based SoC and has 15 fixed exceptions and 45 IRQs. - -A Cortex-M3/4-based board uses vectored exceptions. This means each exception -calls a handler directly from the vector table. - -Handlers are provided for exceptions 1-6, 11-12, and 14-15. The table here -identifies the handlers used for each exception. - -+------+------------+----------------+--------------------------+ -| Exc# | Name | Remarks | Used by Zephyr Kernel | -+======+============+================+==========================+ -| 1 | Reset | | system initialization | -+------+------------+----------------+--------------------------+ -| 2 | NMI | | system fatal error | -+------+------------+----------------+--------------------------+ -| 3 | Hard fault | | system fatal error | -+------+------------+----------------+--------------------------+ -| 4 | MemManage | MPU fault | system fatal error | -+------+------------+----------------+--------------------------+ -| 5 | Bus | | system fatal error | -+------+------------+----------------+--------------------------+ -| 6 | Usage | undefined | system fatal error | -| | fault | instruction, | | -| | | or switch | | -| | | attempt to ARM | | -| | | mode | | -+------+------------+----------------+--------------------------+ -| 11 | SVC | | system calls, kernel | -| | | | run-time exceptions, | -| | | | and IRQ offloading | -+------+------------+----------------+--------------------------+ -| 12 | Debug | | system fatal error | -| | monitor | | | -+------+------------+----------------+--------------------------+ -| 14 | PendSV | | context switch | -+------+------------+----------------+--------------------------+ -| 15 | SYSTICK | | system clock | -+------+------------+----------------+--------------------------+ - -Pin Mapping -=========== - -The ARM V2M MPS2 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 GPIO 0 -- Pins 16 - 31 are for GPIO 1 -- Pins 32 - 47 are for GPIO 2 -- Pins 48 - 51 are for GPIO 3 - -Mapping from the ARM MPS2 Board pins to GPIO controllers: - -.. rst-class:: rst-columns - - - 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 - -Peripheral Mapping: - -.. rst-class:: rst-columns - - - 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 - -For more details please refer to `MPS2 Technical Reference Manual (TRM)`_. - -System Clock -============ - -The V2M MPS2 main clock is 24 MHz. - -Serial Port -=========== - -The V2M MPS2 processor has five UARTs. Both the UARTs have only two wires for -RX/TX and no flow control (CTS/RTS) or FIFO. The Zephyr console output, by -default, is utilizing UART0. - -Programming and Debugging -************************* - -Flashing -======== - -V2M MPS2 provides: - -- A USB connection to the host computer, which exposes a Mass Storage and an - USB Serial Port. -- A Serial Flash device, which implements the USB flash disk file storage. -- A physical UART connection which is relayed over interface USB Serial port. - -Flashing an application to V2M MPS2 ------------------------------------ - -Here is an example for the :zephyr:code-sample:`hello_world` application. - -.. zephyr-app-commands:: - :zephyr-app: samples/hello_world - :board: mps2/an385 - :goals: build - -Connect the V2M MPS2 to your host computer using the USB port and you should -see a USB connection which exposes a Mass Storage and a USB Serial Port. -Copy the generated zephyr.bin in the exposed drive. -Reset the board and you should be able to see on the corresponding Serial Port -the following message: - -.. code-block:: console - - Hello World! arm - - -.. _V2M MPS2 Website: - https://developer.mbed.org/platforms/ARM-MPS2/ - -.. _MPS2 Technical Reference Manual (TRM): - http://infocenter.arm.com/help/topic/com.arm.doc.100112_0200_05_en/versatile_express_cortex_m_prototyping_systems_v2m_mps2_and_v2m_mps2plus_technical_reference_100112_0200_05_en.pdf - -.. _Application Note AN385: - http://infocenter.arm.com/help/topic/com.arm.doc.dai0385c/DAI0385C_cortex_m3_on_v2m_mps2.pdf diff --git a/boards/arm/mps2/doc/mps2_an521.rst b/boards/arm/mps2/doc/mps2_an521.rst index 33a4f4d7ca6..067b4f286b0 100644 --- a/boards/arm/mps2/doc/mps2_an521.rst +++ b/boards/arm/mps2/doc/mps2_an521.rst @@ -15,7 +15,7 @@ CPU and the following devices: - Cortex-M System Design Kit GPIO - Cortex-M System Design Kit UART -.. image:: img/mps2_an521.jpg +.. image:: img/mps2.jpg :align: center :alt: ARM MPS2+ AN521 diff --git a/boards/arm/mps2/doc/mps2_armv6m.rst b/boards/arm/mps2/doc/mps2_armv6m.rst new file mode 100644 index 00000000000..11666d3cf62 --- /dev/null +++ b/boards/arm/mps2/doc/mps2_armv6m.rst @@ -0,0 +1,281 @@ +.. _mps2_armv6m_board: + +ARM V2M MPS2 Armv6-m (AN383) +############################ + +Overview +******** + +Currently ``mps2/an383`` is the only mps2 Armv6-m based board target supported in Zephyr. +It provides support for the ARM Cortex-M0+ (AN383) CPU and the following devices: + +- Nested Vectored Interrupt Controller (NVIC) +- System Tick System Clock (SYSTICK) +- Cortex-M System Design Kit UART + +.. image:: img/mps2.jpg + :align: center + :alt: ARM V2M MPS2 + +In addition to enabling actual hardware usage, this board target can +also use `FVP`_. to emulate the AN383 platform running on the MPS2+. + +More information about the board can be found at the `V2M MPS2 Website`_. + +The Application Note AN383 can be found at `Application Note AN383`_. + +.. note:: + This board target makes no claims about its suitability for use + with actual MPS2 hardware systems using AN383, or any other hardware + system. It has been tested on FVP. + + +Hardware +******** + +ARM V2M MPS2 AN383 provides the following hardware components: + +- ARM Cortex-M0+ +- ARM IoT Subsystem for Cortex-M +- Form factor: 140x120cm +- ZBTSRAM: 8MB single cycle SRAM, 16MB PSRAM +- Video: QSVGA touch screen panel, 4bit RGB VGA connector +- Audio: Audio Codec +- Debug: + + - ARM JTAG20 connector + - ARM parallel trace connector (MICTOR38) + - 20 pin Cortex debug connector + - 10 pin Cortex debug connector + - ILA connector for FPGA debug + +- Expansion + + - GPIO + - SPI + +.. note:: + 4 MB of flash memory (in ZBTSRAM 1, starting at address 0x00400000) and 4 MB of RAM + (in ZBTSRAM 2 & 3, starting at address 0x20000000) are available. + +Supported Features +================== + +The ``mps2/an383`` board target 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-polling; | +| | | serial port-interrupt | ++-----------+------------+-------------------------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+-------------------------------------+ +| WATCHDOG | on-chip | watchdog | ++-----------+------------+-------------------------------------+ +| TIMER | on-chip | counter | ++-----------+------------+-------------------------------------+ +| DUALTIMER | on-chip | counter | ++-----------+------------+-------------------------------------+ + +Other hardware features are not currently supported by the port. +See the `V2M MPS2 Website`_ for a complete list of V2M MPS2 board hardware +features. + +The default configuration can be found in +:zephyr_file:`boards/arm/mps2/mps2_an383_defconfig` + +Interrupt Controller +==================== + +MPS2 is a Cortex-M0+ based SoC and has 6 fixed exceptions and 32 IRQs. + +A Cortex-M0+ board uses vectored exceptions. This means each exception +calls a handler directly from the vector table. + +Handlers are provided for exceptions 1-3, 11, and 14-15. The table here +MPS2 is a Cortex-M0+ based SoC and has 15 fixed exceptions and 45 IRQs. + ++------+------------+----------------+--------------------------+ +| Exc# | Name | Remarks | Used by Zephyr Kernel | ++======+============+================+==========================+ +| 1 | Reset | | system initialization | ++------+------------+----------------+--------------------------+ +| 2 | NMI | | system fatal error | ++------+------------+----------------+--------------------------+ +| 3 | Hard fault | | system fatal error | ++------+------------+----------------+--------------------------+ +| 11 | SVC | | system calls, kernel | +| | | | run-time exceptions, | +| | | | and IRQ offloading | ++------+------------+----------------+--------------------------+ +| 14 | PendSV | | context switch | ++------+------------+----------------+--------------------------+ +| 15 | SYSTICK | optional | system clock | ++------+------------+----------------+--------------------------+ + +Pin Mapping +=========== + +The ARM V2M MPS2 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 GPIO 0 +- Pins 16 - 31 are for GPIO 1 +- Pins 32 - 47 are for GPIO 2 +- Pins 48 - 51 are for GPIO 3 + +Mapping from the ARM MPS2 Board pins to GPIO controllers: + +.. rst-class:: rst-columns + + - 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 + +Peripheral Mapping: + +.. rst-class:: rst-columns + + - 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 + +For more details please refer to `MPS2 Technical Reference Manual (TRM)`_. + +System Clock +============ + +The V2M MPS2 main clock is 24 MHz. + +Serial Port +=========== + +The V2M MPS2 processor has five UARTs. Both the UARTs have only two wires for +RX/TX and no flow control (CTS/RTS) or FIFO. The Zephyr console output, by +default, is utilizing UART0. + +Programming and Debugging +************************* + +Flashing +======== + +V2M MPS2 provides: + +- A USB connection to the host computer, which exposes a Mass Storage and an + USB Serial Port. +- A Serial Flash device, which implements the USB flash disk file storage. +- A physical UART connection which is relayed over interface USB Serial port. + +Flashing an application to V2M MPS2 +----------------------------------- + +Here is an example for the :zephyr:code-sample:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: mps2/an383 + :goals: build + +Connect the V2M MPS2 to your host computer using the USB port and you should +see a USB connection which exposes a Mass Storage and a USB Serial Port. +Copy the generated zephyr.bin in the exposed drive. +Reset the board and you should be able to see on the corresponding Serial Port +the following message: + +.. code-block:: console + + Hello World! arm + +Running an applicatoin with FVP +------------------------------- + +Here is the same example for running with FVP. +Set the ``ARMFVP_BIN_PATH`` environemnt variable to the location of your FVP you have downloaded from `here `_ + +.. code-block:: console + + export ARMFVP_BIN_PATH=/home/../FVP_MPS2/ + +Then build with the same command you would use normally, and run with ``west build -t run_armfvp``. + +.. _V2M MPS2 Website: + https://developer.mbed.org/platforms/ARM-MPS2/ + +.. _MPS2 Technical Reference Manual (TRM): + https://developer.arm.com/documentation/100112/0200/ + +.. _Application Note AN383: + https://documentation-service.arm.com/static/5ed1051dca06a95ce53f88a1 + +.. _FVP: + https://developer.arm.com/downloads/view/FMFVP diff --git a/boards/arm/mps2/doc/mps2_armv7m.rst b/boards/arm/mps2/doc/mps2_armv7m.rst new file mode 100644 index 00000000000..ab6fab5d292 --- /dev/null +++ b/boards/arm/mps2/doc/mps2_armv7m.rst @@ -0,0 +1,308 @@ +.. _mps2_armv7m_board: + +ARM V2M MPS2 Armv7-m (AN385/AN386/AN500) +######################################## + +Overview +******** + +The ``mps2/an385``, ``mps2/an386``, and ``mps2/an500`` board targets are three of +the mps2 Armv7-m based board targets supported in Zephyr. This document +provides details about the support provided for these three Armv7-m mps2 board targets +(**AN385**, **AN386**, **AN500**) and the following devices: + +- Nested Vectored Interrupt Controller (NVIC) +- System Tick System Clock (SYSTICK) +- Cortex-M System Design Kit UART + +.. image:: img/mps2.jpg + :align: center + :alt: ARM V2M MPS2 + +In addition to enabling actual hardware usage, these board targets can +also use `FVP`_ to emulate the platforms running on the MPS2+. + +More information about the board can be found at the `V2M MPS2 Website`_. + +The application note for each of the board can be found as follows: + +- AN385 can be found at `Application Note AN385`_ +- AN386 can be found at `Application Note AN386`_ +- AN500 can be found at `Application Note AN500`_ + +AN385 is also supported to run with QEMU, and is set to run with QEMU by default. + +.. note:: + These board targets makes no claims about its suitability for use + with actual MPS2 hardware systems, or any other hardware + system. + +Hardware +******** + +ARM V2M MPS2 provides the following hardware components: + +- ARM Cortex-M Chip +- ARM IoT Subsystem for Cortex-M +- Form factor: 140x120cm +- ZBTSRAM: 8MB single cycle SRAM, 16MB PSRAM +- Video: QSVGA touch screen panel, 4bit RGB VGA connector +- Audio: Audio Codec +- Debug: + + - ARM JTAG20 connector + - ARM parallel trace connector (MICTOR38) + - 20 pin Cortex debug connector + - 10 pin Cortex debug connector + - ILA connector for FPGA debug + +- Expansion + + - GPIO + - SPI + +.. note:: + 4 MB of flash memory (in ZBTSRAM 1, starting at address 0x00400000) and 4 MB of RAM + (in ZBTSRAM 2 & 3, starting at address 0x20000000) are available. + +Supported Features +================== + +The ``mps2/an385``, ``mps2/an386``, and ``mps2/an500`` board targets support the following hardware features: + ++-----------+------------+-------------------------------------+ +| Interface | Controller | Driver/Component | ++===========+============+=====================================+ +| NVIC | on-chip | nested vector interrupt controller | ++-----------+------------+-------------------------------------+ +| SYSTICK | on-chip | systick | ++-----------+------------+-------------------------------------+ +| UART | on-chip | serial port-polling; | +| | | serial port-interrupt | ++-----------+------------+-------------------------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+-------------------------------------+ +| WATCHDOG | on-chip | watchdog | ++-----------+------------+-------------------------------------+ +| TIMER | on-chip | counter | ++-----------+------------+-------------------------------------+ +| DUALTIMER | on-chip | counter | ++-----------+------------+-------------------------------------+ + +Other hardware features are not currently supported by the port. +See the `V2M MPS2 Website`_ for a complete list of V2M MPS2 board hardware +features. + +The default configuration can be found in +:zephyr_file:`boards/arm/mps2/mps2_an385_defconfig` +or similarly in ``mps2_anxxx_defconfig`` for the other applicable boards. + +Interrupt Controller +==================== + +MPS2 is a Cortex-M based SoC and has 15 fixed exceptions and 45 IRQs. + +A Cortex-M3/4/7-based board uses vectored exceptions. This means each exception +calls a handler directly from the vector table. + +Handlers are provided for exceptions 1-6, 11-12, and 14-15. The table here +identifies the handlers used for each exception. + ++------+------------+----------------+--------------------------+ +| Exc# | Name | Remarks | Used by Zephyr Kernel | ++======+============+================+==========================+ +| 1 | Reset | | system initialization | ++------+------------+----------------+--------------------------+ +| 2 | NMI | | system fatal error | ++------+------------+----------------+--------------------------+ +| 3 | Hard fault | | system fatal error | ++------+------------+----------------+--------------------------+ +| 4 | MemManage | MPU fault | system fatal error | ++------+------------+----------------+--------------------------+ +| 5 | Bus | | system fatal error | ++------+------------+----------------+--------------------------+ +| 6 | Usage | undefined | system fatal error | +| | fault | instruction, | | +| | | or switch | | +| | | attempt to ARM | | +| | | mode | | ++------+------------+----------------+--------------------------+ +| 11 | SVC | | system calls, kernel | +| | | | run-time exceptions, | +| | | | and IRQ offloading | ++------+------------+----------------+--------------------------+ +| 12 | Debug | | system fatal error | +| | monitor | | | ++------+------------+----------------+--------------------------+ +| 14 | PendSV | | context switch | ++------+------------+----------------+--------------------------+ +| 15 | SYSTICK | | system clock | ++------+------------+----------------+--------------------------+ + +Pin Mapping +=========== + +The ARM V2M MPS2 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 GPIO 0 +- Pins 16 - 31 are for GPIO 1 +- Pins 32 - 47 are for GPIO 2 +- Pins 48 - 51 are for GPIO 3 + +Mapping from the ARM MPS2 Board pins to GPIO controllers: + +.. rst-class:: rst-columns + + - 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 + +Peripheral Mapping: + +.. rst-class:: rst-columns + + - 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 + +For more details please refer to `MPS2 Technical Reference Manual (TRM)`_. + +System Clock +============ + +The V2M MPS2 main clock is 24 MHz. + +Serial Port +=========== + +The V2M MPS2 processor has five UARTs. Both the UARTs have only two wires for +RX/TX and no flow control (CTS/RTS) or FIFO. The Zephyr console output, by +default, is utilizing UART0. + +Programming and Debugging +************************* + +Flashing +======== + +V2M MPS2 provides: + +- A USB connection to the host computer, which exposes a Mass Storage and an + USB Serial Port. +- A Serial Flash device, which implements the USB flash disk file storage. +- A physical UART connection which is relayed over interface USB Serial port. + +Flashing an application to V2M MPS2 +----------------------------------- + +Here is an example for the :zephyr:code-sample:`hello_world` application with AN385. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: mps2/an385 + :goals: build + +Connect the V2M MPS2 to your host computer using the USB port and you should +see a USB connection which exposes a Mass Storage and a USB Serial Port. +Copy the generated zephyr.bin in the exposed drive. +Reset the board and you should be able to see on the corresponding Serial Port +the following message: + +.. code-block:: console + + Hello World! arm + +Running an applicatoin with FVP +------------------------------- + +Here is the same example for running with FVP. +Set the ``ARMFVP_BIN_PATH`` environemnt variable to the location of your FVP you have downloaded from `here `_ + +.. code-block:: console + + export ARMFVP_BIN_PATH=/home/../FVP_MPS2/ + +Then build with the same command you would use normally, and run with ``west build -t run_armfvp``. + +.. _V2M MPS2 Website: + https://developer.mbed.org/platforms/ARM-MPS2/ + +.. _MPS2 Technical Reference Manual (TRM): + https://developer.arm.com/documentation/100112/0200/ + +.. _Application Note AN385: + https://documentation-service.arm.com/static/5ed107a5ca06a95ce53f89e3 + +.. _Application Note AN386: + https://documentation-service.arm.com/static/5ed1094dca06a95ce53f8a9f + +.. _Application Note AN500: + https://documentation-service.arm.com/static/5ed112fcca06a95ce53f8eb3 + +.. _FVP: + https://developer.arm.com/downloads/view/FMFVP diff --git a/boards/arm/mps2/mps2-pinctrl.dtsi b/boards/arm/mps2/mps2-pinctrl.dtsi new file mode 100644 index 00000000000..da259040e97 --- /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.dts b/boards/arm/mps2/mps2_an383.dts new file mode 100644 index 00000000000..ef21f37b3f7 --- /dev/null +++ b/boards/arm/mps2/mps2_an383.dts @@ -0,0 +1,30 @@ +/* + * Copyright 2024 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include "mps2_base.dtsi" + +/* FVP does not support uart3 and uart4 */ +/* hence we delete them for AN383 in FVP */ +/delete-node/ &uart3; +/delete-node/ &uart4; + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-m0+"; + reg = <0>; + }; + }; +}; diff --git a/boards/arm/mps2/mps2_an383.yaml b/boards/arm/mps2/mps2_an383.yaml new file mode 100644 index 00000000000..24922573775 --- /dev/null +++ b/boards/arm/mps2/mps2_an383.yaml @@ -0,0 +1,18 @@ +identifier: mps2/an383 +name: ARM V2M MPS2-an383 +type: mcu +arch: arm +simulation: + - name: armfvp + exec: FVP_MPS2_Cortex-M0plus +toolchain: + - zephyr + - gnuarmemb +supported: + - counter + - netif:serial-net + - gpio + - watchdog +testing: + default: true +vendor: arm diff --git a/boards/arm/mps2/mps2_an383_defconfig b/boards/arm/mps2/mps2_an383_defconfig new file mode 100644 index 00000000000..aaa7c33d63d --- /dev/null +++ b/boards/arm/mps2/mps2_an383_defconfig @@ -0,0 +1,20 @@ +# +# Copyright 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_RUNTIME_NMI=y + +# GPIOs +CONFIG_GPIO=y + +# Serial +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y + +CONFIG_ARM_MPU=y + +# 0x0 is a valid address, we cannot prevent access to that area +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y diff --git a/boards/arm/mps2/mps2_an385.dts b/boards/arm/mps2/mps2_an385.dts index d2db1cebed0..fd7279d203d 100644 --- a/boards/arm/mps2/mps2_an385.dts +++ b/boards/arm/mps2/mps2_an385.dts @@ -1,58 +1,25 @@ -/* SPDX-License-Identifier: Apache-2.0 */ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright 2024 Arm Limited and/or its affiliates + */ /dts-v1/; #include #include #include +#include "mps2_base.dtsi" -/ { - compatible = "arm,mps2"; - #address-cells = <1>; - #size-cells = <1>; - - aliases { - led0 = &led_0; - led1 = &led_1; - sw0 = &user_button_0; - sw1 = &user_button_1; - watchdog0 = &wdog0; - }; - - chosen { - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,uart-pipe = &uart1; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - }; +/* + * FVP does not support uart3 and uart4 whilst QEMU does. + * So if using QEMU, you might want to comment out the following two lines + */ - leds { - compatible = "gpio-leds"; - led_0: led_0 { - gpios = <&gpio_led0 0>; - label = "USERLED0"; - }; - led_1: led_1 { - gpios = <&gpio_led0 1>; - label = "USERLED1"; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - user_button_0: button_0 { - label = "USERPB0"; - gpios = <&gpio_button 0>; - zephyr,code = ; - }; - user_button_1: button_1 { - label = "USERPB1"; - gpios = <&gpio_button 1>; - zephyr,code = ; - }; - }; +/delete-node/ &uart3; +/delete-node/ &uart4; +/ { cpus { #address-cells = <1>; #size-cells = <0>; @@ -62,223 +29,4 @@ reg = <0>; }; }; - - sram0: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 0x400000>; - }; - - flash0: flash@0 { - compatible = "soc-nv-flash"; - reg = <0 0x400000>; - }; - - sim_flash_controller: sim_flash_controller { - compatible = "zephyr,sim-flash"; - - #address-cells = <1>; - #size-cells = <1>; - erase-value = <0x00>; - - flash_sim0: flash_sim@0 { - compatible = "soc-nv-flash"; - reg = <0x00000000 0x8000>; - - erase-block-size = <1024>; - write-block-size = <4>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - storage_partition: partition@0 { - label = "storage_partition"; - reg = <0x00000000 0x8000>; - }; - }; - }; - }; - - sysclk: system-clock { - compatible = "fixed-clock"; - clock-frequency = <25000000>; - #clock-cells = <0>; - }; - - soc { - timer0: timer@40000000 { - compatible = "arm,cmsdk-timer"; - reg = <0x40000000 0x1000>; - interrupts = <8 3>; - }; - - timer1: timer@40001000 { - compatible = "arm,cmsdk-timer"; - reg = <0x40001000 0x1000>; - interrupts = <9 3>; - }; - - dtimer0: dtimer@40002000 { - compatible = "arm,cmsdk-dtimer"; - reg = <0x40002000 0x1000>; - interrupts = <10 3>; - }; - - uart0: uart@40004000 { - compatible = "arm,cmsdk-uart"; - reg = <0x40004000 0x1000>; - interrupts = <1 3 0 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; - }; - - uart1: uart@40005000 { - compatible = "arm,cmsdk-uart"; - reg = <0x40005000 0x1000>; - interrupts = <3 3 2 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; - }; - - uart2: uart@40006000 { - compatible = "arm,cmsdk-uart"; - reg = <0x40006000 0x1000>; - interrupts = <5 3 4 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; - }; - - uart3: uart@40007000 { - compatible = "arm,cmsdk-uart"; - reg = <0x40007000 0x1000>; - interrupts = <19 3 18 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; - }; - - wdog0: wdog@40008000 { - compatible = "arm,cmsdk-watchdog"; - clocks = <&sysclk>; - reg = <0x40008000 0x1000>; - }; - - uart4: uart@40009000 { - compatible = "arm,cmsdk-uart"; - reg = <0x40009000 0x1000>; - interrupts = <21 3 20 3>; - interrupt-names = "tx", "rx"; - clocks = <&sysclk>; - current-speed = <115200>; - }; - - gpio0: gpio@40010000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x40010000 0x1000>; - interrupts = <6 3>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpio1: gpio@40011000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x40011000 0x1000>; - interrupts = <7 3>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpio2: gpio@40012000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x40012000 0x1000>; - interrupts = <16 3>; - gpio-controller; - #gpio-cells = <2>; - }; - - gpio3: gpio@40013000 { - compatible = "arm,cmsdk-gpio"; - reg = <0x40013000 0x1000>; - interrupts = <17 3>; - gpio-controller; - #gpio-cells = <2>; - }; - - eth0: eth@40200000 { - /* Linux has "smsc,lan9115" */ - compatible = "smsc,lan9220"; - /* Such a big size from memory map in AN385 */ - /* Actual reg range is ~0x200 */ - reg = <0x40200000 0x100000>; - interrupts = <13 3>; - }; - - i2c_touch: i2c@40022000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x40022000 0x1000>; - }; - - i2c_audio_conf: i2c@40023000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x40023000 0x1000>; - }; - - i2c_shield0: i2c@40029000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x40029000 0x1000>; - }; - - i2c_shield1: i2c@4002a000 { - compatible = "arm,versatile-i2c"; - clock-frequency = ; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x4002a000 0x1000>; - }; - - gpio_led0: mps2_fpgaio@40028000 { - compatible = "arm,mps2-fpgaio-gpio"; - - reg = <0x40028000 0x4>; - gpio-controller; - #gpio-cells = <1>; - ngpios = <2>; - }; - - gpio_button: mps2_fpgaio@40028008 { - compatible = "arm,mps2-fpgaio-gpio"; - - reg = <0x40028008 0x4>; - gpio-controller; - #gpio-cells = <1>; - ngpios = <2>; - }; - - gpio_misc: mps2_fpgaio@4002804c { - compatible = "arm,mps2-fpgaio-gpio"; - - reg = <0x4002804c 0x4>; - gpio-controller; - #gpio-cells = <1>; - ngpios = <10>; - }; - - }; -}; - -&nvic { - arm,num-irq-priority-bits = <3>; }; diff --git a/boards/arm/mps2/mps2_an385.yaml b/boards/arm/mps2/mps2_an385.yaml index bbd929892c5..ca7d2443c93 100644 --- a/boards/arm/mps2/mps2_an385.yaml +++ b/boards/arm/mps2/mps2_an385.yaml @@ -4,10 +4,11 @@ type: mcu arch: arm simulation: - name: qemu + - name: armfvp + exec: FVP_MPS2_Cortex-M3 toolchain: - zephyr - gnuarmemb - - xtools supported: - counter - netif:serial-net @@ -16,3 +17,5 @@ supported: testing: default: true vendor: arm +ram: 4096 +flash: 4096 diff --git a/boards/arm/mps2/mps2_an386.dts b/boards/arm/mps2/mps2_an386.dts new file mode 100644 index 00000000000..44aacd6cbc1 --- /dev/null +++ b/boards/arm/mps2/mps2_an386.dts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include +#include +#include "mps2_base.dtsi" + +/* FVP does not support uart3 and uart4 */ +/* hence we delete them for AN386 in FVP */ +/delete-node/ &uart3; +/delete-node/ &uart4; + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-m4f"; + reg = <0>; + }; + }; +}; diff --git a/boards/arm/mps2/mps2_an386.yaml b/boards/arm/mps2/mps2_an386.yaml new file mode 100644 index 00000000000..f71e166e683 --- /dev/null +++ b/boards/arm/mps2/mps2_an386.yaml @@ -0,0 +1,19 @@ +identifier: mps2/an386 +name: ARM V2M MPS2-an386 +type: mcu +arch: arm +simulation: + - name: armfvp + exec: FVP_MPS2_Cortex-M4 +toolchain: + - zephyr + - gnuarmemb +supported: + - counter + - gpio + - watchdog +testing: + default: true + ignore_tags: + - net +vendor: arm diff --git a/boards/arm/mps2/mps2_an386_defconfig b/boards/arm/mps2/mps2_an386_defconfig new file mode 100644 index 00000000000..723288edb52 --- /dev/null +++ b/boards/arm/mps2/mps2_an386_defconfig @@ -0,0 +1,15 @@ +# +# Copyright 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_RUNTIME_NMI=y + +# GPIOs +CONFIG_GPIO=y + +# Serial +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y diff --git a/boards/arm/mps2/mps2_an500.dts b/boards/arm/mps2/mps2_an500.dts new file mode 100644 index 00000000000..6cd48be45fc --- /dev/null +++ b/boards/arm/mps2/mps2_an500.dts @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright 2024 Arm Limited and/or its affiliates */ +/dts-v1/; + +#include +#include +#include +#include "mps2_base.dtsi" + +/* FVP does not support uart3 and uart4 */ +/* hence we delete them for AN500 in FVP */ +/delete-node/ &uart3; +/delete-node/ &uart4; +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-m7"; + reg = <0>; + }; + }; +}; diff --git a/boards/arm/mps2/mps2_an500.yaml b/boards/arm/mps2/mps2_an500.yaml new file mode 100644 index 00000000000..cc4c713d799 --- /dev/null +++ b/boards/arm/mps2/mps2_an500.yaml @@ -0,0 +1,19 @@ +identifier: mps2/an500 +name: ARM V2M MPS2-an500 +type: mcu +arch: arm +simulation: + - name: armfvp + exec: FVP_MPS2_Cortex-M7 +toolchain: + - zephyr + - gnuarmemb +supported: + - counter + - gpio + - watchdog +testing: + default: true + ignore_tags: + - net +vendor: arm diff --git a/boards/arm/mps2/mps2_an500_defconfig b/boards/arm/mps2/mps2_an500_defconfig new file mode 100644 index 00000000000..723288edb52 --- /dev/null +++ b/boards/arm/mps2/mps2_an500_defconfig @@ -0,0 +1,15 @@ +# +# Copyright 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_RUNTIME_NMI=y + +# GPIOs +CONFIG_GPIO=y + +# Serial +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y diff --git a/boards/arm/mps2/mps2_an521-common.dtsi b/boards/arm/mps2/mps2_an521-common.dtsi index 5b1959ff5fe..b96f1144982 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 2bb956645ca..532384377da 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 68210b954b4..e511285c190 100644 --- a/boards/arm/mps2/mps2_an521_cpu0.yaml +++ b/boards/arm/mps2/mps2_an521_cpu0.yaml @@ -10,13 +10,11 @@ simulation: toolchain: - gnuarmemb - zephyr - - xtools supported: - gpio 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 e2b24cd9ba5..d67718fcc59 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_cpu0_ns.yaml b/boards/arm/mps2/mps2_an521_cpu0_ns.yaml index c4a589c9396..8f0a61596ca 100644 --- a/boards/arm/mps2/mps2_an521_cpu0_ns.yaml +++ b/boards/arm/mps2/mps2_an521_cpu0_ns.yaml @@ -10,7 +10,6 @@ simulation: toolchain: - gnuarmemb - zephyr - - xtools testing: default: true only_tags: diff --git a/boards/arm/mps2/mps2_an521_cpu1.dts b/boards/arm/mps2/mps2_an521_cpu1.dts index 311694ca399..24b39b50978 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_an521_cpu1.yaml b/boards/arm/mps2/mps2_an521_cpu1.yaml index 3880d479d6e..5264acb61f4 100644 --- a/boards/arm/mps2/mps2_an521_cpu1.yaml +++ b/boards/arm/mps2/mps2_an521_cpu1.yaml @@ -10,7 +10,6 @@ simulation: toolchain: - gnuarmemb - zephyr - - xtools testing: default: true only_tags: diff --git a/boards/arm/mps2/mps2_base.dtsi b/boards/arm/mps2/mps2_base.dtsi new file mode 100644 index 00000000000..021373fac43 --- /dev/null +++ b/boards/arm/mps2/mps2_base.dtsi @@ -0,0 +1,282 @@ +/* Copyright 2024-2025 Arm Limited and/or its affiliates */ +/* SPDX-License-Identifier: Apache-2.0 */ + +/ { + compatible = "arm,mps2"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + led0 = &led_0; + led1 = &led_1; + sw0 = &user_button_0; + sw1 = &user_button_1; + watchdog0 = &wdog0; + }; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,uart-pipe = &uart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,flash-controller = &sim_flash_controller; + }; + + leds { + compatible = "gpio-leds"; + led_0: led_0 { + gpios = <&gpio_led0 0>; + label = "USERLED0"; + }; + + led_1: led_1 { + gpios = <&gpio_led0 1>; + label = "USERLED1"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + user_button_0: button_0 { + label = "USERPB0"; + gpios = <&gpio_button 0>; + zephyr,code = ; + }; + + user_button_1: button_1 { + label = "USERPB1"; + gpios = <&gpio_button 1>; + zephyr,code = ; + }; + }; + + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 0x400000>; + }; + + flash0: flash@0 { + compatible = "soc-nv-flash"; + reg = <0 0x400000>; + }; + + sim_flash_controller: sim_flash_controller { + compatible = "zephyr,sim-flash"; + #address-cells = <1>; + #size-cells = <1>; + erase-value = <0x00>; + + flash_sim0: flash_sim@0 { + compatible = "soc-nv-flash"; + reg = <0x00000000 0x8000>; + erase-block-size = <1024>; + write-block-size = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + storage_partition: partition@0 { + label = "storage_partition"; + reg = <0x00000000 0x8000>; + }; + }; + }; + }; + + sysclk: system-clock { + compatible = "fixed-clock"; + clock-frequency = <25000000>; + #clock-cells = <0>; + }; + + soc { + timer0: timer@40000000 { + compatible = "arm,cmsdk-timer"; + reg = <0x40000000 0x1000>; + interrupts = <8 3>; + }; + + timer1: timer@40001000 { + compatible = "arm,cmsdk-timer"; + reg = <0x40001000 0x1000>; + interrupts = <9 3>; + }; + + dtimer0: dtimer@40002000 { + compatible = "arm,cmsdk-dtimer"; + reg = <0x40002000 0x1000>; + interrupts = <10 3>; + }; + + uart0: uart@40004000 { + compatible = "arm,cmsdk-uart"; + reg = <0x40004000 0x1000>; + interrupts = <1 3 0 3>; + interrupt-names = "tx", "rx"; + clocks = <&sysclk>; + current-speed = <115200>; + }; + + uart1: uart@40005000 { + compatible = "arm,cmsdk-uart"; + reg = <0x40005000 0x1000>; + interrupts = <3 3 2 3>; + interrupt-names = "tx", "rx"; + clocks = <&sysclk>; + current-speed = <115200>; + }; + + uart2: uart@40006000 { + compatible = "arm,cmsdk-uart"; + reg = <0x40006000 0x1000>; + interrupts = <5 3 4 3>; + interrupt-names = "tx", "rx"; + clocks = <&sysclk>; + current-speed = <115200>; + }; + + uart3: uart@40007000 { + compatible = "arm,cmsdk-uart"; + reg = <0x40007000 0x1000>; + interrupts = <19 3 18 3>; + interrupt-names = "tx", "rx"; + clocks = <&sysclk>; + current-speed = <115200>; + pinctrl-0 = <&uart3_default>; + pinctrl-names = "default"; + }; + + wdog0: wdog@40008000 { + compatible = "arm,cmsdk-watchdog"; + clocks = <&sysclk>; + reg = <0x40008000 0x1000>; + }; + + uart4: uart@40009000 { + compatible = "arm,cmsdk-uart"; + reg = <0x40009000 0x1000>; + interrupts = <21 3 20 3>; + interrupt-names = "tx", "rx"; + clocks = <&sysclk>; + current-speed = <115200>; + pinctrl-0 = <&uart4_default>; + pinctrl-names = "default"; + }; + + gpio0: gpio@40010000 { + compatible = "arm,cmsdk-gpio"; + reg = <0x40010000 0x1000>; + interrupts = <6 3>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio1: gpio@40011000 { + compatible = "arm,cmsdk-gpio"; + reg = <0x40011000 0x1000>; + interrupts = <7 3>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio2: gpio@40012000 { + compatible = "arm,cmsdk-gpio"; + reg = <0x40012000 0x1000>; + interrupts = <16 3>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio3: gpio@40013000 { + compatible = "arm,cmsdk-gpio"; + reg = <0x40013000 0x1000>; + interrupts = <17 3>; + gpio-controller; + #gpio-cells = <2>; + }; + + eth0: eth@40200000 { + /* Linux has "smsc,lan9115" */ + compatible = "smsc,lan9220"; + /* Such a big size from memory map in AN385 */ + /* Actual reg range is ~0x200 */ + reg = <0x40200000 0x100000>; + interrupts = <13 3>; + }; + + i2c_touch: i2c@40022000 { + compatible = "arm,versatile-i2c"; + clock-frequency = ; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x40022000 0x1000>; + }; + + i2c_audio_conf: i2c@40023000 { + compatible = "arm,versatile-i2c"; + clock-frequency = ; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x40023000 0x1000>; + }; + + i2c_shield0: i2c@40029000 { + compatible = "arm,versatile-i2c"; + clock-frequency = ; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x40029000 0x1000>; + pinctrl-0 = <&sbcon0_default>; + pinctrl-names = "default"; + }; + + i2c_shield1: i2c@4002a000 { + compatible = "arm,versatile-i2c"; + clock-frequency = ; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4002a000 0x1000>; + pinctrl-0 = <&sbcon1_default>; + pinctrl-names = "default"; + }; + + gpio_led0: mps2_fpgaio@40028000 { + compatible = "arm,mmio32-gpio"; + reg = <0x40028000 0x4>; + gpio-controller; + #gpio-cells = <1>; + ngpios = <2>; + }; + + gpio_button: mps2_fpgaio@40028008 { + compatible = "arm,mmio32-gpio"; + reg = <0x40028008 0x4>; + gpio-controller; + #gpio-cells = <1>; + ngpios = <2>; + direction-input; + }; + + gpio_misc: mps2_fpgaio@4002804c { + 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 6cf93983072..00000000000 --- 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 4ce6cf0c910..014b80f307f 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 ca090a832fc..e6204c4c2ea 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 00000000000..17b143ae644 --- /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 798af263310..3348101bc72 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 6fd5c7acd40..d46f6c602cf 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 ae71ddf7282..55188180f0c 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 87a7100ed37..b63d2b1211c 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 # @@ -17,10 +17,10 @@ simulation: toolchain: - gnuarmemb - zephyr - - xtools 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 5a4e0031946..9540682e37b 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_an547_ns.yaml b/boards/arm/mps3/mps3_corstone300_an547_ns.yaml index 3efa3da5de6..15e47f38110 100644 --- a/boards/arm/mps3/mps3_corstone300_an547_ns.yaml +++ b/boards/arm/mps3/mps3_corstone300_an547_ns.yaml @@ -16,7 +16,6 @@ simulation: toolchain: - gnuarmemb - zephyr - - xtools testing: default: true only_tags: diff --git a/boards/arm/mps3/mps3_corstone300_an552.dts b/boards/arm/mps3/mps3_corstone300_an552.dts index 7c7ec8d02a5..51aabcda2fa 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.yaml b/boards/arm/mps3/mps3_corstone300_an552.yaml index ecabe715085..8feba8f3d6c 100644 --- a/boards/arm/mps3/mps3_corstone300_an552.yaml +++ b/boards/arm/mps3/mps3_corstone300_an552.yaml @@ -10,7 +10,6 @@ flash: 512 toolchain: - gnuarmemb - zephyr - - xtools supported: - gpio testing: diff --git a/boards/arm/mps3/mps3_corstone300_an552_ns.dts b/boards/arm/mps3/mps3_corstone300_an552_ns.dts index 17e9d259bca..7b8bab99ff6 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_an552_ns.yaml b/boards/arm/mps3/mps3_corstone300_an552_ns.yaml index b8a914a5725..229778378bd 100644 --- a/boards/arm/mps3/mps3_corstone300_an552_ns.yaml +++ b/boards/arm/mps3/mps3_corstone300_an552_ns.yaml @@ -10,7 +10,6 @@ flash: 512 toolchain: - gnuarmemb - zephyr - - xtools testing: default: true only_tags: diff --git a/boards/arm/mps3/mps3_corstone300_fvp.dts b/boards/arm/mps3/mps3_corstone300_fvp.dts index eff11378c61..886b8d77629 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 3d850b7f4ea..e6cb88bc5a7 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 @@ -13,12 +13,11 @@ simulation: toolchain: - gnuarmemb - zephyr - - xtools 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 8a9704cae3a..d2be764eb50 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_corstone300_fvp_ns.yaml b/boards/arm/mps3/mps3_corstone300_fvp_ns.yaml index 0802a129434..52de52a2a1b 100644 --- a/boards/arm/mps3/mps3_corstone300_fvp_ns.yaml +++ b/boards/arm/mps3/mps3_corstone300_fvp_ns.yaml @@ -7,12 +7,9 @@ type: mcu arch: arm ram: 2048 flash: 512 -# Related issue #81656 -twister: false toolchain: - gnuarmemb - zephyr - - xtools testing: default: true only_tags: diff --git a/boards/arm/mps3/mps3_corstone310_an555.dts b/boards/arm/mps3/mps3_corstone310_an555.dts index f16aff58eae..47c2a9626a8 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.yaml b/boards/arm/mps3/mps3_corstone310_an555.yaml index 5bcd0fb1925..5005c8c6843 100644 --- a/boards/arm/mps3/mps3_corstone310_an555.yaml +++ b/boards/arm/mps3/mps3_corstone310_an555.yaml @@ -10,7 +10,6 @@ flash: 32 toolchain: - gnuarmemb - zephyr - - xtools supported: - gpio testing: diff --git a/boards/arm/mps3/mps3_corstone310_an555_defconfig b/boards/arm/mps3/mps3_corstone310_an555_defconfig index f5607f3da4c..cfea436df56 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 786ca6d9eb1..4a910777e11 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_an555_ns.yaml b/boards/arm/mps3/mps3_corstone310_an555_ns.yaml index f6a1f444f39..80423596e31 100644 --- a/boards/arm/mps3/mps3_corstone310_an555_ns.yaml +++ b/boards/arm/mps3/mps3_corstone310_an555_ns.yaml @@ -10,7 +10,6 @@ flash: 32 toolchain: - gnuarmemb - zephyr - - xtools testing: default: true only_tags: diff --git a/boards/arm/mps3/mps3_corstone310_fvp.dts b/boards/arm/mps3/mps3_corstone310_fvp.dts index 6ad45b5f973..585a7297d72 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 ab6c8d7e561..7259d65a238 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 @@ -13,10 +13,10 @@ simulation: toolchain: - gnuarmemb - zephyr - - xtools 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 f5607f3da4c..cfea436df56 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 acc9b5fb737..9cd73ee3959 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/mps3/mps3_corstone310_fvp_ns.yaml b/boards/arm/mps3/mps3_corstone310_fvp_ns.yaml index 6a70eff7fb0..307329bcf90 100644 --- a/boards/arm/mps3/mps3_corstone310_fvp_ns.yaml +++ b/boards/arm/mps3/mps3_corstone310_fvp_ns.yaml @@ -10,7 +10,6 @@ flash: 32 toolchain: - gnuarmemb - zephyr - - xtools testing: default: true only_tags: diff --git a/boards/arm/v2m_beetle/CMakeLists.txt b/boards/arm/v2m_beetle/CMakeLists.txt deleted file mode 100644 index 9bc25bae4c6..00000000000 --- 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 856239761b8..00000000000 --- 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 00000000000..3bd342daac9 --- /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 abb2687701c..8e8dc71872a 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/arm/v2m_beetle/v2m_beetle.yaml b/boards/arm/v2m_beetle/v2m_beetle.yaml index ca1e17d2d8d..3284abddb36 100644 --- a/boards/arm/v2m_beetle/v2m_beetle.yaml +++ b/boards/arm/v2m_beetle/v2m_beetle.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - counter vendor: arm diff --git a/boards/arm/v2m_musca_b1/v2m_musca_b1.yaml b/boards/arm/v2m_musca_b1/v2m_musca_b1.yaml index 72be434271d..51b0acbf3a4 100644 --- a/boards/arm/v2m_musca_b1/v2m_musca_b1.yaml +++ b/boards/arm/v2m_musca_b1/v2m_musca_b1.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio vendor: arm diff --git a/boards/arm/v2m_musca_b1/v2m_musca_b1_musca_b1_ns.yaml b/boards/arm/v2m_musca_b1/v2m_musca_b1_musca_b1_ns.yaml index 8f8700b0885..7d13a46149f 100644 --- a/boards/arm/v2m_musca_b1/v2m_musca_b1_musca_b1_ns.yaml +++ b/boards/arm/v2m_musca_b1/v2m_musca_b1_musca_b1_ns.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 64 flash: 1663 vendor: arm diff --git a/boards/arm/v2m_musca_s1/v2m_musca_s1.yaml b/boards/arm/v2m_musca_s1/v2m_musca_s1.yaml index 7e99e0fc4eb..2d35c16b3c3 100644 --- a/boards/arm/v2m_musca_s1/v2m_musca_s1.yaml +++ b/boards/arm/v2m_musca_s1/v2m_musca_s1.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio vendor: arm diff --git a/boards/arm/v2m_musca_s1/v2m_musca_s1_musca_s1_ns.yaml b/boards/arm/v2m_musca_s1/v2m_musca_s1_musca_s1_ns.yaml index 090f6996c58..747247dcc75 100644 --- a/boards/arm/v2m_musca_s1/v2m_musca_s1_musca_s1_ns.yaml +++ b/boards/arm/v2m_musca_s1/v2m_musca_s1_musca_s1_ns.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 256 flash: 511 vendor: arm diff --git a/boards/aspeed/ast1030_evb/doc/index.rst b/boards/aspeed/ast1030_evb/doc/index.rst index 1c23d7d2644..1faa0185e27 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/atmel/sam/sam4e_xpro/doc/index.rst b/boards/atmel/sam/sam4e_xpro/doc/index.rst index 1069727aa6c..fe51eaf3f90 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/sam4e_xpro/sam4e_xpro.yaml b/boards/atmel/sam/sam4e_xpro/sam4e_xpro.yaml index 561b06b8afe..ef72c87ba72 100644 --- a/boards/atmel/sam/sam4e_xpro/sam4e_xpro.yaml +++ b/boards/atmel/sam/sam4e_xpro/sam4e_xpro.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 1024 ram: 128 supported: diff --git a/boards/atmel/sam/sam4l_ek/doc/index.rst b/boards/atmel/sam/sam4l_ek/doc/index.rst index f958a540515..899498f61a5 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/sam4l_ek/sam4l_ek.yaml b/boards/atmel/sam/sam4l_ek/sam4l_ek.yaml index 3a8193e5515..3be5a297f05 100644 --- a/boards/atmel/sam/sam4l_ek/sam4l_ek.yaml +++ b/boards/atmel/sam/sam4l_ek/sam4l_ek.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2020-2025, Gerson Fernando Budke +# SPDX-License-Identifier: Apache-2.0 + identifier: sam4l_ek name: SAM4L-EK type: mcu @@ -5,7 +8,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 256 ram: 32 supported: @@ -17,4 +19,5 @@ supported: - spi - uart - usb_device + - watchdog vendor: atmel diff --git a/boards/atmel/sam/sam4l_ek/sam4l_ek_defconfig b/boards/atmel/sam/sam4l_ek/sam4l_ek_defconfig index 6c902f537d7..141c98be565 100644 --- a/boards/atmel/sam/sam4l_ek/sam4l_ek_defconfig +++ b/boards/atmel/sam/sam4l_ek/sam4l_ek_defconfig @@ -1,7 +1,9 @@ +# Copyright (c) 2020-2025, Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y +CONFIG_WDT_DISABLE_AT_BOOT=y CONFIG_CONSOLE=y CONFIG_SERIAL=y diff --git a/boards/atmel/sam/sam4s_xplained/doc/index.rst b/boards/atmel/sam/sam4s_xplained/doc/index.rst index 480411323bd..6f39a88367a 100644 --- a/boards/atmel/sam/sam4s_xplained/doc/index.rst +++ b/boards/atmel/sam/sam4s_xplained/doc/index.rst @@ -23,43 +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 | -+-----------+------------+-------------------------------------+ -| 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 =================== @@ -84,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/sam4s_xplained/sam4s_xplained-pinctrl.dtsi b/boards/atmel/sam/sam4s_xplained/sam4s_xplained-pinctrl.dtsi index 703e04ca5e1..479755f1a79 100644 --- a/boards/atmel/sam/sam4s_xplained/sam4s_xplained-pinctrl.dtsi +++ b/boards/atmel/sam/sam4s_xplained/sam4s_xplained-pinctrl.dtsi @@ -29,18 +29,21 @@ ; }; }; + uart1_default: uart1_default { group1 { pinmux = , ; }; }; + usart1_default: usart1_default { group1 { pinmux = , ; }; }; + pwm0_default: pwm0_default { group1 { pinmux = , @@ -48,12 +51,21 @@ ; }; }; + adc0_default: adc0_default { group1 { pinmux = , ; }; }; + + dacc_default: dacc_default { + group1 { + pinmux = , + ; + }; + }; + smc_default: smc_default { group1 { pinmux = , diff --git a/boards/atmel/sam/sam4s_xplained/sam4s_xplained.dts b/boards/atmel/sam/sam4s_xplained/sam4s_xplained.dts index 2e06d08aade..eb777a75b17 100644 --- a/boards/atmel/sam/sam4s_xplained/sam4s_xplained.dts +++ b/boards/atmel/sam/sam4s_xplained/sam4s_xplained.dts @@ -190,6 +190,13 @@ tracking-time = <2>; }; +&dacc { + status = "okay"; + + pinctrl-0 = <&dacc_default>; + pinctrl-names = "default"; +}; + &wdt { status = "okay"; }; diff --git a/boards/atmel/sam/sam4s_xplained/sam4s_xplained.yaml b/boards/atmel/sam/sam4s_xplained/sam4s_xplained.yaml index 0cc1a4f9deb..857d2995164 100644 --- a/boards/atmel/sam/sam4s_xplained/sam4s_xplained.yaml +++ b/boards/atmel/sam/sam4s_xplained/sam4s_xplained.yaml @@ -5,12 +5,12 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 1024 ram: 128 supported: - adc - counter + - dac - gpio - hwinfo - memc diff --git a/boards/atmel/sam/sam_e70_xplained/doc/index.rst b/boards/atmel/sam/sam_e70_xplained/doc/index.rst index 6c816439176..659f793049d 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_e70_xplained/sam_e70_xplained_same70q21.yaml b/boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21.yaml index a9fb5a4704f..3cec4f75182 100644 --- a/boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21.yaml +++ b/boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 2048 ram: 384 supported: diff --git a/boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21b.yaml b/boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21b.yaml index 4adc2dc6dd3..7a70dbc5844 100644 --- a/boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21b.yaml +++ b/boards/atmel/sam/sam_e70_xplained/sam_e70_xplained_same70q21b.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 2048 ram: 384 supported: diff --git a/boards/atmel/sam/sam_v71_xult/doc/index.rst b/boards/atmel/sam/sam_v71_xult/doc/index.rst index cb7ecbfda43..d58c6ded861 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/sam/sam_v71_xult/sam_v71_xult_samv71q21.yaml b/boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21.yaml index 271565dac24..c1873f6aaae 100644 --- a/boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21.yaml +++ b/boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 2048 ram: 384 supported: diff --git a/boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21b.yaml b/boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21b.yaml index 732d1de39e6..b0a226550c9 100644 --- a/boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21b.yaml +++ b/boards/atmel/sam/sam_v71_xult/sam_v71_xult_samv71q21b.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 2048 ram: 384 supported: diff --git a/boards/atmel/sam0/samc21n_xpro/doc/index.rst b/boards/atmel/sam0/samc21n_xpro/doc/index.rst index 678e3afa453..094f75631ea 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/samc21n_xpro/samc21n_xpro.dts b/boards/atmel/sam0/samc21n_xpro/samc21n_xpro.dts index 3827dc104d9..dc49e1016c3 100644 --- a/boards/atmel/sam0/samc21n_xpro/samc21n_xpro.dts +++ b/boards/atmel/sam0/samc21n_xpro/samc21n_xpro.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2022 Kamil Serwus + # Copyright (c) 2024-2025 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -82,6 +83,14 @@ pinctrl-names = "default"; }; +&rtc { + status = "okay"; + counter-mode = "clock"; + prescaler = <1024>; + + atmel,assigned-clocks = <&osc32kctrl 4>; +}; + &sercom0 { status = "okay"; compatible = "atmel,sam0-uart"; diff --git a/boards/atmel/sam0/samc21n_xpro/samc21n_xpro.yaml b/boards/atmel/sam0/samc21n_xpro/samc21n_xpro.yaml index 428d79e1110..3c32cfef322 100644 --- a/boards/atmel/sam0/samc21n_xpro/samc21n_xpro.yaml +++ b/boards/atmel/sam0/samc21n_xpro/samc21n_xpro.yaml @@ -1,5 +1,5 @@ # Copyright (c) 2022 Kamil Serwus -# Copyright (c) 2024 Gerson Fernando Budke +# Copyright (c) 2024-2025 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 identifier: samc21n_xpro name: SAM C21N Xplained Pro @@ -8,7 +8,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 256 ram: 32 supported: @@ -18,6 +17,7 @@ supported: - gpio - i2c - pwm + - rtc - spi - uart vendor: atmel diff --git a/boards/atmel/sam0/samd20_xpro/doc/index.rst b/boards/atmel/sam0/samd20_xpro/doc/index.rst index 6127a37aff6..f374a15dad3 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/samd20_xpro/samd20_xpro.dts b/boards/atmel/sam0/samd20_xpro/samd20_xpro.dts index 83f5df99c05..6e465087aef 100644 --- a/boards/atmel/sam0/samd20_xpro/samd20_xpro.dts +++ b/boards/atmel/sam0/samd20_xpro/samd20_xpro.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2018 Sean Nyekjaer + # Copyright (c) 2024-2025 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -51,6 +52,12 @@ clock-frequency = ; }; +&rtc { + status = "okay"; + counter-mode = "clock"; + prescaler = <1024>; +}; + &sercom0 { status = "okay"; compatible = "atmel,sam0-spi"; diff --git a/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml b/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml index 1db726120e1..06077f79cd3 100644 --- a/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml +++ b/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Gerson Fernando Budke +# Copyright (c) 2024-2025 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 identifier: samd20_xpro @@ -8,13 +8,13 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 256 ram: 32 supported: - flash - gpio - i2c + - rtc - spi - uart - watchdog diff --git a/boards/atmel/sam0/samd21_xpro/doc/index.rst b/boards/atmel/sam0/samd21_xpro/doc/index.rst index 057d6d80b8d..a7b2245e158 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/samd21_xpro/samd21_xpro.dts b/boards/atmel/sam0/samd21_xpro/samd21_xpro.dts index f390bc106de..72c0b815b8b 100644 --- a/boards/atmel/sam0/samd21_xpro/samd21_xpro.dts +++ b/boards/atmel/sam0/samd21_xpro/samd21_xpro.dts @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 Bryan O'Donoghue - * Copyright (c) 2024 Gerson Fernando Budke + # Copyright (c) 2024-2025 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -71,6 +71,12 @@ pinctrl-names = "default"; }; +&rtc { + status = "okay"; + counter-mode = "clock"; + prescaler = <1024>; +}; + &sercom0 { status = "okay"; compatible = "atmel,sam0-uart"; diff --git a/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml b/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml index e1e8e08bdbb..2ffa9435ca5 100644 --- a/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml +++ b/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml @@ -1,5 +1,5 @@ # Copyright (c) 2018 Bryan O'Donoghue -# Copyright (c) 2024 Gerson Fernando Budke +# Copyright (c) 2024-2025 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 identifier: samd21_xpro @@ -9,7 +9,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 256 ram: 32 supported: @@ -18,6 +17,7 @@ supported: - gpio - i2c - pwm + - rtc - spi - uart - usb_device diff --git a/boards/atmel/sam0/same54_xpro/doc/index.rst b/boards/atmel/sam0/same54_xpro/doc/index.rst index 61b127d7a1b..3e76b6492d3 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/same54_xpro/same54_xpro.dts b/boards/atmel/sam0/same54_xpro/same54_xpro.dts index f8d957727cd..b6b9ff9d78d 100644 --- a/boards/atmel/sam0/same54_xpro/same54_xpro.dts +++ b/boards/atmel/sam0/same54_xpro/same54_xpro.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2019 Benjamin Valentin + # Copyright (c) 2024-2025 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -68,6 +69,14 @@ pinctrl-names = "default"; }; +&rtc { + status = "okay"; + counter-mode = "clock"; + prescaler = <1024>; + + atmel,assigned-clocks = <&osc32kctrl 4>; +}; + &sercom2 { status = "okay"; compatible = "atmel,sam0-uart"; diff --git a/boards/atmel/sam0/same54_xpro/same54_xpro.yaml b/boards/atmel/sam0/same54_xpro/same54_xpro.yaml index 1cddeeaf7ad..bd46418551f 100644 --- a/boards/atmel/sam0/same54_xpro/same54_xpro.yaml +++ b/boards/atmel/sam0/same54_xpro/same54_xpro.yaml @@ -1,5 +1,5 @@ # Copyright (c) 2019 Benjamin Valentin -# Copyright (c) 2024 Gerson Fernando Budke +# Copyright (c) 2024-2025 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 identifier: same54_xpro name: SAM E54 Xplained Pro @@ -8,16 +8,17 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 1024 ram: 256 supported: - adc + - dma - flash - gpio - i2c - netif:eth - pwm + - rtc - spi - uart - usb_device diff --git a/boards/atmel/sam0/saml21_xpro/doc/index.rst b/boards/atmel/sam0/saml21_xpro/doc/index.rst index b92e1bf09a7..90ee2676088 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/saml21_xpro/saml21_xpro.dts b/boards/atmel/sam0/saml21_xpro/saml21_xpro.dts index c0e0e43d666..f1a14ab071b 100644 --- a/boards/atmel/sam0/saml21_xpro/saml21_xpro.dts +++ b/boards/atmel/sam0/saml21_xpro/saml21_xpro.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Argentum Systems Ltd. + # Copyright (c) 2024-2025 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -71,6 +72,14 @@ pinctrl-names = "default"; }; +&rtc { + status = "okay"; + counter-mode = "clock"; + prescaler = <1024>; + + atmel,assigned-clocks = <&osc32kctrl 4>; +}; + &sercom0 { status = "okay"; compatible = "atmel,sam0-spi"; diff --git a/boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml b/boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml index be39f0dc517..9588bef980d 100644 --- a/boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml +++ b/boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml @@ -1,5 +1,5 @@ # Copyright (c) 2021 Argentum Systems Ltd. -# Copyright (c) 2024 Gerson Fernando Budke +# Copyright (c) 2024-2025 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 identifier: saml21_xpro name: SAM L21 Xplained Pro @@ -8,7 +8,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 256 ram: 32 supported: @@ -18,6 +17,7 @@ supported: - gpio - i2c - pwm + - rtc - spi - uart - usb_device diff --git a/boards/atmel/sam0/samr21_xpro/doc/index.rst b/boards/atmel/sam0/samr21_xpro/doc/index.rst index e04b4d7a711..94db3100c6e 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/samr21_xpro/samr21_xpro.dts b/boards/atmel/sam0/samr21_xpro/samr21_xpro.dts index e53fdc80f55..5b7514c26d8 100644 --- a/boards/atmel/sam0/samr21_xpro/samr21_xpro.dts +++ b/boards/atmel/sam0/samr21_xpro/samr21_xpro.dts @@ -1,6 +1,6 @@ /* * Copyright (c) 2019 Benjamin Valentin - * Copyright (c) 2019-2024 Gerson Fernando Budke + * Copyright (c) 2019-2025 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -122,6 +122,12 @@ pinctrl-names = "default"; }; +&rtc { + status = "okay"; + counter-mode = "clock"; + prescaler = <1024>; +}; + &sercom0 { status = "okay"; compatible = "atmel,sam0-uart"; diff --git a/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml b/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml index b61a8209edb..77e032878b2 100644 --- a/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml +++ b/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml @@ -1,5 +1,5 @@ # Copyright (c) 2019 Benjamin Valentin -# Copyright (c) 2019-2024 Gerson Fernando Budke +# Copyright (c) 2019-2025 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 identifier: samr21_xpro @@ -9,16 +9,17 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 256 ram: 32 supported: - adc + - dma - flash - gpio - i2c - netif - pwm + - rtc - spi - uart - usb_device diff --git a/boards/atmel/sam0/samr34_xpro/doc/index.rst b/boards/atmel/sam0/samr34_xpro/doc/index.rst index 4a38544be35..001233e1180 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/atmel/sam0/samr34_xpro/pre_dt_board.cmake b/boards/atmel/sam0/samr34_xpro/pre_dt_board.cmake new file mode 100644 index 00000000000..94f7f4e4459 --- /dev/null +++ b/boards/atmel/sam0/samr34_xpro/pre_dt_board.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2021 Linaro Limited +# SPDX-License-Identifier: Apache-2.0 + +# SPI is implemented via sercom so node name isn't spi@... +list(APPEND EXTRA_DTC_FLAGS "-Wno-spi_bus_bridge") diff --git a/boards/atmel/sam0/samr34_xpro/samr34_xpro.dts b/boards/atmel/sam0/samr34_xpro/samr34_xpro.dts index 964cd8af4df..cb267d86dba 100644 --- a/boards/atmel/sam0/samr34_xpro/samr34_xpro.dts +++ b/boards/atmel/sam0/samr34_xpro/samr34_xpro.dts @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Argentum Systems Ltd. + # Copyright (c) 2024-2025 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -71,6 +72,14 @@ pinctrl-names = "default"; }; +&rtc { + status = "okay"; + counter-mode = "clock"; + prescaler = <1024>; + + atmel,assigned-clocks = <&osc32kctrl 4>; +}; + &sercom0 { status = "okay"; compatible = "atmel,sam0-uart"; diff --git a/boards/atmel/sam0/samr34_xpro/samr34_xpro.yaml b/boards/atmel/sam0/samr34_xpro/samr34_xpro.yaml index 488fba3bb32..c4365171526 100644 --- a/boards/atmel/sam0/samr34_xpro/samr34_xpro.yaml +++ b/boards/atmel/sam0/samr34_xpro/samr34_xpro.yaml @@ -1,5 +1,5 @@ # Copyright (c) 2021 Argentum Systems Ltd. -# Copyright (c) 2024 Gerson Fernando Budke +# Copyright (c) 2024-2025 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 identifier: samr34_xpro name: SAM R34 Xplained Pro @@ -8,7 +8,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools flash: 256 ram: 32 supported: @@ -18,6 +17,7 @@ supported: - gpio - i2c - pwm + - rtc - spi - uart - usb_device diff --git a/boards/bbc/microbit/bbc_microbit.yaml b/boards/bbc/microbit/bbc_microbit.yaml index cb1b12a7d36..521c111f2b8 100644 --- a/boards/bbc/microbit/bbc_microbit.yaml +++ b/boards/bbc/microbit/bbc_microbit.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 16 testing: ignore_tags: diff --git a/boards/bbc/microbit/doc/index.rst b/boards/bbc/microbit/doc/index.rst index 1d829d89a89..9224cd4f24d 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/bbc_microbit_v2.yaml b/boards/bbc/microbit_v2/bbc_microbit_v2.yaml index 5eb925efff6..81928e2c1ed 100644 --- a/boards/bbc/microbit_v2/bbc_microbit_v2.yaml +++ b/boards/bbc/microbit_v2/bbc_microbit_v2.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 128 testing: ignore_tags: diff --git a/boards/bbc/microbit_v2/doc/index.rst b/boards/bbc/microbit_v2/doc/index.rst index 62c3cee2252..24fbaf5d2a3 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/blueclover_plt_demo_v2_nrf52832.yaml b/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.yaml index 6536b8a957f..74fa69a1cba 100644 --- a/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.yaml +++ b/boards/bcdevices/plt_demo_v2/blueclover_plt_demo_v2_nrf52832.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 64 flash: 512 supported: diff --git a/boards/bcdevices/plt_demo_v2/doc/index.rst b/boards/bcdevices/plt_demo_v2/doc/index.rst index 646e5c92025..cdab9ada052 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/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0-pinctrl.dtsi b/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0-pinctrl.dtsi index dfc744b72e4..9cf1363ba22 100644 --- a/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0-pinctrl.dtsi +++ b/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0-pinctrl.dtsi @@ -18,4 +18,12 @@ /* 0x14 is address of padconfig register of p8.22 and 14 is mux mode */ pinmux = ; }; + i2c6_scl_default: i2c6_scl_default { + /* 0x1e0 is the address of padconfig register of p9.17 and 2 is mux mode */ + pinmux = ; + }; + i2c6_sda_default: i2c6_sda_default { + /* 0x1dc is the address of padconfig register of p9.18 and 2 is mux mode */ + pinmux = ; + }; }; diff --git a/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.dts b/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.dts index 8c4c8f0e8e4..804abfd9566 100644 --- a/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.dts +++ b/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.dts @@ -45,6 +45,12 @@ }; }; +&i2c6 { + status = "okay"; + pinctrl-0 = <&i2c6_scl_default &i2c6_sda_default>; + pinctrl-names = "default"; +}; + &uart2 { status = "okay"; pinctrl-0 = <&uart2_tx_default &uart2_rx_default>; diff --git a/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.yaml b/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.yaml index 0adaeddf82f..1bc51599e77 100644 --- a/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.yaml +++ b/boards/beagle/beaglebone_ai64/beaglebone_ai64_j721e_main_r5f0_0.yaml @@ -11,7 +11,7 @@ ram: 32 toolchain: - zephyr - gnuarmemb - - xtools supported: - uart + - i2c vendor: beagle diff --git a/boards/beagle/beaglebone_ai64/doc/index.rst b/boards/beagle/beaglebone_ai64/doc/index.rst index d54775011db..3e62a1ad54a 100644 --- a/boards/beagle/beaglebone_ai64/doc/index.rst +++ b/boards/beagle/beaglebone_ai64/doc/index.rst @@ -44,9 +44,11 @@ The board configuration supports, +-----------+------------+-----------------------+ | Interface | Controller | Driver/Component | +===========+============+=======================+ -| UART | on-chip | serial port-polling | +| UART | on-chip | serial port-polling, | | | | serial port-interrupt | +-----------+------------+-----------------------+ +| I2C | on-chip | i2c-polling | ++-----------+------------+-----------------------+ Other hardwares features are currently not supported. diff --git a/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.yaml b/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.yaml index cbe7f154814..989f7f8e2f0 100644 --- a/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.yaml +++ b/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.yaml @@ -7,7 +7,6 @@ flash: 704 toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - i2c diff --git a/boards/beagle/beagleconnect_freedom/doc/index.rst b/boards/beagle/beagleconnect_freedom/doc/index.rst index 8bf3bf4e6e6..3fac0a1f08d 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/beagleplay_cc1352p7.yaml b/boards/beagle/beagleplay/beagleplay_cc1352p7.yaml index 816b755471f..8a35e3700ed 100644 --- a/boards/beagle/beagleplay/beagleplay_cc1352p7.yaml +++ b/boards/beagle/beagleplay/beagleplay_cc1352p7.yaml @@ -7,7 +7,6 @@ flash: 704 toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - uart diff --git a/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst b/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst index 24665eafce1..7f38c4589c7 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/beagley_ai/Kconfig.beagley_ai b/boards/beagle/beagley_ai/Kconfig.beagley_ai new file mode 100644 index 00000000000..fb4ca252ea1 --- /dev/null +++ b/boards/beagle/beagley_ai/Kconfig.beagley_ai @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Texas Instruments Incorporated +# Andrew Davis +# +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_BEAGLEY_AI + select SOC_J722S_MAIN_R5F0_0 if BOARD_BEAGLEY_AI_J722S_MAIN_R5F0_0 + select SOC_J722S_MCU_R5F0_0 if BOARD_BEAGLEY_AI_J722S_MCU_R5F0_0 diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0-pinctrl.dtsi b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0-pinctrl.dtsi new file mode 100644 index 00000000000..0ffa8f91073 --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0-pinctrl.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Texas Instruments Incorporated + * Andrew Davis + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + uart1_rx_default: uart1_rx_default { + /* (C27) MCASP0_AFSR.UART1_RXD */ + pinmux = ; + }; + + uart1_tx_default: uart1_tx_default { + /* (F24) MCASP0_ACLKR.UART1_TXD */ + pinmux = ; + }; +}; diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0.dts b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0.dts new file mode 100644 index 00000000000..5bf213b6444 --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0.dts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 Texas Instruments Incorporated + * Andrew Davis + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "beagley_ai_j722s_main_r5f0_0-pinctrl.dtsi" +#include + +/ { + model = "BeagleBoard.org BeagleY-AI"; + compatible = "beagle,beagley-ai"; + + chosen { + zephyr,sram = &atcm; + zephyr,console = &uart1; + }; + + cpus { + cpu@0 { + status = "okay"; + }; + }; + + ddr0: memory@a2000000 { + compatible = "mmio-sram"; + reg = <0xa2000000 DT_SIZE_M(1)>; + }; + + rsc_table: memory@a2100000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0xa2100000 DT_SIZE_M(1)>; + zephyr,memory-region = "RSC_TABLE"; + }; + + ddr1: memory@a2200000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0xa2200000 DT_SIZE_M(14)>; + zephyr,memory-region = "DRAM"; + }; +}; + +&uart1 { + status = "okay"; + pinctrl-0 = <&uart1_tx_default &uart1_rx_default>; + pinctrl-names = "default"; + current-speed = <115200>; +}; + +&systick_timer { + status = "okay"; +}; diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0.yaml b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0.yaml new file mode 100644 index 00000000000..40986711f15 --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0.yaml @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Texas Instruments Incorporated +# Andrew Davis +# +# SPDX-License-Identifier: Apache-2.0 + +identifier: beagley_ai/j722s/main_r5f0_0 +name: BeagleY-AI MAIN domain R5F Core 0 +type: mcu +arch: arm +ram: 32 +toolchain: + - zephyr + - gnuarmemb +supported: + - uart +vendor: beagle diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0_defconfig b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0_defconfig new file mode 100644 index 00000000000..a8cf44f32db --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_main_r5f0_0_defconfig @@ -0,0 +1,15 @@ +# Copyright (c) 2024 Texas Instruments Incorporated +# Andrew Davis +# +# SPDX-License-Identifier: Apache-2.0 + +# Zephyr Kernel Configuration +CONFIG_XIP=n + +# Serial Driver +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0-pinctrl.dtsi b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0-pinctrl.dtsi new file mode 100644 index 00000000000..0ffa8f91073 --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0-pinctrl.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Texas Instruments Incorporated + * Andrew Davis + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + uart1_rx_default: uart1_rx_default { + /* (C27) MCASP0_AFSR.UART1_RXD */ + pinmux = ; + }; + + uart1_tx_default: uart1_tx_default { + /* (F24) MCASP0_ACLKR.UART1_TXD */ + pinmux = ; + }; +}; diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0.dts b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0.dts new file mode 100644 index 00000000000..e2957226a66 --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0.dts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 Texas Instruments Incorporated + * Andrew Davis + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "beagley_ai_j722s_mcu_r5f0_0-pinctrl.dtsi" +#include + +/ { + model = "BeagleBoard.org BeagleY-AI"; + compatible = "beagle,beagley-ai"; + + chosen { + zephyr,sram = &atcm; + zephyr,console = &uart1; + }; + + cpus { + cpu@0 { + status = "okay"; + }; + }; + + ddr0: memory@a1000000 { + compatible = "mmio-sram"; + reg = <0xa1000000 DT_SIZE_M(1)>; + }; + + rsc_table: memory@a1100000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0xa1100000 DT_SIZE_M(1)>; + zephyr,memory-region = "RSC_TABLE"; + }; + + ddr1: memory@a1200000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0xa1200000 DT_SIZE_M(14)>; + zephyr,memory-region = "DRAM"; + }; +}; + +&uart1 { + status = "okay"; + pinctrl-0 = <&uart1_tx_default &uart1_rx_default>; + pinctrl-names = "default"; + current-speed = <115200>; +}; + +&systick_timer { + status = "okay"; +}; diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0.yaml b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0.yaml new file mode 100644 index 00000000000..665814f9d53 --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0.yaml @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Texas Instruments Incorporated +# Andrew Davis +# +# SPDX-License-Identifier: Apache-2.0 + +identifier: beagley_ai/j722s/mcu_r5f0_0 +name: BeagleY-AI MCU domain R5F Core 0 +type: mcu +arch: arm +ram: 32 +toolchain: + - zephyr + - gnuarmemb +supported: + - uart +vendor: beagle diff --git a/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0_defconfig b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0_defconfig new file mode 100644 index 00000000000..a8cf44f32db --- /dev/null +++ b/boards/beagle/beagley_ai/beagley_ai_j722s_mcu_r5f0_0_defconfig @@ -0,0 +1,15 @@ +# Copyright (c) 2024 Texas Instruments Incorporated +# Andrew Davis +# +# SPDX-License-Identifier: Apache-2.0 + +# Zephyr Kernel Configuration +CONFIG_XIP=n + +# Serial Driver +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/beagle/beagley_ai/board.yml b/boards/beagle/beagley_ai/board.yml new file mode 100644 index 00000000000..af83769160e --- /dev/null +++ b/boards/beagle/beagley_ai/board.yml @@ -0,0 +1,6 @@ +board: + name: beagley_ai + full_name: BeagleY-AI + vendor: beagle + socs: + - name: j722s diff --git a/boards/beagle/beagley_ai/doc/assets/beagley_ai.webp b/boards/beagle/beagley_ai/doc/assets/beagley_ai.webp new file mode 100644 index 00000000000..f943829c710 Binary files /dev/null and b/boards/beagle/beagley_ai/doc/assets/beagley_ai.webp differ diff --git a/boards/beagle/beagley_ai/doc/index.rst b/boards/beagle/beagley_ai/doc/index.rst new file mode 100644 index 00000000000..6e1e6ca7e7e --- /dev/null +++ b/boards/beagle/beagley_ai/doc/index.rst @@ -0,0 +1,134 @@ +.. zephyr:board:: beagley_ai + +Overview +******** + +BeagleY-AI is a computational platform powered by TI AM67A (J722S) SoC, which is +targeted for automotive applications. + +Hardware +******** +BeagleY-AI is powered by TI AM67A (J722S) SoC, which has two domains (Main, +MCU). This document gives overview of Zephyr running on both Cortex R5. + +L1 Memory System +---------------- +BeagleY-AI defaults to single-core mode for the R5 subsystem. Changes in that +will impact the L1 memory system configuration. + +* 32KB instruction cache +* 32KB data cache +* 64KB tightly-coupled memory (TCM) + * 32KB TCMA + * 32KB TCMB + +Region Address Translation +-------------------------- +The RAT module performs a region based address translation. It translates a +32-bit input address into a 36-bit output address. Any input transaction that +starts inside of a programmed region will have its address translated, if the +region is enabled. + +VIM Interrupt Controller +------------------------ +The VIM aggregates device interrupts and sends them to the R5F CPU(s). The VIM +module supports 512 interrupt inputs per R5F core. Each interrupt can be either +a level or a pulse (both active-high). The VIM has two interrupt outputs per core +IRQ and FIQ. + +Supported Features +****************** +The board configuration supports a console UART via the HAT header pins. Future +versions will also support a console over RPmsg. + ++-----------+------------+-----------------------+ +| Interface | Controller | Driver/Component | ++===========+============+=======================+ +| UART | on-chip | serial port-polling | +| | | serial port-interrupt | ++-----------+------------+-----------------------+ + +Other hardware features are currently not supported. + +The default configuration can be found in the defconfig file. + +Future configurations will add support for GPIO, I2C, SPI, etc. + +Running Zephyr +************** + +The AM67A does not have a separate flash for the R5 core. Because of this +an A53 core has to load the program for the R5 core to the right memory +address, set the PC and start the processor. +This can be done from Linux on the A53 core via remoteproc. + +This is the memory mapping from A53 to the memory usable by the R5. Note that +the R5 core always sees its local TCMA at address 0x00000000 and its TCMB0 +at address 0x41010000. + +The A53 Linux configuration allocates a region in DDR that is shared with +the R5. The amount of the allocation can be changed in the Linux device tree. +Note that BeagleY-AI has 4GB of DDR. + ++-------------------+---------------+--------------+--------+ +| Region | Addr from A53 | MAIN R5F | Size | ++===================+===============+==============+========+ +| ATCM | 0x0078400000 | 0x0000000000 | 32KB | ++-------------------+---------------+--------------+--------+ +| BTCM | 0x0078500000 | 0x0041010000 | 32KB | ++-------------------+---------------+--------------+--------+ +| DDR Shared Region | 0x00A2000000 | 0x00A2000000 | 16MB | ++-------------------+---------------+--------------+--------+ + ++-------------------+---------------+--------------+--------+ +| Region | Addr from A53 | MCU R5F | Size | ++===================+===============+==============+========+ +| ATCM | 0x0079000000 | 0x0000000000 | 32KB | ++-------------------+---------------+--------------+--------+ +| BTCM | 0x0079020000 | 0x0041010000 | 32KB | ++-------------------+---------------+--------------+--------+ +| DDR Shared Region | 0x00A1000000 | 0x00A1000000 | 16MB | ++-------------------+---------------+--------------+--------+ + +Steps to run the image +---------------------- +Here is an example for the :zephyr:code-sample:`hello_world` application +targeting the MAIN domain Cortex R5F on BeagleY-AI: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: beagley_ai/j722s/main_r5f0_0 + :goals: build + +For the MCU domain Cortex R5F on BeagleY-AI: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: beagley_ai/j722s/mcu_r5f0_0 + :goals: build + +To load the image: + +| Copy Zephyr image to the /lib/firmware/ directory. +| ``cp build/zephyr/zephyr.elf /lib/firmware/`` +| +| Ensure the Core is not running. +| ``echo stop > /dev/remoteproc/am67a-{main,mcu}-r5f0_0/state`` +| +| Configuring the image name to the remoteproc module. +| ``echo zephyr.elf > /dev/remoteproc/am67a-{main,mcu}-r5f0_0/firmware`` +| +| Once the image name is configured, send the start command. +| ``echo start > /dev/remoteproc/am67a-{main,mcu}-r5f0_0/state`` + +Console +------- +The Zephyr on BeagleY-AI Cortex-R5F uses UART 1 (HAT pins 8-TX, 10-RX) +as console. + +References +********** +* `BeagleY-AI Homepage `_ +* `AM67A TRM `_ +* `Pinout guide `_ +* `Documentation `_ diff --git a/boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2 b/boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2 new file mode 100644 index 00000000000..b154f4e2e4e --- /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 00000000000..d1f7b9aff41 --- /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 00000000000..03f54cde3bb --- /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 00000000000..34ecf2d1e00 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 00000000000..ecd9542919c --- /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 00000000000..7f54984345a --- /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 00000000000..6b1c256976b --- /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 00000000000..fc258c2e383 --- /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 00000000000..02a9f623a27 --- /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 00000000000..f7698f24bf3 --- /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 00000000000..f0cff3f9e2d --- /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 00000000000..f907d27024b --- /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 00000000000..898cdfcf29a --- /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 00000000000..3f2cb762859 --- /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 00000000000..4341ee22c8e --- /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 00000000000..00fd5282bd2 --- /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 00000000000..88af7f3d91d --- /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 00000000000..674354645c1 --- /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 00000000000..9499bcaa82e 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 00000000000..a1355669cb2 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 00000000000..8283eb15db6 --- /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 00000000000..da08fb45884 --- /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 00000000000..cd566c1fa1c --- /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 51212bd4c64..0c2c796abd4 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/blues/swan_r5/swan_r5.yaml b/boards/blues/swan_r5/swan_r5.yaml index 5e0efea6540..7f9791b19d2 100644 --- a/boards/blues/swan_r5/swan_r5.yaml +++ b/boards/blues/swan_r5/swan_r5.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - pwm - spi diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/Kconfig.bl604e_iot_dvk b/boards/bouffalolab/bl60x/bl604e_iot_dvk/Kconfig.bl604e_iot_dvk new file mode 100644 index 00000000000..806d0c5ca00 --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/Kconfig.bl604e_iot_dvk @@ -0,0 +1,6 @@ +# Copyright (c) 2022-2025 ATL Electronics +# +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_BL604E_IOT_DVK + select SOC_BL604E20Q2I diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk-pinctrl.dtsi b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk-pinctrl.dtsi new file mode 100644 index 00000000000..f5cce349d3c --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk-pinctrl.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021-2025 ATL Electronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = , + ; + bias-pull-up; + input-schmitt-enable; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + pinmux = , + ; + bias-high-impedance; + }; + }; +}; diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk.dts b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk.dts new file mode 100644 index 00000000000..e81d9cc6b37 --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk.dts @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2022-2025 ATL Electronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "bl604e_iot_dvk-pinctrl.dtsi" + +/ { + model = "BL604E IOT DVK development board"; + compatible = "bflb,bl604"; + + chosen { + zephyr,flash = &flash0; + zephyr,itcm = &itcm; + zephyr,dtcm = &dtcm; + zephyr,sram = &sram0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + }; +}; + +&cpu0 { + clock-frequency = ; +}; + +&spi1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4000b000 0x1000 0x23000000 0xc00000>; + + flash0: flash@0 { + compatible = "issi,is25lp128", "jedec,spi-nor"; + status = "disabled"; + size = ; + jedec-id = [96 60 18]; + reg = <0>; + spi-max-frequency = ; + }; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk.yaml b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk.yaml new file mode 100644 index 00000000000..51b1065ff22 --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2022-2025 ATL Electronics +# +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl604e_iot_dvk +name: BL604E IOT DVK development board +type: mcu +arch: riscv +ram: 64 +toolchain: + - zephyr +testing: + ignore_tags: + - net + - bluetooth +supported: + - pinctrl + - uart +vendor: bflb diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk_defconfig b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk_defconfig new file mode 100644 index 00000000000..2b274c4a841 --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk_defconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2022-2025 ATL Electronics +# +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y + +CONFIG_UART_CONSOLE=y +CONFIG_UART_BFLB=y diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/board.cmake b/boards/bouffalolab/bl60x/bl604e_iot_dvk/board.cmake new file mode 100644 index 00000000000..a8e089640bd --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/board.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2022-2025 ATL Electronics +# +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(openocd --cmd-pre-init "source [find bl60x.cfg]") + +board_runner_args(openocd --use-elf --no-load --no-init) +board_runner_args(openocd --gdb-init "set mem inaccessible-by-default off") +board_runner_args(openocd --gdb-init "set architecture riscv:rv32") +board_runner_args(openocd --gdb-init "set remotetimeout 250") +board_runner_args(openocd --gdb-init "set print asm-demangle on") +board_runner_args(openocd --gdb-init "set backtrace limit 32") +board_runner_args(openocd --gdb-init "mem 0x22008000 0x22014000 rw") +board_runner_args(openocd --gdb-init "mem 0x42008000 0x42014000 rw") +board_runner_args(openocd --gdb-init "mem 0x22014000 0x22020000 rw") +board_runner_args(openocd --gdb-init "mem 0x42014000 0x42020000 rw") +board_runner_args(openocd --gdb-init "mem 0x22020000 0x2203C000 rw") +board_runner_args(openocd --gdb-init "mem 0x42020000 0x4203C000 rw") +board_runner_args(openocd --gdb-init "mem 0x23000000 0x23400000 ro") +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/board.yml b/boards/bouffalolab/bl60x/bl604e_iot_dvk/board.yml new file mode 100644 index 00000000000..843d38b0e8a --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/board.yml @@ -0,0 +1,6 @@ +board: + name: bl604e_iot_dvk + full_name: BL604E IOT DVK development board + vendor: bflb + socs: + - name: bl604e20q2i diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/doc/img/bl_604e.webp b/boards/bouffalolab/bl60x/bl604e_iot_dvk/doc/img/bl_604e.webp new file mode 100644 index 00000000000..a4e60232feb Binary files /dev/null and b/boards/bouffalolab/bl60x/bl604e_iot_dvk/doc/img/bl_604e.webp differ diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/doc/index.rst b/boards/bouffalolab/bl60x/bl604e_iot_dvk/doc/index.rst new file mode 100644 index 00000000000..76522129e41 --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/doc/index.rst @@ -0,0 +1,104 @@ +.. zephyr:board:: bl604e_iot_dvk + +Overview +******** + +BL602/BL604 is a Wi-Fi+BLE chipset introduced by Bouffalo Lab, which is used +for low power consumption and high performance application development. The +wireless subsystem includes 2.4G radio, Wi-Fi 802.11b/g/n and BLE 5.0 +baseband/MAC design. The microcontroller subsystem includes a 32-bit RISC CPU +with low power consumption, cache and memory. The power management unit +controls the low power consumption mode. In addition, it also supports +various security features. The external interfaces include SDIO, SPI, UART, +I2C, IR remote, PWM, ADC, DAC, PIR and GPIO. + +The BL602 Development Board features a SiFive E24 32 bit RISC-V CPU with FPU, +it supports High Frequency clock up to 192Mhz, have 128k ROM, 276kB RAM, +2.4 GHz WIFI 1T1R mode, support 20 MHz, data rate up to 72.2 Mbps, BLE 5.0 +with 2MB phy. It is a secure MCU which supports Secure boot, ECC-256 signed +image, QSPI/SPI Flash On-The-Fly AES Decryption and PKA (Public Key +Accelerator). + +Hardware +******** + +For more information about the Bouffalo Lab BL-60x MCU: + +- `Bouffalo Lab BL60x MCU Website`_ +- `Bouffalo Lab BL60x MCU Datasheet`_ +- `Bouffalo Lab Development Zone`_ +- `The RISC-V BL602 Book`_ + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +The default configuration can be found in the Kconfig +:zephyr_file:`boards/bouffalolab/bl60x/bl604e_iot_dvk/bl604e_iot_dvk_defconfig`. + +System Clock +============ + +The BL604E Development Board is configured to run at max speed (192MHz). + +Serial Port +=========== + +The ``bl604e_iot_dvk`` board uses UART0 as default serial port. It is connected +to USB Serial converter and port is used for both program and console. + + +Programming and Debugging +************************* + +Samples +======= + +#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample +application: + + .. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: bl604e_iot_dvk + :goals: build flash + +#. Run your favorite terminal program to listen for output. Under Linux the + terminal should be :code:`/dev/ttyACM0`. For example: + + .. code-block:: console + + $ minicom -D /dev/ttyACM0 -o + + The -o option tells minicom not to send the modem initialization + string. Connection should be configured as follows: + + - Speed: 115200 + - Data: 8 bits + - Parity: None + - Stop bits: 1 + + Then, press and release RST button + + .. code-block:: console + + *** Booting Zephyr OS build v4.1.0 *** + Hello World! bl604e_iot_dvk/bl604e20q2i + +Congratulations, you have ``bl604e_iot_dvk`` configured and running Zephyr. + + +.. _Bouffalo Lab BL60x MCU Website: + https://en.bouffalolab.com/product/?type=detail&id=6 + +.. _Bouffalo Lab BL60x MCU Datasheet: + https://github.com/bouffalolab/bl_docs/tree/main/BL602_DS/en + +.. _Bouffalo Lab Development Zone: + https://dev.bouffalolab.com/home?id=guest + +.. _The RISC-V BL602 Book: + https://lupyuen.github.io/articles/book + +.. _Flashing Firmware to BL602: + https://lupyuen.github.io/articles/book#flashing-firmware-to-bl602 diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/support/bl60x.cfg b/boards/bouffalolab/bl60x/bl604e_iot_dvk/support/bl60x.cfg new file mode 100644 index 00000000000..fcabb2c4e7c --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/support/bl60x.cfg @@ -0,0 +1,79 @@ +# Copyright (c) 2022-2025 ATL Electronics +# +# SPDX-License-Identifier: Apache-2.0 + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME riscv +} + +if { [info exists WORKAREASIZE] } { + set _WORKAREASIZE $WORKAREASIZE +} else { + set _WORKAREASIZE 0x10000 +} + +if { [info exists WORKAREAADDR] } { + set _WORKAREAADDR $WORKAREAADDR +} else { + set _WORKAREAADDR 0x22020000 +} + +if { [info exists CPUTAPID] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x20000c05 +} + +transport select jtag +jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id $_CPUTAPID + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME + +$_TARGETNAME.0 configure -work-area-phys $_WORKAREAADDR -work-area-size $_WORKAREASIZE -work-area-backup 1 + +echo "Ready for Remote Connections" + +$_TARGETNAME.0 configure -event reset-assert-pre { + echo "reset-assert-pre" + adapter speed 100 +} + +$_TARGETNAME.0 configure -event reset-deassert-post { + echo "reset-deassert-post" + + adapter speed 100 + + reg mstatus 0x7800 + reg mie 0x0 +# reg pc 0x23000000 +} + +$_TARGETNAME.0 configure -event reset-init { + echo "reset-init" + + adapter speed 3000 +} + +$_TARGETNAME.0 configure -event gdb-attach { + echo "Debugger attaching: halting execution" + reset halt + gdb_breakpoint_override hard +} + +$_TARGETNAME.0 configure -event gdb-detach { + echo "Debugger detaching: resuming execution" + resume +} + +gdb_memory_map enable +gdb_flash_program enable + +# 'progbuf', 'sysbus' or 'abstract' +riscv set_mem_access sysbus +riscv set_command_timeout_sec 1 + +init +reset init diff --git a/boards/bouffalolab/bl60x/bl604e_iot_dvk/support/openocd.cfg b/boards/bouffalolab/bl60x/bl604e_iot_dvk/support/openocd.cfg new file mode 100644 index 00000000000..ffd60cfb196 --- /dev/null +++ b/boards/bouffalolab/bl60x/bl604e_iot_dvk/support/openocd.cfg @@ -0,0 +1,19 @@ +# OpenOCD Script for PineCone connected via Sipeed JTAG Debugger (FTDI FT2232D) +# Ref: bl_iot_sdk/tools/debug/if_bflb_link.cfg +# source [find interface/if_bflb_link.cfg] + +# Uncomment to enable debug messages +# debug_level 4 + +# BouffaloLab USB-JTAG/TTL adapter +# Or Sipeed JTAG Debugger based on FTDI FT2232D + +adapter driver ftdi +ftdi vid_pid 0x0403 0x6010 + +# Sipeed JTAG Debugger uses FTDI Channel 0, not 1 +ftdi channel 0 +# ftdi_channel 1 + +ftdi layout_init 0x00f8 0x00fb +adapter speed 4000 diff --git a/boards/bouffalolab/index.rst b/boards/bouffalolab/index.rst new file mode 100644 index 00000000000..f0380b6b45c --- /dev/null +++ b/boards/bouffalolab/index.rst @@ -0,0 +1,10 @@ +.. _boards-bouffalolab: + +Bouffalo Lab Intelligent Technology (Nanjing) Co., Ltd. +####################################################### + +.. toctree:: + :maxdepth: 1 + :glob: + + **/* diff --git a/boards/bytesatwork/bytesensi_l/bytesensi_l.dts b/boards/bytesatwork/bytesensi_l/bytesensi_l.dts index 2054d6bd2e2..b3be00fc171 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 d1b220a778b..35e402497ed 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/circuitdojo_feather_nrf9160.yaml b/boards/circuitdojo/feather/circuitdojo_feather_nrf9160.yaml index ee93576b4af..c3f8f1634d4 100644 --- a/boards/circuitdojo/feather/circuitdojo_feather_nrf9160.yaml +++ b/boards/circuitdojo/feather/circuitdojo_feather_nrf9160.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 64 flash: 256 diff --git a/boards/circuitdojo/feather/circuitdojo_feather_nrf9160_ns.yaml b/boards/circuitdojo/feather/circuitdojo_feather_nrf9160_ns.yaml index 582e28dbfc9..85c4c60194f 100644 --- a/boards/circuitdojo/feather/circuitdojo_feather_nrf9160_ns.yaml +++ b/boards/circuitdojo/feather/circuitdojo_feather_nrf9160_ns.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/common/esp32.board.cmake b/boards/common/esp32.board.cmake index cfe7b7683fc..4669c2e620b 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 new file mode 100644 index 00000000000..c231f5ad1cf --- /dev/null +++ b/boards/common/openocd-adi-max32.boards.cmake @@ -0,0 +1,26 @@ +# +# Copyright (c) 2025 Analog Devices, Inc +# +# SPDX-License-Identifier: Apache-2.0 + +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() + +# MAX32666 share the same target configuration file with MAX32665 +if(CONFIG_SOC_MAX32666) + set(MAX32_TARGET_CFG "max32665.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") + board_runner_args(openocd "--cmd-erase=max32xxx mass_erase 0") +endif() diff --git a/boards/common/openocd-stm32.board.cmake b/boards/common/openocd-stm32.board.cmake new file mode 100644 index 00000000000..855411fa34b --- /dev/null +++ b/boards/common/openocd-stm32.board.cmake @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_SOC_SERIES_STM32L0X OR CONFIG_SOC_SERIES_STM32L1X) + board_runner_args(openocd "--cmd-erase=stm32l1x mass_erase 0") +elseif(CONFIG_SOC_SERIES_STM32L4X OR + CONFIG_SOC_SERIES_STM32L5X OR + CONFIG_SOC_SERIES_STM32U5X OR + CONFIG_SOC_SERIES_STM32WBX OR + CONFIG_SOC_SERIES_STM32G0X OR + CONFIG_SOC_SERIES_STM32G4X) + board_runner_args(openocd "--cmd-erase=stm32l4x mass_erase 0") +elseif(CONFIG_SOC_SERIES_STM32F0X OR + CONFIG_SOC_SERIES_STM32F1X OR + CONFIG_SOC_SERIES_STM32F3X) + board_runner_args(openocd "--cmd-erase=stm32f1x mass_erase 0") +elseif(CONFIG_SOC_SERIES_STM32F2X OR + CONFIG_SOC_SERIES_STM32F4X OR + CONFIG_SOC_SERIES_STM32F7X) + board_runner_args(openocd "--cmd-erase=stm32f2x mass_erase 0") +endif() diff --git a/boards/common/openocd.board.cmake b/boards/common/openocd.board.cmake index 14d32d4be25..b1d09fe0a2d 100644 --- a/boards/common/openocd.board.cmake +++ b/boards/common/openocd.board.cmake @@ -20,3 +20,6 @@ board_finalize_runner_args(openocd --cmd-load "${OPENOCD_CMD_LOAD_DEFAULT}" --cmd-verify "${OPENOCD_CMD_VERIFY_DEFAULT}" ) + +# Manufacturer common options +include(${CMAKE_CURRENT_LIST_DIR}/openocd-stm32.board.cmake) diff --git a/boards/common/rfp.board.cmake b/boards/common/rfp.board.cmake new file mode 100644 index 00000000000..afce0c8019c --- /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/contextualelectronics_abc.yaml b/boards/contextualelectronics/abc/contextualelectronics_abc.yaml index f96fa8c29bf..57f5b4f49bb 100644 --- a/boards/contextualelectronics/abc/contextualelectronics_abc.yaml +++ b/boards/contextualelectronics/abc/contextualelectronics_abc.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - arduino_i2c - arduino_spi diff --git a/boards/contextualelectronics/abc/doc/index.rst b/boards/contextualelectronics/abc/doc/index.rst index d7f12bc4738..02ddb9689e5 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/croxel_cx1825_nrf52840.yaml b/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.yaml index bc550fd4cc4..3eef0741d5a 100644 --- a/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.yaml +++ b/boards/croxel/croxel_cx1825/croxel_cx1825_nrf52840.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - ble - counter diff --git a/boards/croxel/croxel_cx1825/doc/index.rst b/boards/croxel/croxel_cx1825/doc/index.rst index ab88c4dd432..cee944d5f97 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/ctcc_nrf52840.yaml b/boards/ct/ctcc/ctcc_nrf52840.yaml index 3f4099b5b87..332273c3a42 100644 --- a/boards/ct/ctcc/ctcc_nrf52840.yaml +++ b/boards/ct/ctcc/ctcc_nrf52840.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - ble - gpio diff --git a/boards/ct/ctcc/ctcc_nrf9161-pinctrl.dtsi b/boards/ct/ctcc/ctcc_nrf9161-pinctrl.dtsi index c48b2987b85..10eece2fd56 100644 --- a/boards/ct/ctcc/ctcc_nrf9161-pinctrl.dtsi +++ b/boards/ct/ctcc/ctcc_nrf9161-pinctrl.dtsi @@ -25,28 +25,6 @@ }; }; - uart1_default: uart1_default { - group1 { - psels = , - ; - }; - group2 { - psels = , - ; - bias-pull-up; - }; - }; - - uart1_sleep: uart1_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; - spi3_default: spi3_default { group1 { psels = , diff --git a/boards/ct/ctcc/ctcc_nrf9161.yaml b/boards/ct/ctcc/ctcc_nrf9161.yaml index 8cc32c4068a..3c3a63796e1 100644 --- a/boards/ct/ctcc/ctcc_nrf9161.yaml +++ b/boards/ct/ctcc/ctcc_nrf9161.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 88 flash: 1024 supported: diff --git a/boards/ct/ctcc/ctcc_nrf9161_common.dtsi b/boards/ct/ctcc/ctcc_nrf9161_common.dtsi index 92a2a757c55..00e53a5262c 100644 --- a/boards/ct/ctcc/ctcc_nrf9161_common.dtsi +++ b/boards/ct/ctcc/ctcc_nrf9161_common.dtsi @@ -39,10 +39,6 @@ }; }; -&adc { - status = "okay"; -}; - &gpiote { status = "okay"; }; @@ -59,14 +55,6 @@ pinctrl-names = "default", "sleep"; }; -&uart1 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart1_default>; - pinctrl-1 = <&uart1_sleep>; - pinctrl-names = "default", "sleep"; -}; - &spi3 { compatible = "nordic,nrf-spim"; status = "okay"; diff --git a/boards/ct/ctcc/ctcc_nrf9161_ns.yaml b/boards/ct/ctcc/ctcc_nrf9161_ns.yaml index 67a17c77209..1017ca1989b 100644 --- a/boards/ct/ctcc/ctcc_nrf9161_ns.yaml +++ b/boards/ct/ctcc/ctcc_nrf9161_ns.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 128 flash: 192 supported: diff --git a/boards/ct/ctcc/doc/index.rst b/boards/ct/ctcc/doc/index.rst index 97780246a74..5a890893c23 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/cy8ckit_062_ble_cy8c6347_m0_0_0_0.yaml b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_0_0_0.yaml index 0ef2e8ae823..562a016589c 100644 --- a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_0_0_0.yaml +++ b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_0_0_0.yaml @@ -14,7 +14,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - arduino_gpio - arduino_spi diff --git a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_1_0_0.yaml b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_1_0_0.yaml index 032fc65cdf3..c4284bd0ef8 100644 --- a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_1_0_0.yaml +++ b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_1_0_0.yaml @@ -14,7 +14,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - arduino_gpio - arduino_spi diff --git a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_defconfig b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_defconfig index fefeed4980f..16e024e3bca 100644 --- a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_defconfig +++ b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m0_defconfig @@ -7,7 +7,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -CONFIG_BUILD_OUTPUT_HEX=y # UART driver CONFIG_SERIAL=y diff --git a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_0_0_0.yaml b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_0_0_0.yaml index 1ca0aaa3a11..ba6b4bbc74d 100644 --- a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_0_0_0.yaml +++ b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_0_0_0.yaml @@ -14,7 +14,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - arduino_gpio - gpio diff --git a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_1_0_0.yaml b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_1_0_0.yaml index cdfb09a6942..44697309a42 100644 --- a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_1_0_0.yaml +++ b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_1_0_0.yaml @@ -14,7 +14,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - arduino_gpio - gpio diff --git a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_defconfig b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_defconfig index fefeed4980f..16e024e3bca 100644 --- a/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_defconfig +++ b/boards/cypress/cy8ckit_062_ble/cy8ckit_062_ble_cy8c6347_m4_defconfig @@ -7,7 +7,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -CONFIG_BUILD_OUTPUT_HEX=y # UART driver CONFIG_SERIAL=y diff --git a/boards/cypress/cy8ckit_062_ble/doc/index.rst b/boards/cypress/cy8ckit_062_ble/doc/index.rst index 01ad4696ea2..8a5090a5ed4 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/cy8ckit_062_wifi_bt_cy8c6247_m0.yaml b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m0.yaml index 4135437c52a..12d1dca31d5 100644 --- a/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m0.yaml +++ b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m0.yaml @@ -13,7 +13,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio vendor: cypress diff --git a/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m0_defconfig b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m0_defconfig index fd9d1d319ab..d9ff32f44cc 100644 --- a/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m0_defconfig +++ b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m0_defconfig @@ -6,7 +6,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -CONFIG_BUILD_OUTPUT_HEX=y # UART driver CONFIG_SERIAL=y diff --git a/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4.yaml b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4.yaml index e861d197140..2a5b4a1f788 100644 --- a/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4.yaml +++ b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4.yaml @@ -13,7 +13,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio vendor: cypress diff --git a/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4_defconfig b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4_defconfig index fd9d1d319ab..d9ff32f44cc 100644 --- a/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4_defconfig +++ b/boards/cypress/cy8ckit_062_wifi_bt/cy8ckit_062_wifi_bt_cy8c6247_m4_defconfig @@ -6,7 +6,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y -CONFIG_BUILD_OUTPUT_HEX=y # UART driver CONFIG_SERIAL=y diff --git a/boards/cypress/cy8ckit_062_wifi_bt/doc/index.rst b/boards/cypress/cy8ckit_062_wifi_bt/doc/index.rst index a0ad601ad63..dc201ecc7a7 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 78a960ec2e4..1dd7b14a629 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/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m1.yaml b/boards/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m1.yaml index 565ddbffdb8..aaf3326b4a4 100644 --- a/boards/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m1.yaml +++ b/boards/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m1.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 32 flash: 64 supported: diff --git a/boards/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m3.yaml b/boards/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m3.yaml index 416365ff291..c4334d658f5 100644 --- a/boards/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m3.yaml +++ b/boards/digilent/arty_a7/arty_a7_designstart_fpga_cortex_m3.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 32 flash: 32 supported: diff --git a/boards/digilent/zybo/zybo.yaml b/boards/digilent/zybo/zybo.yaml index 573fb74f666..8f4e5f5b94a 100644 --- a/boards/digilent/zybo/zybo.yaml +++ b/boards/digilent/zybo/zybo.yaml @@ -8,7 +8,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 524288 supported: - gpio diff --git a/boards/dptechnics/walter/doc/index.rst b/boards/dptechnics/walter/doc/index.rst index c77e266f52b..eb5dc5e3d50 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_appcpu_defconfig b/boards/dptechnics/walter/walter_esp32s3_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/dptechnics/walter/walter_esp32s3_appcpu_defconfig +++ b/boards/dptechnics/walter/walter_esp32s3_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/dptechnics/walter/walter_esp32s3_procpu.dts b/boards/dptechnics/walter/walter_esp32s3_procpu.dts index 8d864885e0f..0568d597960 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/dptechnics/walter/walter_esp32s3_procpu_defconfig b/boards/dptechnics/walter/walter_esp32s3_procpu_defconfig index 59f3df7a866..36749d64448 100644 --- a/boards/dptechnics/walter/walter_esp32s3_procpu_defconfig +++ b/boards/dptechnics/walter/walter_esp32s3_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/dragino/lsn50/doc/index.rst b/boards/dragino/lsn50/doc/index.rst index 999c809a90f..d5981b51817 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/lsn50/dragino_lsn50.yaml b/boards/dragino/lsn50/dragino_lsn50.yaml index 52418c949a4..cc4c19c5958 100644 --- a/boards/dragino/lsn50/dragino_lsn50.yaml +++ b/boards/dragino/lsn50/dragino_lsn50.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 20 flash: 192 testing: diff --git a/boards/dragino/nbsn95/doc/index.rst b/boards/dragino/nbsn95/doc/index.rst index c18bb7eee40..c99e6c87bdc 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/dragino/nbsn95/dragino_nbsn95.yaml b/boards/dragino/nbsn95/dragino_nbsn95.yaml index f614987d58d..3128e7d2a04 100644 --- a/boards/dragino/nbsn95/dragino_nbsn95.yaml +++ b/boards/dragino/nbsn95/dragino_nbsn95.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 20 flash: 192 testing: diff --git a/boards/ebyte/e73_tbb/doc/index.rst b/boards/ebyte/e73_tbb/doc/index.rst index 5d1327e322c..68bd2608dc9 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/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.yaml b/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.yaml index 9311e76cff1..67853fd073d 100644 --- a/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.yaml +++ b/boards/ebyte/e73_tbb/ebyte_e73_tbb_nrf52832.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 64 flash: 512 supported: diff --git a/boards/electronut/nrf52840_blip/doc/index.rst b/boards/electronut/nrf52840_blip/doc/index.rst index 03dfff0bf56..376412e4d40 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_blip/nrf52840_blip.yaml b/boards/electronut/nrf52840_blip/nrf52840_blip.yaml index 694c2c251b8..975f1b831ed 100644 --- a/boards/electronut/nrf52840_blip/nrf52840_blip.yaml +++ b/boards/electronut/nrf52840_blip/nrf52840_blip.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - i2c diff --git a/boards/electronut/nrf52840_papyr/doc/nrf52840_papyr.rst b/boards/electronut/nrf52840_papyr/doc/nrf52840_papyr.rst index 391175eebc2..f674496b021 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/electronut/nrf52840_papyr/nrf52840_papyr.yaml b/boards/electronut/nrf52840_papyr/nrf52840_papyr.yaml index 446c5205f96..1c743016802 100644 --- a/boards/electronut/nrf52840_papyr/nrf52840_papyr.yaml +++ b/boards/electronut/nrf52840_papyr/nrf52840_papyr.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/element14/warp7/doc/index.rst b/boards/element14/warp7/doc/index.rst index d0940f5271a..016681c30ab 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/element14/warp7/warp7_mcimx7d_m4.yaml b/boards/element14/warp7/warp7_mcimx7d_m4.yaml index 96a7e7fbca8..24bcdb296fb 100644 --- a/boards/element14/warp7/warp7_mcimx7d_m4.yaml +++ b/boards/element14/warp7/warp7_mcimx7d_m4.yaml @@ -13,7 +13,6 @@ flash: 32 toolchain: - zephyr - gnuarmemb - - xtools testing: ignore_tags: - net diff --git a/boards/enclustra/mercury_xu/mercury_xu.dts b/boards/enclustra/mercury_xu/mercury_xu.dts index df51ab470c5..c0abbec19a3 100644 --- a/boards/enclustra/mercury_xu/mercury_xu.dts +++ b/boards/enclustra/mercury_xu/mercury_xu.dts @@ -10,7 +10,7 @@ / { model = "Mercury XU"; - compatible = "xlnx,zynqmp"; + compatible = "enclustra,mercury_xu"; chosen { zephyr,console = &uart0; diff --git a/boards/enclustra/mercury_xu/mercury_xu.yaml b/boards/enclustra/mercury_xu/mercury_xu.yaml index df01c2b112a..f2cc537a06c 100644 --- a/boards/enclustra/mercury_xu/mercury_xu.yaml +++ b/boards/enclustra/mercury_xu/mercury_xu.yaml @@ -6,4 +6,4 @@ arch: arm toolchain: - zephyr - gnuarmemb -vendor: xlnx +vendor: enclustra diff --git a/boards/ene/kb1200_evb/doc/index.rst b/boards/ene/kb1200_evb/doc/index.rst index 6558b8dad54..2bd60859af7 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/ene/kb1200_evb/kb1200_evb.yaml b/boards/ene/kb1200_evb/kb1200_evb.yaml index efa85b9c830..e381e7c6c6a 100644 --- a/boards/ene/kb1200_evb/kb1200_evb.yaml +++ b/boards/ene/kb1200_evb/kb1200_evb.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - uart diff --git a/boards/enjoydigital/litex_vexriscv/doc/index.rst b/boards/enjoydigital/litex_vexriscv/doc/index.rst index f9764907eb4..bd47c381a73 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 19f56f8b289..cb308261903 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 228660a603a..9b5bc1c6baf 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 b1f03780559..1089af3047e 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 783a8f2a7f7..e9d5e2855ab 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 7bc3c8feb55..c3e9af32006 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_wroom/esp32_devkitc_wroom_procpu_defconfig b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu_defconfig index 3be2d9e39d5..172a46d1005 100644 --- a/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu_defconfig +++ b/boards/espressif/esp32_devkitc_wroom/esp32_devkitc_wroom_procpu_defconfig @@ -1,8 +1,6 @@ # Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32_devkitc_wrover/doc/index.rst b/boards/espressif/esp32_devkitc_wrover/doc/index.rst index cf1fb64f32f..5bab845c938 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 f4f51cce98a..dbfd9d07b80 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_appcpu_defconfig b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_appcpu_defconfig +++ b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 33f0f3f134b..c91a7178113 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 62e40f71e93..32de7a52bd3 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_devkitc_wrover/esp32_devkitc_wrover_procpu_defconfig b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu_defconfig index 3be2d9e39d5..172a46d1005 100644 --- a/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu_defconfig +++ b/boards/espressif/esp32_devkitc_wrover/esp32_devkitc_wrover_procpu_defconfig @@ -1,8 +1,6 @@ # Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32_ethernet_kit/doc/index.rst b/boards/espressif/esp32_ethernet_kit/doc/index.rst index 7233284d314..22a942989fd 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 3e30654db8b..1b6bd6b701c 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_appcpu_defconfig b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_appcpu_defconfig +++ b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 91446897fc4..bf2fbbd6d3a 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 */ @@ -7,7 +7,7 @@ #include #include "esp32_ethernet_kit-pinctrl.dtsi" -#include +#include / { model = "Espressif ESP32-Ethernet-Kit PROCPU"; @@ -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 fb3c3cdd704..f6fd5a5f410 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/esp32_ethernet_kit/esp32_ethernet_kit_procpu_defconfig b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu_defconfig index f029cac9e9e..e192c240251 100644 --- a/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu_defconfig +++ b/boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32c3_devkitc/doc/index.rst b/boards/espressif/esp32c3_devkitc/doc/index.rst index a57d0be2623..eae08a6b8fc 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 86326fcc077..ec61f303a6c 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_devkitc/esp32c3_devkitc_defconfig b/boards/espressif/esp32c3_devkitc/esp32c3_devkitc_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/espressif/esp32c3_devkitc/esp32c3_devkitc_defconfig +++ b/boards/espressif/esp32c3_devkitc/esp32c3_devkitc_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32c3_devkitm/doc/index.rst b/boards/espressif/esp32c3_devkitm/doc/index.rst index 24eb23bc7b8..d4fcb4e1713 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 25bd583daee..2e1b41edfc1 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_devkitm/esp32c3_devkitm_defconfig b/boards/espressif/esp32c3_devkitm/esp32c3_devkitm_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/espressif/esp32c3_devkitm/esp32c3_devkitm_defconfig +++ b/boards/espressif/esp32c3_devkitm/esp32c3_devkitm_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32c3_rust/doc/index.rst b/boards/espressif/esp32c3_rust/doc/index.rst index a6f41a01866..144b6948b85 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 867fa84adcf..9c931e91f57 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/esp32c3_rust/esp32c3_rust_defconfig b/boards/espressif/esp32c3_rust/esp32c3_rust_defconfig index a0483fa8a08..147089fe70e 100644 --- a/boards/espressif/esp32c3_rust/esp32c3_rust_defconfig +++ b/boards/espressif/esp32c3_rust/esp32c3_rust_defconfig @@ -1,8 +1,6 @@ # Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32c6_devkitc/Kconfig b/boards/espressif/esp32c6_devkitc/Kconfig index c6a99b1032d..e24ba970a9b 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 4bd1fce4efc..9b30251fea4 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 ecbc4573360..ee0f04afaa7 100644 --- a/boards/espressif/esp32c6_devkitc/doc/index.rst +++ b/boards/espressif/esp32c6_devkitc/doc/index.rst @@ -84,41 +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 | -+------------+------------+-------------------------------------+ -| Wi-Fi | on-chip | | -+------------+------------+-------------------------------------+ +.. zephyr:board-supported-hw:: System requirements ******************* @@ -140,6 +106,8 @@ below to retrieve those files. Building & Flashing ******************* +.. zephyr:board-supported-runners:: + Simple boot =========== @@ -181,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: @@ -230,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 @@ -239,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: @@ -254,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 ********* @@ -271,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= @@ -279,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 896ae30530c..00000000000 --- 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 f36685e8367..00000000000 --- a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -identifier: esp32c6_devkitc -name: ESP32-C6 -vendor: espressif -type: mcu -arch: riscv -toolchain: - - zephyr -supported: - - gpio - - watchdog - - uart - - dma - - pwm - - spi - - counter - - entropy - - i2c diff --git a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_defconfig b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_defconfig deleted file mode 100644 index 6539bd42e59..00000000000 --- a/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_defconfig +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_CONSOLE=y -CONFIG_SERIAL=y -CONFIG_UART_CONSOLE=y -CONFIG_GPIO=y 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 00000000000..ef8dbea59b3 --- /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 00000000000..6eed11176b0 --- /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_hpcore_defconfig b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore_defconfig new file mode 100644 index 00000000000..187793c76e8 --- /dev/null +++ b/boards/espressif/esp32c6_devkitc/esp32c6_devkitc_hpcore_defconfig @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y 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 00000000000..739781e692b --- /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 00000000000..49e25bcdba0 --- /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 00000000000..42ee26028f9 --- /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 e5cb0ff6191..63bf3eca409 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 756aaf9b5b7..434260d9486 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 9038cea4a1e..337a63b6b56 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 */ @@ -23,7 +23,7 @@ }; chosen { - zephyr,sram = &sram0; + zephyr,sram = &sram1; zephyr,console = &uart0; zephyr,shell-uart = &uart0; zephyr,flash = &flash0; @@ -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 44a6f971e3b..b3598a28d9c 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_devkitc/esp32s2_devkitc_defconfig b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc_defconfig index f029cac9e9e..e192c240251 100644 --- a/boards/espressif/esp32s2_devkitc/esp32s2_devkitc_defconfig +++ b/boards/espressif/esp32s2_devkitc/esp32s2_devkitc_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32s2_saola/doc/index.rst b/boards/espressif/esp32s2_saola/doc/index.rst index a2ad776acfe..d86a986b5e6 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 7ab4fc67119..5b402c838cf 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 c97108951ab..23249ceb3f6 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 */ @@ -23,7 +23,7 @@ }; chosen { - zephyr,sram = &sram0; + zephyr,sram = &sram1; zephyr,console = &uart0; zephyr,shell-uart = &uart0; zephyr,flash = &flash0; @@ -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 bebe2a293a8..e8a37ffd2ed 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/esp32s2_saola/esp32s2_saola_defconfig b/boards/espressif/esp32s2_saola/esp32s2_saola_defconfig index 5476839e2ba..e192c240251 100644 --- a/boards/espressif/esp32s2_saola/esp32s2_saola_defconfig +++ b/boards/espressif/esp32s2_saola/esp32s2_saola_defconfig @@ -1,8 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 - -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32s3_devkitc/doc/index.rst b/boards/espressif/esp32s3_devkitc/doc/index.rst index 008b64fecae..4d5b07797a2 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_appcpu_defconfig b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_appcpu_defconfig +++ b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu.dts index 48806ab5a4c..a7dec600f43 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_devkitc/esp32s3_devkitc_procpu_defconfig b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu_defconfig index d789bab1824..d8fbaa87925 100644 --- a/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu_defconfig +++ b/boards/espressif/esp32s3_devkitc/esp32s3_devkitc_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32s3_devkitm/doc/index.rst b/boards/espressif/esp32s3_devkitm/doc/index.rst index ada774ec2a1..044a3a6a660 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_appcpu_defconfig b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_appcpu_defconfig deleted file mode 100644 index 1ac2b1c55c9..00000000000 --- a/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_appcpu_defconfig +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_MAIN_STACK_SIZE=4096 diff --git a/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu.dts index 89c5b8c1641..c468871e25e 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_devkitm/esp32s3_devkitm_procpu_defconfig b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu_defconfig index 92308aa841b..d8fbaa87925 100644 --- a/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu_defconfig +++ b/boards/espressif/esp32s3_devkitm/esp32s3_devkitm_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=4096 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp32s3_eye/doc/index.rst b/boards/espressif/esp32s3_eye/doc/index.rst index 662c4e51998..e7b7643cbba 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_appcpu_defconfig b/boards/espressif/esp32s3_eye/esp32s3_eye_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/espressif/esp32s3_eye/esp32s3_eye_appcpu_defconfig +++ b/boards/espressif/esp32s3_eye/esp32s3_eye_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu.dts index 1b2afa8b83a..7391ad2357e 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/esp32s3_eye/esp32s3_eye_procpu_defconfig b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu_defconfig index 6c24dead95b..32d7051fab4 100644 --- a/boards/espressif/esp32s3_eye/esp32s3_eye_procpu_defconfig +++ b/boards/espressif/esp32s3_eye/esp32s3_eye_procpu_defconfig @@ -1,6 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=4096 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp8684_devkitm/doc/index.rst b/boards/espressif/esp8684_devkitm/doc/index.rst index 1b20435c586..c5e00b5b5b4 100644 --- a/boards/espressif/esp8684_devkitm/doc/index.rst +++ b/boards/espressif/esp8684_devkitm/doc/index.rst @@ -46,31 +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 | -+------------+------------+-------------------------------------+ -| 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`_. @@ -94,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 a6a76ac4756..8081d955c8f 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/esp8684_devkitm/esp8684_devkitm.yaml b/boards/espressif/esp8684_devkitm/esp8684_devkitm.yaml index 3344e8d5e2c..870622d948c 100644 --- a/boards/espressif/esp8684_devkitm/esp8684_devkitm.yaml +++ b/boards/espressif/esp8684_devkitm/esp8684_devkitm.yaml @@ -5,6 +5,7 @@ arch: riscv toolchain: - zephyr supported: + - adc - gpio - watchdog - uart diff --git a/boards/espressif/esp8684_devkitm/esp8684_devkitm_defconfig b/boards/espressif/esp8684_devkitm/esp8684_devkitm_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/espressif/esp8684_devkitm/esp8684_devkitm_defconfig +++ b/boards/espressif/esp8684_devkitm/esp8684_devkitm_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/espressif/esp_wrover_kit/doc/index.rst b/boards/espressif/esp_wrover_kit/doc/index.rst index 96f1c0570c2..0c5a2ee8dd4 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_appcpu_defconfig b/boards/espressif/esp_wrover_kit/esp_wrover_kit_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/espressif/esp_wrover_kit/esp_wrover_kit_appcpu_defconfig +++ b/boards/espressif/esp_wrover_kit/esp_wrover_kit_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 614bd1ec54f..552829c4c52 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/espressif/esp_wrover_kit/esp_wrover_kit_procpu_defconfig b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu_defconfig index f029cac9e9e..e192c240251 100644 --- a/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu_defconfig +++ b/boards/espressif/esp_wrover_kit/esp_wrover_kit_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/ezurio/bl5340_dvk/Kconfig.defconfig b/boards/ezurio/bl5340_dvk/Kconfig.defconfig index b71b51265b9..2f93c265e0a 100644 --- a/boards/ezurio/bl5340_dvk/Kconfig.defconfig +++ b/boards/ezurio/bl5340_dvk/Kconfig.defconfig @@ -72,9 +72,6 @@ config BT_HCI_VS # https://www.buydisplay.com/2-8-inch-tft-touch-shield-for-arduino-w-capacitive-touch-screen-module if DISPLAY -config INPUT_FT5336_INTERRUPT - default y - if LVGL config LV_Z_VDB_SIZE diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp.yaml b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp.yaml index cf432d7ab6e..5237c073ffa 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp.yaml +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 448 flash: 1024 diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_ns.yaml b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_ns.yaml index 89d29c79e05..9bbf93a52d2 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_ns.yaml +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpuapp_ns.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 192 flash: 192 diff --git a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet.yaml b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet.yaml index ab6f60bdd3a..99e7ee5a37e 100644 --- a/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet.yaml +++ b/boards/ezurio/bl5340_dvk/bl5340_dvk_nrf5340_cpunet.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 64 flash: 256 diff --git a/boards/ezurio/bl5340_dvk/doc/index.rst b/boards/ezurio/bl5340_dvk/doc/index.rst index b19a0516c30..35ce806fc53 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/bl54l15_dvk/Kconfig b/boards/ezurio/bl54l15_dvk/Kconfig new file mode 100644 index 00000000000..412d5c5b3dd --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/Kconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# BL54L15 DVK board configuration + +if BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/ezurio/bl54l15_dvk/Kconfig.bl54l15_dvk b/boards/ezurio/bl54l15_dvk/Kconfig.bl54l15_dvk new file mode 100644 index 00000000000..739ab7de8a5 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/Kconfig.bl54l15_dvk @@ -0,0 +1,9 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_BL54L15_DVK + select SOC_NRF54L10_CPUAPP if BOARD_BL54L15_DVK_NRF54L10_CPUAPP || BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS + select SOC_NRF54L15_CPUAPP if BOARD_BL54L15_DVK_NRF54L15_CPUAPP || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS + select SOC_NRF54L15_CPUFLPR if BOARD_BL54L15_DVK_NRF54L15_CPUFLPR || \ + BOARD_BL54L15_DVK_NRF54L15_CPUFLPR_XIP diff --git a/boards/ezurio/bl54l15_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig new file mode 100644 index 00000000000..61d46eebccf --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/Kconfig.defconfig @@ -0,0 +1,32 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if BOARD_BL54L15_DVK_NRF54L10_CPUAPP || BOARD_BL54L15_DVK_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_BL54L15_DVK_NRF54L10_CPUAPP || BOARD_BL54L15_DVK_NRF54L15_CPUAPP + +if BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS + +config BT_CTLR + default BT + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y + +endif # BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS || BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_common.dtsi b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_common.dtsi new file mode 100644 index 00000000000..62aa39437b8 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_common.dtsi @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "bl54l15_dvk_nrf54l_10_15-pinctrl.dtsi" + +/ { + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + + led1: led_1 { + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + + led2: led_2 { + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; + label = "Green LED 2"; + }; + + led3: led_3 { + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + label = "Green LED 3"; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + + /* + * PWM signal can be exposed on GPIO pin only within same domain. + * There is only one domain which contains both PWM and GPIO: + * PWM20/21/22 and GPIO Port P1. + * Only LEDs connected to P1 can work with PWM, for example LED1. + */ + pwm_led1: pwm_led_1 { + pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; + + buttons { + compatible = "gpio-keys"; + + button0: button_0 { + gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 0"; + zephyr,code = ; + }; + + button1: button_1 { + gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 1"; + zephyr,code = ; + }; + + button2: button_2 { + gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 2"; + zephyr,code = ; + }; + + button3: button_3 { + gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 3"; + zephyr,code = ; + }; + }; + + aliases { + led0 = &led0; + led1 = &led1; + led2 = &led2; + led3 = &led3; + pwm-led0 = &pwm_led1; + sw0 = &button0; + sw1 = &button1; + sw2 = &button2; + sw3 = &button3; + watchdog0 = &wdt31; + }; +}; + +&uart20 { + current-speed = <115200>; + pinctrl-0 = <&uart20_default>; + pinctrl-1 = <&uart20_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&uart30 { + current-speed = <115200>; + pinctrl-0 = <&uart30_default>; + pinctrl-1 = <&uart30_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm20_default>; + pinctrl-1 = <&pwm20_sleep>; + pinctrl-names = "default", "sleep"; +}; + +/* Get a node label for wi-fi spi to use in shield files */ +wifi_spi: &spi22 {}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.dts new file mode 100644 index 00000000000..3d9336bbeab --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.dts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "nrf54l_10_15_cpuapp_common.dtsi" + +/ { + compatible = "ezurio,bl54l15_dvk_nrf54l10-cpuapp"; + model = "Ezurio BL54L15 DVK nRF54L10 Application MCU"; + + chosen { + zephyr,code-partition = &slot0_partition; + zephyr,sram = &cpuapp_sram; + }; +}; + +/* FLPR not supported yet, give all SRAM and RRAM to the APP core */ +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(192)>; + ranges = <0x0 0x20000000 DT_SIZE_K(192)>; +}; + +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1022)>; +}; + +/* These partition sizes assume no FLPR area in RRAM */ +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(224)>; + }; + + slot0_ns_partition: partition@48000 { + label = "image-0-nonsecure"; + reg = <0x48000 DT_SIZE_K(224)>; + }; + + slot1_partition: partition@80000 { + label = "image-1"; + reg = <0x80000 DT_SIZE_K(224)>; + }; + + slot1_ns_partition: partition@b8000 { + label = "image-1-nonsecure"; + reg = <0xb8000 DT_SIZE_K(224)>; + }; + + /* 32K from 0xf0000 to 0xf7fff reserved for TF-M partitions */ + + storage_partition: partition@f8000 { + label = "storage"; + reg = <0xf8000 DT_SIZE_K(28)>; + }; + + /* 2K from 0xff000 to 0xff7ff unused */ + }; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.yaml new file mode 100644 index 00000000000..0a53875b749 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp.yaml @@ -0,0 +1,24 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15_dvk/nrf54l10/cpuapp +name: BL54L15-DVK-nRF54L10-Application +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 192 +flash: 230 +supported: + - adc + - counter + - gpio + - i2c + - pwm + - retained_mem + - spi + - watchdog + - i2s diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_defconfig new file mode 100644 index 00000000000..c460d11847e --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts new file mode 100644 index 00000000000..02d900390cc --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.dts @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#define USE_NON_SECURE_ADDRESS_MAP 1 + +#include +#include "nrf54l_10_15_cpuapp_common.dtsi" + +/ { + compatible = "ezurio,bl54l15_dvk_nrf54l10-cpuapp"; + model = "Ezurio BL54L15 DVK nRF54L10 Application MCU"; + + chosen { + zephyr,code-partition = &slot0_ns_partition; + zephyr,sram = &sram0_ns; + zephyr,entropy = &psa_rng; + }; + + /delete-node/ rng; + + psa_rng: psa-rng { + status = "okay"; + }; +}; + +/ { + /* + * Default SRAM planning when building for nRF54L10 with ARM TrustZone-M support. + * - Lowest 96 kB SRAM allocated to Secure image (sram0_s). + * - Upper 96 kB SRAM allocated to Non-Secure image (sram0_ns). + * + * nRF54L10 has 192 kB of volatile memory (SRAM) but the last 42kB are reserved for + * the FLPR MCU. + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + sram0_s: image_s@20000000 { + /* Secure image memory */ + reg = <0x20000000 DT_SIZE_K(72)>; + }; + + sram0_ns: image_ns@20012000 { + /* Non-Secure image memory */ + reg = <0x20012000 DT_SIZE_K(72)>; + }; + }; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + /* nRF54L10 has 1022 kB of non volatile memory (RRAM) but the + * last 62kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(384)>; + }; + + tfm_ps_partition: partition@60000 { + label = "tfm-ps"; + reg = <0x00060000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@64000 { + label = "tfm-its"; + reg = <0x00064000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@68000 { + label = "tfm-otp"; + reg = <0x00068000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@6A000 { + label = "image-0-nonsecure"; + reg = <0x0006A000 DT_SIZE_K(504)>; + }; + + storage_partition: partition@E8000 { + label = "storage"; + reg = <0x000E8000 DT_SIZE_K(32)>; + }; + }; +}; + +&uart30 { + /* Disable so that TF-M can use this UART */ + status = "disabled"; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.yaml new file mode 100644 index 00000000000..d2ad19f03c4 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15_dvk/nrf54l10/cpuapp/ns +name: BL54L15-DVK-nRF54l10-Application-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 192 +flash: 1022 +supported: + - adc + - gpio + - i2c + - spi + - counter + - watchdog + - adc + - i2s diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig new file mode 100644 index 00000000000..dea04c45f20 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l10_cpuapp_ns_defconfig @@ -0,0 +1,37 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# Don't enable the cache in the non-secure image as it is a +# secure-only peripheral on 54l +CONFIG_CACHE_MANAGEMENT=n +CONFIG_EXTERNAL_CACHE=n + +CONFIG_UART_CONSOLE=y +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_GPIO=y + +# Start SYSCOUNTER on driver init +CONFIG_NRF_GRTC_START_SYSCOUNTER=y + +# Disable TFM BL2 since it is not supported +CONFIG_TFM_BL2=n + +# Support for silence logging is not supported at the moment +# Tracked by: NCSDK-31930 +CONFIG_TFM_LOG_LEVEL_SILENCE=n + +# The oscillators are configured as secure and cannot be configured +# from the non secure application directly. This needs to be set +# otherwise nrfx will try to configure them, resulting in a bus +# fault. +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.dts new file mode 100644 index 00000000000..ef92bda9930 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.dts @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "nrf54l_10_15_cpuapp_common.dtsi" + +/ { + compatible = "ezurio,bl54l15_dvk_nrf54l15-cpuapp"; + model = "Ezurio BL54L15_DVK nRF54L15 Application MCU"; + + chosen { + zephyr,code-partition = &slot0_partition; + zephyr,sram = &cpuapp_sram; + }; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.yaml new file mode 100644 index 00000000000..abcf0f54482 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp.yaml @@ -0,0 +1,25 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15_dvk/nrf54l15/cpuapp +name: BL54L15-DVK-nRF54l15-Application +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 188 +flash: 324 +supported: + - adc + - counter + - dmic + - gpio + - i2c + - pwm + - retained_mem + - spi + - watchdog + - i2s diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_defconfig new file mode 100644 index 00000000000..c460d11847e --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.dts new file mode 100644 index 00000000000..38712ba7074 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.dts @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#define USE_NON_SECURE_ADDRESS_MAP 1 + +#include +#include "nrf54l_10_15_cpuapp_common.dtsi" + +/ { + compatible = "ezurio,bl54l15_dvk_nrf54l15-cpuapp"; + model = "Ezurio BL54L15 DVK nRF54L15 Application MCU"; + + chosen { + zephyr,code-partition = &slot0_ns_partition; + zephyr,sram = &sram0_ns; + zephyr,entropy = &psa_rng; + }; + + /delete-node/ rng; + + psa_rng: psa-rng { + status = "okay"; + }; +}; + +/ { + /* + * Default SRAM planning when building for nRF54L15 with ARM TrustZone-M support + * - Lowest 80 kB SRAM allocated to Secure image (sram0_s). + * - Upper 80 kB SRAM allocated to Non-Secure image (sram0_ns). + * + * nRF54L15 has 256 kB of volatile memory (SRAM) but the last 96kB are reserved for + * the FLPR MCU. + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + sram0_s: image_s@20000000 { + /* Secure image memory */ + reg = <0x20000000 DT_SIZE_K(80)>; + }; + + sram0_ns: image_ns@20014000 { + /* Non-Secure image memory */ + reg = <0x20014000 DT_SIZE_K(80)>; + }; + }; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the + * last 96kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(844)>; + }; + + storage_partition: partition@15D000 { + label = "storage"; + reg = <0x00015D000 DT_SIZE_K(32)>; + }; + }; +}; + +&uart30 { + /* Disable so that TF-M can use this UART */ + status = "disabled"; + + current-speed = <115200>; + pinctrl-0 = <&uart30_default>; + pinctrl-1 = <&uart30_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.yaml new file mode 100644 index 00000000000..83ef14a15a3 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15_dvk/nrf54l15/cpuapp/ns +name: BL54L15-DVK-nRF54l15-Application-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 256 +flash: 1524 +supported: + - adc + - gpio + - i2c + - spi + - counter + - watchdog + - adc + - i2s diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig new file mode 100644 index 00000000000..dea04c45f20 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuapp_ns_defconfig @@ -0,0 +1,37 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# Don't enable the cache in the non-secure image as it is a +# secure-only peripheral on 54l +CONFIG_CACHE_MANAGEMENT=n +CONFIG_EXTERNAL_CACHE=n + +CONFIG_UART_CONSOLE=y +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_GPIO=y + +# Start SYSCOUNTER on driver init +CONFIG_NRF_GRTC_START_SYSCOUNTER=y + +# Disable TFM BL2 since it is not supported +CONFIG_TFM_BL2=n + +# Support for silence logging is not supported at the moment +# Tracked by: NCSDK-31930 +CONFIG_TFM_LOG_LEVEL_SILENCE=n + +# The oscillators are configured as secure and cannot be configured +# from the non secure application directly. This needs to be set +# otherwise nrfx will try to configure them, resulting in a bus +# fault. +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts new file mode 100644 index 00000000000..0e00b2d1e5e --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.dts @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "bl54l15_dvk_common.dtsi" + +/ { + model = "Ezurio BL54L15 DVK nRF54L15 FLPR MCU"; + compatible = "ezurio,bl54l15_dvk_nrf54l15-cpuflpr"; + + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,code-partition = &cpuflpr_code_partition; + zephyr,flash = &cpuflpr_rram; + zephyr,sram = &cpuflpr_sram; + }; +}; + +&cpuflpr_sram { + status = "okay"; + /* size must be increased due to booting from SRAM */ + reg = <0x20028000 DT_SIZE_K(96)>; + ranges = <0x0 0x20028000 0x18000>; +}; + +&cpuflpr_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuflpr_code_partition: partition@0 { + label = "image-0"; + reg = <0x0 DT_SIZE_K(96)>; + }; + }; +}; + +&grtc { + owned-channels = <3 4>; + status = "okay"; +}; + +&uart30 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.yaml new file mode 100644 index 00000000000..a324778c0e4 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15_dvk/nrf54l15/cpuflpr +name: BL54L15-DVK-nRF54L15-Fast-Lightweight-Peripheral-Processor +type: mcu +arch: riscv +toolchain: + - zephyr +sysbuild: true +ram: 96 +flash: 96 +supported: + - counter + - gpio + - i2c + - spi + - watchdog diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_defconfig new file mode 100644 index 00000000000..9695bd3f5df --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_defconfig @@ -0,0 +1,18 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +CONFIG_USE_DT_CODE_PARTITION=y + +# Execute from SRAM +CONFIG_XIP=n diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip.dts b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip.dts new file mode 100644 index 00000000000..f1bbe27b447 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip.dts @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "bl54l15_dvk_nrf54l15_cpuflpr.dts" + +&cpuflpr_sram { + reg = <0x2002f000 DT_SIZE_K(68)>; + ranges = <0x0 0x2002f000 0x11000>; +}; diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip.yaml b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip.yaml new file mode 100644 index 00000000000..0c473591f9c --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15_dvk/nrf54l15/cpuflpr/xip +name: BL54L15-DVK-nRF54L15-Fast-Lightweight-Peripheral-Processor (RRAM XIP) +type: mcu +arch: riscv +toolchain: + - zephyr +sysbuild: true +ram: 68 +flash: 96 +supported: + - counter + - gpio + - i2c + - spi + - watchdog diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip_defconfig b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip_defconfig new file mode 100644 index 00000000000..b433045216a --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l15_cpuflpr_xip_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +# Execute from RRAM +CONFIG_XIP=y diff --git a/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l_10_15-pinctrl.dtsi b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l_10_15-pinctrl.dtsi new file mode 100644 index 00000000000..1377b613e2f --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/bl54l15_dvk_nrf54l_10_15-pinctrl.dtsi @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * Copyright (c) 2025 Ezurio LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + /omit-if-no-ref/ uart20_default: uart20_default { + group1 { + psels = , + ; + }; + + group2 { + psels = , + ; + bias-pull-up; + }; + }; + + /omit-if-no-ref/ uart20_sleep: uart20_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ uart30_default: uart30_default { + group1 { + psels = , + ; + }; + + group2 { + psels = , + ; + bias-pull-up; + }; + }; + + /omit-if-no-ref/ uart30_sleep: uart30_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ spi00_default: spi00_default { + group1 { + psels = , + , + ; + }; + }; + + /omit-if-no-ref/ spi00_sleep: spi00_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ pwm20_default: pwm20_default { + group1 { + psels = ; + }; + }; + + /omit-if-no-ref/ pwm20_sleep: pwm20_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ grtc_default: grtc_default { + group1 { + psels = , + ; + }; + }; + + /omit-if-no-ref/ grtc_sleep: grtc_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/boards/ezurio/bl54l15_dvk/board.cmake b/boards/ezurio/bl54l15_dvk/board.cmake new file mode 100644 index 00000000000..53b6961dee0 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/board.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_SOC_NRF54L10_CPUAPP OR CONFIG_SOC_NRF54L15_CPUAPP) + board_runner_args(jlink "--device=nRF54L15_M33" "--speed=4000") +elseif(CONFIG_SOC_NRF54L15_CPUFLPR) + board_runner_args(jlink "--device=nRF54L15_RV32") +elseif(CONFIG_SOC_NRF54L10_CPUFLPR) + set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54l_10_15_cpuflpr.JLinkScript) + board_runner_args(jlink "--device=RISC-V" "--speed=4000" "-if SW" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") +endif() + +if(CONFIG_BOARD_BL54L15_DVK_NRF54L10_CPUAPP_NS OR CONFIG_BOARD_BL54L15_DVK_NRF54L15_CPUAPP_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +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/nrfutil.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/bl54l15_dvk/board.yml b/boards/ezurio/bl54l15_dvk/board.yml new file mode 100644 index 00000000000..841dec0f4ae --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/board.yml @@ -0,0 +1,52 @@ +board: + name: bl54l15_dvk + full_name: BL54L15 DVK + vendor: ezurio + socs: + - name: nrf54l10 + variants: + - name: ns + cpucluster: cpuapp + - name: nrf54l15 + variants: + - name: xip + cpucluster: cpuflpr + - name: ns + cpucluster: cpuapp +runners: + run_once: + '--recover': + - runners: + - nrfjprog + - nrfutil + run: first + groups: + - boards: + - bl54l15_dvk/nrf54l15/cpuapp + - bl54l15_dvk/nrf54l15/cpuapp/ns + - bl54l15_dvk/nrf54l15/cpuflpr + - bl54l15_dvk/nrf54l15/cpuflpr/xip + '--erase': + - runners: + - nrfjprog + - jlink + - nrfutil + run: first + groups: + - boards: + - bl54l15_dvk/nrf54l15/cpuapp + - bl54l15_dvk/nrf54l15/cpuapp/ns + - bl54l15_dvk/nrf54l15/cpuflpr + - bl54l15_dvk/nrf54l15/cpuflpr/xip + '--reset': + - runners: + - nrfjprog + - jlink + - nrfutil + run: last + groups: + - boards: + - bl54l15_dvk/nrf54l15/cpuapp + - bl54l15_dvk/nrf54l15/cpuapp/ns + - bl54l15_dvk/nrf54l15/cpuflpr + - bl54l15_dvk/nrf54l15/cpuflpr/xip diff --git a/boards/ezurio/bl54l15_dvk/doc/bl54l15_dvk.rst b/boards/ezurio/bl54l15_dvk/doc/bl54l15_dvk.rst new file mode 100644 index 00000000000..f5f7c798b01 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/doc/bl54l15_dvk.rst @@ -0,0 +1,142 @@ +.. zephyr:board:: bl54l15_dvk + +Overview +******** + +.. note:: + You can find more information about the BL54L15 module on the `BL54L15 website`_. + + You can find more information about the BL54L10 module on the `BL54L10 website`_. + + You can find more information about the underlying nRF54L15 SoC on the + `nRF54L15 website`_. For the nRF54L15 technical documentation and other + resources (such as SoC Datasheet), see the `nRF54L15 documentation`_ page. + +The BL54L15 Development Kit provides support for the Ezurio BL54L15 and BL54L10 +range of modules. + +The modules are based on the Nordic Semiconductor nRF54L15 and nRF54L10 Arm Cortex-M33 CPUs. + +The BL54L15 module incorporates the QFN package nRF54L15 (1524kB Flash, 256kB RAM). The BL54L10 +module the QFN package nRF54L10 (1022kB Flash, 192kB RAM). Both parts feature up to 31 configurable +GPIOs and BLE Radio TX Power up to 7dBm. + +The modules include the following devices: + +* :abbr:`SAADC (Successive Approximation Analog to Digital Converter)` +* CLOCK +* RRAM +* :abbr:`GPIO (General Purpose Input Output)` +* :abbr:`TWIM (I2C-compatible two-wire interface master with EasyDMA)` +* MEMCONF +* :abbr:`MPU (Memory Protection Unit)` +* :abbr:`NVIC (Nested Vectored Interrupt Controller)` +* :abbr:`PWM (Pulse Width Modulation)` +* :abbr:`GRTC (Global real-time counter)` +* Segger RTT (RTT Console) +* :abbr:`SPI (Serial Peripheral Interface)` +* :abbr:`UARTE (Universal asynchronous receiver-transmitter)` +* :abbr:`WDT (Watchdog Timer)` + +Hardware +******** + +The BL54L15 DVK has two crystal oscillators: + +* High-frequency 32 MHz crystal oscillator (HFXO) +* Low-frequency 32.768 kHz crystal oscillator (LFXO) + +The crystal oscillators can be configured to use either +internal or external capacitors. + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and Debugging +************************* + +Applications for the ``bl54l15_dvk/nrf54l15/cpuapp`` and ``bl54l15_dvk/nrf54l10/cpuapp`` +board targets 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. + +Applications for the ``bl54l15_dvk/nrf54l15/cpuflpr`` board target need to be built +using sysbuild to include the ``vpr_launcher`` image for the application core. + +Enter the following command to compile ``hello_world`` for the FLPR core: + +.. code-block:: console + + west build -p -b bl54l15_dvk/nrf54l15/cpuflpr --sysbuild + +Flashing +======== + +As an example, this section shows how to build and flash the :zephyr:code-sample:`hello_world` +application. + +.. warning:: + + When programming the device, you might get an error similar to the following message:: + + ERROR: The operation attempted is unavailable due to readback protection in + ERROR: your device. Please use --recover to unlock the device. + + This error occurs when readback protection is enabled. + To disable the readback protection, you must *recover* your device. + + Enter the following command to recover the core:: + + west flash --recover + + The ``--recover`` command erases the flash memory and then writes a small binary into + the recovered flash memory. + This binary prevents the readback protection from enabling itself again after a pin + reset or power cycle. + +Follow the instructions in the :ref:`nordic_segger` page to install +and configure all the necessary software. Further information can be +found in :ref:`nordic_segger_flashing`. + +To build and program the sample to the BL54L15 DVK, complete the following steps: + +First, connect the BL54L15 DVK to your computer using the IMCU USB port on the DVK. +Next, build the sample by running the following command: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: bl54l15_dvk/nrf54l15/cpuapp + :goals: build flash + +Testing the LEDs and buttons on the BL54L15 DVK +************************************************ + +Test the BL54L15 DVK with a :zephyr:code-sample:`blinky` sample. + +.. _BL54L15 website: https://www.ezurio.com/product/bl54l15-series-bluetooth-le-80215-4-nfc +.. _BL54L10 website: https://www.ezurio.com/wireless-modules/bluetooth-modules/bl54-series/bl54l10-series-bluetooth-le-802-15-4-nfc +.. _nRF54L15 website: https://www.nordicsemi.com/Products/nRF54L15 +.. _nRF54L15 documentation: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/index.html + +.. _bl54l15_dvk_nrf54l10: + +BL54L10 emulation on BL54L15 DVK +******************************** + +Overview +======== + +The ``bl54l15_dvk/nrf54l10`` board is a modified version of the BL54L15 DVK +that enforces the limitations imposed by the nRF54L10 IC, upon which the BL54L10 is based. +The nRF54L10 is a cost-reduced variant of the original nRF54L15. Since Ezurio does not offer a +development kit for the BL54L10 you can use this board to develop for this +module while using the BL54L15 Development Kit (453-00001-K1, 453-00044-K1). + +See above for more information about the development board. Refer to +the `BL54L10 website`_ for details of the BL54L10 module and the `nRF54L10 website`_ for +the official reference on the underlying SoC. + +.. _BL54L10 website: https://www.ezurio.com/wireless-modules/bluetooth-modules/bl54-series/bl54l10-series-bluetooth-le-802-15-4-nfc +.. _nRF54L10 website: https://www.nordicsemi.com/Products/nRF54L10 diff --git a/boards/ezurio/bl54l15_dvk/doc/img/bl54l15_dvk.webp b/boards/ezurio/bl54l15_dvk/doc/img/bl54l15_dvk.webp new file mode 100644 index 00000000000..9bdc924af83 Binary files /dev/null and b/boards/ezurio/bl54l15_dvk/doc/img/bl54l15_dvk.webp differ diff --git a/boards/ezurio/bl54l15_dvk/nrf54l_10_15_cpuapp_common.dtsi b/boards/ezurio/bl54l15_dvk/nrf54l_10_15_cpuapp_common.dtsi new file mode 100644 index 00000000000..8671beb29cf --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/nrf54l_10_15_cpuapp_common.dtsi @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is common to the secure and non-secure domain */ + +#include "bl54l15_dvk_common.dtsi" + +/ { + chosen { + zephyr,console = &uart20; + zephyr,shell-uart = &uart20; + zephyr,uart-mcumgr = &uart20; + zephyr,bt-mon-uart = &uart20; + zephyr,bt-c2h-uart = &uart20; + zephyr,flash-controller = &rram_controller; + zephyr,flash = &cpuapp_rram; + zephyr,ieee802154 = &ieee802154; + }; +}; + +&cpuapp_sram { + status = "okay"; +}; + +&lfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15500>; +}; + +&hfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15000>; +}; + +®ulators { + status = "okay"; +}; + +&vregmain { + status = "okay"; + regulator-initial-mode = ; +}; + +&grtc { + owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; + /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ + child-owned-channels = <3 4 7 8 9 10 11>; + status = "okay"; +}; + +&uart20 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; + +&radio { + status = "okay"; +}; + +&ieee802154 { + status = "okay"; +}; + +&temp { + status = "okay"; +}; + +&clock { + status = "okay"; +}; + +&spi00 { + status = "okay"; + cs-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi00_default>; + pinctrl-1 = <&spi00_sleep>; + pinctrl-names = "default", "sleep"; + + mx25r64: mx25r6435f@0 { + compatible = "jedec,spi-nor"; + status = "okay"; + reg = <0>; + spi-max-frequency = <8000000>; + jedec-id = [c2 28 17]; + sfdp-bfp = [ + e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb + ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52 + 10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 48 44 + 30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff + ]; + size = <67108864>; + has-dpd; + t-enter-dpd = <10000>; + t-exit-dpd = <35000>; + }; +}; + +&adc { + status = "okay"; +}; diff --git a/boards/ezurio/bl54l15_dvk/support/nrf54l_10_15_cpuflpr.JLinkScript b/boards/ezurio/bl54l15_dvk/support/nrf54l_10_15_cpuflpr.JLinkScript new file mode 100644 index 00000000000..1cf94ee52a4 --- /dev/null +++ b/boards/ezurio/bl54l15_dvk/support/nrf54l_10_15_cpuflpr.JLinkScript @@ -0,0 +1,5 @@ +int InitTarget(void) { + // Base address where DMI registers can be found in the APB address space + JLINK_ExecCommand("CORESIGHT_SetCoreBaseAddr = 0x5004C400"); + return 0; +} diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig b/boards/ezurio/bl54l15u_dvk/Kconfig new file mode 100644 index 00000000000..b1623fe1b82 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/Kconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# BL54L15U DVK board configuration + +if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS + +DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc) + +config NRF_TRUSTZONE_FLASH_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the flash region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral-specific symbols. + +config NRF_TRUSTZONE_RAM_REGION_SIZE + hex + default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity) + help + This defines the RAM region size from the TrustZone perspective. + It is used when configuring the TrustZone and when setting alignments + requirements for the partitions. + This abstraction allows us to configure TrustZone without depending + on peripheral specific symbols. + +endif # BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig.bl54l15u_dvk b/boards/ezurio/bl54l15u_dvk/Kconfig.bl54l15u_dvk new file mode 100644 index 00000000000..f807b23268e --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/Kconfig.bl54l15u_dvk @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_BL54L15U_DVK + select SOC_NRF54L15_CPUAPP if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP || BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS + select SOC_NRF54L15_CPUFLPR if BOARD_BL54L15U_DVK_NRF54L15_CPUFLPR || \ + BOARD_BL54L15U_DVK_NRF54L15_CPUFLPR_XIP diff --git a/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig new file mode 100644 index 00000000000..4ee4dc3e6d2 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/Kconfig.defconfig @@ -0,0 +1,32 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP + +config ROM_START_OFFSET + default 0x800 if BOOTLOADER_MCUBOOT + +endif # BOARD_BL54L15U_DVK_NRF54L15_CPUAPP + +if BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS + +config BT_CTLR + default BT + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y + +endif # BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_common.dtsi b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_common.dtsi new file mode 100644 index 00000000000..72206859685 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_common.dtsi @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "bl54l15u_dvk_nrf54l15-pinctrl.dtsi" + +/ { + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + + led1: led_1 { + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + + led2: led_2 { + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; + label = "Green LED 2"; + }; + + led3: led_3 { + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + label = "Green LED 3"; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + + /* + * PWM signal can be exposed on GPIO pin only within same domain. + * There is only one domain which contains both PWM and GPIO: + * PWM20/21/22 and GPIO Port P1. + * Only LEDs connected to P1 can work with PWM, for example LED1. + */ + pwm_led1: pwm_led_1 { + pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; + + buttons { + compatible = "gpio-keys"; + + button0: button_0 { + gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 0"; + zephyr,code = ; + }; + + button1: button_1 { + gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 1"; + zephyr,code = ; + }; + + button2: button_2 { + gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 2"; + zephyr,code = ; + }; + + button3: button_3 { + gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 3"; + zephyr,code = ; + }; + }; + + aliases { + led0 = &led0; + led1 = &led1; + led2 = &led2; + led3 = &led3; + pwm-led0 = &pwm_led1; + sw0 = &button0; + sw1 = &button1; + sw2 = &button2; + sw3 = &button3; + watchdog0 = &wdt31; + }; +}; + +&uart20 { + current-speed = <115200>; + pinctrl-0 = <&uart20_default>; + pinctrl-1 = <&uart20_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&uart30 { + current-speed = <115200>; + pinctrl-0 = <&uart30_default>; + pinctrl-1 = <&uart30_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm20_default>; + pinctrl-1 = <&pwm20_sleep>; + pinctrl-names = "default", "sleep"; +}; + +/* Get a node label for wi-fi spi to use in shield files */ +wifi_spi: &spi22 {}; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15-pinctrl.dtsi b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15-pinctrl.dtsi new file mode 100644 index 00000000000..1377b613e2f --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15-pinctrl.dtsi @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * Copyright (c) 2025 Ezurio LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + /omit-if-no-ref/ uart20_default: uart20_default { + group1 { + psels = , + ; + }; + + group2 { + psels = , + ; + bias-pull-up; + }; + }; + + /omit-if-no-ref/ uart20_sleep: uart20_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ uart30_default: uart30_default { + group1 { + psels = , + ; + }; + + group2 { + psels = , + ; + bias-pull-up; + }; + }; + + /omit-if-no-ref/ uart30_sleep: uart30_sleep { + group1 { + psels = , + , + , + ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ spi00_default: spi00_default { + group1 { + psels = , + , + ; + }; + }; + + /omit-if-no-ref/ spi00_sleep: spi00_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ pwm20_default: pwm20_default { + group1 { + psels = ; + }; + }; + + /omit-if-no-ref/ pwm20_sleep: pwm20_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; + + /omit-if-no-ref/ grtc_default: grtc_default { + group1 { + psels = , + ; + }; + }; + + /omit-if-no-ref/ grtc_sleep: grtc_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.dts new file mode 100644 index 00000000000..7ea5099aa3f --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.dts @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "nrf54l15_cpuapp_common.dtsi" + +/ { + compatible = "ezurio,bl54l15u_dvk_nrf54l15-cpuapp"; + model = "Ezurio BL54L15u_DVK nRF54L15 Application MCU"; + + chosen { + zephyr,code-partition = &slot0_partition; + zephyr,sram = &cpuapp_sram; + }; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(64)>; + }; + + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x10000 DT_SIZE_K(324)>; + }; + + slot0_ns_partition: partition@61000 { + label = "image-0-nonsecure"; + reg = <0x61000 DT_SIZE_K(324)>; + }; + + slot1_partition: partition@b2000 { + label = "image-1"; + reg = <0xb2000 DT_SIZE_K(324)>; + }; + + slot1_ns_partition: partition@103000 { + label = "image-1-nonsecure"; + reg = <0x103000 DT_SIZE_K(324)>; + }; + + /* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */ + storage_partition: partition@15c000 { + label = "storage"; + reg = <0x15c000 DT_SIZE_K(36)>; + }; + }; +}; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.yaml b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.yaml new file mode 100644 index 00000000000..264368c2baf --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp.yaml @@ -0,0 +1,25 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15u_dvk/nrf54l15/cpuapp +name: BL54L15u-DVK-nRF54l15-Application +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 188 +flash: 324 +supported: + - adc + - counter + - dmic + - gpio + - i2c + - pwm + - retained_mem + - spi + - watchdog + - i2s diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_defconfig b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_defconfig new file mode 100644 index 00000000000..c460d11847e --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_defconfig @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.dts new file mode 100644 index 00000000000..f03eb6a5e81 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.dts @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#define USE_NON_SECURE_ADDRESS_MAP 1 + +#include +#include "nrf54l15_cpuapp_common.dtsi" + +/ { + compatible = "ezurio,bl54l15u_dvk_nrf54l15-cpuapp"; + model = "Ezurio BL54L15u DVK nRF54L15 Application MCU"; + + chosen { + zephyr,code-partition = &slot0_ns_partition; + zephyr,sram = &sram0_ns; + zephyr,entropy = &psa_rng; + }; + + /delete-node/ rng; + + psa_rng: psa-rng { + status = "okay"; + }; +}; + +/ { + /* + * Default SRAM planning when building for nRF54L15 with ARM TrustZone-M support + * - Lowest 80 kB SRAM allocated to Secure image (sram0_s). + * - Upper 80 kB SRAM allocated to Non-Secure image (sram0_ns). + * + * nRF54L15 has 256 kB of volatile memory (SRAM) but the last 96kB are reserved for + * the FLPR MCU. + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + sram0_s: image_s@20000000 { + /* Secure image memory */ + reg = <0x20000000 DT_SIZE_K(80)>; + }; + + sram0_ns: image_ns@20014000 { + /* Non-Secure image memory */ + reg = <0x20014000 DT_SIZE_K(80)>; + }; + }; +}; + +&cpuapp_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* nRF54L15 has 1524 kB of non volatile memory (RRAM) but the + * last 96kB are reserved for the FLPR MCU. + * + * This static layout needs to be the same with the upstream TF-M layout in the + * header flash_layout.h of the relevant platform. Any updates in the layout + * needs to happen both in the flash_layout.h and in this file at the same time. + */ + slot0_partition: partition@0 { + label = "image-0"; + reg = <0x0000000 DT_SIZE_K(512)>; + }; + + tfm_ps_partition: partition@80000 { + label = "tfm-ps"; + reg = <0x00080000 DT_SIZE_K(16)>; + }; + + tfm_its_partition: partition@84000 { + label = "tfm-its"; + reg = <0x00084000 DT_SIZE_K(16)>; + }; + + tfm_otp_partition: partition@88000 { + label = "tfm-otp"; + reg = <0x00088000 DT_SIZE_K(8)>; + }; + + slot0_ns_partition: partition@8A000 { + label = "image-0-nonsecure"; + reg = <0x0008A000 DT_SIZE_K(844)>; + }; + + storage_partition: partition@15D000 { + label = "storage"; + reg = <0x00015D000 DT_SIZE_K(32)>; + }; + }; +}; + +&uart30 { + /* Disable so that TF-M can use this UART */ + status = "disabled"; + + current-speed = <115200>; + pinctrl-0 = <&uart30_default>; + pinctrl-1 = <&uart30_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.yaml b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.yaml new file mode 100644 index 00000000000..11a3347969d --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns.yaml @@ -0,0 +1,23 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +identifier: bl54l15u_dvk/nrf54l15/cpuapp/ns +name: BL54L15u-DVK-nRF54l15-Application-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - zephyr +sysbuild: true +ram: 256 +flash: 1524 +supported: + - adc + - gpio + - i2c + - spi + - counter + - watchdog + - adc + - i2s diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig new file mode 100644 index 00000000000..24848d53b82 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuapp_ns_defconfig @@ -0,0 +1,37 @@ +# Copyright (c) 2025 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# Don't enable the cache in the non-secure image as it is a +# secure-only peripheral on 54l +CONFIG_CACHE_MANAGEMENT=n +CONFIG_EXTERNAL_CACHE=n + +CONFIG_UART_CONSOLE=y +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_GPIO=y + +# Start SYSCOUNTER on driver init +CONFIG_NRF_GRTC_START_SYSCOUNTER=y + +# Disable TFM BL2 since it is not supported +CONFIG_TFM_BL2=n + +# Support for silence logging is not supported at the moment +# Tracked by: NCSDK-31930 +CONFIG_TFM_LOG_LEVEL_SILENCE=n + +# The oscillators are configured as secure and cannot be configured +# from the non secure application directly. This needs to be set +# otherwise nrfx will try to configure them, resulting in a bus +# fault. +CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts new file mode 100644 index 00000000000..12e280a9a90 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.dts @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "bl54l15u_dvk_common.dtsi" + +/ { + model = "Ezurio BL54L15u DVK nRF54L15 FLPR MCU"; + compatible = "ezurio,bl54l15u_dvk_nrf54l15-cpuflpr"; + + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + zephyr,code-partition = &cpuflpr_code_partition; + zephyr,flash = &cpuflpr_rram; + zephyr,sram = &cpuflpr_sram; + }; +}; + +&cpuflpr_sram { + status = "okay"; + /* size must be increased due to booting from SRAM */ + reg = <0x20028000 DT_SIZE_K(96)>; + ranges = <0x0 0x20028000 0x18000>; +}; + +&cpuflpr_rram { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cpuflpr_code_partition: partition@0 { + label = "image-0"; + reg = <0x0 DT_SIZE_K(96)>; + }; + }; +}; + +&grtc { + owned-channels = <3 4>; + status = "okay"; +}; + +&uart30 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.yaml b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.yaml new file mode 100644 index 00000000000..bf3c14b52bf --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15u_dvk/nrf54l15/cpuflpr +name: BL54L15u-DVK-nRF54L15-Fast-Lightweight-Peripheral-Processor +type: mcu +arch: riscv +toolchain: + - zephyr +sysbuild: true +ram: 96 +flash: 96 +supported: + - counter + - gpio + - i2c + - spi + - watchdog diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_defconfig b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_defconfig new file mode 100644 index 00000000000..9695bd3f5df --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_defconfig @@ -0,0 +1,18 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +CONFIG_USE_DT_CODE_PARTITION=y + +# Execute from SRAM +CONFIG_XIP=n diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip.dts b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip.dts new file mode 100644 index 00000000000..2380f2cdf25 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip.dts @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "bl54l15u_dvk_nrf54l15_cpuflpr.dts" + +&cpuflpr_sram { + reg = <0x2002f000 DT_SIZE_K(68)>; + ranges = <0x0 0x2002f000 0x11000>; +}; diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip.yaml b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip.yaml new file mode 100644 index 00000000000..27d584351de --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +identifier: bl54l15u_dvk/nrf54l15/cpuflpr/xip +name: BL54L15u-DVK-nRF54L15-Fast-Lightweight-Peripheral-Processor (RRAM XIP) +type: mcu +arch: riscv +toolchain: + - zephyr +sysbuild: true +ram: 68 +flash: 96 +supported: + - counter + - gpio + - i2c + - spi + - watchdog diff --git a/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip_defconfig b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip_defconfig new file mode 100644 index 00000000000..b433045216a --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/bl54l15u_dvk_nrf54l15_cpuflpr_xip_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y + +# Execute from RRAM +CONFIG_XIP=y diff --git a/boards/ezurio/bl54l15u_dvk/board.cmake b/boards/ezurio/bl54l15u_dvk/board.cmake new file mode 100644 index 00000000000..f8e306c4bcc --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/board.cmake @@ -0,0 +1,20 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# Copyright (c) 2025 Ezurio LLC +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_SOC_NRF54L15_CPUAPP) + board_runner_args(jlink "--device=nRF54L15_M33" "--speed=4000") +elseif(CONFIG_SOC_NRF54L15_CPUFLPR) + board_runner_args(jlink "--device=nRF54L15_RV32") +endif() + +if(CONFIG_BOARD_BL54L15U_DVK_NRF54L15_CPUAPP_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +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/nrfutil.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/ezurio/bl54l15u_dvk/board.yml b/boards/ezurio/bl54l15u_dvk/board.yml new file mode 100644 index 00000000000..1553980eaa8 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/board.yml @@ -0,0 +1,48 @@ +board: + name: bl54l15u_dvk + full_name: BL54L15u DVK + vendor: ezurio + socs: + - name: nrf54l15 + variants: + - name: xip + cpucluster: cpuflpr + - name: ns + cpucluster: cpuapp +runners: + run_once: + '--recover': + - runners: + - nrfjprog + - nrfutil + run: first + groups: + - boards: + - bl54l15u_dvk/nrf54l15/cpuapp + - bl54l15u_dvk/nrf54l15/cpuapp/ns + - bl54l15u_dvk/nrf54l15/cpuflpr + - bl54l15u_dvk/nrf54l15/cpuflpr/xip + '--erase': + - runners: + - nrfjprog + - jlink + - nrfutil + run: first + groups: + - boards: + - bl54l15u_dvk/nrf54l15/cpuapp + - bl54l15u_dvk/nrf54l15/cpuapp/ns + - bl54l15u_dvk/nrf54l15/cpuflpr + - bl54l15u_dvk/nrf54l15/cpuflpr/xip + '--reset': + - runners: + - nrfjprog + - jlink + - nrfutil + run: last + groups: + - boards: + - bl54l15u_dvk/nrf54l15/cpuapp + - bl54l15u_dvk/nrf54l15/cpuapp/ns + - bl54l15u_dvk/nrf54l15/cpuflpr + - bl54l15u_dvk/nrf54l15/cpuflpr/xip diff --git a/boards/ezurio/bl54l15u_dvk/doc/bl54l15u_dvk.rst b/boards/ezurio/bl54l15u_dvk/doc/bl54l15u_dvk.rst new file mode 100644 index 00000000000..3e3e705be8d --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/doc/bl54l15u_dvk.rst @@ -0,0 +1,115 @@ +.. zephyr:board:: bl54l15u_dvk + +Overview +******** + +.. note:: + You can find more information about the BL54L15u module on the `BL54L15u website`_. + + You can find more information about the underlying nRF54L15 SoC on the + `nRF54L15 website`_. For the nRF54L15 technical documentation and other + resources (such as SoC Datasheet), see the `nRF54L15 documentation`_ page. + +The BL54L15u Development Kit provides support for the Ezurio BL54L15u module. + +The module is based on the Nordic Semiconductor nRF54L15 Arm Cortex-M33 CPU. + +The BL54L15u module incorporates the WLCSP package nRF54L15 (1524kB Flash, 256kB RAM). +The part features up to 32 configurable GPIOs and BLE Radio TX Power up to 8dBm. + +The module includes the following devices: + +* :abbr:`SAADC (Successive Approximation Analog to Digital Converter)` +* CLOCK +* RRAM +* :abbr:`GPIO (General Purpose Input Output)` +* :abbr:`TWIM (I2C-compatible two-wire interface master with EasyDMA)` +* MEMCONF +* :abbr:`MPU (Memory Protection Unit)` +* :abbr:`NVIC (Nested Vectored Interrupt Controller)` +* :abbr:`PWM (Pulse Width Modulation)` +* :abbr:`GRTC (Global real-time counter)` +* Segger RTT (RTT Console) +* :abbr:`SPI (Serial Peripheral Interface)` +* :abbr:`UARTE (Universal asynchronous receiver-transmitter)` +* :abbr:`WDT (Watchdog Timer)` + +Hardware +******** + +The BL54L15u DVK has two crystal oscillators: + +* High-frequency 32 MHz crystal oscillator (HFXO) +* Low-frequency 32.768 kHz crystal oscillator (LFXO) + +The crystal oscillators can be configured to use either +internal or external capacitors. + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +Programming and Debugging +************************* + +Applications for the ``bl54l15u_dvk/nrf54l15/cpuapp`` board target 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. + +Applications for the ``bl54l15u_dvk/nrf54l15/cpuflpr`` board target need to be +built using sysbuild to include the ``vpr_launcher`` image for the application core. + +Enter the following command to compile ``hello_world`` for the FLPR core: + +.. code-block:: console + + west build -p -b bl54l15u_dvk/nrf54l15/cpuflpr --sysbuild + +Flashing +======== + +As an example, this section shows how to build and flash the :zephyr:code-sample:`hello_world` +application. + +.. warning:: + + When programming the device, you might get an error similar to the following message:: + + ERROR: The operation attempted is unavailable due to readback protection in + ERROR: your device. Please use --recover to unlock the device. + + This error occurs when readback protection is enabled. + To disable the readback protection, you must *recover* your device. + + Enter the following command to recover the core:: + + west flash --recover + + The ``--recover`` command erases the flash memory and then writes a small binary into + the recovered flash memory. + This binary prevents the readback protection from enabling itself again after a pin + reset or power cycle. + +Follow the instructions in the :ref:`nordic_segger` page to install +and configure all the necessary software. Further information can be +found in :ref:`nordic_segger_flashing`. + +To build and program the sample to the BL54L15u DVK, complete the following steps: + +First, connect the BL54L15u DVK to your computer using the IMCU USB port on the DVK. +Next, build the sample by running the following command: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: bl54l15u_dvk/nrf54l15/cpuapp + :goals: build flash + +Testing the LEDs and buttons on the BL54L15u DVK +************************************************ + +Test the BL54L15u DVK with a :zephyr:code-sample:`blinky` sample. + +.. _BL54L15u website: https://www.ezurio.com/wireless-modules/bluetooth-modules/bl54-series/bl54l15-micro-series-bluetooth-le-802-15-4-nfc +.. _nRF54L15 website: https://www.nordicsemi.com/Products/nRF54L15 +.. _nRF54L15 documentation: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/index.html diff --git a/boards/ezurio/bl54l15u_dvk/doc/img/bl54l15u_dvk.webp b/boards/ezurio/bl54l15u_dvk/doc/img/bl54l15u_dvk.webp new file mode 100644 index 00000000000..bef2a629baf Binary files /dev/null and b/boards/ezurio/bl54l15u_dvk/doc/img/bl54l15u_dvk.webp differ diff --git a/boards/ezurio/bl54l15u_dvk/nrf54l15_cpuapp_common.dtsi b/boards/ezurio/bl54l15u_dvk/nrf54l15_cpuapp_common.dtsi new file mode 100644 index 00000000000..e630abab4a9 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/nrf54l15_cpuapp_common.dtsi @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * Copyright (c) 2025 Ezurio LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* This file is common to the secure and non-secure domain */ + +#include "bl54l15u_dvk_common.dtsi" + +/ { + chosen { + zephyr,console = &uart20; + zephyr,shell-uart = &uart20; + zephyr,uart-mcumgr = &uart20; + zephyr,bt-mon-uart = &uart20; + zephyr,bt-c2h-uart = &uart20; + zephyr,flash-controller = &rram_controller; + zephyr,flash = &cpuapp_rram; + zephyr,ieee802154 = &ieee802154; + }; +}; + +&cpuapp_sram { + status = "okay"; +}; + +&lfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15500>; +}; + +&hfxo { + load-capacitors = "internal"; + load-capacitance-femtofarad = <15000>; +}; + +®ulators { + status = "okay"; +}; + +&vregmain { + status = "okay"; + regulator-initial-mode = ; +}; + +&grtc { + owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; + /* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */ + child-owned-channels = <3 4 7 8 9 10 11>; + status = "okay"; +}; + +&uart20 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpiote20 { + status = "okay"; +}; + +&gpiote30 { + status = "okay"; +}; + +&radio { + status = "okay"; +}; + +&ieee802154 { + status = "okay"; +}; + +&temp { + status = "okay"; +}; + +&clock { + status = "okay"; +}; + +&spi00 { + status = "okay"; + cs-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&spi00_default>; + pinctrl-1 = <&spi00_sleep>; + pinctrl-names = "default", "sleep"; + + mx25r64: mx25r6435f@0 { + compatible = "jedec,spi-nor"; + status = "okay"; + reg = <0>; + spi-max-frequency = <8000000>; + jedec-id = [c2 28 17]; + sfdp-bfp = [ + e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb + ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52 + 10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 48 44 + 30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff + ]; + size = <67108864>; + has-dpd; + t-enter-dpd = <10000>; + t-exit-dpd = <35000>; + }; +}; + +&adc { + status = "okay"; +}; diff --git a/boards/ezurio/bl54l15u_dvk/support/nrf54l15_cpuflpr.JLinkScript b/boards/ezurio/bl54l15u_dvk/support/nrf54l15_cpuflpr.JLinkScript new file mode 100644 index 00000000000..1cf94ee52a4 --- /dev/null +++ b/boards/ezurio/bl54l15u_dvk/support/nrf54l15_cpuflpr.JLinkScript @@ -0,0 +1,5 @@ +int InitTarget(void) { + // Base address where DMI registers can be found in the APB address space + JLINK_ExecCommand("CORESIGHT_SetCoreBaseAddr = 0x5004C400"); + return 0; +} diff --git a/boards/ezurio/bl652_dvk/bl652_dvk.yaml b/boards/ezurio/bl652_dvk/bl652_dvk.yaml index a549fcfdd66..4e1a2904366 100644 --- a/boards/ezurio/bl652_dvk/bl652_dvk.yaml +++ b/boards/ezurio/bl652_dvk/bl652_dvk.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 64 flash: 512 supported: diff --git a/boards/ezurio/bl652_dvk/doc/bl652_dvk.rst b/boards/ezurio/bl652_dvk/doc/bl652_dvk.rst index 27ec3f92928..cdceadb2a34 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/bl653_dvk.yaml b/boards/ezurio/bl653_dvk/bl653_dvk.yaml index ee1b610f312..24a17bc8c77 100644 --- a/boards/ezurio/bl653_dvk/bl653_dvk.yaml +++ b/boards/ezurio/bl653_dvk/bl653_dvk.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/ezurio/bl653_dvk/doc/bl653_dvk.rst b/boards/ezurio/bl653_dvk/doc/bl653_dvk.rst index e4de59757e8..811ce96a517 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.yaml b/boards/ezurio/bl654_dvk/bl654_dvk.yaml index c4d016d63b6..c43d8f4328a 100644 --- a/boards/ezurio/bl654_dvk/bl654_dvk.yaml +++ b/boards/ezurio/bl654_dvk/bl654_dvk.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.dts b/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.dts index d826a466bfd..ee5d7260fa4 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/bl654_dvk_nrf52840_pa.yaml b/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.yaml index 6ecf9191591..d38960a6eed 100644 --- a/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.yaml +++ b/boards/ezurio/bl654_dvk/bl654_dvk_nrf52840_pa.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - usb_device diff --git a/boards/ezurio/bl654_dvk/doc/bl654_dvk.rst b/boards/ezurio/bl654_dvk/doc/bl654_dvk.rst index 5a59932df25..30e23866587 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/bl654_sensor_board.yaml b/boards/ezurio/bl654_sensor_board/bl654_sensor_board.yaml index bcaafe5669a..0dce5bbbe46 100644 --- a/boards/ezurio/bl654_sensor_board/bl654_sensor_board.yaml +++ b/boards/ezurio/bl654_sensor_board/bl654_sensor_board.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble 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 373e9bf1bdc..605b5eb8c7f 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/bl654_usb.yaml b/boards/ezurio/bl654_usb/bl654_usb.yaml index 4bf396760cc..a56efa32877 100644 --- a/boards/ezurio/bl654_usb/bl654_usb.yaml +++ b/boards/ezurio/bl654_usb/bl654_usb.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - usb_device - ble diff --git a/boards/ezurio/bl654_usb/doc/bl654_usb.rst b/boards/ezurio/bl654_usb/doc/bl654_usb.rst index 345331890ec..04ac5759753 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 @@ -106,8 +81,10 @@ The board supports programming using the built-in bootloader. The board is factory-programmed with a Ezurio variation of Nordic's open bootloader from Nordic's nRF5x SDK. With this option, you'll use Nordic's `nrfutil`_ program to create firmware packages supported by this -bootloader and flash them to the device. Make sure ``nrfutil`` is installed -before proceeding. These instructions were tested with version 6.1.0. +bootloader and flash them to the device. Before proceeding, make sure: + +* ``nrfutil`` is installed. +* The ``nrf5sdk-tools`` command is installed within ``nrfutil``. #. With the adapter plugged in, reset the board into the bootloader by pressing the RESET button. @@ -132,16 +109,19 @@ before proceeding. These instructions were tested with version 6.1.0. .. code-block:: console - nrfutil pkg generate --hw-version 52 --sd-req=0x00 \ - --application build/zephyr/zephyr.hex \ - --application-version 1 blinky.zip + nrfutil nrf5sdk-tools pkg generate \ + --hw-version 52 \ + --sd-req=0x00 \ + --application build/zephyr/zephyr.hex \ + --application-version 1 \ + blinky.zip #. Flash it onto the board. Note :file:`/dev/ttyACM0` is for Linux; it will be something like ``COMx`` on Windows, and something else on macOS. .. code-block:: console - nrfutil dfu usb-serial -pkg blinky.zip -p /dev/ttyACM0 + nrfutil nrf5sdk-tools dfu usb-serial -pkg blinky.zip -p /dev/ttyACM0 When this command exits, observe the blue LED on the board blinking. diff --git a/boards/ezurio/bt510/bt510.yaml b/boards/ezurio/bt510/bt510.yaml index 198b538eecd..f13cd759f42 100644 --- a/boards/ezurio/bt510/bt510.yaml +++ b/boards/ezurio/bt510/bt510.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble diff --git a/boards/ezurio/bt510/doc/bt510.rst b/boards/ezurio/bt510/doc/bt510.rst index fdfd9312ffe..74b4c48703c 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/bt610.yaml b/boards/ezurio/bt610/bt610.yaml index 5b96d98c527..c56ec758736 100644 --- a/boards/ezurio/bt610/bt610.yaml +++ b/boards/ezurio/bt610/bt610.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble diff --git a/boards/ezurio/bt610/doc/bt610.rst b/boards/ezurio/bt610/doc/bt610.rst index 0ae62035a48..afa138eac63 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/doc/index.rst b/boards/ezurio/mg100/doc/index.rst index 5f66c65e147..b2baed38724 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/mg100/mg100.yaml b/boards/ezurio/mg100/mg100.yaml index 54de18e63ee..bbfd5f81bc7 100644 --- a/boards/ezurio/mg100/mg100.yaml +++ b/boards/ezurio/mg100/mg100.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble diff --git a/boards/ezurio/pinnacle_100_dvk/doc/index.rst b/boards/ezurio/pinnacle_100_dvk/doc/index.rst index 71511d8dfc8..d9f8b260efd 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/pinnacle_100_dvk/pinnacle_100_dvk.yaml b/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.yaml index 3d44a009e2d..5888bc4febc 100644 --- a/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.yaml +++ b/boards/ezurio/pinnacle_100_dvk/pinnacle_100_dvk.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - ble diff --git a/boards/ezurio/rm1xx_dvk/doc/index.rst b/boards/ezurio/rm1xx_dvk/doc/index.rst index 8462f92c1b2..ebb994540eb 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 00000000000..b429435dd09 --- /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 00000000000..10170d65424 --- /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 00000000000..b6a9f42f25d --- /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 00000000000..733b0efc806 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 00000000000..0c7dbbfbe44 --- /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 00000000000..93f9cd88847 --- /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 00000000000..932fcb5f3f4 --- /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 00000000000..13a1289e51c --- /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 00000000000..4ea6d13db0b --- /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 6a558bddc08..f5340f336b6 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/fanke/fk750m1_vbt6/fk750m1_vbt6.yaml b/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.yaml index ffb5170ae82..e436cc6dc0a 100644 --- a/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.yaml +++ b/boards/fanke/fk750m1_vbt6/fk750m1_vbt6.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 1024 flash: 128 supported: diff --git a/boards/fanke/fk7b0m1_vbt6/fk7b0m1_vbt6.yaml b/boards/fanke/fk7b0m1_vbt6/fk7b0m1_vbt6.yaml index e50692f318a..6012823f29c 100644 --- a/boards/fanke/fk7b0m1_vbt6/fk7b0m1_vbt6.yaml +++ b/boards/fanke/fk7b0m1_vbt6/fk7b0m1_vbt6.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 1376 flash: 128 supported: diff --git a/boards/firefly/roc_rk3568_pc/doc/index.rst b/boards/firefly/roc_rk3568_pc/doc/index.rst index bd55e747c51..e26092db576 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 47f223b83ca..bdbc20574ec 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 beee6810d62..f5e6429233a 100644 --- a/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.dts +++ b/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho.dts @@ -22,7 +22,7 @@ }; chosen { - zephyr,sram = &sram0; + zephyr,sram = &sram1; zephyr,console = &uart0; zephyr,shell-uart = &uart0; zephyr,flash = &flash0; @@ -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 da3da1bdc3a..4fc82a2f23d 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/franzininho/esp32s2_franzininho/esp32s2_franzininho_defconfig b/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho_defconfig index f566acd9340..e192c240251 100644 --- a/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho_defconfig +++ b/boards/franzininho/esp32s2_franzininho/esp32s2_franzininho_defconfig @@ -1,9 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 - - -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/fysetc/ucan/doc/index.rst b/boards/fysetc/ucan/doc/index.rst index f9b4b53809f..725d87e62a4 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 9f7781f3e21..0dde96f2fc7 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/generic_leon3/generic_leon3.yaml b/boards/gaisler/generic_leon3/generic_leon3.yaml index 62130690461..206eedbabc9 100644 --- a/boards/gaisler/generic_leon3/generic_leon3.yaml +++ b/boards/gaisler/generic_leon3/generic_leon3.yaml @@ -9,7 +9,6 @@ ram: 4096 flash: 2048 toolchain: - zephyr - - xtools supported: - netif testing: diff --git a/boards/gaisler/gr716a_mini/doc/index.rst b/boards/gaisler/gr716a_mini/doc/index.rst index 0f723306105..77cf7231192 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/gaisler/gr716a_mini/gr716a_mini.yaml b/boards/gaisler/gr716a_mini/gr716a_mini.yaml index 4d2743602c6..8625d54c095 100644 --- a/boards/gaisler/gr716a_mini/gr716a_mini.yaml +++ b/boards/gaisler/gr716a_mini/gr716a_mini.yaml @@ -7,7 +7,6 @@ simulation: arch: sparc toolchain: - zephyr - - xtools supported: - netif - spi diff --git a/boards/gardena/sgrm/doc/index.rst b/boards/gardena/sgrm/doc/index.rst index 40d05a9f4f3..5b0da0a61c7 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/gardena/sgrm/sgrm.yaml b/boards/gardena/sgrm/sgrm.yaml index fe14fefec88..9488fca96fc 100644 --- a/boards/gardena/sgrm/sgrm.yaml +++ b/boards/gardena/sgrm/sgrm.yaml @@ -10,7 +10,6 @@ ram: 32 flash: 256 toolchain: - gnuarmemb - - xtools - zephyr supported: - dma diff --git a/boards/gd/gd32a503v_eval/doc/index.rst b/boards/gd/gd32a503v_eval/doc/index.rst index 8fcec05bdc3..27e715227a7 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/gd32a503v_eval/gd32a503v_eval.yaml b/boards/gd/gd32a503v_eval/gd32a503v_eval.yaml index e2e2145d9af..3182b92a191 100644 --- a/boards/gd/gd32a503v_eval/gd32a503v_eval.yaml +++ b/boards/gd/gd32a503v_eval/gd32a503v_eval.yaml @@ -10,7 +10,6 @@ flash: 384 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - counter diff --git a/boards/gd/gd32e103v_eval/doc/index.rst b/boards/gd/gd32e103v_eval/doc/index.rst index 382bed8c7de..49d6f799199 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/gd32e103v_eval/gd32e103v_eval.yaml b/boards/gd/gd32e103v_eval/gd32e103v_eval.yaml index a5dd9ba759b..203ef2d95e9 100644 --- a/boards/gd/gd32e103v_eval/gd32e103v_eval.yaml +++ b/boards/gd/gd32e103v_eval/gd32e103v_eval.yaml @@ -10,7 +10,6 @@ flash: 128 toolchain: - zephyr - gnuarmemb - - xtools supported: - dac - counter diff --git a/boards/gd/gd32e507v_start/doc/index.rst b/boards/gd/gd32e507v_start/doc/index.rst index a8b8f7a9469..68eaf60ef49 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/gd32e507v_start/gd32e507v_start.yaml b/boards/gd/gd32e507v_start/gd32e507v_start.yaml index 8a1b4e4b89b..3e216953ec8 100644 --- a/boards/gd/gd32e507v_start/gd32e507v_start.yaml +++ b/boards/gd/gd32e507v_start/gd32e507v_start.yaml @@ -10,7 +10,6 @@ flash: 512 toolchain: - zephyr - gnuarmemb - - xtools supported: - pwm - gpio diff --git a/boards/gd/gd32e507z_eval/doc/index.rst b/boards/gd/gd32e507z_eval/doc/index.rst index 610562b3eae..f43863fbadb 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/gd32e507z_eval/gd32e507z_eval.yaml b/boards/gd/gd32e507z_eval/gd32e507z_eval.yaml index 594df3a5f8d..f4174207b84 100644 --- a/boards/gd/gd32e507z_eval/gd32e507z_eval.yaml +++ b/boards/gd/gd32e507z_eval/gd32e507z_eval.yaml @@ -10,7 +10,6 @@ flash: 512 toolchain: - zephyr - gnuarmemb - - xtools supported: - pwm - gpio diff --git a/boards/gd/gd32f350r_eval/doc/index.rst b/boards/gd/gd32f350r_eval/doc/index.rst index 2c7ad726352..e30ab453690 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/gd32f350r_eval/gd32f350r_eval.yaml b/boards/gd/gd32f350r_eval/gd32f350r_eval.yaml index 17834719ff1..1133959c2f4 100644 --- a/boards/gd/gd32f350r_eval/gd32f350r_eval.yaml +++ b/boards/gd/gd32f350r_eval/gd32f350r_eval.yaml @@ -10,7 +10,6 @@ flash: 128 toolchain: - zephyr - gnuarmemb - - xtools supported: - watchdog - dma diff --git a/boards/gd/gd32f403z_eval/doc/index.rst b/boards/gd/gd32f403z_eval/doc/index.rst index d304094a3e7..7d2ca320ca7 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/gd32f403z_eval/gd32f403z_eval.yaml b/boards/gd/gd32f403z_eval/gd32f403z_eval.yaml index 1bec175723a..675d101ad31 100644 --- a/boards/gd/gd32f403z_eval/gd32f403z_eval.yaml +++ b/boards/gd/gd32f403z_eval/gd32f403z_eval.yaml @@ -10,7 +10,6 @@ flash: 512 toolchain: - zephyr - gnuarmemb - - xtools supported: - counter - pwm diff --git a/boards/gd/gd32f407v_start/doc/index.rst b/boards/gd/gd32f407v_start/doc/index.rst index 68332eb51b8..615659bf820 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/gd32f407v_start/gd32f407v_start.yaml b/boards/gd/gd32f407v_start/gd32f407v_start.yaml index e79982ef6e8..418a6be76e1 100644 --- a/boards/gd/gd32f407v_start/gd32f407v_start.yaml +++ b/boards/gd/gd32f407v_start/gd32f407v_start.yaml @@ -10,7 +10,6 @@ flash: 3072 toolchain: - zephyr - gnuarmemb - - xtools supported: - pwm - gpio diff --git a/boards/gd/gd32f450i_eval/doc/index.rst b/boards/gd/gd32f450i_eval/doc/index.rst index d342cc9774d..05b2c20ba7a 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/gd32f450i_eval/gd32f450i_eval.yaml b/boards/gd/gd32f450i_eval/gd32f450i_eval.yaml index 88ac1c0f558..c4e95480151 100644 --- a/boards/gd/gd32f450i_eval/gd32f450i_eval.yaml +++ b/boards/gd/gd32f450i_eval/gd32f450i_eval.yaml @@ -10,7 +10,6 @@ flash: 3072 toolchain: - zephyr - gnuarmemb - - xtools supported: - dac - pwm diff --git a/boards/gd/gd32f450v_start/doc/index.rst b/boards/gd/gd32f450v_start/doc/index.rst index 36870e0c667..6105b6afc16 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/gd32f450v_start/gd32f450v_start.yaml b/boards/gd/gd32f450v_start/gd32f450v_start.yaml index 62cf201bcd2..ede877bb156 100644 --- a/boards/gd/gd32f450v_start/gd32f450v_start.yaml +++ b/boards/gd/gd32f450v_start/gd32f450v_start.yaml @@ -10,7 +10,6 @@ flash: 3072 toolchain: - zephyr - gnuarmemb - - xtools supported: - pwm - gpio diff --git a/boards/gd/gd32f450z_eval/doc/index.rst b/boards/gd/gd32f450z_eval/doc/index.rst index 5a8d8b74763..7b012d1ddb2 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/gd32f450z_eval/gd32f450z_eval.yaml b/boards/gd/gd32f450z_eval/gd32f450z_eval.yaml index 3cc5f359495..b5d60e8d905 100644 --- a/boards/gd/gd32f450z_eval/gd32f450z_eval.yaml +++ b/boards/gd/gd32f450z_eval/gd32f450z_eval.yaml @@ -10,7 +10,6 @@ flash: 3072 toolchain: - zephyr - gnuarmemb - - xtools supported: - counter - dac diff --git a/boards/gd/gd32f470i_eval/doc/index.rst b/boards/gd/gd32f470i_eval/doc/index.rst index 1a8865f4d06..4c90c4d3f12 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/gd32f470i_eval/gd32f470i_eval.yaml b/boards/gd/gd32f470i_eval/gd32f470i_eval.yaml index 9537f9aef30..ba01d162869 100644 --- a/boards/gd/gd32f470i_eval/gd32f470i_eval.yaml +++ b/boards/gd/gd32f470i_eval/gd32f470i_eval.yaml @@ -10,7 +10,6 @@ flash: 3072 toolchain: - zephyr - gnuarmemb - - xtools supported: - counter - dac diff --git a/boards/gd/gd32l233r_eval/doc/index.rst b/boards/gd/gd32l233r_eval/doc/index.rst index d6770856256..d025a2bf96e 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/gd32l233r_eval/gd32l233r_eval.yaml b/boards/gd/gd32l233r_eval/gd32l233r_eval.yaml index 04e38f9e46c..99aacaea2f5 100644 --- a/boards/gd/gd32l233r_eval/gd32l233r_eval.yaml +++ b/boards/gd/gd32l233r_eval/gd32l233r_eval.yaml @@ -10,5 +10,4 @@ flash: 256 toolchain: - zephyr - gnuarmemb - - xtools vendor: gd diff --git a/boards/gd/gd32vf103c_starter/doc/index.rst b/boards/gd/gd32vf103c_starter/doc/index.rst index 40b22fa18c5..a443dbde5f3 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 773262c8eab..2f8dd496f61 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 3f717a84341..ed5c8c11135 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/dragonclaw/google_dragonclaw.yaml b/boards/google/dragonclaw/google_dragonclaw.yaml index bf535af2c1e..584bcbd29a4 100644 --- a/boards/google/dragonclaw/google_dragonclaw.yaml +++ b/boards/google/dragonclaw/google_dragonclaw.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 256 flash: 1024 vendor: google diff --git a/boards/google/icetower/doc/index.rst b/boards/google/icetower/doc/index.rst index 45ecb81be2d..7106102f718 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/icetower/google_icetower.yaml b/boards/google/icetower/google_icetower.yaml index c0b2473c100..b867fb64846 100644 --- a/boards/google/icetower/google_icetower.yaml +++ b/boards/google/icetower/google_icetower.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 1024 flash: 2048 vendor: google diff --git a/boards/google/quincy/Kconfig.google_quincy b/boards/google/quincy/Kconfig.google_quincy new file mode 100644 index 00000000000..5bf9347a860 --- /dev/null +++ b/boards/google/quincy/Kconfig.google_quincy @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Google LLC +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_GOOGLE_QUINCY + select SOC_NPCX9MFP diff --git a/boards/google/quincy/board.cmake b/boards/google/quincy/board.cmake new file mode 100644 index 00000000000..85a7ea7b5f1 --- /dev/null +++ b/boards/google/quincy/board.cmake @@ -0,0 +1,9 @@ +# Copyright (c) 2024 Google LLC +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(jlink "--device=Cortex-M4" "--speed=4000") +board_runner_args(openocd --cmd-load "npcx_write_image") +board_runner_args(openocd --cmd-verify "npcx_verify_image") + +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/google/quincy/board.yml b/boards/google/quincy/board.yml new file mode 100644 index 00000000000..e0774ca8b86 --- /dev/null +++ b/boards/google/quincy/board.yml @@ -0,0 +1,6 @@ +board: + name: google_quincy + full_name: Quincy + vendor: google + socs: + - name: npcx9mfp diff --git a/boards/google/quincy/doc/index.rst b/boards/google/quincy/doc/index.rst new file mode 100644 index 00000000000..ec960007ec8 --- /dev/null +++ b/boards/google/quincy/doc/index.rst @@ -0,0 +1,49 @@ +.. zephyr:board:: google_quincy + +Overview +******** + +Google Quincy is a board created for fingerprint-related functionality +development. + +The board has connectors for fingerprint sensors. A UART Console is exposed +over μServo and USB connectors. The MCU can be flashed using μServo or SWD. + +Hardware +******** + +- NPCX99FPA0BX VFBGA144 package + +Peripheral Mapping +=================== + +- UART_1 (CONSOLE) TX/RX : GPIO65/GPIO64 +- UART_2 (PROG) TX/RX : GPIO86/GPIO75 +- SPI_0 (SHI) CS/CLK/MISO/MOSI : GPIO53/GPIO55/GPIO47/GPIO46 +- SPI_1 (SPIP) CS/CLK/MISO/MOSI : GPIOA6/GPIOA1/GPIO95/GPIOA3 +- SPI_2 (GP) CS/CLK/MISO/MOSI : GPIO30/GPIO25/GPIO24/GPIO31 + +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 +`Chromium Servo Micro Documentation`_. + +Debugging +========= + +Use SWD with a J-Link. + +References +********** + +.. target-notes:: + +.. _Chromium EC Flashing Documentation: + https://chromium.googlesource.com/chromiumos/platform/ec#Flashing-via-the-servo-debug-board +.. _Chromium Servo Micro Documentation: + https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/master/docs/servo_micro.md diff --git a/boards/google/quincy/google_quincy.dts b/boards/google/quincy/google_quincy.dts new file mode 100644 index 00000000000..7067cd4cf31 --- /dev/null +++ b/boards/google/quincy/google_quincy.dts @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Google LLC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include + +/ { + model = "Google Quincy development board"; + compatible = "google,quincy-fpmcu"; + + chosen { + zephyr,console = &uart1; + zephyr,shell-uart = &uart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,flash-controller = &int_flash; + }; + + aliases { + /* For watchdog sample */ + watchdog0 = &twd0; + }; +}; + +/* UART1: Servo UART (console) */ +&uart1 { + /* Use UART1_SL2 ie. PIN64.65 */ + pinctrl-0 = <&uart1_2_sin_gp64 + &uart1_2_sout_gp65>; + pinctrl-names = "default"; + current-speed = <115200>; + status = "okay"; +}; + +/* UART2: AP UART (Host Commands and MKBP) */ +&uart2 { + pinctrl-0 = <&uart2_sin_gp75 + &uart2_sout_gp86>; + pinctrl-names = "default"; + current-speed = <115200>; + status = "okay"; +}; + +/* SHI0: communication with the AP */ +&shi0 { + status = "okay"; + pinctrl-0 = <&shi_gp46_47_53_55>; + pinctrl-names = "default"; +}; + +/* SPIP0: communication with the fingerprint sensor */ +&spip0 { + pinctrl-0 = <&spip_sclk_mosi_miso_gp95_gpa1_gpa3_gpa5_sl + &spip_sclk_mosi_miso_gp95_gpa1_gpa3_gpa5_no_spip_inv>; + cs-gpios = <&gpioa 6 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + status = "okay"; +}; diff --git a/boards/google/quincy/google_quincy.yaml b/boards/google/quincy/google_quincy.yaml new file mode 100644 index 00000000000..5ec04710dfe --- /dev/null +++ b/boards/google/quincy/google_quincy.yaml @@ -0,0 +1,19 @@ +identifier: google_quincy +name: Google Quincy Development Board +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 512 +flash: 1024 +vendor: google +supported: + - clock + - gpio + - i2c + - pm + - pwm + - spi + - uart + - watchdog diff --git a/boards/google/quincy/google_quincy_defconfig b/boards/google/quincy/google_quincy_defconfig new file mode 100644 index 00000000000..0b5fcc5649f --- /dev/null +++ b/boards/google/quincy/google_quincy_defconfig @@ -0,0 +1,23 @@ +# Copyright (c) 2024 Google Inc +# SPDX-License-Identifier: Apache-2.0 + +# General Kernel Options +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=15000000 + +# Serial Drivers +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# GPIO Controller +CONFIG_GPIO=y + +# Clock Controller +CONFIG_CLOCK_CONTROL=y + +# Enable MPU and HW stack protection +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/google/twinkie_v2/doc/index.rst b/boards/google/twinkie_v2/doc/index.rst index 3ba2f42e267..89450cf04ff 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/google/twinkie_v2/google_twinkie_v2.yaml b/boards/google/twinkie_v2/google_twinkie_v2.yaml index bc9028b4e9a..5509e5f4079 100644 --- a/boards/google/twinkie_v2/google_twinkie_v2.yaml +++ b/boards/google/twinkie_v2/google_twinkie_v2.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 144 flash: 512 testing: diff --git a/boards/hardkernel/odroid_go/doc/index.rst b/boards/hardkernel/odroid_go/doc/index.rst index 0963435fa3d..3c14c9c23b0 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_appcpu_defconfig b/boards/hardkernel/odroid_go/odroid_go_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/hardkernel/odroid_go/odroid_go_appcpu_defconfig +++ b/boards/hardkernel/odroid_go/odroid_go_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/hardkernel/odroid_go/odroid_go_procpu.dts b/boards/hardkernel/odroid_go/odroid_go_procpu.dts index 386627ff358..38510fbeadf 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/hardkernel/odroid_go/odroid_go_procpu_defconfig b/boards/hardkernel/odroid_go/odroid_go_procpu_defconfig index 1a0608e1def..c59a51342aa 100644 --- a/boards/hardkernel/odroid_go/odroid_go_procpu_defconfig +++ b/boards/hardkernel/odroid_go/odroid_go_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst b/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst index c4987a76b8f..abe91f4ca90 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_appcpu_defconfig b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_appcpu_defconfig +++ b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 c641e773e07..426a7a13378 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_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu_defconfig b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu_defconfig index f029cac9e9e..e192c240251 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu_defconfig +++ b/boards/heltec/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y 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 4f6430965e5..431f83d41eb 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_appcpu_defconfig b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_appcpu_defconfig +++ b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 9e02e3db483..631d873cd10 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/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu_defconfig b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu_defconfig index 2dfe1853d5c..c698c607636 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu_defconfig +++ b/boards/heltec/heltec_wireless_stick_lite_v3/heltec_wireless_stick_lite_v3_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CLOCK_CONTROL=y CONFIG_CONSOLE=y CONFIG_GPIO=y diff --git a/boards/holyiot/yj16019/doc/index.rst b/boards/holyiot/yj16019/doc/index.rst index 86575a0838b..867fbdf88a6 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/holyiot/yj16019/holyiot_yj16019.yaml b/boards/holyiot/yj16019/holyiot_yj16019.yaml index 573af0e86d3..f60d7b319a3 100644 --- a/boards/holyiot/yj16019/holyiot_yj16019.yaml +++ b/boards/holyiot/yj16019/holyiot_yj16019.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - ble - pwm diff --git a/boards/iar/index.rst b/boards/iar/index.rst new file mode 100644 index 00000000000..3cc895fdb55 --- /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 00000000000..f04f3979a7e --- /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 00000000000..1d0b4be283d --- /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 00000000000..67419bb5068 --- /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 00000000000..1ce5bb76c16 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 00000000000..cc95c94a0ff --- /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 00000000000..ff7635b676d --- /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 00000000000..b430c8f5d9b --- /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 00000000000..75a3154c8fb --- /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 00000000000..fa1360a7143 --- /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 0643a355e59..9b83276abbf 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 8395bcd98ce..a7c2ad2f4f6 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/cy8ckit_062s4_defconfig b/boards/infineon/cy8ckit_062s4/cy8ckit_062s4_defconfig index d0909391c45..80182936a00 100644 --- a/boards/infineon/cy8ckit_062s4/cy8ckit_062s4_defconfig +++ b/boards/infineon/cy8ckit_062s4/cy8ckit_062s4_defconfig @@ -5,7 +5,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y -CONFIG_BUILD_OUTPUT_HEX=y CONFIG_CORTEX_M_SYSTICK=y CONFIG_XIP=y diff --git a/boards/infineon/cy8ckit_062s4/doc/index.rst b/boards/infineon/cy8ckit_062s4/doc/index.rst index b5e3e39cc1d..8a1efe9fe28 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.yaml b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w.yaml index 5eb55d4de6d..7d4185c860e 100644 --- a/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w.yaml +++ b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w.yaml @@ -24,5 +24,6 @@ supported: - i2c - thermistor - uart + - dma - timer vendor: infineon diff --git a/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig index 221643eca27..54183d73c1c 100644 --- a/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig +++ b/boards/infineon/cy8cproto_062_4343w/cy8cproto_062_4343w_defconfig @@ -5,8 +5,6 @@ # General configuration CONFIG_CORTEX_M_SYSTICK=y -CONFIG_BUILD_OUTPUT_HEX=y - CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y @@ -22,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 f04c28e5d00..c4696ca8d86 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 7d0d29ea39c..51c814073a3 100644 --- a/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble_defconfig +++ b/boards/infineon/cy8cproto_063_ble/cy8cproto_063_ble_defconfig @@ -6,8 +6,6 @@ # General configuration CONFIG_CORTEX_M_SYSTICK=y -CONFIG_BUILD_OUTPUT_HEX=y - CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y @@ -24,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 90623b80382..f3c83260513 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.dts b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02.dts index 927b1f865f4..92a748d2ee1 100644 --- a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02.dts +++ b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02.dts @@ -38,6 +38,16 @@ uart2: &scb2 { pinctrl-0 = <&p3_3_scb2_uart_tx &p3_2_scb2_uart_rx &p3_1_scb2_uart_rts &p3_0_scb2_uart_cts>; pinctrl-names = "default"; + + dmas = <&dma0 8>, <&dma0 9>; + dma-names = "tx", "rx"; +}; + +&dma0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "infineon,cat1-dma"; + status = "okay"; }; &fll0 { diff --git a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02.yaml b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02.yaml index 9d83de725c0..3244d698080 100644 --- a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02.yaml +++ b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02.yaml @@ -17,6 +17,7 @@ supported: - uart - clock_control - bluetooth + - adc - watchdog - spi - i2c diff --git a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig index e50b5462bab..c59deaae71c 100644 --- a/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig +++ b/boards/infineon/cyw920829m2evk_02/cyw920829m2evk_02_defconfig @@ -4,9 +4,6 @@ # # General configuration -CONFIG_BUILD_OUTPUT_HEX=y -CONFIG_BUILD_OUTPUT_BIN=y - CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y @@ -23,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 d4c5193c382..0dd56962c15 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 bfad619aedc..5d89d5e2dbd 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/xmc45_relax_kit/xmc45_relax_kit.yaml b/boards/infineon/xmc45_relax_kit/xmc45_relax_kit.yaml index fde3084c862..7733dd224e0 100644 --- a/boards/infineon/xmc45_relax_kit/xmc45_relax_kit.yaml +++ b/boards/infineon/xmc45_relax_kit/xmc45_relax_kit.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - dma diff --git a/boards/infineon/xmc47_relax_kit/doc/index.rst b/boards/infineon/xmc47_relax_kit/doc/index.rst index d5796afd7ea..09aa90843a0 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/doc/index.rst b/boards/innblue/innblue21/doc/index.rst index bafb7d9911a..6a923bc969a 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/innblue21/innblue21_nrf9160.yaml b/boards/innblue/innblue21/innblue21_nrf9160.yaml index 5722ebcd8c9..e19348bd0fd 100644 --- a/boards/innblue/innblue21/innblue21_nrf9160.yaml +++ b/boards/innblue/innblue21/innblue21_nrf9160.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 64 flash: 256 diff --git a/boards/innblue/innblue21/innblue21_nrf9160_ns.yaml b/boards/innblue/innblue21/innblue21_nrf9160_ns.yaml index 17faee49190..dd1cef9b328 100644 --- a/boards/innblue/innblue21/innblue21_nrf9160_ns.yaml +++ b/boards/innblue/innblue21/innblue21_nrf9160_ns.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/innblue/innblue22/doc/index.rst b/boards/innblue/innblue22/doc/index.rst index 9e84c4691df..d87a7b222a8 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/innblue/innblue22/innblue22_nrf9160.yaml b/boards/innblue/innblue22/innblue22_nrf9160.yaml index 9bad5763319..2fc3a3cb3d3 100644 --- a/boards/innblue/innblue22/innblue22_nrf9160.yaml +++ b/boards/innblue/innblue22/innblue22_nrf9160.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 64 flash: 256 diff --git a/boards/innblue/innblue22/innblue22_nrf9160_ns.yaml b/boards/innblue/innblue22/innblue22_nrf9160_ns.yaml index 4542d90bad0..d81920f42ed 100644 --- a/boards/innblue/innblue22/innblue22_nrf9160_ns.yaml +++ b/boards/innblue/innblue22/innblue22_nrf9160_ns.yaml @@ -4,7 +4,6 @@ type: mcu arch: arm toolchain: - gnuarmemb - - xtools - zephyr ram: 128 flash: 192 diff --git a/boards/intel/adl/Kconfig.defconfig b/boards/intel/adl/Kconfig.defconfig index 3a6bcaf9ce0..4e3f649a205 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 eafedb0c550..8c804c48c75 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 2237dfb963a..9c0d2ca0cda 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 7a051327234..8c36c0e39dd 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 3d897eb9673..4f2503e2afc 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 5f03e403e3c..6acb302da0b 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 913d2a8c3e3..85f377409f7 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 913d2a8c3e3..85f377409f7 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 429223286bf..5373f0c0bf8 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 24443bce131..37aab5b06d4 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 7e79840a033..d842740df75 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 00000000000..ee5e7343e83 --- /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 00000000000..177c7c1f0d2 --- /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 00000000000..19f802f0c31 --- /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 00000000000..6b01bab2aee --- /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 00000000000..f3b6dd2e2f8 --- /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 00000000000..239a679eb89 --- /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 00000000000..3ae2d4592c8 --- /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 00000000000..a569213d394 --- /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 00000000000..853850deb12 --- /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/niosv_g/niosv_g.dts b/boards/intel/niosv_g/niosv_g.dts index 4ebd9c9721a..cbaf19ec02d 100644 --- a/boards/intel/niosv_g/niosv_g.dts +++ b/boards/intel/niosv_g/niosv_g.dts @@ -27,7 +27,7 @@ }; &mtimer { - reg = <0x90000 0x10>; + reg = <0x90000 0x8 0x90008 0x8>; }; &uart0 { diff --git a/boards/intel/niosv_m/niosv_m.dts b/boards/intel/niosv_m/niosv_m.dts index 495594f72dc..e32edc3c7c2 100644 --- a/boards/intel/niosv_m/niosv_m.dts +++ b/boards/intel/niosv_m/niosv_m.dts @@ -27,7 +27,7 @@ }; &mtimer { - reg = <0x90000 0x10>; + reg = <0x90000 0x8 0x90008 0x8>; }; &uart0 { diff --git a/boards/intel/rpl/Kconfig.defconfig b/boards/intel/rpl/Kconfig.defconfig index 4eb5d8c3126..6478c25f658 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 00000000000..e5033cdd7c3 --- /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 00000000000..123837216ab --- /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 00000000000..d4c7074979f --- /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 00000000000..cdd3ad54735 --- /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 00000000000..d6d81db1aea 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 00000000000..c942044b556 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 00000000000..4d0ccfb7485 --- /dev/null +++ b/boards/ite/it515xx_evb/it515xx_evb.dts @@ -0,0 +1,121 @@ +/* + * 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>; +}; + +&adc0 { + status = "okay"; + pinctrl-0 = <&adc0_ch3_gpi3_default>; + pinctrl-names = "default"; +}; + +/* test fan tachometer sensor */ +&tach0 { + status = "okay"; + input-pin = ; + pulses-per-round = <2>; + pinctrl-0 = <&tach0a_gpd6_default>; + pinctrl-names = "default"; +}; diff --git a/boards/ite/it515xx_evb/it515xx_evb.yaml b/boards/ite/it515xx_evb/it515xx_evb.yaml new file mode 100644 index 00000000000..cddae71d22d --- /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 00000000000..b14dac07519 --- /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 a106a9d6151..00000000000 --- 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 d31b989f225..938264879b8 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 29e8ad721c8..3aa16d53df1 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 505c2d7d910..e4e0b974264 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 2b174670d48..2a244e464eb 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 57fc0404475..0c81c357762 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 0e215fddf7e..751294a77b6 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 0ee42f981f0..59b4af711c9 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 0a57a0937f7..31ef24d2811 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/Kconfig.khadas_edge2 b/boards/khadas/edge2/Kconfig.khadas_edge2 new file mode 100644 index 00000000000..58dd61dfe79 --- /dev/null +++ b/boards/khadas/edge2/Kconfig.khadas_edge2 @@ -0,0 +1,5 @@ +# Copyright 2024 Université Gustave Eiffel +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_KHADAS_EDGE2 + select SOC_RK3588S diff --git a/boards/khadas/edge2/board.yml b/boards/khadas/edge2/board.yml new file mode 100644 index 00000000000..93138f3a2bb --- /dev/null +++ b/boards/khadas/edge2/board.yml @@ -0,0 +1,6 @@ +board: + name: khadas_edge2 + full_name: Edge2 + vendor: khadas + socs: + - name: rk3588s diff --git a/boards/khadas/edge2/doc/index.rst b/boards/khadas/edge2/doc/index.rst new file mode 100644 index 00000000000..f0ac6de53f8 --- /dev/null +++ b/boards/khadas/edge2/doc/index.rst @@ -0,0 +1,83 @@ +.. zephyr:board:: khadas_edge2 + +Overview +******** + +See `Product page`_ + +.. _Product page: https://www.khadas.com/edge2 + +Hardware +******** + +See `Hardware details`_ + +.. _Hardware details: https://docs.khadas.com/products/sbc/edge2/hardware/start + +Supported Features +================== + +.. zephyr:board-supported-hw:: + +There are multiple serial ports on the board: Zephyr is using +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`: + +1. Non-SMP mode + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :host-os: unix + :board: khadas_edge2 + :goals: build + +This will build an image with the hello world sample app. + +Build the zephyr image: + +.. code-block:: console + + mkimage -C none -A arm64 -O linux -a 0x10000000 -e 0x10000000 -d build/zephyr/zephyr.bin build/zephyr/zephyr.img + +Burn the image on the board (we choose to use Rockchip burning tool `rkdeveloptool `_, you will need a `SPL `_ which is provided by khadas: + +.. code-block:: console + + rkdeveloptool db rk3588_spl_loader_*; rkdeveloptool wl 0x100000 zephyr.img; rkdeveloptool rd + +The sector 0x100000 was chosen arbitrarily (far away from U-Boot image) + +Use U-Boot to load and run Zephyr: + +.. code-block:: console + + mmc read ${pxefile_addr_r} 0x100000 0x1000; bootm start ${pxefile_addr_r}; bootm loados; bootm go + +0x1000 is the size (in number of sectors) or your image. Increase it if needed. + +It will display the following console output: + +.. code-block:: console + + *** Booting Zephyr OS build XXXXXXXXXXXX *** + Hello World! khadas_edge2 + +Flashing +======== + +Zephyr image can be loaded in DDR memory at address 0x10000000 from SD Card, +EMMC, QSPI Flash or downloaded from network in uboot. + +References +========== + +`Edge2 Documentation`_ + +.. _Edge2 Documentation: https://docs.khadas.com/products/sbc/edge2/start diff --git a/boards/khadas/edge2/doc/khadas_edge2.jpg b/boards/khadas/edge2/doc/khadas_edge2.jpg new file mode 100644 index 00000000000..68278e72a98 Binary files /dev/null and b/boards/khadas/edge2/doc/khadas_edge2.jpg differ diff --git a/boards/khadas/edge2/khadas_edge2.dts b/boards/khadas/edge2/khadas_edge2.dts new file mode 100644 index 00000000000..021015213b7 --- /dev/null +++ b/boards/khadas/edge2/khadas_edge2.dts @@ -0,0 +1,33 @@ +/* + * Copyright 2024 Université Gustave Eiffel + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include + +/ { + model = "Khadas Edge2"; + compatible = "khadas,edge2"; + + chosen { + zephyr,sram = &sram0; + zephyr,console = &uart2; + zephyr,shell-uart = &uart2; + }; + + cpus { + /delete-node/ cpu@1; + /delete-node/ cpu@2; + /delete-node/ cpu@3; + /delete-node/ cpu@4; + /delete-node/ cpu@5; + /delete-node/ cpu@6; + /delete-node/ cpu@7; + }; +}; + +&uart2 { + status = "okay"; +}; diff --git a/boards/khadas/edge2/khadas_edge2.yaml b/boards/khadas/edge2/khadas_edge2.yaml new file mode 100644 index 00000000000..c9ed4ad11b2 --- /dev/null +++ b/boards/khadas/edge2/khadas_edge2.yaml @@ -0,0 +1,9 @@ +identifier: khadas_edge2 +name: Khadas Edge2 (single core, non SMP) +type: mcu +arch: arm64 +toolchain: + - zephyr + - cross-compile +ram: 8192 +vendor: khadas diff --git a/boards/khadas/edge2/khadas_edge2_defconfig b/boards/khadas/edge2/khadas_edge2_defconfig new file mode 100644 index 00000000000..38b7f52812f --- /dev/null +++ b/boards/khadas/edge2/khadas_edge2_defconfig @@ -0,0 +1,17 @@ +# Copyright 2024 Université Gustave Eiffel +# SPDX-License-Identifier: Apache-2.0 + +# Platform Configuration +CONFIG_ARM64_VA_BITS_40=y +CONFIG_ARM64_PA_BITS_40=y +CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=24000000 +CONFIG_CACHE_MANAGEMENT=y +CONFIG_ARMV8_A_NS=y + +# Serial Drivers +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y + +# Enable Console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/khadas/edgev/doc/index.rst b/boards/khadas/edgev/doc/index.rst index 82294c07e99..b645563e5b2 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 d88eec584c6..6a001bbfdd8 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/kincony/kincony_kc868_a32/kincony_kc868_a32_appcpu_defconfig b/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_appcpu_defconfig +++ b/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu_defconfig b/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu_defconfig index 071024ac98d..7ed3d6b89a2 100644 --- a/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu_defconfig +++ b/boards/kincony/kincony_kc868_a32/kincony_kc868_a32_procpu_defconfig @@ -1,8 +1,6 @@ # Copyright (c) Bartosz Bilas # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y 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 00000000000..bfdcff973f9 --- /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 00000000000..0f8fc102b94 --- /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 00000000000..3daadffce78 --- /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 00000000000..9487cc1d810 --- /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 00000000000..feae063129a --- /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 00000000000..e292243d1b0 --- /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 00000000000..1cf931ddf99 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 00000000000..48bccacea86 --- /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 00000000000..889f287c642 --- /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 00000000000..87211d91eff --- /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 00000000000..4bebd86dbd0 --- /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 00000000000..acdaeafe3a6 --- /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 00000000000..8bd68e35113 --- /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 00000000000..82666bb5331 --- /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 00000000000..e1a877543e6 --- /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 00000000000..4f5d5090163 --- /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 00000000000..1ecb279b3f6 --- /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 00000000000..ff6f71a2c50 --- /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 00000000000..5d80b878c0b --- /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 00000000000..00e143500b4 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 00000000000..3246d36a972 --- /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 00000000000..ba6d29bb19b --- /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 00000000000..5a4e89ead58 --- /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 00000000000..c0b383270f5 --- /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 00000000000..df003531af9 --- /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 00000000000..34ab592b186 --- /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 00000000000..2da6bfecb7c --- /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 00000000000..420778b68b2 --- /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 00000000000..12f013272e0 --- /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 00000000000..57d1a920ecd --- /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 00000000000..ad92d0100c9 --- /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 00000000000..b970f6b1b8d 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 00000000000..b90f5a21417 --- /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 00000000000..0b2c4909fe0 --- /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 00000000000..a4bff2af2d2 --- /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 00000000000..2d2422e11a9 --- /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 00000000000..b9bea7145c3 --- /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 00000000000..6087787aad3 --- /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 00000000000..d325c30273b --- /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 00000000000..5b01812a0bf --- /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 00000000000..fbb8fd6b910 --- /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 fa6613d7414..1b662bb030c 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_appcpu_defconfig b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_appcpu_defconfig +++ b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts index 6ae0dbeb015..42c3391f387 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_lora32/ttgo_lora32_esp32_procpu_defconfig b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu_defconfig index e18641b5d44..8dcf3d7e54b 100644 --- a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu_defconfig +++ b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/lilygo/ttgo_t7v1_5/board.yml b/boards/lilygo/ttgo_t7v1_5/board.yml index 0a3f7198646..5912db5520c 100644 --- a/boards/lilygo/ttgo_t7v1_5/board.yml +++ b/boards/lilygo/ttgo_t7v1_5/board.yml @@ -1,5 +1,6 @@ board: name: ttgo_t7v1_5 + full_name: TTGO T7 Mini32 V1.5 vendor: lilygo socs: - name: esp32 diff --git a/boards/lilygo/ttgo_t7v1_5/doc/index.rst b/boards/lilygo/ttgo_t7v1_5/doc/index.rst index 13f5107cd80..57d12645c9a 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_t7v1_5/ttgo_t7v1_5_esp32_appcpu.dts b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_appcpu.dts index baca8424861..d61269a1d52 100644 --- a/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_appcpu.dts +++ b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_appcpu.dts @@ -13,7 +13,7 @@ compatible = "espressif,esp32"; chosen { - zephyr,sram = &sram0; + zephyr,sram = &sram1; zephyr,ipc_shm = &shm0; zephyr,ipc = &ipm0; zephyr,flash = &flash0; diff --git a/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_appcpu_defconfig b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_appcpu_defconfig +++ b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu.dts b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu.dts index 4fab0e2ae72..735ba0a8c52 100644 --- a/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu.dts +++ b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu.dts @@ -22,7 +22,7 @@ }; chosen { - zephyr,sram = &sram0; + zephyr,sram = &sram1; zephyr,console = &uart0; zephyr,shell-uart = &uart0; zephyr,flash = &flash0; diff --git a/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu_defconfig b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu_defconfig index f029cac9e9e..e192c240251 100644 --- a/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu_defconfig +++ b/boards/lilygo/ttgo_t7v1_5/ttgo_t7v1_5_esp32_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/lilygo/ttgo_t8c3/doc/index.rst b/boards/lilygo/ttgo_t8c3/doc/index.rst index 4179528b6af..33cab641524 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_t8c3/ttgo_t8c3_defconfig b/boards/lilygo/ttgo_t8c3/ttgo_t8c3_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/lilygo/ttgo_t8c3/ttgo_t8c3_defconfig +++ b/boards/lilygo/ttgo_t8c3/ttgo_t8c3_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/lilygo/ttgo_t8s3/doc/index.rst b/boards/lilygo/ttgo_t8s3/doc/index.rst index 09455ed19a6..fb29b2e5f7b 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_appcpu_defconfig b/boards/lilygo/ttgo_t8s3/ttgo_t8s3_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/lilygo/ttgo_t8s3/ttgo_t8s3_appcpu_defconfig +++ b/boards/lilygo/ttgo_t8s3/ttgo_t8s3_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu.dts b/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu.dts index a034a9cb49a..0bc8b847092 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_t8s3/ttgo_t8s3_procpu_defconfig b/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu_defconfig index 723de34c471..d8fbaa87925 100644 --- a/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu_defconfig +++ b/boards/lilygo/ttgo_t8s3/ttgo_t8s3_procpu_defconfig @@ -1,6 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/lilygo/ttgo_tbeam/Kconfig b/boards/lilygo/ttgo_tbeam/Kconfig new file mode 100644 index 00000000000..c52379f257a --- /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 00000000000..3a2d17ac5cf --- /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 00000000000..3b3202cf8e4 --- /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 00000000000..91b3caa2c75 --- /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 00000000000..fad0e34cdca --- /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 00000000000..eb488921e4a 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 00000000000..fa6082abaa2 --- /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 00000000000..338e6e4e6ea --- /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 00000000000..a8a93a72bf8 --- /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 00000000000..3547f3e351a --- /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 00000000000..8eca6127690 --- /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 00000000000..48546641cad --- /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 00000000000..43143525fb5 --- /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 00000000000..6d2fe9c703a --- /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 00000000000..6b1097cdb38 --- /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 00000000000..c6a99b1032d --- /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 00000000000..3a2d17ac5cf --- /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 00000000000..ddca709de7a --- /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 00000000000..2f04d1fe886 --- /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 00000000000..e5295b2bec2 --- /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 00000000000..115cc04fa29 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 00000000000..3ea6b50446f --- /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 00000000000..02754ff2a73 --- /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 00000000000..874d3c94639 --- /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 00000000000..6db7d4c16e6 --- /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 00000000000..746472787cb --- /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/lilygo/ttgo_toiplus/ttgo_toiplus_defconfig b/boards/lilygo/ttgo_toiplus/ttgo_toiplus_defconfig new file mode 100644 index 00000000000..187793c76e8 --- /dev/null +++ b/boards/lilygo/ttgo_toiplus/ttgo_toiplus_defconfig @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_GPIO=y diff --git a/boards/lilygo/twatch_s3/Kconfig b/boards/lilygo/twatch_s3/Kconfig new file mode 100644 index 00000000000..8d5a48cfc2c --- /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 00000000000..f7e4f32af39 --- /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 00000000000..7d37de9b1aa --- /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 00000000000..338ccb6bec9 --- /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 00000000000..2f04d1fe886 --- /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 00000000000..e894af0d251 --- /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 00000000000..b79ef681317 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 00000000000..3dc07e37673 --- /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 00000000000..0b2c4909fe0 --- /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 00000000000..b62a16f797a --- /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 00000000000..35d19fc17b1 --- /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 00000000000..e834a090c9f --- /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 00000000000..48546641cad --- /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 00000000000..b78676a8b0a --- /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 00000000000..975c4750ac0 --- /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 00000000000..d8fbaa87925 --- /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 b91c0700def..bfc13c12181 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 f000b61f316..1b0a13b77df 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/esp32c3_luatos_core/esp32c3_luatos_core_defconfig b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_defconfig +++ b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_esp32c3_usb_defconfig b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_esp32c3_usb_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_esp32c3_usb_defconfig +++ b/boards/luatos/esp32c3_luatos_core/esp32c3_luatos_core_esp32c3_usb_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core.dtsi index 43ee4b45264..fc3c57e1b9f 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/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_defconfig b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_defconfig +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_usb_defconfig b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_usb_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_usb_defconfig +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_appcpu_usb_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_defconfig b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_defconfig index d789bab1824..d8fbaa87925 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_defconfig +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb_defconfig b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb_defconfig index d789bab1824..d8fbaa87925 100644 --- a/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb_defconfig +++ b/boards/luatos/esp32s3_luatos_core/esp32s3_luatos_core_procpu_usb_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/m5stack/m5stack_atom_lite/doc/index.rst b/boards/m5stack/m5stack_atom_lite/doc/index.rst index 87e56a23677..9b84f801fd6 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_appcpu_defconfig b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_appcpu_defconfig +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 012c2b1f8fe..226b1d1a004 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_atom_lite/m5stack_atom_lite_procpu_defconfig b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu_defconfig index 0ec9d053667..c3c35f0cfe9 100644 --- a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu_defconfig +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_GPIO=y CONFIG_CONSOLE=y diff --git a/boards/m5stack/m5stack_atoms3/doc/index.rst b/boards/m5stack/m5stack_atoms3/doc/index.rst index 1b863cb08be..9cedbfb5180 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_appcpu_defconfig b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_appcpu_defconfig +++ b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu.dts index ed963407407..bb81fbbb39f 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/m5stack_atoms3_procpu_defconfig b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu_defconfig index 88c69e52e8c..60b1ee000fc 100644 --- a/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu_defconfig +++ b/boards/m5stack/m5stack_atoms3/m5stack_atoms3_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_GPIO=y CONFIG_REGULATOR=y # for LCD backlight diff --git a/boards/m5stack/m5stack_atoms3_lite/doc/index.rst b/boards/m5stack/m5stack_atoms3_lite/doc/index.rst index 23af62d96e6..8403358be1e 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_appcpu_defconfig b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_appcpu_defconfig +++ b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y 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 c5884a846a1..60bc3d6429a 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_atoms3_lite/m5stack_atoms3_lite_procpu_defconfig b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu_defconfig index d789bab1824..d8fbaa87925 100644 --- a/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu_defconfig +++ b/boards/m5stack/m5stack_atoms3_lite/m5stack_atoms3_lite_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/m5stack/m5stack_core2/Kconfig.defconfig b/boards/m5stack/m5stack_core2/Kconfig.defconfig index 155a3c1d39c..1999b90c5b8 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 @@ -23,9 +23,6 @@ config GPIO_AXP192_INIT_PRIORITY config REGULATOR_FIXED_INIT_PRIORITY default 75 -config INPUT_FT5336_INTERRUPT - default y if INPUT - config INPUT default y diff --git a/boards/m5stack/m5stack_core2/doc/index.rst b/boards/m5stack/m5stack_core2/doc/index.rst index 9855ef1de59..fb21227767c 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_appcpu_defconfig b/boards/m5stack/m5stack_core2/m5stack_core2_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/m5stack/m5stack_core2/m5stack_core2_appcpu_defconfig +++ b/boards/m5stack/m5stack_core2/m5stack_core2_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts b/boards/m5stack/m5stack_core2/m5stack_core2_procpu.dts index 554e1885488..172fb1c6c5d 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 008eb0afc9e..0fcad2e5e26 100644 --- a/boards/m5stack/m5stack_core2/m5stack_core2_procpu_defconfig +++ b/boards/m5stack/m5stack_core2/m5stack_core2_procpu_defconfig @@ -1,12 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 -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/Kconfig.defconfig b/boards/m5stack/m5stack_cores3/Kconfig.defconfig index b31bac7c90a..fe718f3cf4a 100644 --- a/boards/m5stack/m5stack_cores3/Kconfig.defconfig +++ b/boards/m5stack/m5stack_cores3/Kconfig.defconfig @@ -5,9 +5,6 @@ if BOARD_M5STACK_CORES3_ESP32S3_PROCPU || BOARD_M5STACK_CORES3_ESP32S3_PROCPU_SE -config INPUT_FT5336_INTERRUPT - default y if INPUT - config INPUT default y diff --git a/boards/m5stack/m5stack_cores3/doc/index.rst b/boards/m5stack/m5stack_cores3/doc/index.rst index d9025e3f6d8..2fdd042c38e 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_appcpu_defconfig b/boards/m5stack/m5stack_cores3/m5stack_cores3_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_appcpu_defconfig +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu.dts b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu.dts index 1def598cdec..5a579251bb6 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu.dts +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu.dts @@ -30,3 +30,20 @@ reg = <0x10>; }; }; + +®ulator { + vddcam_3v3: ALDO3 { + regulator-min-microvolt = <3000000>; + /* regulator-init-microvolt = <3300000>; */ + regulator-max-microvolt = <3500000>; + regulator-boot-on; + status = "okay"; + }; + + avdd: BLDO1 { + regulator-min-microvolt = <2700000>; + /* regulator-init-microvolt = <2800000>; */ + regulator-max-microvolt = <3300000>; + status = "okay"; + }; +}; diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi index 9b9b8991a15..1d4fd8c4a6f 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi @@ -31,6 +31,7 @@ watchdog0 = &wdt0; rtc = &bm8563_rtc; sdhc0 = &sd0; + led0 = &axp2101_led; }; lvgl_pointer { @@ -78,13 +79,101 @@ pinctrl-0 = <&i2c0_default>; pinctrl-names = "default"; + axp2101@34 { + compatible = "x-powers,axp2101"; + reg = <0x34>; + status = "okay"; + + regulator: regulator { + compatible = "x-powers,axp2101-regulator"; + status = "okay"; + + /* + * Typically, no initialization is performed since non-volatile + * values are used. + * If you remove the commenting, initialization will be performed + * with the default value. + */ + + vdd_3v3: DCDC1 { + regulator-min-microvolt = <3000000>; + /* regulator-init-microvolt = <3300000>; */ + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + status = "okay"; + }; + + vcc_3v3: DCDC3 { + regulator-min-microvolt = <3100000>; + /* regulator-init-microvolt = <3300000>; */ + regulator-max-microvolt = <3500000>; + regulator-boot-on; + regulator-always-on; + status = "okay"; + }; + + vdd_1v8: ALDO1 { + regulator-min-microvolt = <1700000>; + /* regulator-init-microvolt = <1800000>; */ + regulator-max-microvolt = <1900000>; + regulator-boot-on; + status = "okay"; + }; + + vdda_3v3: ALDO2 { + regulator-min-microvolt = <3100000>; + /* regulator-init-microvolt = <3300000>; */ + regulator-max-microvolt = <3500000>; + regulator-boot-on; + status = "okay"; + }; + + vdd_3v3_sd: ALDO4 { + regulator-min-microvolt = <3100000>; + /* regulator-init-microvolt = <3300000>; */ + regulator-max-microvolt = <3500000>; + regulator-boot-on; + status = "okay"; + }; + + dvdd: BLDO2 { + regulator-min-microvolt = <3100000>; + /* regulator-init-microvolt = <3300000>; */ + regulator-max-microvolt = <3500000>; + status = "okay"; + }; + + vcc_bl: DLDO1 { + regulator-min-microvolt = <2500000>; + /* regulator-init-microvolt = <3300000>; */ + regulator-max-microvolt = <3300000>; + regulator-boot-on; + status = "okay"; + }; + }; + + charger: charger { + compatible = "x-powers,axp2101-charger"; + constant-charge-current-max-microamp = <200000>; + constant-charge-voltage-max-microvolt = <4200000>; + charge-term-current-microamp = <125000>; + }; + + axp2101_led: led { + compatible = "x-powers,axp2101-led"; + status = "okay"; + x-powers,mode = "by-reg"; + }; + }; + bm8563_rtc: bm8563@51 { compatible = "nxp,pcf8563"; reg = <0x51>; status = "okay"; }; - aw9523b@58 { + aw9523b: aw9523b@58 { compatible = "awinic,aw9523b"; reg = <0x58>; status = "okay"; @@ -156,3 +245,7 @@ &esp32_bt_hci { status = "okay"; }; + +&wifi { + status = "okay"; +}; diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_defconfig b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_defconfig index 6539bd42e59..187793c76e8 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_defconfig +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_defconfig @@ -1,6 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_se_defconfig b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_se_defconfig index 6539bd42e59..187793c76e8 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_se_defconfig +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_se_defconfig @@ -1,6 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/m5stack/m5stack_stamps3/doc/index.rst b/boards/m5stack/m5stack_stamps3/doc/index.rst index 3762fd49b1c..4e006eca8a3 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_appcpu_defconfig b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/m5stack/m5stack_stamps3/m5stack_stamps3_appcpu_defconfig +++ b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu.dts index f2733a57195..d2aa01fa61c 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/m5stack_stamps3/m5stack_stamps3_procpu_defconfig b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu_defconfig index 466f9999601..68d1fe58d2e 100644 --- a/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu_defconfig +++ b/boards/m5stack/m5stack_stamps3/m5stack_stamps3_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_GPIO=y CONFIG_CONSOLE=y diff --git a/boards/m5stack/m5stickc_plus/Kconfig.defconfig b/boards/m5stack/m5stickc_plus/Kconfig.defconfig index 86819dba82d..9399c4d1f32 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 f40e21fbd5e..e6e65a3e1d8 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_appcpu_defconfig b/boards/m5stack/m5stickc_plus/m5stickc_plus_appcpu_defconfig index 9abf2ff0430..48546641cad 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_appcpu_defconfig +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_appcpu_defconfig @@ -1,4 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CLOCK_CONTROL=y diff --git a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu.dts index 6b1a2dd8ba2..2a85c2c0353 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/m5stickc_plus/m5stickc_plus_procpu_defconfig b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu_defconfig index 6b210f481bc..35626ba6fea 100644 --- a/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu_defconfig +++ b/boards/m5stack/m5stickc_plus/m5stickc_plus_procpu_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/m5stack/stamp_c3/doc/index.rst b/boards/m5stack/stamp_c3/doc/index.rst index a953b595b2c..704bacc6cad 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 cbd3a3fdd92..800ae9f36c0 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/m5stack/stamp_c3/stamp_c3_defconfig b/boards/m5stack/stamp_c3/stamp_c3_defconfig index ef633ce56a1..187793c76e8 100644 --- a/boards/m5stack/stamp_c3/stamp_c3_defconfig +++ b/boards/m5stack/stamp_c3/stamp_c3_defconfig @@ -1,7 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_MAIN_STACK_SIZE=2048 - CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y diff --git a/boards/madmachine/mm_feather/doc/index.rst b/boards/madmachine/mm_feather/doc/index.rst index 7c1b985fc70..c717db21baa 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 0b655edd1c2..ea9dd21d797 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_feather/mm_feather.yaml b/boards/madmachine/mm_feather/mm_feather.yaml index a8af021d856..a4541bc88a8 100644 --- a/boards/madmachine/mm_feather/mm_feather.yaml +++ b/boards/madmachine/mm_feather/mm_feather.yaml @@ -11,7 +11,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 32768 flash: 8192 supported: diff --git a/boards/madmachine/mm_swiftio/doc/index.rst b/boards/madmachine/mm_swiftio/doc/index.rst index 6845fa1fa36..80cff7d6c96 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 cbdf85c3c12..814c448c1d8 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/madmachine/mm_swiftio/mm_swiftio.yaml b/boards/madmachine/mm_swiftio/mm_swiftio.yaml index cc27cbe2540..dbd5b79b7b6 100644 --- a/boards/madmachine/mm_swiftio/mm_swiftio.yaml +++ b/boards/madmachine/mm_swiftio/mm_swiftio.yaml @@ -11,7 +11,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 32768 flash: 8192 supported: diff --git a/boards/makerbase/mks_canable_v20/doc/index.rst b/boards/makerbase/mks_canable_v20/doc/index.rst index 0a86e6fa6fc..abc27df5189 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/nrf52832_mdk/nrf52832_mdk.yaml b/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.yaml index 68b42cf5afa..3218983ff38 100644 --- a/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.yaml +++ b/boards/makerdiary/nrf52832_mdk/nrf52832_mdk.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 64 flash: 512 supported: diff --git a/boards/makerdiary/nrf52840_mdk/nrf52840_mdk.yaml b/boards/makerdiary/nrf52840_mdk/nrf52840_mdk.yaml index c3be56dacaa..79d62b2bf32 100644 --- a/boards/makerdiary/nrf52840_mdk/nrf52840_mdk.yaml +++ b/boards/makerdiary/nrf52840_mdk/nrf52840_mdk.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - usb_device - ble diff --git a/boards/makerdiary/nrf52840_mdk_usb_dongle/doc/index.rst b/boards/makerdiary/nrf52840_mdk_usb_dongle/doc/index.rst index ac4743c7748..83b5621bee8 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/makerdiary/nrf52840_mdk_usb_dongle/nrf52840_mdk_usb_dongle.yaml b/boards/makerdiary/nrf52840_mdk_usb_dongle/nrf52840_mdk_usb_dongle.yaml index e714e1cafb5..f0fa9668e55 100644 --- a/boards/makerdiary/nrf52840_mdk_usb_dongle/nrf52840_mdk_usb_dongle.yaml +++ b/boards/makerdiary/nrf52840_mdk_usb_dongle/nrf52840_mdk_usb_dongle.yaml @@ -7,7 +7,6 @@ flash: 1024 toolchain: - zephyr - gnuarmemb - - xtools supported: - usb_device - ble diff --git a/boards/mediatek/mt8186/afe-mt8186.dts b/boards/mediatek/mt8186/afe-mt8186.dts new file mode 100644 index 00000000000..e6bd2ac557c --- /dev/null +++ b/boards/mediatek/mt8186/afe-mt8186.dts @@ -0,0 +1,54 @@ + afe_dl1: afe_dl1 { + compatible = "mediatek,afe"; + afe-name = "DL1"; + dai-id = <0>; + downlink; + base = <0x11210050 0x11210054>; + cur = <0x11210058 0x1121005c>; + end = <0x11210060 0x11210064>; + fs = <0x1121004c 24 4>; + mono = <0x1121004c 8 1>; + enable = <0x11210010 4 1>; + hd = <0x1121004c 0 1>; + }; + + afe_dl2: afe_dl2 { + compatible = "mediatek,afe"; + afe-name = "DL2"; + dai-id = <1>; + downlink; + base = <0x1121006c 0x11210070>; + cur = <0x11210074 0x11210078>; + end = <0x1121007c 0x11210080>; + fs = <0x11210068 24 4>; + mono = <0x11210068 8 1>; + enable = <0x11210010 5 1>; + hd = <0x11210068 0 1>; + }; + + afe_ul1: afe_ul1 { + compatible = "mediatek,afe"; + 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>; + enable = <0x11210010 31 1>; + hd = <0x11210374 0 1>; + }; + + afe_ul2: afe_ul2 { + compatible = "mediatek,afe"; + afe-name = "UL2"; + dai-id = <3>; + base = <0x11210860 0x11210864>; + cur = <0x11210868 0x1121086c>; + end = <0x11210870 0x11210874>; + fs = <0x1121085c 24 4>; + mono = <0x1121085c 8 1>; + enable = <0x11210010 16 1>; + hd = <0x1121085c 0 1>; + }; diff --git a/boards/mediatek/mt8188/afe-mt8188.dts b/boards/mediatek/mt8188/afe-mt8188.dts new file mode 100644 index 00000000000..fbe47f5a2b4 --- /dev/null +++ b/boards/mediatek/mt8188/afe-mt8188.dts @@ -0,0 +1,67 @@ + afe_dl2: afe_dl2 { + compatible = "mediatek,afe"; + afe-name = "DL2"; + dai-id = <0>; + downlink; + base = <0x00000000 0x10b11250>; + cur = <0x00000000 0x10b11254>; + end = <0x00000000 0x10b11258>; + fs = <0x10b115a0 10 5>; + enable = <0x10b11200 18 1>; + hd = <0x10b1125c 5 1>; + msb = <0x10b1192c 18 1>; + msb2 = <0x10b11930 18 1>; + agent-disable = <0x10b10014 18 1>; + ch-num = <0x10b1125c 0 5>; + }; + + afe_dl3: afe_dl3 { + compatible = "mediatek,afe"; + afe-name = "DL3"; + dai-id = <1>; + downlink; + base = <0x00000000 0x10b11260>; + cur = <0x00000000 0x10b11264>; + end = <0x00000000 0x10b11268>; + fs = <0x10b115a0 15 5>; + enable = <0x10b11200 19 1>; + hd = <0x10b1126c 5 1>; + msb = <0x10b1192c 19 1>; + msb2 = <0x10b11930 19 1>; + agent-disable = <0x10b10014 19 1>; + ch-num = <0x10b1126c 0 5>; + }; + + afe_ul4: afe_ul4 { + compatible = "mediatek,afe"; + 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>; + enable = <0x10b11200 4 1>; + hd = <0x10b1133c 5 1>; + msb = <0x10b1192c 3 1>; + msb2 = <0x10b11930 3 1>; + agent-disable = <0x10b10014 3 1>; + }; + + afe_ul5: afe_ul5 { + compatible = "mediatek,afe"; + 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>; + enable = <0x10b11200 5 1>; + hd = <0x10b1134c 5 1>; + msb = <0x10b1192c 4 1>; + msb2 = <0x10b11930 4 1>; + agent-disable = <0x10b10014 4 1>; + }; diff --git a/boards/mediatek/mt8195/afe-mt8195.dts b/boards/mediatek/mt8195/afe-mt8195.dts new file mode 100644 index 00000000000..37b335754df --- /dev/null +++ b/boards/mediatek/mt8195/afe-mt8195.dts @@ -0,0 +1,65 @@ + afe_dl2: afe_dl2 { + compatible = "mediatek,afe"; + afe-name = "DL2"; + dai-id = <0>; + downlink; + base = <0x00000000 0x10891250>; + cur = <0x00000000 0x10891254>; + end = <0x00000000 0x10891258>; + fs = <0x108915a0 10 5>; + enable = <0x10891200 18 1>; + hd = <0x1089125c 5 1>; + msb = <0x1089192c 18 1>; + msb2 = <0x10891930 18 1>; + agent-disable = <0x10890014 18 1>; + ch-num = <0x1089125c 0 5>; + }; + + afe_dl3: afe_dl3 { + compatible = "mediatek,afe"; + afe-name = "DL3"; + dai-id = <1>; + downlink; + base = <0x00000000 0x10891260>; + cur = <0x00000000 0x10891264>; + end = <0x00000000 0x10891268>; + fs = <0x108915a0 15 5>; + enable = <0x10891200 19 1>; + hd = <0x1089126c 5 1>; + msb = <0x1089192c 19 1>; + msb2 = <0x10891930 19 1>; + agent-disable = <0x10890014 19 1>; + ch-num = <0x1089126c 0 5>; + }; + + afe_ul4: afe_ul4 { + compatible = "mediatek,afe"; + afe-name = "UL4"; + dai-id = <2>; + base = <0x00000000 0x10891330>; + cur = <0x00000000 0x10891334>; + end = <0x00000000 0x10891338>; + fs = <0x108915a8 15 5>; + mono = <0x1089133c 1 1>; + enable = <0x10891200 4 1>; + hd = <0x1089133c 5 1>; + msb = <0x1089192c 3 1>; + msb2 = <0x10891930 3 1>; + agent-disable = <0x10890014 3 1>; + }; + + afe_ul5: afe_ul5 { + compatible = "mediatek,afe"; + afe-name = "UL5"; + dai-id = <3>; + base = <0x00000000 0x10891340>; + cur = <0x00000000 0x10891344>; + end = <0x00000000 0x10891348>; + fs = <0x108915a8 20 5>; + mono = <0x1089134c 1 1>; + enable = <0x10891200 5 1>; + hd = <0x1089134c 5 1>; + msb = <0x1089192c 4 1>; + msb2 = <0x10891930 4 1>; + agent-disable = <0x10890014 4 1>; + }; diff --git a/boards/mediatek/mt8195/mt8195_adsp.dts b/boards/mediatek/mt8195/mt8195_adsp.dts index 76a2b94415a..53346746041 100644 --- a/boards/mediatek/mt8195/mt8195_adsp.dts +++ b/boards/mediatek/mt8195/mt8195_adsp.dts @@ -34,9 +34,9 @@ cpuclk: cpuclk@10000000 { compatible = "mediatek,mt8195_cpuclk"; reg = <0x10000000 380>; - cg_reg = <0x10720180>; - pll_ctrl_reg = <0x1000c7e0>; - freqs_mhz = <26 370 540 720>; + cg-reg = <0x10720180>; + pll-ctrl-reg = <0x1000c7e0>; + freqs-mhz = <26 370 540 720>; }; core_intc: core_intc@0 { diff --git a/boards/mediatek/mt8196/afe-mt8196.dts b/boards/mediatek/mt8196/afe-mt8196.dts new file mode 100644 index 00000000000..a28d9f658e1 --- /dev/null +++ b/boards/mediatek/mt8196/afe-mt8196.dts @@ -0,0 +1,66 @@ + afe_dl1: afe_dl1 { + compatible = "mediatek,afe"; + afe-name = "DL1"; + dai-id = <1>; + downlink; + base = <0x1a114470 0x1a114474>; + cur = <0x1a114478 0x1a11447c>; + end = <0x1a114480 0x1a114484>; + fs = <0x1a114490 8 5>; + mono = <0x1a114490 4 1>; + enable = <0x1a114490 28 1>; + hd = <0x1a114490 0 1>; + }; + + afe_dl_24ch: afe_dl_24ch { + compatible = "mediatek,afe"; + afe-name = "DL_24CH"; + dai-id = <0>; + downlink; + base = <0x1a114620 0x1a114624>; + cur = <0x1a114628 0x1a11462c>; + end = <0x1a114630 0x1a114634>; + fs = <0x1a114640 8 5>; + enable = <0x1a114640 31 1>; + hd = <0x1a114640 0 1>; + ch-num = <0x1a114640 24 6>; + }; + + afe_ul0: afe_ul0 { + compatible = "mediatek,afe"; + afe-name = "UL0"; + dai-id = <2>; + base = <0x1a114d60 0x1a114d64>; + cur = <0x1a114d68 0x1a114d6c>; + end = <0x1a114d70 0x1a114d74>; + fs = <0x1a114d80 8 5>; + mono = <0x1a114d80 4 1>; + enable = <0x1a114d80 28 1>; + hd = <0x1a114d80 0 1>; + }; + + afe_ul1: afe_ul1 { + compatible = "mediatek,afe"; + afe-name = "UL1"; + dai-id = <3>; + base = <0x1a114d90 0x1a114d94>; + cur = <0x1a114d98 0x1a114d9c>; + end = <0x1a114da0 0x1a114da4>; + fs = <0x1a114db0 8 5>; + mono = <0x1a114db0 4 1>; + enable = <0x1a114db0 28 1>; + hd = <0x1a114db0 0 1>; + }; + + afe_ul2: afe_ul2 { + compatible = "mediatek,afe"; + afe-name = "UL2"; + dai-id = <4>; + base = <0x1a114dc0 0x1a114dc4>; + cur = <0x1a114dc8 0x1a114dcc>; + end = <0x1a114dd0 0x1a114dd4>; + fs = <0x1a114de0 8 5>; + mono = <0x1a114de0 4 1>; + enable = <0x1a114de0 28 1>; + hd = <0x1a114de0 0 1>; + }; diff --git a/boards/mediatek/mt8196/mt8196_adsp.dts b/boards/mediatek/mt8196/mt8196_adsp.dts index 27fc2f0048a..f8bee05bbe4 100644 --- a/boards/mediatek/mt8196/mt8196_adsp.dts +++ b/boards/mediatek/mt8196/mt8196_adsp.dts @@ -101,6 +101,10 @@ interrupt-parent = <&intc_g2>; interrupts = <7 0 0>; }; + +/* Generated code for AFE devices */ +#include "afe-mt8196.dts" + }; /* soc */ chosen { }; diff --git a/boards/microchip/ev11l78a/doc/index.rst b/boards/microchip/ev11l78a/doc/index.rst index 95d05add0c0..15661123062 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/ev11l78a/ev11l78a.yaml b/boards/microchip/ev11l78a/ev11l78a.yaml index f9b2a1a53a2..88417ca90d9 100644 --- a/boards/microchip/ev11l78a/ev11l78a.yaml +++ b/boards/microchip/ev11l78a/ev11l78a.yaml @@ -7,7 +7,6 @@ flash: 64 toolchain: - zephyr - gnuarmemb - - xtools supported: - adc - gpio diff --git a/boards/microchip/m2gl025_miv/doc/index.rst b/boards/microchip/m2gl025_miv/doc/index.rst index 88a4fa2b951..d48d0bebcab 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 0ca8a90ad48..0b7eb516d7e 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 910ba104da1..8a65f871360 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 856069de406..7c5c131cf52 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; }; }; @@ -52,7 +50,7 @@ &i2c_smb_0 { status = "okay"; - port_sel = <0>; + port-sel = <0>; sda-gpios = ; scl-gpios = ; pinctrl-0 = < &i2c00_scl_gpio004 &i2c00_sda_gpio003 >; @@ -61,7 +59,7 @@ &i2c_smb_1 { status = "okay"; - port_sel = <1>; + port-sel = <1>; sda-gpios = ; scl-gpios = ; pinctrl-0 = < &i2c01_scl_gpio131 &i2c01_sda_gpio130 >; @@ -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 d78477f825f..da7c46a8a54 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 3039d18174e..164cb7182e7 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 229ba41dff7..01a7081bcf4 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 c712d74b563..9a3c9e22aeb 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 a70db14a3eb..fbc1aa677af 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; }; @@ -80,7 +78,7 @@ &i2c_smb_0 { status = "okay"; - port_sel = <0>; + port-sel = <0>; sda-gpios = ; scl-gpios = ; pinctrl-0 = < &i2c00_scl_gpio004 &i2c00_sda_gpio003 >; @@ -89,7 +87,7 @@ &i2c_smb_1 { status = "okay"; - port_sel = <1>; + port-sel = <1>; sda-gpios = ; scl-gpios = ; pinctrl-0 = < &i2c01_scl_gpio131 &i2c01_sda_gpio130 >; @@ -114,7 +112,7 @@ &i2c_smb_2 { status = "okay"; - port_sel = <7>; + port-sel = <7>; sda-gpios = ; scl-gpios = ; pinctrl-0 = < &i2c07_scl_gpio013 &i2c07_sda_gpio012 >; @@ -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 { diff --git a/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml b/boards/microchip/mec15xxevb_assy6853/mec15xxevb_assy6853.yaml index 8b8190d20d8..afd985cb020 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 51e8498df60..731a1c2d63f 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 2c93b83e744..00000000000 --- 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 0671beb4143..b05c4d5bd3f 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 c0427d03d3d..bc2ad391664 100644 --- a/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts +++ b/boards/microchip/mec172xevb_assy6906/mec172xevb_assy6906.dts @@ -125,7 +125,7 @@ /* I2C */ &i2c_smb_0 { status = "okay"; - port_sel = <0>; + port-sel = <0>; pinctrl-0 = < &i2c00_scl_gpio004 &i2c00_sda_gpio003 >; pinctrl-names = "default"; @@ -145,7 +145,7 @@ &i2c_smb_1 { status = "okay"; - port_sel = <1>; + port-sel = <1>; pinctrl-0 = <&i2c01_scl_gpio131 &i2c01_sda_gpio130>; pinctrl-names = "default"; @@ -180,7 +180,7 @@ &i2c_smb_2 { status = "okay"; - port_sel = <7>; + port-sel = <7>; pinctrl-0 = <&i2c07_scl_gpio013 &i2c07_sda_gpio012>; pinctrl-names = "default"; }; @@ -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 d1aeaeaac58..f2b72ae4282 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 92626f6319f..6e36ea0dec8 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 c3487f561e9..00000000000 --- 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 a6bc75fc8fb..18441232c41 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 94a08cd03f1..e5d7e888baa 100644 --- a/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts +++ b/boards/microchip/mec172xmodular_assy6930/mec172xmodular_assy6930.dts @@ -119,7 +119,7 @@ /* I2C */ &i2c_smb_0 { status = "okay"; - port_sel = <0>; + port-sel = <0>; pinctrl-0 = < &i2c00_scl_gpio004 &i2c00_sda_gpio003 >; pinctrl-names = "default"; @@ -139,7 +139,7 @@ &i2c_smb_1 { status = "okay"; - port_sel = <1>; + port-sel = <1>; pinctrl-0 = <&i2c01_scl_gpio131 &i2c01_sda_gpio130>; pinctrl-names = "default"; }; @@ -158,7 +158,7 @@ &i2c_smb_2 { status = "okay"; - port_sel = <7>; + port-sel = <7>; pinctrl-0 = <&i2c07_scl_gpio013 &i2c07_sda_gpio012>; pinctrl-names = "default"; }; @@ -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 c191b0b1555..ec6ae819151 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 00000000000..84b859f1f17 --- /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 00000000000..85a094ac8d1 --- /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 00000000000..b58c53c2bcc --- /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 00000000000..951583698bd --- /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 00000000000..0ea3dbcffa4 --- /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 00000000000..2d631fca280 --- /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 00000000000..840168650d4 --- /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 00000000000..2849b6b8a08 --- /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 00000000000..da25d132cef --- /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 00000000000..950e721cea8 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 00000000000..f71375f8690 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 00000000000..a2b52bd505c --- /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 00000000000..cfdc0564d2f --- /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 00000000000..47eaa31ebd3 --- /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 00000000000..fc4eb98d568 --- /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 00000000000..ae39df56b04 --- /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 00000000000..47eaa31ebd3 --- /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 00000000000..1187fef8a07 --- /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 00000000000..ad4578718f4 --- /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 00000000000..47eaa31ebd3 --- /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 00000000000..b2e7c570cc6 --- /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 00000000000..d825e2177d8 --- /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 00000000000..47eaa31ebd3 --- /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 00000000000..62ddf143691 --- /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 00000000000..b7428492fc6 --- /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 00000000000..8c630afbfc0 --- /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 ee5d07b5bda..12c57e62029 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 5a626a78364..d5fea8287b3 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.yaml b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.yaml index 9cc16dc9c8d..04a7c550fed 100644 --- a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.yaml +++ b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.yaml @@ -6,7 +6,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 32 flash: 256 supported: diff --git a/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig b/boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1_defconfig index 2e434ba45ea..1c187cb544c 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 02208b66bf3..02504c3bc9a 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/mini_m4_for_stm32/mikroe_mini_m4_for_stm32.yaml b/boards/mikroe/mini_m4_for_stm32/mikroe_mini_m4_for_stm32.yaml index e83b864f1ab..1ea71f99223 100644 --- a/boards/mikroe/mini_m4_for_stm32/mikroe_mini_m4_for_stm32.yaml +++ b/boards/mikroe/mini_m4_for_stm32/mikroe_mini_m4_for_stm32.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 128 flash: 1024 supported: diff --git a/boards/mikroe/stm32_m4_clicker/doc/index.rst b/boards/mikroe/stm32_m4_clicker/doc/index.rst index 8bddfd3f7aa..77f52fa96bf 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/mikroe/stm32_m4_clicker/mikroe_stm32_m4_clicker.yaml b/boards/mikroe/stm32_m4_clicker/mikroe_stm32_m4_clicker.yaml index 96d16aa2d63..361df157777 100644 --- a/boards/mikroe/stm32_m4_clicker/mikroe_stm32_m4_clicker.yaml +++ b/boards/mikroe/stm32_m4_clicker/mikroe_stm32_m4_clicker.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools ram: 128 flash: 1024 supported: diff --git a/boards/mxchip/az3166_iotdevkit/az3166_iotdevkit.yaml b/boards/mxchip/az3166_iotdevkit/az3166_iotdevkit.yaml index bcb0ab9aa29..e67ec4da930 100644 --- a/boards/mxchip/az3166_iotdevkit/az3166_iotdevkit.yaml +++ b/boards/mxchip/az3166_iotdevkit/az3166_iotdevkit.yaml @@ -5,7 +5,6 @@ arch: arm toolchain: - zephyr - gnuarmemb - - xtools supported: - gpio - pwm diff --git a/boards/mxchip/az3166_iotdevkit/doc/index.rst b/boards/mxchip/az3166_iotdevkit/doc/index.rst index 230073f8295..8ea178b7f93 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 8906001f177..6b6a5a5e10e 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 b86941cc854..00000000000 --- 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 b629778f4cb..00000000000 --- 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 2d896061f78..00000000000 --- 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 cb7c03889c4..00000000000 --- 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 c3f7c89918d..00000000000 --- 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 07defd4185b..00000000000 --- 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 21c29768c8e..00000000000 --- 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 572617a0736..00000000000 --- 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 aa0ef1e6974..00000000000 --- 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 05d445ddd1b..00000000000 --- 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 8723505658a..00000000000 --- 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