Skip to content

Commit 63e8366

Browse files
evgeniy-paltsevMaureenHelm
authored andcommitted
ARC: boards: nsim: hs5x/hs6x: setup apertures to be runnable on HAPS
Setup peripheral and NOC apertures to make hs5x and hs6x configurations runnable on real HW (HAPS). Signed-off-by: Evgeniy Paltsev <[email protected]> Signed-off-by: Eugeniy Paltsev <[email protected]>
1 parent 233afcb commit 63e8366

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

boards/arc/nsim/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
zephyr_sources_ifdef(CONFIG_ARC_MPU_ENABLE arc_mpu_regions.c)
4+
zephyr_sources_ifdef(CONFIG_ISA_ARCV3 haps_arcv3_init.c)

boards/arc/nsim/haps_arcv3_init.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2022 Synopsys
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <soc.h>
8+
#include <zephyr/init.h>
9+
10+
#define ARC_CLN_MST_NOC_0_0_ADDR 292
11+
#define ARC_CLN_MST_NOC_0_0_SIZE 293
12+
13+
#define ARC_CLN_MST_NOC_0_1_ADDR 2560
14+
#define ARC_CLN_MST_NOC_0_1_SIZE 2561
15+
16+
#define ARC_CLN_MST_NOC_0_2_ADDR 2562
17+
#define ARC_CLN_MST_NOC_0_2_SIZE 2563
18+
19+
#define ARC_CLN_MST_NOC_0_3_ADDR 2564
20+
#define ARC_CLN_MST_NOC_0_3_SIZE 2565
21+
22+
#define ARC_CLN_MST_NOC_0_4_ADDR 2566
23+
#define ARC_CLN_MST_NOC_0_4_SIZE 2567
24+
25+
#define ARC_CLN_PER0_BASE 2688
26+
#define ARC_CLN_PER0_SIZE 2689
27+
28+
#define AUX_CLN_ADDR 0x640
29+
#define AUX_CLN_DATA 0x641
30+
31+
32+
static int haps_arcv3_init(const struct device *dev)
33+
{
34+
ARG_UNUSED(dev);
35+
36+
z_arc_v2_aux_reg_write(AUX_CLN_ADDR, ARC_CLN_PER0_BASE);
37+
z_arc_v2_aux_reg_write(AUX_CLN_DATA, 0xF00);
38+
z_arc_v2_aux_reg_write(AUX_CLN_ADDR, ARC_CLN_PER0_SIZE);
39+
z_arc_v2_aux_reg_write(AUX_CLN_DATA, 1);
40+
41+
z_arc_v2_aux_reg_write(AUX_CLN_ADDR, ARC_CLN_MST_NOC_0_0_ADDR);
42+
z_arc_v2_aux_reg_write(AUX_CLN_DATA, (DT_REG_ADDR(DT_CHOSEN(zephyr_sram)) / (1024 * 1024)));
43+
z_arc_v2_aux_reg_write(AUX_CLN_ADDR, ARC_CLN_MST_NOC_0_0_SIZE);
44+
z_arc_v2_aux_reg_write(AUX_CLN_DATA, (DT_REG_SIZE(DT_CHOSEN(zephyr_sram)) / (1024 * 1024)));
45+
46+
47+
return 0;
48+
}
49+
50+
51+
SYS_INIT(haps_arcv3_init, PRE_KERNEL_1, 0);

0 commit comments

Comments
 (0)