dcgong2917 opened a new pull request, #20662:
URL: https://github.com/apache/nuttx/pull/20662

   ## Summary
   
   Exposes two RTL8730E general-purpose timers and the on-chip
   watchdog through the shared Ameba timer/watchdog drivers, each gated by its
   own CONFIG_AMEBA_TIMER/CONFIG_AMEBA_WDG (both disabled by default). No
   common driver code changes -- everything chip-specific goes in the new
   ameba_timer_chip.h/ameba_wdg_chip.h, so the other Ameba ICs are untouched.
   
   Timer: exposes /dev/timer0 (TIM2) and /dev/timer1 (TIM3), both 32-bit
   LP basic timers at 32.768 kHz. TIM0 and TIM1 are deliberately not exposed:
   the AP ROM claims TIM0 as the always-on system timer behind
   DelayUs()/SYSTIMER_*, and the vendor HAL claims TIM1 as its application
   (us_ticker.c) and UART-timeout (serial_api.c) timer. The RCC
   masks sit in group 2 with the per-timer bit at 16 + n, distinct from the SPI
   (group 1) and I2C (group 0) blocks on this same chip.
   
   Watchdog: exposes /dev/watchdog0, driving WDG4 -- the CA32 non-secure
   system watchdog -- matching the vendor HAL wdt_api.c, which selects
   WDG4_DEV/WDG4_IRQ for CONFIG_ARM_CORE_CA32 (KM4 uses WDG2 instead). All
   WDG_* symbols the driver calls are in the AP ROM, so this driver needs no
   RAM-side fwlib source.
   
   CMake fix: while bringing these two up under CMake, found and fixed a
   pre-existing defect in the RTL8730E CMakeLists.txt: the libameba_fwlib.a
   build block was gated on CONFIG_RTL8730E_FLASH_FS/CONFIG_RTL8730E_WIFI
   only, so a driver-only config (i2c, spi, pwm, timer) never built the
   archive even though the link step below unconditionally lists those
   drivers -- linking whatever (or no) archive a previous config had left in
   the board tree. Confirmed on a clean upstream/master checkout that this also
   broke the already-merged pwm config under CMake. Widened the build
   condition to match the drivers whose SDK support is not in lib_rom.a, and
   made the archive step remove the old archive before repacking it (it lives
   in the board source tree and is shared across build directories, so
   ar crs alone left members from a previously built config behind).
   
   ## Impact
   
   New peripheral drivers for one board, both disabled by default, plus a
   CMake-only build fix for the same board's already-merged drivers. No change
   to any shared driver, nor to any other chip or board.
   
   ## Testing
   
   Hardware: RTL8730E EVB. Timer: periodic interrupts firing at the correct
   32.768 kHz tick rate (20-sample examples/timer run on /dev/timer0).
   Watchdog: keepalive, early-interrupt stop-emulation, and timeout reset all
   exercised with examples/watchdog -- the reset reason reported by the boot
   ROM (KM4 BOOT REASON 8000: WDG4) confirms the reset came from the exact
   instance this driver drives.
   
   Build: all eight rtl8730e_evb configs
   (nsh/gpio/uart/i2c/spi/pwm/timer/wdg), each with both the
   make and cmake build systems; checkpatch clean; every defconfig matches
   savedefconfig.


-- 
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]

Reply via email to