bsp/leon3: Add LEON3_IRQAMP_BASE

This commit is contained in:
Sebastian Huber
2021-07-16 11:19:51 +02:00
parent 8f235798a6
commit 824556e0b8
4 changed files with 35 additions and 1 deletions

View File

@@ -41,6 +41,8 @@
#include <grlib/irqamp-regs.h>
#include <grlib/io.h>
#include <bspopts.h>
struct ambapp_dev;
#ifdef __cplusplus
@@ -84,7 +86,11 @@ extern rtems_interrupt_lock LEON3_IrqCtrl_Lock;
/**
* @brief This pointer provides the IRQ(A)MP register block address.
*/
#if defined(LEON3_IRQAMP_BASE)
#define LEON3_IrqCtrl_Regs ((irqamp *) LEON3_IRQAMP_BASE)
#else
extern irqamp *LEON3_IrqCtrl_Regs;
#endif
/**
* @brief This pointer provides the IRQ(A)MP device information block.

View File

@@ -115,9 +115,10 @@ RTEMS_SYSINIT_ITEM(
);
#endif
/* Pointers to Interrupt Controller configuration registers */
#if !defined(LEON3_IRQAMP_BASE)
irqamp *LEON3_IrqCtrl_Regs;
struct ambapp_dev *LEON3_IrqCtrl_Adev;
#endif
#if !defined(LEON3_GPTIMER_BASE)
gptimer *LEON3_Timer_Regs;
@@ -140,7 +141,12 @@ static void amba_initialize(void)
struct ambapp_bus *plb;
plb = ambapp_plb();
#if defined(LEON3_IRQAMP_BASE) && defined(LEON3_GPTIMER_BASE)
(void) plb;
(void) adev;
#endif
#if !defined(LEON3_IRQAMP_BASE)
/* Find LEON3 Interrupt controller */
adev = (void *)ambapp_for_each(plb, (OPTIONS_ALL|OPTIONS_APB_SLVS),
VENDOR_GAISLER, GAISLER_IRQMP,
@@ -167,6 +173,7 @@ static void amba_initialize(void)
icsel = (icsel >> ((7 - (LEON3_Cpu_Index & 0x7)) * 4)) & 0xf;
LEON3_IrqCtrl_Regs += icsel;
}
#endif
#if !defined(LEON3_GPTIMER_BASE)
/* find GP Timer */

View File

@@ -36,6 +36,8 @@ links:
uid: optapbuartbase
- role: build-dependency
uid: optgptimerbase
- role: build-dependency
uid: optirqampbase
- role: build-dependency
uid: optconirq
- role: build-dependency

View File

@@ -0,0 +1,19 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2021 embedded brains GmbH & Co. KG
actions:
- get-integer: null
- format-and-define: null
build-type: option
default:
- enabled-by: sparc/gr712rc
value: 0x80000200
- enabled-by: sparc/gr740
value: 0xff904000
enabled-by: true
format: '{:#010x}'
links: []
name: LEON3_IRQAMP_BASE
description: |
This option defines the base address of the IRQ(A)MP register block.
type: build