yangsong8-a1 opened a new pull request, #21888:
URL: https://github.com/apache/nuttx/pull/21888
## Summary
depends-on: apache/nuttx/pull/21851
The first three commits belong to #21851 (OCU framework); this PR adds
the i.MX GPT lower halves on top:
- 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_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, whose GPT model implements the free-running
counter and the compare-match interrupts. The board system-tick GPT
driver was stubbed out for the run so the test owned GPT1; a test
program registered the device with imx_gpt_initialize() (3 OCU + 2 ICU
channels) and exercised it. OCU compare matches are delivered to the
requesting task as a signal and re-armed with
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
QEMU provides no input-capture signal source, so the ICU channels could
only be opened and queried (frequency, duty cycle and edge count all
return OK with 0 edges).
--
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]