1 /* 2 * Copyright (c) 2019 Synopsys, Inc. All rights reserved. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * This module provides routines to initialize and support soc-level hardware 9 * for the HS Development Kit 10 */ 11 #include <device.h> 12 #include <init.h> 13 #include "soc.h" 14 arc_hsdk_init(const struct device * dev)15static int arc_hsdk_init(const struct device *dev) 16 { 17 ARG_UNUSED(dev); 18 19 uint32_t core; 20 uint32_t i; 21 22 /* allocate all IDU interrupts to master core */ 23 core = z_arc_v2_core_id(); 24 25 z_arc_connect_idu_disable(); 26 27 for (i = 0; i < (CONFIG_NUM_IRQS - ARC_CONNECT_IDU_IRQ_START); i++) { 28 z_arc_connect_idu_set_mode(i, ARC_CONNECT_INTRPT_TRIGGER_LEVEL, 29 ARC_CONNECT_DISTRI_MODE_ROUND_ROBIN); 30 z_arc_connect_idu_set_dest(i, 1 << core); 31 z_arc_connect_idu_set_mask(i, 0x0); 32 } 33 34 z_arc_connect_idu_enable(); 35 36 37 return 0; 38 } 39 40 SYS_INIT(arc_hsdk_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); 41