yangsong8-a1 opened a new pull request, #21935: URL: https://github.com/apache/nuttx/pull/21935
## Summary Rebased on top of the merged OCU framework (#21851): this PR adds the i.MX GPT lower halves: - the shared core maps the MMIO block, starts the free-running counter and owns the single interrupt that dispatches compare-match events; - the OCU lower-half registers each channel as /dev/ocuN, plugging into the generic OCU upper-half (TIMER_IMX_GPT_NUM_OCU, 1-3, default 1); - the ICU lower-half registers each channel as /dev/capN, deriving frequency, duty cycle and edge count from captured counter values and plugging into the generic capture upper-half (TIMER_IMX_GPT_NUM_ICU, 1-2, default 1). ## Impact New driver, no change to existing code. Enabled with CONFIG_TIMER_IMX_GPT plus CONFIG_TIMER_IMX_GPT_OCU / CONFIG_TIMER_IMX_GPT_ICU. ## Testing Ubuntu 22.04, QEMU 6.2. Builds with no new warnings: - qemu-armv8a:nsh + TIMER + TIMER_IMX_GPT + TIMER_IMX_GPT_OCU + TIMER_IMX_GPT_ICU + OCU (aarch64-none-elf-gcc 13.2) - sabre-6quad:nsh + TIMER + TIMER_IMX_GPT + TIMER_IMX_GPT_ICU + OCU (arm-none-eabi-gcc 10.3) Ran on QEMU sabrelite(The GPT model implements a free-running counter and compare-match interrupts.) The system-level GPT driver has been stubbed out to allow the test exclusive access to GPT1. The test program uses `imx_gpt_initialize()` to register 3 OCU (Output Compare Unit) channels and 2 ICU (Input Compare Unit) channels. OCU matches are delivered via signals, and the channels are reloaded using `OCUIOC_SETADVANCETHRESHOLD`. IMXGPT imx_gpt_initialize ret=0 errno=0 IMXGPT /dev/ocu0 match 1 sigwait ret=0 sig=10 counter=33143248 threshold=33102531 IMXGPT /dev/ocu0 match 2 sigwait ret=0 sig=10 counter=66107883 threshold=66102531 IMXGPT /dev/ocu0 match 3 sigwait ret=0 sig=10 counter=99108202 threshold=99102531 IMXGPT /dev/ocu1 match 1 sigwait ret=0 sig=12 counter=132172019 threshold=132166541 IMXGPT /dev/ocu1 match 2 sigwait ret=0 sig=12 counter=165170977 threshold=165166541 IMXGPT /dev/cap0 FREQUENCY ret=0 freq=0 (no input signal) IMXGPT /dev/cap0 EDGES ret=0 edges=0 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
