soc: arc: synopsys: move secure timer0 definition to DT

Use Devicetree to describe secure timer0 instead of hardcoding values in
<soc.h>.

DT files have been structured to match the following requirements: In
case of sectimer0 - it's should be only enabled for:

- emsdp_em7d_esp.dts
- em_starterkit_em7d.dts
- nsim_sem_mpu_stack_guard.dts
- nsim_sem.dts

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-06-15 13:24:21 +02:00 committed by Anas Nashif
parent 44250fe3d3
commit 5f40a9f40f
11 changed files with 47 additions and 16 deletions

View file

@ -7,7 +7,7 @@
/dts-v1/;
#include <mem.h>
#include <synopsys/emsk.dtsi>
#include <synopsys/emsk-sec.dtsi>
#include "em_starterkit_r23.dtsi"
#include "board.dtsi"

View file

@ -6,7 +6,7 @@
/dts-v1/;
#include <synopsys/emsdp.dtsi>
#include <synopsys/emsdp-sec.dtsi>
#include "board.dtsi"
/ {

View file

@ -0,0 +1,14 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/
#include "nsim_em.dtsi"
/ {
sectimer0: sectimer0 {
compatible = "snps,arc-timer";
interrupts = <20 1>;
interrupt-parent = <&intc>;
};
};

View file

@ -7,7 +7,7 @@
/dts-v1/;
#include "nsim_em.dtsi"
#include "nsim_em-sec.dtsi"
/ {

View file

@ -6,7 +6,7 @@
/dts-v1/;
#include "nsim_em.dtsi"
#include "nsim_em-sec.dtsi"
/ {
model = "snps,nsim_sem_mpu_stack_guard";

View file

@ -27,7 +27,7 @@
#define _ARC_V2_TMR0_COUNT _ARC_V2_S_TMR0_COUNT
#define _ARC_V2_TMR0_CONTROL _ARC_V2_S_TMR0_CONTROL
#define _ARC_V2_TMR0_LIMIT _ARC_V2_S_TMR0_LIMIT
#define IRQ_TIMER0 IRQ_SEC_TIMER0
#define IRQ_TIMER0 DT_IRQN(DT_NODELABEL(sectimer0))
#else
#define IRQ_TIMER0 DT_IRQN(DT_NODELABEL(timer0))

View file

@ -0,0 +1,14 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/
#include "emsdp.dtsi"
/ {
sectimer0: sectimer0 {
compatible = "snps,arc-timer";
interrupts = <20 1>;
interrupt-parent = <&intc>;
};
};

View file

@ -0,0 +1,14 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/
#include "emsk.dtsi"
/ {
sectimer0: sectimer0 {
compatible = "snps,arc-timer";
interrupts = <20 1>;
interrupt-parent = <&intc>;
};
};

View file

@ -19,9 +19,6 @@
/* default system clock */
#define SYSCLK_DEFAULT_IOSC_HZ MHZ(100)
/* ARC EM Core IRQs */
#define IRQ_SEC_TIMER0 20
#ifndef _ASMLANGUAGE
#include <zephyr/sys/util.h>

View file

@ -20,11 +20,6 @@
/* On the EM Starter Kit board, the peripheral bus clock frequency is 50Mhz */
#define SYSCLK_DEFAULT_IOSC_HZ MHZ(50)
/* ARC EM Core IRQs */
#if defined(CONFIG_BOARD_EM_STARTERKIT_R23) && defined(CONFIG_SOC_EMSK_EM7D)
#define IRQ_SEC_TIMER0 20
#endif /* CONFIG_BOARD_EM_STARTERKIT_R23 && CONFIG_SOC_EMSK_EM7D */
#if defined(CONFIG_BOARD_EM_STARTERKIT_R23) && defined(CONFIG_SOC_EMSK_EM7D)
#define IRQ_CORE_DMA_COMPLETE 22
#define IRQ_CORE_DMA_ERROR 23

View file

@ -16,9 +16,6 @@
#include <zephyr/sys/util.h>
/* ARC EM Core IRQs */
#define IRQ_SEC_TIMER0 20
#ifndef _ASMLANGUAGE
#include <zephyr/sys/util.h>