-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add support for TI TMS570LC43 SoC #88741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
arch/arm/core/Kconfig
Outdated
| config PLATFORM_SPECIFIC_PRE_STACK_INIT | ||
| bool "Platform (SOC) specific startup hook executed before the stack is initialised" | ||
| help | ||
| The platform specific initialization code (z_arm_platform_pre_stack_init) is | ||
| executed in the early startup code right after the registers are set to known | ||
| values and before stack is set up. Note that this code cannot use the stack unlike | ||
| z_arm_platform_init. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nashif for review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decided to not include this commit, soc_reset_hook is sufficient with a small fix before jumping to z_prep_c.
| clocks { | ||
| /* | ||
| * OSC_IN (16 MHZ) | ||
| * -> PLL1 (300 MHz) | ||
| * -> GCLK1 (300 MHz) | ||
| * -> HCLK (150 MHz) | ||
| * -> VCLK (75 MHz) | ||
| * -> RTICLK (75 MHz, divider is bypassed when VCLK is the source) | ||
| */ | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this an empty section with no nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nordicjm thak you for the review, I have fixed the PR based on your comments. Sorry it was still in draft, I was rebasing and refactoring some code still from an older branch. I will still keep it in draft for today, while I add some description, and also try to figure out what to do with the BSD 3-clause code from TI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I squashed some commits and this comment block is left as is for reference, however, the section is no longer empty.
soc/ti/hercules/Kconfig.soc
Outdated
| bool | ||
|
|
||
| config SOC_FAMILY | ||
| default "ti_hercules" if SOC_FAMILY_HERCULES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
names must match either: default "hercules" if SOC_FAMILY_HERCULES or default "ti_hercules" if SOC_FAMILY_TI_HERCULES, soc.yml must also match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| # TMS470 requires the ARM "legacy Word Invariant Addressing big-endian mode" | ||
| zephyr_compile_options( | ||
| -mbe32 | ||
| ${TOOLCHAIN_C_FLAGS} | ||
| ) | ||
|
|
||
| zephyr_ld_options( | ||
| -mbe32 | ||
| ${TOOLCHAIN_LD_FLAGS} | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tejlmand for comment
|
|
||
| # launchpad is 16MHz | ||
| config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
| default 16000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to come from dts property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the comment and value, but kept it in Kconfig.defconfig as several other SoCs seem to have it too.
| # SPDX-License-Identifier: Apache-2.0 | ||
| CONFIG_PINCTRL=y | ||
| CONFIG_PINCTRL_TI_TMS570=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| default y | ||
| depends on DT_HAS_TI_TMS570_VIM_ENABLED | ||
| help | ||
| The TI Vectored Interrupt Manager provides hardware assistance for prioritizing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help indent is 1x tab followed by 2x spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| if CPU_CORTEX_R5 | ||
|
|
||
| config TMS570_VIM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this relate to cortex r5 if it's a ti specific thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
dts/arm/ti/tms570.dtsi
Outdated
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix in original commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, I think
| config FLASH_BASE_ADDRESS | ||
| default 1000000 | ||
| default 0x00000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix in original commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
6fb7d8e to
338a715
Compare
c5325f3 to
cc4599b
Compare
9e56391 to
5aaadbf
Compare
BSD licensed code moved to HAL in zephyrproject-rtos/hal_ti#63
5aaadbf to
5c9e447
Compare
|
| config MULTITHREADING | ||
| default y | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| config MULTITHREADING | |
| default y |
arm arch specific changes were removed so removing my -1
| +-----------+------------+--------------------------------------+ | ||
| | Interface | Controller | Driver/Component | | ||
| +===========+============+======================================+ | ||
| | VIM | on-chip | Vectored interrupt manager | | ||
| +-----------+------------+--------------------------------------+ | ||
| | SCI | on-chip | Serial communication interface | | ||
| +-----------+------------+--------------------------------------+ | ||
| | IOMM | on-chip | Pin multiplexing | | ||
| +---------------------------------------------------------------+ | ||
| | GIO | on-chip | General purpose input / output | | ||
| +-----------+------------+--------------------------------------+ | ||
| | RTI | on-chip | Real-time interrupt | | ||
| +-----------+------------+--------------------------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just let the .. zephyr:board-supported-hw:: work its magic
| +-----------+------------+--------------------------------------+ | |
| | Interface | Controller | Driver/Component | | |
| +===========+============+======================================+ | |
| | VIM | on-chip | Vectored interrupt manager | | |
| +-----------+------------+--------------------------------------+ | |
| | SCI | on-chip | Serial communication interface | | |
| +-----------+------------+--------------------------------------+ | |
| | IOMM | on-chip | Pin multiplexing | | |
| +---------------------------------------------------------------+ | |
| | GIO | on-chip | General purpose input / output | | |
| +-----------+------------+--------------------------------------+ | |
| | RTI | on-chip | Real-time interrupt | | |
| +-----------+------------+--------------------------------------+ |
| @@ -0,0 +1,5 @@ | |||
| board: | |||
| name: tms570_launchxl2 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| name: tms570_launchxl2 | |
| name: tms570_launchxl2 | |
| full_name: Hercules TMS570LC43x LaunchPad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping
5c9e447 to
5d2a1df
Compare
Adds new SoC. Some of the necessary startup code is based on the vendor provides tool (halcogen) and it includes SoC init and some errata handling. That code originally had BSD-3-clause license, so it cannot be part of this commit, and has been moved to TI hal repository (modules/hal/ti). The Halcogen code was mostly adapted to zephyr coding style and the the dependencies were minimized. As for erratas, the included one right now is PLL startup problem errata. We also have CORTEX-R5#7 (ARM ID-780125), but it was not included because: 1. Halcogen code does not implement it 3. This is Cortex R5 errata, Xilinx R5 implementation has this note https://adaptivesupport.amd.com/s/article/65878 Signed-off-by: Tavish Naruka <[email protected]>
Adds driver for TI TMS570 SoC. Signed-off-by: Tavish Naruka <[email protected]>
Adds SCI peripheral UART driver for TMS570. Signed-off-by: Tavish Naruka <[email protected]>
Add TI VIM driver specific to the TMS570 chips. This driver/peripheral is not compatible with the existing intc_vim.c for some other TI chips. Signed-off-by: Tavish Naruka <[email protected]>
Adds the RTI timer for TI TMS570 SoC and enables it as the system timer for enabling multithreading. Signed-off-by: Tavish Naruka <[email protected]>
Adds TI TMS570 SoC GPIO driver. Signed-off-by: Tavish Naruka <[email protected]>
Adds minimal config for TI TMS570 launchpad which has the TMS570LC43 SoC. Signed-off-by: Tavish Naruka <[email protected]>
Adds basic information about the board about supported peripherals. Signed-off-by: Tavish Naruka <[email protected]>
5d2a1df to
3a31b70
Compare
|
Sorry, one (hopefully final) code push here to move back one of the header files (Apache 2.0 licensed) back to zephyr soc directory from the hal_ti module which did not really need those. Now both soc_defaults.h soc_internal.h are included in soc directory (same as before I moved some code to hal_ti) |
kartben
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for docs, thanks
|
| SW_RESET = 0x0010U, /**< Alias for Software Reset */ | ||
| EXT_RESET = 0x0008U, /**< Alias for External Reset */ | ||
| NO_RESET = 0x0000U /**< Alias for No Reset */ | ||
| } resetSource_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be snake case not camel case
| void _mpuInit_(void); | ||
| uint32_t _errata_SSWF021_45_both_plls(uint32_t count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and these?
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |



The SoC has a Cortex-R5 CPU, it required big-endian and BE32 compiler flags. I enabled big-endian ARMv7-R in the SDK toolchain here, and maybe only this CPU uses it as of now: zephyrproject-rtos/sdk-ng#765
I only have (and plan to use) only this specific SoC (TMS570LC43xx), so I focus on getting this chip working, but variants should be able to utilize this code mostly as is (AFAIK).
There is some code in the soc directory (soc.c, asm_funcs.S, soc_pll_errata.c) that is adapted from "TI Halcogen" generated code. It was license BSD 3-clause, and I am checking with TI support if they could help re-licensing it, so I did not create an RFC for the board related to that yet. I did not want to add this to the HAL module, as I am exporting only very limited portions of what the Halcogen generates, but open to suggestions.