Skip to content

Commit 7603f65

Browse files
author
Siyuan Cheng
committed
arc: add XY mem support
Add arc XY mem configuration Signed-off-by: Siyuan Cheng <[email protected]>
1 parent 83e4f5d commit 7603f65

File tree

20 files changed

+211
-7
lines changed

20 files changed

+211
-7
lines changed

boards/arc/em_starterkit/arc_mpu_regions.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ static struct arc_mpu_region mpu_regions[] = {
2929
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
3030
#endif
3131

32+
#if DT_REG_SIZE(DT_INST(0, arc_xccm)) > 0
33+
/* Region XCCM */
34+
MPU_REGION_ENTRY("XCCM",
35+
DT_REG_ADDR(DT_INST(0, arc_xccm)),
36+
DT_REG_SIZE(DT_INST(0, arc_xccm)),
37+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
38+
#endif
39+
#if DT_REG_SIZE(DT_INST(0, arc_yccm)) > 0
40+
/* Region YCCM */
41+
MPU_REGION_ENTRY("YCCM",
42+
DT_REG_ADDR(DT_INST(0, arc_yccm)),
43+
DT_REG_SIZE(DT_INST(0, arc_yccm)),
44+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
45+
#endif
46+
3247
#if DT_REG_SIZE(DT_INST(0, mmio_sram)) > 0
3348
/* Region DDR RAM */
3449
MPU_REGION_ENTRY("DDR RAM",

boards/arc/em_starterkit/em_starterkit.dts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
compatible = "arc,dccm";
3737
reg = <0x80000000 DT_SIZE_K(128)>;
3838
};
39+
40+
xccm@c0000000 {
41+
compatible = "arc,xccm";
42+
reg = <0xc0000000 DT_SIZE_K(8)>;
43+
};
44+
45+
yccm@e0000000 {
46+
compatible = "arc,yccm";
47+
reg = <0xe0000000 DT_SIZE_K(8)>;
48+
};
3949
};
4050

4151
&uart1 {

boards/arc/em_starterkit/em_starterkit_em11d.dts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
compatible = "arc,dccm";
3737
reg = <0x80000000 DT_SIZE_K(64)>;
3838
};
39+
40+
xccm@e0000000 {
41+
compatible = "arc,xccm";
42+
reg = <0xc0000000 DT_SIZE_K(8)>;
43+
};
44+
45+
yccm@e0000000 {
46+
compatible = "arc,yccm";
47+
reg = <0xe0000000 DT_SIZE_K(8)>;
48+
};
3949
};
4050

4151
&uart1 {

boards/arc/emsdp/arc_mpu_regions.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ static struct arc_mpu_region mpu_regions[] = {
2020
DT_REG_ADDR(DT_INST(0, arc_dccm)),
2121
DT_REG_SIZE(DT_INST(0, arc_dccm)),
2222
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
23+
/* Region XCCM */
24+
#if DT_REG_SIZE(DT_INST(0, arc_xccm)) > 0
25+
MPU_REGION_ENTRY("XCCM",
26+
DT_REG_ADDR(DT_INST(0, arc_xccm)),
27+
DT_REG_SIZE(DT_INST(0, arc_xccm)),
28+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
29+
#endif
30+
/* Region YCCM */
31+
#if DT_REG_SIZE(DT_INST(0, arc_yccm)) > 0
32+
MPU_REGION_ENTRY("YCCM",
33+
DT_REG_ADDR(DT_INST(0, arc_yccm)),
34+
DT_REG_SIZE(DT_INST(0, arc_yccm)),
35+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
36+
#endif
2337
/* Region DDR RAM */
2438
MPU_REGION_ENTRY("SRAM",
2539
DT_REG_ADDR(DT_INST(0, mmio_sram)),

boards/arc/emsdp/emsdp.dts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include <synopsys/emsdp.dtsi>
10+
#include <mem.h>
1011
#include "board.dtsi"
1112

1213
/ {
@@ -22,6 +23,16 @@
2223
zephyr,console = &uart0;
2324
zephyr,shell-uart = &uart0;
2425
};
26+
27+
xccm@c0000000 {
28+
compatible = "arc,xccm";
29+
reg = <0xc0000000 DT_SIZE_K(16)>;
30+
};
31+
32+
yccm@e0000000 {
33+
compatible = "arc,yccm";
34+
reg = <0xe0000000 DT_SIZE_K(16)>;
35+
};
2536
};
2637

2738
&uart0 {

boards/arc/emsdp/emsdp_em9d.dts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include <synopsys/emsdp.dtsi>
10+
#include <mem.h>
1011
#include "board.dtsi"
1112

1213
/ {
@@ -22,6 +23,16 @@
2223
zephyr,console = &uart0;
2324
zephyr,shell-uart = &uart0;
2425
};
26+
27+
xccm@c0000000 {
28+
compatible = "arc,xccm";
29+
reg = <0xc0000000 DT_SIZE_K(16)>;
30+
};
31+
32+
yccm@e0000000 {
33+
compatible = "arc,yccm";
34+
reg = <0xe0000000 DT_SIZE_K(16)>;
35+
};
2536
};
2637

2738
&uart0 {

boards/arc/iotdk/arc_mpu_regions.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ static struct arc_mpu_region mpu_regions[] = {
2020
DT_REG_ADDR(DT_INST(0, arc_dccm)),
2121
DT_REG_SIZE(DT_INST(0, arc_dccm)),
2222
REGION_KERNEL_RAM_ATTR),
23+
/* Region XCCM */
24+
#if DT_REG_SIZE(DT_INST(0, arc_xccm)) > 0
25+
MPU_REGION_ENTRY("XCCM",
26+
DT_REG_ADDR(DT_INST(0, arc_xccm)),
27+
DT_REG_SIZE(DT_INST(0, arc_xccm)),
28+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
29+
#endif
30+
/* Region YCCM */
31+
#if DT_REG_SIZE(DT_INST(0, arc_yccm)) > 0
32+
MPU_REGION_ENTRY("YCCM",
33+
DT_REG_ADDR(DT_INST(0, arc_yccm)),
34+
DT_REG_SIZE(DT_INST(0, arc_yccm)),
35+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
36+
#endif
2337
/* Region DDR RAM */
2438
MPU_REGION_ENTRY("SRAM",
2539
CONFIG_SRAM_BASE_ADDRESS,

boards/arc/iotdk/iotdk.dts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include <synopsys/arc_iot.dtsi>
10+
#include <mem.h>
1011
#include "board.dtsi"
1112

1213
/ {
@@ -23,6 +24,16 @@
2324
zephyr,console = &uart0;
2425
zephyr,shell-uart = &uart0;
2526
};
27+
28+
xccm@c0000000 {
29+
compatible = "arc,xccm";
30+
reg = <0xc0000000 DT_SIZE_K(32)>;
31+
};
32+
33+
yccm@e0000000 {
34+
compatible = "arc,yccm";
35+
reg = <0xe0000000 DT_SIZE_K(32)>;
36+
};
2637
};
2738

2839
&cpu0 {

boards/arc/nsim/arc_mpu_regions.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,20 @@ static struct arc_mpu_region mpu_regions[] = {
3737
DT_REG_SIZE(DT_INST(0, arc_dccm)),
3838
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
3939
#endif
40-
40+
#if DT_REG_SIZE(DT_INST(0, arc_xccm)) > 0
41+
/* Region XCCM */
42+
MPU_REGION_ENTRY("XCCM",
43+
DT_REG_ADDR(DT_INST(0, arc_xccm)),
44+
DT_REG_SIZE(DT_INST(0, arc_xccm)),
45+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
46+
#endif
47+
#if DT_REG_SIZE(DT_INST(0, arc_yccm)) > 0
48+
/* Region YCCM */
49+
MPU_REGION_ENTRY("YCCM",
50+
DT_REG_ADDR(DT_INST(0, arc_yccm)),
51+
DT_REG_SIZE(DT_INST(0, arc_yccm)),
52+
REGION_KERNEL_RAM_ATTR | REGION_DYNAMIC),
53+
#endif
4154
/*
4255
* Region peripheral is shared by secure world and normal world by default,
4356
* no need a static mpu entry. If some peripherals belong to secure world,

boards/arc/nsim/nsim.dtsi

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,41 @@
55
*/
66

77
/dts-v1/;
8-
9-
#include "skeleton.dtsi"
108
#include <mem.h>
9+
#include "skeleton.dtsi"
10+
11+
12+
#ifndef ICCM_ADDR
13+
#define ICCM_ADDR 0
14+
#endif
15+
16+
#ifndef ICCM_SIZE
17+
#define ICCM_SIZE DT_SIZE_K(1024)
18+
#endif
19+
20+
#ifndef DCCM_ADDR
21+
#define DCCM_ADDR 80000000
22+
#endif
23+
24+
#ifndef DCCM_SIZE
25+
#define DCCM_SIZE DT_SIZE_K(1024)
26+
#endif
27+
28+
#ifndef XCCM_ADDR
29+
#define XCCM_ADDR c0000000
30+
#endif
31+
32+
#ifndef YCCM_ADDR
33+
#define YCCM_ADDR e0000000
34+
#endif
35+
36+
#ifndef XCCM_SIZE
37+
#define XCCM_SIZE DT_SIZE_K(64)
38+
#endif
39+
40+
#ifndef YCCM_SIZE
41+
#define YCCM_SIZE DT_SIZE_K(64)
42+
#endif
1143

1244
/ {
1345
cpus {
@@ -36,4 +68,14 @@
3668
zephyr,console = &uart0;
3769
zephyr,shell-uart = &uart0;
3870
};
71+
72+
xccm@c0000000 {
73+
compatible = "arc,xccm";
74+
reg = <DT_ADDR(XCCM_ADDR) XCCM_SIZE>;
75+
};
76+
77+
yccm@e0000000 {
78+
compatible = "arc,yccm";
79+
reg = <DT_ADDR(YCCM_ADDR) YCCM_SIZE>;
80+
};
3981
};

0 commit comments

Comments
 (0)