Skip to content

Commit 468c607

Browse files
author
Tavish Naruka
committed
soc: ti: add TI Hercules TMS570LC43x SoC
Adds new SoC. The vendor provides a tool (halcogen) to generate code including SoC init and errata handling code, which is also included here after adapting it to coding style and reducing dependencies. As for erratas, the applicable one at this stage is PLL startup errata. We also have CORTEX-R5#7 (ARM ID-780125), but we did not implement it due to several reasons: 1. did not implement it in the past codebase 2. 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 1b96482 commit 468c607

File tree

17 files changed

+1194
-0
lines changed

17 files changed

+1194
-0
lines changed

dts/arm/ti/tms570.dtsi

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2025 ispace inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
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+
34+
soc {
35+
#address-cells = <1>;
36+
#size-cells = <1>;
37+
38+
sys: sys@ffffff00 {
39+
reg = <0xffffff00 256>, /* SYS1 */
40+
<0xffffe100 256>, /* SYS2 */
41+
<0xffff1000 0x800>, /* PCR1 */
42+
<0xfcff1000 0x800>, /* PCR2 */
43+
<0xfff78000 0x800>, /* PCR3 */
44+
<0xfff87000 0x1000>, /* FCR */
45+
<0xfffff500 0x100>, /* ESM */
46+
<0xFFFFFFE4 4>, /* SYS_EXCEPTION */
47+
<0xFFFFFC98 4>, /* WATCHDOG_STATUS */
48+
<0xFFFFEC00 44>; /* DCC */
49+
};
50+
51+
sram0: memory@8000000 {
52+
compatible = "mmio-sram";
53+
reg = <0x08000000 DT_SIZE_K(512)>;
54+
};
55+
56+
flc0: flash_controller@f0000000 {
57+
compatible = "flash-controller";
58+
reg = <0xf0000000 0x00480000>;
59+
60+
#address-cells = <1>;
61+
#size-cells = <1>;
62+
status = "okay";
63+
64+
flash0: flash@0 {
65+
compatible = "soc-nv-flash";
66+
reg = <0x00000000 DT_SIZE_M(4)>;
67+
};
68+
};
69+
70+
};
71+
};

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_HERCULES
5+
6+
rsource "*/Kconfig"
7+
8+
endif # SOC_FAMILY_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_HERCULES
5+
6+
rsource "*/Kconfig.defconfig"
7+
8+
endif # SOC_FAMILY_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_HERCULES
5+
bool
6+
7+
config SOC_FAMILY
8+
default "ti_hercules" if SOC_FAMILY_HERCULES
9+
10+
rsource "*/Kconfig.soc"

soc/ti/hercules/soc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
socs:
2+
- name: tms570lc43x
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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_sources(
17+
soc.c
18+
soc_pll_errata.c
19+
asm_funcs.S
20+
)
21+
22+
zephyr_library_include_directories(
23+
${ZEPHYR_BASE}/kernel/include
24+
${ZEPHYR_BASE}/arch/arm/include
25+
)
26+
27+
zephyr_include_directories(.)
28+
29+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_r/scripts/linker.ld CACHE INTERNAL "")
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2025 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_TI_TMS570LC43X
5+
bool
6+
select ARM
7+
select CPU_CORTEX_R5
8+
select BIG_ENDIAN
9+
select CPU_HAS_DCLS
10+
select CPU_HAS_ARM_MPU
11+
select CPU_HAS_DCACHE
12+
select CPU_HAS_ICACHE
13+
select PLATFORM_SPECIFIC_INIT
14+
select PLATFORM_SPECIFIC_PRE_STACK_INIT
15+
# select CPU_HAS_FPU
16+
# select ARM_CUSTOM_INTERRUPT_CONTROLLER
17+
imply XIP
18+
19+
if SOC_TI_TMS570LC43X
20+
21+
endif # SOC_TI_TMS570LC43X
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 16000000
21+
22+
config FLASH_BASE_ADDRESS
23+
default 1000000
24+
25+
config FLASH_SIZE
26+
default 4096
27+
28+
config NUM_IRQS
29+
int
30+
# must be >= the highest interrupt number used
31+
default 127
32+
33+
endif # SOC_TI_TMS570LC43X
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2024 ispace, inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_TI_HERCULES
5+
bool
6+
select SOC_FAMILY_HERCULES
7+
help
8+
TI Hercules family
9+
10+
config SOC_TI_TMS570LC43X
11+
bool
12+
select SOC_SERIES_TI_HERCULES
13+
help
14+
TI TMS570LC43X
15+
16+
config SOC_SERIES
17+
default "ti_hercules" if SOC_SERIES_TI_HERCULES
18+
19+
config SOC
20+
default "tms570lc43x" if SOC_TI_TMS570LC43X

0 commit comments

Comments
 (0)