Skip to content

Commit 95a0808

Browse files
author
Tavish Naruka
committed
soc: ti: add TI Hercules TMS570LC43x SoC
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]>
1 parent fd6b05c commit 95a0808

File tree

13 files changed

+349
-0
lines changed

13 files changed

+349
-0
lines changed

dts/arm/ti/tms570.dtsi

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright (c) 2025 ispace inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include <freq.h>
7+
#include <mem.h>
8+
#include <arm/armv7-r.dtsi>
9+
10+
/ {
11+
cpus {
12+
#address-cells = <1>;
13+
#size-cells = <0>;
14+
15+
cpu0: cpu@0 {
16+
device_type = "cpu";
17+
compatible = "arm,cortex-r5";
18+
reg = <0>;
19+
status = "okay";
20+
};
21+
};
22+
23+
clocks {
24+
/*
25+
* OSC_IN (16 MHZ)
26+
* -> PLL1 (300 MHz)
27+
* -> GCLK1 (300 MHz)
28+
* -> HCLK (150 MHz)
29+
* -> VCLK (75 MHz)
30+
* -> RTICLK (75 MHz, divider is bypassed when VCLK is the source)
31+
*/
32+
33+
osc_in: osc_in {
34+
compatible = "fixed-clock";
35+
#clock-cells = <0>;
36+
clock-frequency = <DT_FREQ_M(16)>;
37+
status = "okay";
38+
};
39+
40+
clk_vclk: clk_vclk {
41+
compatible = "fixed-clock";
42+
#clock-cells = <0>;
43+
clock-frequency = <DT_FREQ_M(75)>;
44+
status = "okay";
45+
};
46+
47+
clk_rticlk: clk_rticlk {
48+
compatible = "fixed-clock";
49+
#clock-cells = <0>;
50+
clock-frequency = <DT_FREQ_M(75)>;
51+
status = "okay";
52+
};
53+
};
54+
55+
soc {
56+
#address-cells = <1>;
57+
#size-cells = <1>;
58+
59+
sys: sys@ffffff00 {
60+
reg = <0xffffff00 256>, /* SYS1 */
61+
<0xffffe100 256>, /* SYS2 */
62+
<0xffff1000 0x800>, /* PCR1 */
63+
<0xfcff1000 0x800>, /* PCR2 */
64+
<0xfff78000 0x800>, /* PCR3 */
65+
<0xfff87000 0x1000>, /* FCR */
66+
<0xfffff500 0x100>, /* ESM */
67+
<0xFFFFFF00 0xfc>, /* SYSBASE */
68+
<0xFFFFFC98 4>, /* WATCHDOG_STATUS */
69+
<0xFFFFEC00 44>, /* DCC */
70+
<0xFFA04000 0x10>; /* POM_CONTROL_BASE */
71+
};
72+
73+
sram0: memory@8000000 {
74+
compatible = "mmio-sram";
75+
reg = <0x08000000 DT_SIZE_K(512)>;
76+
};
77+
78+
flc0: flash_controller@f0000000 {
79+
compatible = "flash-controller";
80+
reg = <0xf0000000 0x00480000>;
81+
#address-cells = <1>;
82+
#size-cells = <1>;
83+
status = "okay";
84+
85+
flash0: flash@0 {
86+
compatible = "soc-nv-flash";
87+
reg = <0x00000000 DT_SIZE_M(4)>;
88+
};
89+
};
90+
};
91+
};

soc/ti/hercules/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
add_subdirectory(${SOC_NAME})
4+
5+
zephyr_include_directories(${SOC_NAME})

soc/ti/hercules/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2025 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_FAMILY_TI_HERCULES
5+
6+
rsource "*/Kconfig"
7+
8+
endif # SOC_FAMILY_TI_HERCULES

soc/ti/hercules/Kconfig.defconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2025 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_FAMILY_TI_HERCULES
5+
6+
rsource "*/Kconfig.defconfig"
7+
8+
endif # SOC_FAMILY_TI_HERCULES

soc/ti/hercules/Kconfig.soc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_FAMILY_TI_HERCULES
5+
bool
6+
7+
config SOC_FAMILY
8+
default "ti_hercules" if SOC_FAMILY_TI_HERCULES
9+
10+
rsource "*/Kconfig.soc"

soc/ti/hercules/soc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
family:
2+
- name: ti_hercules
3+
series:
4+
- name: ti_tms570
5+
socs:
6+
- name: ti_tms570lc43x
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
5+
# TMS470 requires the ARM "legacy Word Invariant Addressing big-endian mode"
6+
zephyr_compile_options(
7+
-mbe32
8+
${TOOLCHAIN_C_FLAGS}
9+
)
10+
11+
zephyr_ld_options(
12+
-mbe32
13+
${TOOLCHAIN_LD_FLAGS}
14+
)
15+
16+
zephyr_library_include_directories(
17+
${ZEPHYR_BASE}/kernel/include
18+
${ZEPHYR_BASE}/arch/arm/include
19+
)
20+
21+
zephyr_include_directories(.)
22+
23+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_r/scripts/linker.ld CACHE INTERNAL "")
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2025 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_TI_TMS570LC43X
5+
select ARM
6+
select CPU_CORTEX_R5
7+
select BIG_ENDIAN
8+
select CPU_HAS_DCLS
9+
select CPU_HAS_ARM_MPU
10+
select CPU_HAS_DCACHE
11+
select CPU_HAS_ICACHE
12+
select CACHE_MANAGEMENT
13+
select SOC_RESET_HOOK
14+
select ARM_CUSTOM_INTERRUPT_CONTROLLER
15+
select HAS_TMS570_HALCOGEN_CODE
16+
imply XIP
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) Copyright (c) 2025 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_TI_TMS570LC43X
5+
6+
config SYS_CLOCK_EXISTS
7+
default n
8+
9+
config MULTITHREADING
10+
default n
11+
12+
config GEN_SW_ISR_TABLE
13+
default n
14+
15+
config GEN_ISR_TABLES
16+
default n
17+
18+
# launchpad is 16MHz
19+
config SYS_CLOCK_HW_CYCLES_PER_SEC
20+
default $(dt_node_int_prop_int,/soc/rti,clock-frequency)
21+
22+
config NUM_IRQS
23+
# must be >= the highest interrupt number used
24+
default 127
25+
26+
endif # SOC_TI_TMS570LC43X
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2024 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_TI_TMS570
5+
bool
6+
select SOC_FAMILY_TI_HERCULES
7+
help
8+
TI Hercules family
9+
10+
config SOC_TI_TMS570LC43X
11+
bool
12+
select SOC_SERIES_TI_TMS570
13+
help
14+
TI TMS570LC43X
15+
16+
config HAS_TMS570_HALCOGEN_CODE
17+
bool
18+
19+
config SOC_SERIES
20+
default "ti_tms570" if SOC_SERIES_TI_TMS570
21+
22+
config SOC
23+
default "ti_tms570lc43x" if SOC_TI_TMS570LC43X

0 commit comments

Comments
 (0)