zephyr/soc/arc/snps_nsim/soc.c
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00

46 lines
997 B
C

/* soc.c - system/hardware module for nsim */
/*
* Copyright (c) 2016, 2019 Synopsys, Inc. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* This module provides routines to initialize and support board-level hardware
* for the ARC EM and HS cores in nSIM simulator.
*
*/
#include <device.h>
#include <init.h>
#include "soc.h"
#ifdef CONFIG_SMP
static int arc_nsim_init(const struct device *dev)
{
ARG_UNUSED(dev);
uint32_t core;
uint32_t i;
/* allocate all IDU interrupts to master core */
core = z_arc_v2_core_id();
z_arc_connect_idu_disable();
for (i = 0; i < (CONFIG_NUM_IRQS - ARC_CONNECT_IDU_IRQ_START); i++) {
z_arc_connect_idu_set_mode(i, ARC_CONNECT_INTRPT_TRIGGER_LEVEL,
ARC_CONNECT_DISTRI_MODE_ROUND_ROBIN);
z_arc_connect_idu_set_dest(i, 1 << core);
z_arc_connect_idu_set_mask(i, 0x0);
}
z_arc_connect_idu_enable();
return 0;
}
SYS_INIT(arc_nsim_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_SMP */