feat(edma): EDMA driver implementation and host unit tests #102

Merged
hoogv merged 1 commit from feat/101-edma-driver into dev 2026-07-23 18:17:00 +00:00
Owner

Description

Adds hal/dss/edma/hal_edma.c/.h — the EDMA (TPCC/TPTC) driver: bring-up (clears latched error status — no software-visible reset control exists for this block), hal_edma_configure_transfer() (fills one PaRAM entry for a basic AB-Sync one-shot transfer, arming the completion interrupt for that channel), hal_edma_trigger_manual()/hal_edma_channel_enable()/hal_edma_channel_disable() (write-1-to-set/clear strobes), and the six raw device handlers (EDMA_TPCC0_DONE_IRQHandler/EDMA_TPCC0_ERROR_IRQHandler/EDMA_TPTC0_DONE_IRQHandler/EDMA_TPTC0_ERROR_IRQHandler/EDMA_TPTC1_DONE_IRQHandler/EDMA_TPTC1_ERROR_IRQHandler) decoding/clearing status to a weak, application-overridable hal_edma_irq_handler() hook. Both independent TPCC instances supported (TPCC0 owning TPTC0/TPTC1, TPCC1 owning TPTC2/TPTC3), though only TPCC0's channels have VIM routing. Self-contained — no cross-module dependency.

Deliberately minimal one-shot-transfer scope (documented in hal_edma.h's top-of-file comment): no QDMA, no chained/linked transfers, no manual-mode/A-Sync edge cases beyond basic AB-Sync, no per-shadow-region interrupt-enable shadowing.

Why

Continues the DSS-side driver batch started by Mailbox (#99/#100).

Closes #101

Type of Change

  • New feature

Impact Assessment

  • Functional impact: None — self-contained addition alongside the already-landed Mailbox driver.
  • Regulatory impact: None.
  • QMS impact: None.
  • Risk impact: No — existing risk coverage sufficient.

Testing

  • CI pipeline passes (compile, unit tests, integration tests, static analysis)
  • Manually tested: built and ran testing/dss/edma/test_edma_functional locally (5 test cases, 91 assertions, all passing) alongside the full existing ctest suite (343/343 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings, -DENABLE_EDMA_MODULE added); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by flipping hal_edma_configure_transfer()'s OPT.SYNCDIM bit from 1 to 0, confirming the test suite fails (1 assertion), then reverting.
  • No regressions observed in related areas

PR Size

  • XL (> 300 lines) — must split unless exemption declared

Size justification / exemption (if L or XL):

882 raw lines across 6 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (hal_edma.c/.h, 596 lines) and its comprehensive Catch2 spec (test_edma.c, 278 lines, covering both TPCC instances, PaRAM entry configuration, channel bounds checking, and all six IRQ handlers) don't decompose into independently-reviewable sub-PRs, same rationale as every prior driver PR in this project. The remaining files are small CMake/MISRA wiring diffs, also not independently reviewable apart from the driver they enable.

Checklist

  • Commit messages follow type(scope): description convention with Relates to #<issue> footer
  • PR template filled in completely
  • No unverified external binaries introduced (see QMS-GITFLOW-001 Binary Security section)
  • All commits leave the codebase in a compilable, passing-tests state (Commit Integrity Rule)

Summary

  • hal/dss/edma/hal_edma.c/.h: EDMA driver (bring-up, PaRAM transfer config, trigger/enable/disable, IRQ handlers) — QDMA/chaining/shadow-region interrupt shadowing out of scope, documented in the header's top-of-file comment
  • testing/dss/edma/test_edma.c (+ CMakeLists.txt): Catch2 functional test suite. Named test_edma_functional (not test_edma) to avoid a CMake target-name collision with ti_hal_comparison/test_edma.c's register-layout comparison test.
  • testing/CMakeLists.txt: add_subdirectory(dss/edma) and ENABLE_EDMA_MODULE in the shared hw_fakes compile definitions
  • tools/misra/run_misra.sh: -DENABLE_EDMA_MODULE added
## Description Adds `hal/dss/edma/hal_edma.c`/`.h` — the EDMA (TPCC/TPTC) driver: bring-up (clears latched error status — no software-visible reset control exists for this block), `hal_edma_configure_transfer()` (fills one PaRAM entry for a basic AB-Sync one-shot transfer, arming the completion interrupt for that channel), `hal_edma_trigger_manual()`/`hal_edma_channel_enable()`/`hal_edma_channel_disable()` (write-1-to-set/clear strobes), and the six raw device handlers (`EDMA_TPCC0_DONE_IRQHandler`/`EDMA_TPCC0_ERROR_IRQHandler`/`EDMA_TPTC0_DONE_IRQHandler`/`EDMA_TPTC0_ERROR_IRQHandler`/`EDMA_TPTC1_DONE_IRQHandler`/`EDMA_TPTC1_ERROR_IRQHandler`) decoding/clearing status to a weak, application-overridable `hal_edma_irq_handler()` hook. Both independent TPCC instances supported (TPCC0 owning TPTC0/TPTC1, TPCC1 owning TPTC2/TPTC3), though only TPCC0's channels have VIM routing. Self-contained — no cross-module dependency. Deliberately minimal one-shot-transfer scope (documented in `hal_edma.h`'s top-of-file comment): no QDMA, no chained/linked transfers, no manual-mode/A-Sync edge cases beyond basic AB-Sync, no per-shadow-region interrupt-enable shadowing. ## Why Continues the DSS-side driver batch started by Mailbox (#99/#100). ## Related Issue Closes #101 ## Type of Change - [x] New feature ## Impact Assessment - **Functional impact:** None — self-contained addition alongside the already-landed Mailbox driver. - **Regulatory impact:** None. - **QMS impact:** None. - **Risk impact:** No — existing risk coverage sufficient. ## Testing - [x] CI pipeline passes (compile, unit tests, integration tests, static analysis) - [x] Manually tested: built and ran `testing/dss/edma/test_edma_functional` locally (5 test cases, 91 assertions, all passing) alongside the full existing `ctest` suite (343/343 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings, `-DENABLE_EDMA_MODULE` added); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by flipping `hal_edma_configure_transfer()`'s `OPT.SYNCDIM` bit from 1 to 0, confirming the test suite fails (1 assertion), then reverting. - [x] No regressions observed in related areas ## PR Size - [x] XL (> 300 lines) — must split unless exemption declared **Size justification / exemption (if L or XL):** 882 raw lines across 6 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (`hal_edma.c`/`.h`, 596 lines) and its comprehensive Catch2 spec (`test_edma.c`, 278 lines, covering both TPCC instances, PaRAM entry configuration, channel bounds checking, and all six IRQ handlers) don't decompose into independently-reviewable sub-PRs, same rationale as every prior driver PR in this project. The remaining files are small CMake/MISRA wiring diffs, also not independently reviewable apart from the driver they enable. ## Checklist - [x] Commit messages follow `type(scope): description` convention with `Relates to #<issue>` footer - [x] PR template filled in completely - [x] No unverified external binaries introduced (see QMS-GITFLOW-001 Binary Security section) - [x] All commits leave the codebase in a compilable, passing-tests state (Commit Integrity Rule) ## Summary - `hal/dss/edma/hal_edma.c`/`.h`: EDMA driver (bring-up, PaRAM transfer config, trigger/enable/disable, IRQ handlers) — QDMA/chaining/shadow-region interrupt shadowing out of scope, documented in the header's top-of-file comment - `testing/dss/edma/test_edma.c` (+ `CMakeLists.txt`): Catch2 functional test suite. Named `test_edma_functional` (not `test_edma`) to avoid a CMake target-name collision with `ti_hal_comparison/test_edma.c`'s register-layout comparison test. - `testing/CMakeLists.txt`: `add_subdirectory(dss/edma)` and `ENABLE_EDMA_MODULE` in the shared `hw_fakes` compile definitions - `tools/misra/run_misra.sh`: `-DENABLE_EDMA_MODULE` added
feat(edma): EDMA driver implementation and host unit tests
All checks were successful
lint / clang-format (pull_request) Successful in 19s
lint / misra (pull_request) Successful in 50s
lint / clang-format (push) Successful in 9s
tests / host-tests (pull_request) Successful in 46s
tests / host-tests (push) Successful in 43s
lint / misra (push) Successful in 50s
3c68603f71
Adds hal/dss/edma/hal_edma.c/.h - TPCC/TPTC bring-up (clears latched
error status, no software-visible reset exists), one-shot AB-Sync
PaRAM transfer configuration with per-channel interrupt arming,
manual trigger/channel enable/disable strobes, and the six raw device
handlers decoding/clearing status to a weak hal_edma_irq_handler()
hook. Both TPCC instances supported; only TPCC0's channels have VIM
routing. QDMA, chaining, and per-shadow-region interrupt shadowing
are out of scope - see hal_edma.h's top-of-file comment.

Relates to #4, relates to #99, relates to #101
hoogv added this to the Development project 2026-07-23 18:17:09 +00:00
hoogv self-assigned this 2026-07-23 18:17:10 +00:00
Sign in to join this conversation.
No reviewers
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
opendutchsolutions.public/hal_awr6843!102
No description provided.