Repository navigation
arch/tricore: Set up the watchdogs and clocks without the iLLD (4/n) - #21519
Conversation
|
casaroli
left a comment
There was a problem hiding this comment.
This branch has an older copy of the #21518 timer commits (8a116e4 puts the STM definitions in arch/tricore/include/tc3xx/chip.h and tc4xx/chip.h; #21518 now adds arch/tricore/src/common/tricore_stm.h), so it conflicts with #21518 in tricore_systimer.c and tc3xx/tc4xx_timerisr.c.
Fix: rebase the three watchdog and clock commits on the current #21518 head.
5f9b6c3 to
4604f76
Compare
xiaoxiang781216
left a comment
There was a problem hiding this comment.
let's merge #21504 first.
4604f76 to
4139bfe
Compare
4139bfe to
91fc25b
Compare
|
@casaroli rebased to latest, please review/approve. |
|
@xiaoxiang781216 ready to merge, please review/merge |
look at this comment: #21519 (comment) |
addressed |
core0_main disables the CPU and the safety (TC3xx) or system (TC4xx) watchdog through IfxScuWdt or IfxWtu. Add tricore_wdt_disable for each chip family, which does the same with the SCU WDT or WTU registers: read the password, clear ENDINIT (TC3xx) or unlock CTRLA (TC4xx), request the disable and lock again. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The startup code sets up the TC3xx oscillator, PLLs and clock dividers with the iLLD IfxScuCcu_init and its TC39xB default configuration. Add tricore_clockconfig, which runs the same sequence with the SCU and SMU registers: switch to the backup clock, set up the 20 MHz crystal and both PLLs, wait for the lock, switch back, set the clock dividers and raise the system PLL to 300 MHz in steps. The startup code now calls it. The clock registers end up with the same values as with IfxScuCcu_init. Co-authored-by: Parthiban Nallathambi <parthiban@linumiz.com> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The startup code sets up the TC4xx flash wait states, clock dividers, oscillators and PLLs with the iLLD IfxClock_init and its TC4Dx default configuration. Add tricore_clockconfig for TC4xx, which runs the same sequence with the clock, SMU and DMU registers: set the wait states and dividers, power up the 25 MHz crystal and the ramp oscillator, set up both PLLs, ramp the system clock up and switch both clocks to the PLLs. The long waits service the watchdogs, as IfxClock does. The clock registers end up with the same values as with IfxClock_init. Co-authored-by: Parthiban Nallathambi <parthiban@linumiz.com> Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
91fc25b to
08ed461
Compare
|
adding @GUIDINGLI |
Summary
TriCore disables the watchdogs and sets up the clocks through the Infineon
iLLD. core0_main disables the CPU and the safety (TC3xx) or system (TC4xx)
watchdog with IfxScuWdt or IfxWtu, and the startup code sets up the
oscillator, the PLLs and the clock dividers with IfxScuCcu_init (TC3xx)
or IfxClock_init (TC4xx) and their default configurations.
This series adds tricore_wdt_disable for each chip family, which drives
the SCU WDT or WTU registers directly, and tricore_clockconfig, which the
startup code now calls instead of the iLLD clock init. It runs the same
sequence with the clock, SMU and DMU registers and the same settings: on
TC3xx a 20 MHz crystal and the system PLL at 300 MHz, on TC4xx the flash
wait states, a 25 MHz crystal, the ramp oscillator and the system PLL at
500 MHz. All watchdog and clock registers end up with the same values as
before.
NuttX itself no longer calls the iLLD clock and watchdog drivers after
this series, but IfxScuCcu.c, IfxClock.c, IfxScuWdt.c and IfxWtu.c stay
in the build. Other iLLD drivers that are still built use them: IfxAsclin
takes the ASCLIN clock frequency from them for the baud rate, and IfxCpu,
IfxPort, IfxPmsPm, IfxPmsEvr, IfxScuRcu, IfxScuEru and IfxSmu use their
frequency and ENDINIT helpers. The clock hook also stays in the iLLD
startup configuration (Ifx_Cfg_Ssw), as the startup code is still the
iLLD one. These go with the native UART and startup steps that follow.
Dependency
Depends on #21518.
Impact
TriCore only (arch/tricore).
tc4xx_clockconfig.c, with their register definitions in
src/tc3xx/hardware (tc3xx_wdt.h, tc3xx_clock.h, tc3xx_smu.h) and
src/tc4xx/hardware (tc4xx_wdt.h, tc4xx_clock.h, tc4xx_smu.h,
tc4xx_dmu.h).
for TC4xx) calls tricore_clockconfig for the PLL init.
IfxClock.c, IfxScuWdt.c and IfxWtu.c are still built for the iLLD UART
driver and startup code, until those are replaced.
No Kconfig, board defconfig or documentation changes.
Testing
I confirm that changes are verified on local setup and works as intended:
(TC3x), TASKING SmartCode v10.4r1 (TC4x)
triboard_tc4x9_com image
The register definitions were moved into the hardware headers after the
board tests; the disassembly of tc3xx_wdt.o, tc3xx_clockconfig.o,
tc4xx_wdt.o and tc4xx_clockconfig.o is identical before and after the move.
Build results (tip):
Runtime, ostest (on 3db1dd17fbf, the same code before the last rebase):