Add support for TI TMS570LC43 SoC#88741
Add support for TI TMS570LC43 SoC#88741ntavish wants to merge 8 commits intozephyrproject-rtos:mainfrom
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.
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.
why is this an empty section with no nodes?
There was a problem hiding this comment.
@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.
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.
names must match either: default "hercules" if SOC_FAMILY_HERCULES or default "ti_hercules" if SOC_FAMILY_TI_HERCULES, soc.yml must also match
| # 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} | ||
| ) |
|
|
||
| # launchpad is 16MHz | ||
| config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
| default 16000000 |
There was a problem hiding this comment.
needs to come from dts property
There was a problem hiding this comment.
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 |
| 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.
help indent is 1x tab followed by 2x spaces
| if CPU_CORTEX_R5 | ||
|
|
||
| config TMS570_VIM |
There was a problem hiding this comment.
how does this relate to cortex r5 if it's a ti specific thing?
dts/arm/ti/tms570.dtsi
Outdated
|
|
| config FLASH_BASE_ADDRESS | ||
| default 1000000 | ||
| default 0x00000000 |
6fb7d8e to
338a715
Compare
c5325f3 to
cc4599b
Compare
5aaadbf to
5c9e447
Compare
|
| config MULTITHREADING | ||
| default y | ||
|
|
There was a problem hiding this comment.
| 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.
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.
| name: tms570_launchxl2 | |
| name: tms570_launchxl2 | |
| full_name: Hercules TMS570LC43x LaunchPad |
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 <t-naruka@ispace-inc.com>
Adds driver for TI TMS570 SoC. Signed-off-by: Tavish Naruka <t-naruka@ispace-inc.com>
Adds SCI peripheral UART driver for TMS570. Signed-off-by: Tavish Naruka <t-naruka@ispace-inc.com>
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 <t-naruka@ispace-inc.com>
Adds the RTI timer for TI TMS570 SoC and enables it as the system timer for enabling multithreading. Signed-off-by: Tavish Naruka <t-naruka@ispace-inc.com>
Adds TI TMS570 SoC GPIO driver. Signed-off-by: Tavish Naruka <t-naruka@ispace-inc.com>
Adds minimal config for TI TMS570 launchpad which has the TMS570LC43 SoC. Signed-off-by: Tavish Naruka <t-naruka@ispace-inc.com>
Adds basic information about the board about supported peripherals. Signed-off-by: Tavish Naruka <t-naruka@ispace-inc.com>
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) |
|
| 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.
needs to be snake case not camel case
| void _mpuInit_(void); | ||
| uint32_t _errata_SSWF021_45_both_plls(uint32_t count); |
|
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. |
|
Hi ntavish, I’ve been testing this branch locally and found a missing soc.c integration causing a link failure (soc_reset_hook). Adding zephyr_sources(soc.c) and a minimal stub resolves the build. Happy to open a PR or share a patch if useful. |
|
Hello @sgilbert182 I haven't updated this PR in a while. A fix is not necessary at this point, I don't plan to work further on this PR in the near future. But I do hope to pick it up again at some point of time. The halcogen code doesn't seem to be getting merged, but I have gotten rid of much of the BSD license code, and have created more peripheral drivers. The biggest remaining piece is the Cortex-R5 MPU code, which currently is assembly exported from the halcogen GUI, but as I understand it should be compatible with standard Cortex-R MPU and cane be written in C using zephyr MPU APIs. Once I sort that out, I'll rebase to latest zephyr and update this PR (no hal-ti branch code). |
|
Thanks for getting back to me, it sounds like you have a plan! Let me know if there's anything I can do to help, otherwise I look forward to seeing your updated PR |



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.