zephyr/boards/snps/nsim/haps_arcv3_init.c
Jamie McCrae f103c82c31 boards/socs: Rename folders to have proper vendor prefix in
Replaces inaccurate or wrong vendor prefixes in board and soc
folder names with those from thr vendor prefix file

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-22 00:56:51 +01:00

27 lines
685 B
C

/*
* Copyright (c) 2022-2023 Synopsys
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/arch/arc/cluster.h>
#include <zephyr/devicetree.h>
#include <zephyr/init.h>
#define DT_SRAM_NODE_ADDR (DT_REG_ADDR(DT_CHOSEN(zephyr_sram)) / (1024 * 1024))
#define DT_SRAM_NODE_SIZE (DT_REG_SIZE(DT_CHOSEN(zephyr_sram)) / (1024 * 1024))
static int haps_arcv3_init(void)
{
arc_cln_write_reg_nolock(ARC_CLN_PER0_BASE, 0xF00);
arc_cln_write_reg_nolock(ARC_CLN_PER0_SIZE, 1);
arc_cln_write_reg_nolock(ARC_CLN_MST_NOC_0_0_ADDR, DT_SRAM_NODE_ADDR);
arc_cln_write_reg_nolock(ARC_CLN_MST_NOC_0_0_SIZE, DT_SRAM_NODE_SIZE);
return 0;
}
SYS_INIT(haps_arcv3_init, PRE_KERNEL_1, 0);