Skip to content

Commit 963db42

Browse files
slpp95prashanthaescolar
authored andcommitted
soc: ti_k3: Add TI J721E SoC R5
Add initial SoC support for the TI J721E SoC series Cortex-R5 core. TRM for J721e https://www.ti.com/lit/zip/spruil1 File: spruil1c.pdf Signed-off-by: Prashanth S <[email protected]> Signed-off-by: Andrew Davis <[email protected]>
1 parent 0553164 commit 963db42

File tree

10 files changed

+212
-0
lines changed

10 files changed

+212
-0
lines changed

dts/arm/ti/j721e_main_r5.dtsi

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/* Copyright (C) 2023 BeagleBoard.org Foundation
2+
* Copyright (C) 2023 S Prashanth
3+
* Copyright (c) 2024 Texas Instruments Incorporated
4+
* Andrew Davis <[email protected]>
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*/
8+
9+
#include <mem.h>
10+
#include <freq.h>
11+
#include <arm/armv7-r.dtsi>
12+
#include <zephyr/dt-bindings/interrupt-controller/ti-vim.h>
13+
14+
/ {
15+
#address-cells = <1>;
16+
#size-cells = <1>;
17+
18+
cpus {
19+
#address-cells = <1>;
20+
#size-cells = <0>;
21+
22+
cpu0: cpu@0 {
23+
device_type = "cpu";
24+
compatible = "arm,cortex-r5";
25+
reg = <0>;
26+
};
27+
};
28+
29+
atcm: memory@0 {
30+
device_type = "memory";
31+
compatible = "zephyr,memory-region", "mmio-sram";
32+
reg = <0x00000000 DT_SIZE_K(32)>;
33+
zephyr,memory-region = "ATCM";
34+
};
35+
36+
btcm: memory@41010000 {
37+
device_type = "memory";
38+
compatible = "zephyr,memory-region", "mmio-sram";
39+
reg = <0x41010000 DT_SIZE_K(32)>;
40+
zephyr,memory-region = "BTCM";
41+
};
42+
43+
vim: interrupt-controller@ff80000 {
44+
#address-cells = <1>;
45+
compatible = "ti,vim";
46+
reg = <0x0ff80000 0x2800>;
47+
interrupt-controller;
48+
#interrupt-cells = <4>; /* {IRQ/FIQ, IRQ_NUM, IRQ_TYPE, IRQ_PRIO} */
49+
status = "okay";
50+
};
51+
52+
pinctrl: pinctrl@11c000 {
53+
compatible = "ti,k3-pinctrl";
54+
reg = <0x0011c000 0x2b4>;
55+
status = "okay";
56+
};
57+
58+
uart1: uart@2810000 {
59+
compatible = "ns16550";
60+
reg = <0x02810000 0x100>;
61+
clock-frequency = <48000000>;
62+
interrupts = <0 159 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
63+
interrupt-parent = <&vim>;
64+
reg-shift = <2>;
65+
status = "disabled";
66+
};
67+
68+
uart2: uart@2820000 {
69+
compatible = "ns16550";
70+
reg = <0x02820000 0x100>;
71+
clock-frequency = <48000000>;
72+
interrupts = <0 160 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
73+
interrupt-parent = <&vim>;
74+
reg-shift = <2>;
75+
status = "disabled";
76+
};
77+
78+
systick_timer: timer@24c0000 {
79+
compatible = "ti,am654-timer";
80+
reg = <0x24c0000 0x70>;
81+
interrupts = <0 168 IRQ_TYPE_LEVEL IRQ_DEFAULT_PRIORITY>;
82+
interrupt-parent = <&vim>;
83+
status = "disabled";
84+
};
85+
};

include/zephyr/dt-bindings/pinctrl/ti-k3-pinctrl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
#define MUX_MODE_7 7
4040
#define MUX_MODE_8 8
4141
#define MUX_MODE_9 9
42+
#define MUX_MODE_10 10
43+
#define MUX_MODE_11 11
44+
#define MUX_MODE_12 12
45+
#define MUX_MODE_13 13
46+
#define MUX_MODE_14 14
4247

4348
#define K3_PINMUX(offset, value, mux_mode) (((offset) & 0x1fff)) ((value) | (mux_mode))
4449

soc/ti/k3/am6x/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,15 @@ elseif(CONFIG_SOC_SERIES_AM6X_M4)
1818
endif()
1919

2020
set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/m4/linker.ld CACHE INTERNAL "")
21+
elseif(CONFIG_SOC_SERIES_AM6X_R5)
22+
zephyr_sources(r5/soc.c)
23+
24+
zephyr_include_directories(r5)
25+
26+
if(CONFIG_OPENAMP_RSC_TABLE)
27+
zephyr_linker_section(NAME .resource_table GROUP ROM_REGION NOINPUT)
28+
zephyr_linker_section_configure(SECTION .resource_table KEEP INPUT ".resource_table*")
29+
endif()
30+
31+
set(SOC_LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/r5/linker.ld CACHE INTERNAL "")
2132
endif()

soc/ti/k3/am6x/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@ config SOC_SERIES_AM6X_M4
1919
select MM_TI_RAT
2020
select SOC_EARLY_INIT_HOOK
2121

22+
config SOC_SERIES_AM6X_R5
23+
select ARM
24+
select CPU_CORTEX_R5
25+
select CPU_HAS_ARM_MPU
26+
select ARM_CUSTOM_INTERRUPT_CONTROLLER
27+
select VIM
28+
select TI_DM_TIMER
29+
select OPENAMP_RSC_TABLE
30+
select UART_NS16550_ACCESS_WORD_ONLY if UART_NS16550
31+
2232
config SOC_PART_NUMBER
2333
default "AM6234" if SOC_AM6234_A53
2434
default "AM6234" if SOC_AM6234_M4
2535
default "AM6442" if SOC_AM6442_M4
36+
default "J721e" if SOC_J721E_MAIN_R5F0_0

soc/ti/k3/am6x/Kconfig.defconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
if SOC_SERIES_AM6X
55

6+
config KERNEL_ENTRY
7+
default "_vector_table"
8+
69
# Workaround for not being able to have commas in macro arguments
710
DT_CHOSEN_Z_FLASH := zephyr,flash
811

@@ -16,11 +19,13 @@ config NUM_IRQS
1619
int
1720
default 64 if SOC_SERIES_AM6X_M4
1821
default 280 if SOC_SERIES_AM6X_A53
22+
default 512 if SOC_SERIES_AM6X_R5
1923

2024
config SYS_CLOCK_HW_CYCLES_PER_SEC
2125
int
2226
default 400000000 if SOC_SERIES_AM6X_M4
2327
default 200000000 if SOC_SERIES_AM6X_A53
28+
default 19200000 if SOC_SERIES_AM6X_R5
2429

2530
config PINCTRL
2631
default y
@@ -32,6 +37,7 @@ config UART_NS16550
3237

3338
config UART_NS16550_TI_K3
3439
default y if SOC_SERIES_AM6X_M4
40+
default y if SOC_SERIES_AM6X_R5
3541

3642
choice UART_NS16550_VARIANT
3743
default UART_NS16550_VARIANT_NS16750
@@ -41,8 +47,10 @@ endif # SERIAL
4147

4248
config BUILD_OUTPUT_BIN
4349
default n if SOC_SERIES_AM6X_M4
50+
default n if SOC_SERIES_AM6X_R5
4451

4552
config BUILD_NO_GAP_FILL
4653
default y if SOC_SERIES_AM6X_M4
54+
default y if SOC_SERIES_AM6X_R5
4755

4856
endif # SOC_SERIES_AM6X

soc/ti/k3/am6x/Kconfig.soc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ config SOC_SERIES_AM6X_M4
1717
help
1818
Enable support for AM62X M4 Series.
1919

20+
config SOC_SERIES_AM6X_R5
21+
bool
22+
select SOC_SERIES_AM6X
23+
help
24+
Enable support for AM6X R5 Series.
25+
2026
config SOC_AM6234_A53
2127
bool
2228
select SOC_SERIES_AM6X_A53
@@ -29,9 +35,14 @@ config SOC_AM6442_M4
2935
bool
3036
select SOC_SERIES_AM6X_M4
3137

38+
config SOC_J721E_MAIN_R5F0_0
39+
bool
40+
select SOC_SERIES_AM6X_R5
41+
3242
config SOC_SERIES
3343
default "am6x" if SOC_SERIES_AM6X
3444

3545
config SOC
3646
default "am6234" if SOC_AM6234_M4 || SOC_AM6234_A53
3747
default "am6442" if SOC_AM6442_M4
48+
default "j721e" if SOC_J721E_MAIN_R5F0_0

soc/ti/k3/am6x/r5/linker.ld

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Copyright (C) 2023 BeagleBoard.org Foundation
2+
* Copyright (C) 2023 S Prashanth
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/arch/arm/cortex_a_r/scripts/linker.ld>
8+
9+
SECTIONS
10+
{
11+
#ifdef CONFIG_OPENAMP_RSC_TABLE
12+
SECTION_PROLOGUE(.resource_table,, SUBALIGN(4))
13+
{
14+
KEEP(*(.resource_table*))
15+
} GROUP_LINK_IN(RSC_TABLE)
16+
#endif
17+
}

soc/ti/k3/am6x/r5/soc.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* Copyright (C) 2023 BeagleBoard.org Foundation
2+
* Copyright (C) 2023 S Prashanth
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <stdint.h>
8+
#include <zephyr/fatal.h>
9+
10+
#include "soc.h"
11+
12+
unsigned int z_soc_irq_get_active(void)
13+
{
14+
return z_vim_irq_get_active();
15+
}
16+
17+
void z_soc_irq_eoi(unsigned int irq)
18+
{
19+
z_vim_irq_eoi(irq);
20+
}
21+
22+
void z_soc_irq_init(void)
23+
{
24+
z_vim_irq_init();
25+
}
26+
27+
void z_soc_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
28+
{
29+
/* Configure interrupt type and priority */
30+
z_vim_irq_priority_set(irq, prio, flags);
31+
}
32+
33+
void z_soc_irq_enable(unsigned int irq)
34+
{
35+
/* Enable interrupt */
36+
z_vim_irq_enable(irq);
37+
}
38+
39+
void z_soc_irq_disable(unsigned int irq)
40+
{
41+
/* Disable interrupt */
42+
z_vim_irq_disable(irq);
43+
}
44+
45+
int z_soc_irq_is_enabled(unsigned int irq)
46+
{
47+
/* Check if interrupt is enabled */
48+
return z_vim_irq_is_enabled(irq);
49+
}

soc/ti/k3/am6x/r5/soc.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright (C) 2023 BeagleBoard.org Foundation
2+
* Copyright (C) 2023 S Prashanth
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef _TI_K3_J721E_R5_SOC_H_
8+
#define _TI_K3_J721E_R5_SOC_H_
9+
10+
#include <zephyr/drivers/interrupt_controller/intc_vim.h>
11+
12+
#endif /* _TI_K3_J721E_R5_SOC_H_ */

soc/ti/k3/soc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ family:
1010
- name: am6442
1111
cpuclusters:
1212
- name: m4
13+
- name: j721e
14+
cpuclusters:
15+
- name: main_r5f0_0

0 commit comments

Comments
 (0)