Repository navigation
arch/tricore: Drive the ASCLIN UART without the iLLD (6/n)) - #21545
Merged
Merged
Conversation
|
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 10, 2026 07:26
e06bf56 to
894b5dc
Compare
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 10, 2026 07:32
894b5dc to
c5533ee
Compare
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 12, 2026 11:25
c5533ee to
c5167a9
Compare
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 13, 2026 03:55
c5167a9 to
ed9cf9a
Compare
Contributor
Author
|
@xiaoxiang781216 please help to add reviewers @acassis @GUIDINGLI @xiaoxiang781216 @casaroli |
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 13, 2026 11:47
ed9cf9a to
8856cca
Compare
zhangyu981027
suggested changes
Nov 16, 2026
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 17, 2026 13:25
8856cca to
481c23d
Compare
Contributor
Author
|
@zhangyu-duck please review |
zhangyu981027
suggested changes
Nov 18, 2026
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 19, 2026 04:53
481c23d to
1c2c734
Compare
Contributor
Author
|
adding @GUIDINGLI |
The UART driver reaches the ASCLIN and its pins only through the iLLD IfxAsclin and IfxPort. Add the ASCLIN0 base and register offsets of TC3xx and TC4xx, which differ, to hardware/tc3xx_asclin.h and hardware/tc4xx_asclin.h, and the register bits, which are the same, to a new src/common/aurix/tricore_asclin.h, for the AURIX drivers common to both families, as checked against the TC39xB and TC4Dx iLLD headers. Add the port registers and pin modes of the UART pins to hardware/tc3xx_port.h and hardware/tc4xx_port.h. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The baud rate depends on the fast ASCLIN clock, which the iLLD UART driver reads with IfxScuCcu_getAsclinFFrequency or IfxClock_getAsclinFFrequency. Add tricore_clock_asclinf, which computes it the same way from the peripheral PLL and the ASCLINF divider. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The TC3xx and TC4xx serial drivers are the same code but for the chip, and set up the ASCLIN and the UART pins through IfxAsclin and IfxPort, with the pins named by the iLLD pin map. Replace both with one driver, src/common/aurix/tricore_serial.c, which programs the ASCLIN registers directly: 8N1, 16 times oversampling with three samples, FIFO interrupts at one byte. The fractional baud rate divider is the continued fraction of the wanted ratio that fits the 12-bit BRG fields, in place of the IfxAsclin search. The P14.1 RX and P14.0 TX pins are set up with the port registers, which are IOCR and PDR on TC3xx, under the CPU ENDINIT, and PADCFG on TC4xx. src/common/aurix holds the peripheral drivers that both families share; the Make.defs and CMakeLists.txt of tc3xx and tc4xx pull it in, as the stm32 chips do with common/stm32. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Nothing uses IfxAsclin and the ASCLIN pin map any more, since the UART driver programs the ASCLIN and its pins itself, so drop them from the TC3xx and TC4xx builds. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
The UART pins were the last users of IfxPort, so drop IfxPort.c and its pin configuration from the TC3xx and TC4xx builds. Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
ssekar15
force-pushed
the
native-2.5-uart
branch
from
November 19, 2026 13:10
1c2c734 to
7aa7674
Compare
xiaoxiang781216
approved these changes
Nov 19, 2026
Contributor
Author
|
@zhangyu981027 please allow to merge if no further review comments |
Contributor
Author
|
@xiaoxiang781216 please add @acassis @raiden00pl to reviewer. Guide me how do I get these permission on NuttX to do myself. |
Contributor
Author
|
@zhangyu981027 ping unblock this PR to merge |
acassis
approved these changes
Nov 20, 2026
Contributor
Author
|
@acassis many thanks |
Contributor
|
Great work @ssekar15 thank you for native implementation!! :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The TC3xx and TC4xx serial drivers are the same code apart from the chip,
and set up the ASCLIN and the UART pins through the iLLD IfxAsclin and
IfxPort drivers. This PR replaces both with one native ASCLIN driver in a
new src/common/aurix directory for the peripheral drivers that both AURIX
families share, which the tc3xx and tc4xx build files pull in, and stops
building the iLLD ASCLIN and port drivers.
Dependency
Depends on #21546 (startup), which now comes before it.
Impact
TriCore only. tc3xx_serial.c and tc4xx_serial.c are replaced by
src/common/aurix/tricore_serial.c; the UART Kconfig options are unchanged,
and the ASCLIN and pin registers after boot are the same as before.
Testing
I confirm that changes are verified on local setup and works as intended:
(TC3x), TASKING SmartCode v10.4r1 (TC4x)
triboard_tc4x9_com image
Build results (tip):
Runtime, ostest with GCC: