summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/include/leon.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2006-04-24 16:58:41 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2006-04-24 16:58:41 +0000
commitcadb5d1641059adb5bbef5900e2cefee653f2b74 (patch)
tree6353a9fe2f02c1b89b69e6cf55eef27d24710ce7 /c/src/lib/libbsp/sparc/leon3/include/leon.h
parent2006-04-24 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-cadb5d1641059adb5bbef5900e2cefee653f2b74.tar.bz2
2006-04-24 Jiri Gaisler <jiri@gaisler.com>
Edvin Catovic <edvin@gaisler.com> PR bsps/972 * ChangeLog, Makefile.am, configure.ac, amba/amba.c, clock/ckinit.c, console/Makefile.am, console/console.c, console/debugputs.c, include/Makefile.am, include/amba.h, include/bsp.h, include/leon.h, leon_smc91111/leon_smc91111.c, startup/bspstart.c, timer/timer.c, tools/Makefile.am, wrapup/Makefile.am: Added Shared Memory Support Driver. Added Leon Gaisler Research Ethernet support. Enhanced AMBA bus support. * console/debugprintf.c, console/spacewire.c, include/spacewire.h, leon_greth/.cvsignore, leon_greth/Makefile.am, leon_greth/leon_greth.c, shmsupp/.cvsignore, shmsupp/Makefile.am, shmsupp/addrconv.c, shmsupp/getcfg.c, shmsupp/lock.c, shmsupp/mpisr.c: New files.
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/include/leon.h')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/include/leon.h79
1 files changed, 22 insertions, 57 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index 990b359295..a7922b876e 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -116,7 +116,7 @@ typedef struct {
volatile unsigned int ipend;
volatile unsigned int iforce;
volatile unsigned int iclear;
- volatile unsigned int notused00;
+ volatile unsigned int mpstat;
volatile unsigned int notused01;
volatile unsigned int notused02;
volatile unsigned int notused03;
@@ -128,65 +128,24 @@ typedef struct {
volatile unsigned int notused21;
volatile unsigned int notused22;
volatile unsigned int notused23;
- volatile unsigned int mask_p0;
- volatile unsigned int mask_p1;
- volatile unsigned int mask_p2;
- volatile unsigned int mask_p3;
- volatile unsigned int mask_p4;
- volatile unsigned int mask_p5;
- volatile unsigned int mask_p6;
- volatile unsigned int mask_p7;
- volatile unsigned int mask_p8;
- volatile unsigned int mask_p9;
- volatile unsigned int mask_p10;
- volatile unsigned int mask_p11;
- volatile unsigned int mask_p12;
- volatile unsigned int mask_p13;
- volatile unsigned int mask_p14;
- volatile unsigned int mask_p15;
+ volatile unsigned int mask[16];
+ volatile unsigned int force[16];
} LEON3_IrqCtrl_Regs_Map;
-/*
typedef struct {
volatile unsigned int value;
volatile unsigned int reload;
volatile unsigned int conf;
volatile unsigned int notused;
} LEON3_Timer_SubType;
-*/
+
typedef struct {
volatile unsigned int scaler_value; /* common timer registers */
volatile unsigned int scaler_reload;
volatile unsigned int status;
volatile unsigned int notused;
- volatile unsigned int value_t0; /* timer 0 */
- volatile unsigned int reload_t0;
- volatile unsigned int conf_t0;
- volatile unsigned int notused0;
- volatile unsigned int value_t1; /* timer 1 */
- volatile unsigned int reload_t1;
- volatile unsigned int conf_t1;
- volatile unsigned int notused1;
- volatile unsigned int value_t2; /* timer 2 */
- volatile unsigned int reload_t2;
- volatile unsigned int conf_t2;
- volatile unsigned int notused2;
- volatile unsigned int value_t3; /* timer 3 */
- volatile unsigned int reload_t3;
- volatile unsigned int conf_t3;
- volatile unsigned int notused3;
- volatile unsigned int value_t4; /* timer 4 */
- volatile unsigned int reload_t4;
- volatile unsigned int conf_t4;
- volatile unsigned int notused4;
- volatile unsigned int value_t5; /* timer 5 */
- volatile unsigned int reload_t5;
- volatile unsigned int conf_t5;
- volatile unsigned int notused5;
- volatile unsigned int value_t6; /* timer 6 */
- volatile unsigned int reload_t6;
- volatile unsigned int conf_t6;
+ LEON3_Timer_SubType timer[8];
} LEON3_Timer_Regs_Map;
typedef struct {
@@ -295,6 +254,8 @@ extern volatile LEON3_IrqCtrl_Regs_Map *LEON3_IrqCtrl_Regs; /* LEON3 Interrupt
extern volatile LEON3_Timer_Regs_Map *LEON3_Timer_Regs; /* LEON3 GP Timer */
extern volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
+extern int LEON3_Cpu_Index;
+
/* Macros used for manipulating bits in LEON3 GP Timer Control Register */
#define LEON3_GPTIMER_EN 1
@@ -302,6 +263,8 @@ extern volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
#define LEON3_GPTIMER_LD 4
#define LEON3_GPTIMER_IRQEN 8
+#define LEON3_MP_IRQ 14 /* Irq used by shared memory driver */
+
#ifndef ASM
/*
@@ -328,23 +291,24 @@ extern volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
(LEON3_IrqCtrl_Regs.ipend & (1 << (_source)))
#define LEON_Is_interrupt_masked( _source ) \
- (LEON3_IrqCtrl_Regs.mask_p0 & (1 << (_source)))
+ do {\
+ (LEON3_IrqCtrl_Regs.mask[LEON3_Cpu_Index] & (1 << (_source))); \
+ } while (0)
+
#define LEON_Mask_interrupt( _source ) \
do { \
unsigned32 _level; \
- \
_level = sparc_disable_interrupts(); \
- LEON3_IrqCtrl_Regs->mask_p0 &= ~(1 << (_source)); \
+ LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index] &= ~(1 << (_source)); \
sparc_enable_interrupts( _level ); \
} while (0)
#define LEON_Unmask_interrupt( _source ) \
do { \
unsigned32 _level; \
- \
_level = sparc_disable_interrupts(); \
- LEON3_IrqCtrl_Regs->mask_p0 |= (1 << (_source)); \
+ LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index] |= (1 << (_source)); \
sparc_enable_interrupts( _level ); \
} while (0)
@@ -352,10 +316,9 @@ extern volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
do { \
unsigned32 _level; \
unsigned32 _mask = 1 << (_source); \
- \
_level = sparc_disable_interrupts(); \
- (_previous) = LEON3_IrqCtrl_Regs->mask_p0; \
- LEON3_IrqCtrl_Regs->mask_p0 = _previous & ~_mask; \
+ (_previous) = LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index]; \
+ LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index] = _previous & ~_mask; \
sparc_enable_interrupts( _level ); \
(_previous) &= _mask; \
} while (0)
@@ -364,13 +327,13 @@ extern volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
do { \
unsigned32 _level; \
unsigned32 _mask = 1 << (_source); \
- \
_level = sparc_disable_interrupts(); \
- LEON3_IrqCtrl_Regs->mask_p0 = \
- (LEON3_IrqCtrl_Regs->mask_p0 & ~_mask) | (_previous); \
+ LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index] = \
+ (LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index] & ~_mask) | (_previous); \
sparc_enable_interrupts( _level ); \
} while (0)
+
/*
* Each timer control register is organized as follows:
*
@@ -402,6 +365,8 @@ extern volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
#define LEON_REG_TIMER_COUNTER_DEFINED_MASK 0x00000003
#define LEON_REG_TIMER_COUNTER_CURRENT_MODE_MASK 0x00000003
+#include "spacewire.h"
+
#endif /* !ASM */
#ifdef __cplusplus