arch/tricore: add support for tc4xx series chips and boards#18391
arch/tricore: add support for tc4xx series chips and boards#18391zhangyu-duck wants to merge 7 commits intoapache:masterfrom
Conversation
7682822 to
31c2ea0
Compare
745ed4d to
4edecbe
Compare
jerpelea
left a comment
There was a problem hiding this comment.
please document all non Apache license file to
https://github.com/apache/nuttx/blob/master/LICENSE
jerpelea
left a comment
There was a problem hiding this comment.
please add SPDX license identifiers to all files not only Apache licensed ones
4edecbe to
d2a6f48
Compare
ok,thanks, i have updata code |
get it, thanks |
acassis
left a comment
There was a problem hiding this comment.
@zhangyu-duck please update the Documentation https://nuttx.apache.org/docs/latest/platforms/tricore/index.html to include these new chips.
Unfortunately our Documentation is very non-standardized, some Documentation arch are very good, others are very primitive (let say not helpful). So, I suggest you to use https://nuttx.apache.org/docs/latest/platforms/arm/imxrt/index.html as a good reference.
arch/tricore/src/illd/tc4xx/Libraries/doc/iLLD-TC4xx-Releasenotes.pdf
Outdated
Show resolved
Hide resolved
linguini1
left a comment
There was a problem hiding this comment.
I guess since this modifies the TC3xx logic as well, could you please include an OSTest log from a tc3 board? The tc4 log looks good.
|
Also I won't block the PR about this since I have pretty much no familiarity with the tricore architecture, but is it necessary to use the SDK? It seems like this PR needs to include a lot of workarounds for quirks with the SDK (like the libc stubs and patch files). Is it at all possible to avoid using the SDK directly? I know a few other archs in NuttX use this approach (hence why I don't think it's a dealbreaker or anything), but I also know the preferred method is to avoid using vendor SDKs/HALs entirely if possible. |
d2a6f48 to
c194f89
Compare
c194f89 to
c080e06
Compare
|
@simbit18 do you know if LVGL v9.2 files were removed from their site? We need to create our own mirror at github.com/nuttx/ |
On this note, we are already in the phase of developing iLLD independent Tricore support. Although this isn't mature yet, plans are tracked here 1. Also you can find development tree with various branches 2 named |
Woah awesome news! Thanks! |
|
@zhangyu-duck are these changes tested with Tasking only or OSS GCC can also be used? |
|
c080e06 to
f820b57
Compare
| --help-- | ||
| In addition to the 6 cores, tc4xx also has one more security core. | ||
|
|
||
| config CPU_COREID |
There was a problem hiding this comment.
why need this option
There was a problem hiding this comment.
chip’s code and linker script needs to be distinguished for different cores. Originally, this was under vendor, and I placed it in the kconfig under the chip for tc4xx/tc3xx in the community, but someone suggested extracting it to the common section. so i place it in arch/tricore/Kconfig
There was a problem hiding this comment.
I would prefer remove it from Kconifg, since:
- you can get the coreid at runtime directly
- different core has the different defconfig, you can select the different link script directly.
boards/tricore/tc397/a2g-tc397-5v-tft/include/board_memorymap.h
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,86 @@ | |||
| /**************************************************************************** | |||
| * arch/tricore/src/tc4xx/tc4xx_libc.c | |||
There was a problem hiding this comment.
should we move to libc/machine/tricore instead
There was a problem hiding this comment.
i think noneed.
/* The implementation of libc is introduced by default in the Tricore
- toolchain, in nuttx we made a fake libc_fpu.a library to bypass
- this issue, but the linker will still generate markup code,
- add a few definitions to fool the linker.
*/
There was a problem hiding this comment.
how about protected mode, the code in arch can't be used by nuttx_user.bin
| #endif | ||
|
|
||
| #if (IFX_CFG_SSW_ENABLE_LBIST == 1) | ||
| void Ifx_Ssw_Lbist(void) |
There was a problem hiding this comment.
why not use illd version directly?
There was a problem hiding this comment.
This involves copyright issues, so I extracted the key and necessary parts and rewrote them so that they can be used with the SPDX license.
There was a problem hiding this comment.
I mean using the code from illd package directly, and patch the origin file is real need
| for (i = 0; i < 6; i++) | ||
| { | ||
| #ifdef CONFIG_ARCH_TC3XX | ||
| #ifdef CONFIG_ARCH_CHIP_TC3XX |
There was a problem hiding this comment.
why change CONFIG_ARCH_TC3XX to CONFIG_ARCH_CHIP_TC3XX?
TC3XX is not chip name, It should be like ARMV8R: ARCH_ARMV8R
There was a problem hiding this comment.
i think current name is ok, because arch's name is tc1v8
There was a problem hiding this comment.
tc3xx arch's name is tc1V6, tc4xx's is tc1v8
There was a problem hiding this comment.
I think the arch name here should be TRICORE, so we have ARCH_TRICORE.
On upon of ARCH_TRICORE we can have more ARCH_XXX to refer to different cpu series.
But for CHIP, there should be only one chip, So we can only have one CHIP_TC397 or CHIP_TC499.
| /* Cpucs gpsr init */ | ||
|
|
||
| #ifndef CONFIG_ARCH_TC3XX | ||
| #ifndef CONFIG_ARCH_CHIP_TC3XX |
There was a problem hiding this comment.
i think current name is ok, because arch's name is tc1v8
| volatile Ifx_SRC_SRCR *src = &SRC_CPU_CPU0_SB + irq; | ||
|
|
||
| #ifdef CONFIG_ARCH_TC3XX | ||
| #ifdef CONFIG_ARCH_CHIP_TC3XX |
There was a problem hiding this comment.
i think current name is ok, because arch's name is tc1v8
| * so routing to the first cpu in cpuset. | ||
| */ | ||
|
|
||
| #ifdef CONFIG_ARCH_CHIP_TC3XX |
There was a problem hiding this comment.
i think current name is ok, because arch's name is tc1v8
| #include "IfxCpu.h" | ||
| #include "IfxScuWdt.h" | ||
|
|
||
| #ifdef CONFIG_ARCH_CHIP_TC4XX |
There was a problem hiding this comment.
Please use CONFIG_ARCH_TC4XX
There was a problem hiding this comment.
i think current name is ok, because arch's name is tc1v8
There was a problem hiding this comment.
I think the arch name here should be TRICORE, so we have ARCH_TRICORE.
On upon of ARCH_TRICORE we can have more ARCH_XXX.
But for CHIP, there should be one chip, you can use TC397, TC499 etc... So we can only have one CHIP_TC397 or CHIP_TC499.
| @@ -0,0 +1,21 @@ | |||
| ############################################################################ | |||
| # arch/tricore/src/tc4da/Make.defs | |||
There was a problem hiding this comment.
Do we need empty make files?
There was a problem hiding this comment.
i follow original tc397, tc397 also has empty cmake and make。If any content needs to be added later, then these two files will not need to be created again.
| @@ -1,5 +1,5 @@ | |||
| # ############################################################################## | |||
| # boards/arm/samd5e5/metro-m4/CMakeLists.txt | |||
| # arch/tricore/src/tc4da/CMakeLists.txt | |||
There was a problem hiding this comment.
Do we need empty Cmake files?
There was a problem hiding this comment.
i follow original tc397, tc397 also has empty cmake and make。If any content needs to be added later, then these two files will not need to be created again.
|
Hi zhangyu-duck, Great job! My suggestion is to leave the iLLD unchanged and only configure it using the IFX_XXX macros. For your reference, I have already ported NuttX to TC4xN based on iLLD in our internal project, and this port does not modify the iLLD itself. |
Since infineon have open-source plans, I recommend using the ILD library they provide on GitHub. |
add new chip named tc4xx and board tc4evb Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
f820b57 to
73b4513
Compare
|
Can you please perform a test on a TV3 device as well since both are modified? |
Note: Please adhere to Contributing Guidelines.
Summary
Two main updates:
Impact
support tc4xx chip
Testing
nsh> hello
Hello, World!! tc4 ostest
nsh>
i give tc4 ostest.log in attach files
tc4_ostest.log