unify irq data types and code, merge s3c2400/s3c2410 support

This commit is contained in:
Thomas Doerfler
2010-04-09 20:24:57 +00:00
parent a0bdb9b85b
commit c193baadaf
75 changed files with 349 additions and 1527 deletions

View File

@@ -1,3 +1,9 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* shared/irq/irq_init.c, shared/lpc/clock/lpc-clock-config.c,
shared/lpc/network/lpc-ethernet.c, shared/start/start.S: make
irq data types consistent
2010-04-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* shared/lpc/include/lpc-dma.h: New file.

View File

@@ -1,3 +1,8 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* startup/bspstart.c, network/network.c: make irq data types
consistent
2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* console/uart.c: Eliminate warnings.

View File

@@ -49,7 +49,7 @@ static int enet_isr_is_on(const rtems_irq_connect_data *irq);
/* Replace the first value with the clock's interrupt name. */
rtems_irq_connect_data mc9328mxl_enet_isr_data = {
.name = BSP_INT_GPIO_PORTA,
.hdl = (rtems_irq_hdl)enet_isr,
.hdl = enet_isr,
.handle = (void *)BSP_INT_GPIO_PORTA,
.on = enet_isr_on,
.off = enet_isr_off,

View File

@@ -16,6 +16,8 @@
#include <mc9328mxl.h>
extern void rtems_irq_mngt_init(void);
extern void rtems_exception_init_mngt(void);
extern void mmu_set_cpu_async_mode(void);
/*

View File

@@ -1,3 +1,8 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* startup/bspstart.c, network/network.c: make irq data types
consistent
2009-12-08 Fernando Nicodemos <fgnicodemos@terra.com.br>
* console/font8x16.h, console/sed1356.c: Fix typos.

View File

@@ -84,7 +84,7 @@
/* RTEMS event used to start transmit daemon. */
#define START_TRANSMIT_EVENT RTEMS_EVENT_2
rtems_isr at91rm9200_emac_isr(rtems_vector_number vector);
static void at91rm9200_emac_isr (rtems_irq_hdl_param unused);
static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused);
static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused);
static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq);
@@ -92,12 +92,12 @@ static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq);
/* Replace the first value with the clock's interrupt name. */
rtems_irq_connect_data at91rm9200_emac_isr_data = {
AT91RM9200_INT_EMAC,
(rtems_irq_hdl)at91rm9200_emac_isr,
at91rm9200_emac_isr,
NULL,
at91rm9200_emac_isr_on,
at91rm9200_emac_isr_off,
at91rm9200_emac_isr_is_on,
3, /* unused for ARM */
0 }; /* unused for ARM */
at91rm9200_emac_isr_is_on
};
/* use the values defined in linkcmds for our use of SRAM */
@@ -847,7 +847,7 @@ at91rm9200_emac_ioctl (struct ifnet *ifp, ioctl_command_t command, caddr_t data)
}
/* interrupt handler */
rtems_isr at91rm9200_emac_isr (rtems_vector_number v)
static void at91rm9200_emac_isr (rtems_irq_hdl_param unused)
{
unsigned long status32;

View File

@@ -25,6 +25,7 @@
/* Function prototypes */
extern void rtems_irq_mngt_init(void);
extern void rtems_exception_init_mngt(void);
void bsp_libc_init( void *, uint32_t, int );
static void fix_mac_addr(void);
void bsp_usart_init(void);

View File

@@ -1,3 +1,9 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* clock/clockdrv.c, irq/bsp_irq_init.c, irq/irq.h
startup/bspstart.c, network/network.c: make irq data types
consistent
2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* start/start.S: Verify boot_card() is passed a NULL.

View File

@@ -27,11 +27,10 @@ static int clock_isr_is_on(const rtems_irq_connect_data *irq);
rtems_irq_connect_data clock_isr_data = {BSP_TC1OI,
(rtems_irq_hdl)Clock_isr,
NULL,
clock_isr_on,
clock_isr_off,
clock_isr_is_on,
3,
0 };
clock_isr_is_on};
#define CLOCK_VECTOR 0

View File

@@ -17,8 +17,6 @@
#include <bsp.h>
#include <ep7312.h>
extern void default_int_handler(void);
void BSP_rtems_irq_mngt_init(void)
{
long int_stat;

View File

@@ -30,9 +30,10 @@ extern "C" {
* Include some preprocessor value also used by assember code
*/
#include <rtems/irq.h>
#include <rtems.h>
extern void default_int_handler();
extern void default_int_handler(rtems_irq_hdl_param unused);
/*-------------------------------------------------------------------------+
| Constants
+--------------------------------------------------------------------------*/
@@ -66,62 +67,6 @@ typedef unsigned int rtems_irq_number;
#define BSP_DAIINT 21
#define BSP_MAX_INT 22
/*
* Type definition for RTEMS managed interrupts
*/
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef void (*rtems_irq_hdl) (void);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
typedef int (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*);
typedef struct __rtems_irq_connect_data__ {
/*
* IRQ line
*/
rtems_irq_number name;
/*
* handler. See comment on handler properties below in function prototype.
*/
rtems_irq_hdl hdl;
/*
* function for enabling interrupts at device level (ONLY!).
* The BSP code will automatically enable it at i8259s level.
* RATIONALE : anyway such code has to exist in current driver code.
* It is usually called immediately AFTER connecting the interrupt handler.
* RTEMS may well need such a function when restoring normal interrupt
* processing after a debug session.
*
*/
rtems_irq_enable on;
/*
* function for disabling interrupts at device level (ONLY!).
* The code will disable it at i8259s level. RATIONALE : anyway
* such code has to exist for clean shutdown. It is usually called
* BEFORE disconnecting the interrupt. RTEMS may well need such
* a function when disabling normal interrupt processing for
* a debug session. May well be a NOP function.
*/
rtems_irq_disable off;
/*
* function enabling to know what interrupt may currently occur
* if someone manipulates the i8259s interrupt mask without care...
*/
rtems_irq_is_enabled isOn;
/*
* priority level at the vplus level
*/
rtems_irq_level irqLevel;
/*
* Trigger way : Rising or falling edge or High or low level
*/
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
/*-------------------------------------------------------------------------+
| Function Prototypes.
+--------------------------------------------------------------------------*/
@@ -134,53 +79,6 @@ typedef struct __rtems_irq_connect_data__ {
*/
void BSP_rtems_irq_mngt_init();
/*
* function to connect a particular irq handler. This hanlder will NOT be called
* directly as the result of the corresponding interrupt. Instead, a RTEMS
* irq prologue will be called that will :
*
* 1) save the C scratch registers,
* 2) switch to a interrupt stack if the interrupt is not nested,
* 3) store the current i8259s' interrupt masks
* 4) modify them to disable the current interrupt at 8259 level (and may
* be others depending on software priorities)
* 5) aknowledge the i8259s',
* 6) demask the processor,
* 7) call the application handler
*
* As a result the hdl function provided
*
* a) can perfectly be written is C,
* b) may also well directly call the part of the RTEMS API that can be used
* from interrupt level,
* c) It only responsible for handling the jobs that need to be done at
* the device level including (aknowledging/re-enabling the interrupt at device,
* level, getting the data,...)
*
* When returning from the function, the following will be performed by
* the RTEMS irq epilogue :
*
* 1) masks the interrupts again,
* 2) restore the original i8259s' interrupt masks
* 3) switch back on the orinal stack if needed,
* 4) perform rescheduling when necessary,
* 5) restore the C scratch registers...
* 6) restore initial execution flow
*
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* function to get the current RTEMS irq handler for ptr->name. It enables to
* define hanlder chain...
*/
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/*
* function to get disconnect the RTEMS irq handler for ptr->name.
* This function checks that the value given is the current one for safety reason.
* The user can use the previous function to get it.
*/
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
#endif /* __asm__ */

View File

@@ -7,20 +7,19 @@
unsigned int bsp_cs8900_io_base = 0;
unsigned int bsp_cs8900_memory_base = 0;
cs8900_device *g_cs;
rtems_isr cs8900_isr(rtems_vector_number v);
void cs8900_isr(rtems_irq_hdl_param unused);
rtems_irq_connect_data cs8900_isr_data = {BSP_EINT3,
(rtems_irq_hdl)cs8900_isr,
NULL,
NULL,
NULL,
0,
0 };
cs8900_isr,
NULL,
NULL,
NULL,
NULL};
char g_enetbuf[1520];
rtems_isr cs8900_isr(rtems_vector_number v)
void cs8900_isr(rtems_irq_hdl_param unused)
{
cs8900_interrupt(v, g_cs);
cs8900_interrupt(BSP_EINT3, g_cs);
}
/* cs8900_io_set_reg - set one of the I/O addressed registers */

View File

@@ -18,6 +18,7 @@
* Function prototypes
*/
extern void rtems_irq_mngt_init(void);
extern void rtems_exception_init_mngt(void);
/*
* NAME: bsp_start_default - BSP initialization function

View File

@@ -1,3 +1,8 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* clock/clockdrv.c, console/console.c, irq/irq.c, irq/irq.h,
irq/irq_init.c: make irq data types consistent
2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* start/start.S: Verify boot_card() is passed a NULL.

View File

@@ -31,11 +31,10 @@ static int clock_isr_is_on(const rtems_irq_connect_data *irq);
rtems_irq_connect_data clock_isr_data = {BSP_IRQ_TIMER3,
(rtems_irq_hdl)Clock_isr,
NULL,
clock_isr_on,
clock_isr_off,
clock_isr_is_on,
0,
0 };
clock_isr_is_on};
#define CLOCK_VECTOR 0
@@ -44,6 +43,7 @@ rtems_irq_connect_data clock_isr_data = {BSP_IRQ_TIMER3,
#define Clock_driver_support_install_isr( _new, _old ) \
do { \
BSP_install_rtems_irq_handler(&clock_isr_data); \
_old = NULL; \
} while(0)
#define Clock_driver_support_shutdown_hardware() \

View File

@@ -49,7 +49,7 @@ static int gba_pollRead(int minor)
* @return character code
*
*/
static int gba_write(int minor, const char *buf, int len)
static ssize_t gba_write(int minor, const char *buf, size_t len)
{
int i;

View File

@@ -31,9 +31,10 @@ extern "C" {
#define VECTOR_TABLE (&irq_vector_table[0])
#include <stdint.h>
#include <rtems/irq.h>
#include <rtems.h>
extern void default_int_handler();
extern void default_int_handler(rtems_irq_hdl_param unused);
/*---------------------------------------------------------------------------*
* MACROS *
@@ -67,67 +68,10 @@ typedef enum {
BSP_MAX_INT = 16 /**< BSP_MAX_INT <= _irq_max_vector in linkcmds */
} rtems_irq_symbolic_name;
/*
* Type definition for RTEMS managed interrupts
*/
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
extern void _irq_max_vector; /**< defined in lincmds */
extern uint32_t irq_vector_table[BSP_MAX_INT]; /**< allocated in linkcmds */
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef void (*rtems_irq_hdl) (void);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
typedef int (*rtems_irq_is_enabled) (const struct __rtems_irq_connect_data__*);
/** irq connection data structure */
typedef struct __rtems_irq_connect_data__ {
/**
* IRQ line
*/
rtems_irq_symbolic_name name;
/**
* handler. See comment on handler properties below in function prototype.
*/
rtems_irq_hdl hdl;
/**
* function for enabling interrupts at device level (ONLY!).
* The BSP code will automatically enable it at PIC level.
* RATIONALE : anyway such code has to exist in current driver code.
* It is usually called immediately AFTER connecting the interrupt handler.
* RTEMS may well need such a function when restoring normal interrupt
* processing after a debug session.
*
*/
rtems_irq_enable on;
/**
* function for disabling interrupts at device level (ONLY!).
* The code will disable it at PIC level. RATIONALE : anyway
* such code has to exist for clean shutdown. It is usually called
* BEFORE disconnecting the interrupt. RTEMS may well need such
* a function when disabling normal interrupt processing for
* a debug session. May well be a NOP function.
*/
rtems_irq_disable off;
/**
* function enabling to know what interrupt may currently occur
* if someone manipulates the PIC interrupt mask without care...
*/
rtems_irq_is_enabled isOn;
/**
* irq priority level
*/
rtems_irq_level irqLevel;
/**
* Trigger way : Rising or falling edge or High or low level
*/
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
/*-------------------------------------------------------------------------+
| Function Prototypes.
+--------------------------------------------------------------------------*/
@@ -140,55 +84,6 @@ typedef struct __rtems_irq_connect_data__ {
*/
void BSP_rtems_irq_mngt_init();
/**
* @brief function to connect a particular irq handler.
* This hanlder will NOT be called directly as the result of the corresponding interrupt.
* Instead, a RTEMS irq prologue will be called that will :
* 1) save the C scratch registers,
* 2) switch to a interrupt stack if the interrupt is not nested,
* 3) store the current i8259s' interrupt masks
* 4) modify them to disable the current interrupt at 8259 level (and may
* be others depending on software priorities)
* 5) aknowledge the i8259s',
* 6) demask the processor,
* 7) call the application handler
*
* As a result the hdl function provided
* a) can perfectly be written is C,
* b) may also well directly call the part of the RTEMS API that can be used
* from interrupt level,
* c) It only responsible for handling the jobs that need to be done at
* the device level including (aknowledging/re-enabling the interrupt at device,
* level, getting the data,...)
*
* When returning from the function, the following will be performed by
* the RTEMS irq epilogue :
*
* 1) masks the interrupts again,
* 2) restore the original i8259s' interrupt masks
* 3) switch back on the orinal stack if needed,
* 4) perform rescheduling when necessary,
* 5) restore the C scratch registers...
* 6) restore initial execution flow
*
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/**
* function to get the current RTEMS irq handler for ptr->name. It enables to
* define hanlder chain...
*/
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/**
* @brief function to get disconnect the RTEMS irq handler for ptr->name.
* This function checks that the value given is the current one for safety reason.
* The user can use the previous function to get it.
*/
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
#ifdef __cplusplus
}
#endif

View File

@@ -35,7 +35,7 @@ extern void _irq_max_vector;
* @param None
* @return None
*/
void default_int_handler(void)
void default_int_handler(rtems_irq_hdl_param unused)
{
printk("raw_idt_notify has been called \n");
}

View File

@@ -1,3 +1,8 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* Makefile.am, startup/bspstart.c: make irq data types consistent,
use common code for s3c24xx
2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* start/start.S: Verify boot_card() is passed a NULL.

View File

@@ -44,9 +44,9 @@ libbsp_a_SOURCES += ../shared/abort/abort.c
libbsp_a_SOURCES += smc/smc.c smc/smc.h
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/arm920.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/clock.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/timer.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/irq.rel
../../../libcpu/@RTEMS_CPU@/s3c24xx/clock.rel \
../../../libcpu/@RTEMS_CPU@/s3c24xx/timer.rel \
../../../libcpu/@RTEMS_CPU@/s3c24xx/irq.rel
include $(srcdir)/preinstall.am
include $(top_srcdir)/../../../../automake/local.am

View File

@@ -22,6 +22,7 @@
* External Prototypes
*/
extern void rtems_irq_mngt_init(void);
extern void rtems_exception_init_mngt(void);
/*
* BSP specific Idle task

View File

@@ -1,3 +1,7 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* rtl8019/rtl8019.c: make irq data types consistent
2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* start/start.S: Verify boot_card() is passed a NULL.

View File

@@ -352,12 +352,10 @@ ne_check_status (struct ne_softc *sc, int from_irq_handler)
/* Handle an NE2000 interrupt. */
static void
ne_interrupt_handler (uint32_t cdata)
ne_interrupt_handler (rtems_irq_hdl_param handle)
{
rtems_vector_number v = (rtems_vector_number) cdata;
struct ne_softc *sc;
struct ne_softc *sc = handle;
sc = ne_device_for_irno (v);
if (sc == NULL)
return;
@@ -502,15 +500,16 @@ ne_init_hardware (struct ne_softc *sc)
/* Set up interrupts.
*/
static void
ne_init_irq_handler(int irno)
ne_init_irq_handler(ne_softc *sc)
{
rtems_irq_connect_data irq;
#ifdef DEBUG_NE
printk("ne_init_irq_handler(%d)\n", irno);
#endif
irq.name = irno;
irq.name = sc->irno;
irq.hdl = ne_interrupt_handler;
irq.handle = sc;
irq.on = ne_interrupt_on;
irq.off = ne_interrupt_off;
irq.isOn = ne_interrupt_is_on;
@@ -976,7 +975,7 @@ ne_init (void *arg)
sc->rx_daemon_tid = rtems_bsdnet_newproc ("SCrx", 4096, ne_rx_daemon, sc);
/* install rtems irq handler */
ne_init_irq_handler(sc->irno);
ne_init_irq_handler(sc);
}
ifp->if_flags |= IFF_RUNNING;

View File

@@ -1,3 +1,9 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* Makefile.am, clock/clock.c, fb/fb.c, irq/irq.c, sound/sound.c,
startup/bspstart.c, touchscreen/touchscreen.c, wifi/wifi.c: make
irq data types consistent
2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* start/start.S: Verify boot_card() is passed a NULL.

View File

@@ -88,8 +88,6 @@ block_rel_SOURCES = block/block.c
block_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include -DNDS -I$(srcdir)/libfat/source/disc_io
block_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
include_HEADERS += irq/irq.h
noinst_PROGRAMS += irq.rel
irq_rel_SOURCES = irq/irq.c
irq_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include

View File

@@ -13,7 +13,7 @@
#include <rtems.h>
#include <bsp.h>
#include "../irq/irq.h"
#include <rtems/irq.h>
#include <nds.h>
#define CLOCK_VECTOR IRQ_TIMER0
@@ -34,8 +34,7 @@ static rtems_irq_connect_data clock_isr_data = {
NULL,
NULL,
NULL,
0,
0
NULL
};
void update_touchscreen (void);
@@ -52,12 +51,11 @@ void update_touchscreen (void);
* install isr for clock driver.
*/
void
Clock_driver_support_install_isr (rtems_isr_entry new, rtems_isr_entry old)
{
BSP_install_rtems_irq_handler (&clock_isr_data);
}
#define Clock_driver_support_install_isr( _new, _old ) \
do { \
_old = NULL; \
BSP_install_rtems_irq_handler(&clock_isr_data); \
} while (0)
/*
* disable clock.
*/

View File

@@ -17,7 +17,7 @@
#include <sys/types.h>
#include <bsp.h>
#include "../irq/irq.h"
#include <rtems/irq.h>
#include <rtems/libio.h>
#include <nds.h>

View File

@@ -12,7 +12,7 @@
*/
#include <bsp.h>
#include "irq.h"
#include <rtems/irq.h>
#include <nds.h>
/*
@@ -55,7 +55,10 @@ BSP_install_rtems_irq_handler (const rtems_irq_connect_data * irq)
rtems_interrupt_disable (level);
irqSet (irq->name, irq->hdl);
/*
* FIXME: irq_hdl will probably not be called with its parameter
*/
irqSet (irq->name, (VoidFunctionPointer)irq->hdl);
if (irq->on != NULL)
irq->on (irq);

View File

@@ -1,62 +0,0 @@
/*
* Copyright (c) 2008 by Matthieu Bucchianeri <mbucchia@gmail.com>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
* http://www.rtems.com/license/LICENSE
*
* $Id$
*/
#ifndef _IRQ_H_
#define _IRQ_H_
#ifdef __cplusplus
extern "C"
{
#endif
/*
* Type definition for RTEMS managed interrupts
*/
typedef unsigned char rtems_irq_name;
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef void (*rtems_irq_hdl) (void);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__
*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__
*);
typedef int (*rtems_irq_is_enabled) (const struct __rtems_irq_connect_data__
*);
/** irq connection data structure */
typedef struct __rtems_irq_connect_data__
{
rtems_irq_name name;
rtems_irq_hdl hdl;
rtems_irq_enable on;
rtems_irq_disable off;
rtems_irq_is_enabled isOn;
rtems_irq_level irqLevel;
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
void BSP_rtems_irq_mngt_init (void);
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data *);
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data *);
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data *);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -78,10 +78,6 @@ $(PROJECT_INCLUDE)/nds/sound.h: sound/sound.h $(PROJECT_INCLUDE)/nds/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/nds/sound.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/nds/sound.h
$(PROJECT_INCLUDE)/irq.h: irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/irq.h
$(PROJECT_INCLUDE)/libnds/$(dirstamp):
@$(MKDIR_P) $(PROJECT_INCLUDE)/libnds
@: > $(PROJECT_INCLUDE)/libnds/$(dirstamp)

View File

@@ -17,7 +17,7 @@
#include <sys/types.h>
#include <bsp.h>
#include "../irq/irq.h"
#include <rtems/irq.h>
#include <rtems/libio.h>
#include <nds.h>

View File

@@ -15,6 +15,7 @@
#include <bsp/bootcard.h>
#include <nds.h>
extern void BSP_rtems_irq_mngt_init (void);
/*
* start the platform.
*/

View File

@@ -17,7 +17,7 @@
#include <sys/types.h>
#include <bsp.h>
#include "../irq/irq.h"
#include <rtems/irq.h>
#include <rtems/libio.h>
#include <nds.h>

View File

@@ -31,7 +31,7 @@
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <irq.h>
#include <rtems/irq.h>
#include <nds.h>
#include <dswifi9.h>

View File

@@ -1,3 +1,8 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* network/network.c, startup/bspstart.c: make
irq data types consistent
2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h: Rename poorly named define "M" to "JOEL_M" since

View File

@@ -8,20 +8,19 @@
unsigned int bsp_cs8900_io_base = 0;
unsigned int bsp_cs8900_memory_base = 0;
cs8900_device *g_cs;
rtems_isr cs8900_isr(rtems_vector_number v);
void cs8900_isr(rtems_irq_hdl_param unused);
rtems_irq_connect_data cs8900_isr_data = {LPC22xx_INTERRUPT_EINT2,
(rtems_irq_hdl)cs8900_isr,
NULL,
NULL,
NULL,
0,
0 };
NULL,
NULL,
NULL,
NULL};
char g_enetbuf[1520];
rtems_isr cs8900_isr(rtems_vector_number v)
void cs8900_isr(rtems_irq_hdl_param unused)
{
cs8900_interrupt(v, g_cs);
cs8900_interrupt(LPC22xx_INTERRUPT_EINT2, g_cs);
}
/* cs8900_io_set_reg - set one of the I/O addressed registers */

View File

@@ -17,6 +17,7 @@
* Function prototypes
*/
extern void rtems_irq_mngt_init(void);
extern void rtems_exception_init_mngt(void);
extern void UART0_Ini(void);
extern void printi(unsigned long);

View File

@@ -17,7 +17,7 @@
#include <bsp.h>
#include <rtems/bspIo.h>
void default_int_handler(void)
void default_int_handler(rtems_irq_hdl_param unused)
{
printk("raw_idt_notify has been called \n");
}

View File

@@ -112,7 +112,11 @@ static uint32_t lpc_clock_nanoseconds_since_last_tick(void)
#define Clock_driver_support_at_tick() lpc_clock_at_tick()
#define Clock_driver_support_initialize_hardware() lpc_clock_initialize()
#define Clock_driver_support_install_isr(isr, old_isr) \
lpc_clock_handler_install()
do { \
lpc_clock_handler_install(); \
old_isr = NULL; \
} while (0)
#define Clock_driver_support_shutdown_hardware() lpc_clock_cleanup()
#define Clock_driver_nanoseconds_since_last_tick \
lpc_clock_nanoseconds_since_last_tick

View File

@@ -467,7 +467,8 @@ static bool lpc_eth_add_new_mbuf(
| ETH_RX_CTRL_INTERRUPT;
/* Cache flush of descriptor */
rtems_cache_flush_multiple_data_lines(&desc [i], sizeof(desc [0]));
rtems_cache_flush_multiple_data_lines((void *)&desc [i],
sizeof(desc [0]));
/* Add mbuf to table */
mbufs [i] = m;
@@ -580,10 +581,10 @@ static void lpc_eth_receive_task(void *arg)
struct mbuf *m = mbufs [receive_index];
/* Fragment status */
rtems_cache_invalidate_multiple_data_lines(
&status [receive_index],
sizeof(status [0])
);
rtems_cache_invalidate_multiple_data_lines
((void *)&status [receive_index],
sizeof(status [0])
);
stat = status [receive_index].info;
/* Remove mbuf from table */
@@ -908,10 +909,10 @@ static void lpc_eth_transmit_task(void *arg)
);
desc [produce_index].start = mtod(m, uint32_t);
desc [produce_index].control = ctrl;
rtems_cache_flush_multiple_data_lines(
&desc [produce_index],
sizeof(desc [0])
);
rtems_cache_flush_multiple_data_lines
((void *)&desc [produce_index],
sizeof(desc [0])
);
mbufs [produce_index] = m;
LPC_ETH_PRINTF(
@@ -966,7 +967,7 @@ static void lpc_eth_transmit_task(void *arg)
if ((ctrl & ETH_TX_CTRL_LAST) != 0) {
/* Finalize descriptor */
desc [produce_index].control = ctrl & ~ETH_TX_CTRL_SIZE_MASK
desc [produce_index].control = (ctrl & ~ETH_TX_CTRL_SIZE_MASK)
| (new_frame_length - 1);
LPC_ETH_PRINTF(
@@ -982,10 +983,10 @@ static void lpc_eth_transmit_task(void *arg)
);
/* Cache flush of descriptor */
rtems_cache_flush_multiple_data_lines(
&desc [produce_index],
sizeof(desc [0])
);
rtems_cache_flush_multiple_data_lines
((void *)&desc [produce_index],
sizeof(desc [0])
);
/* Next produce index */
produce_index = p;

View File

@@ -17,8 +17,9 @@
*/
#include <rtems/asm.h>
#include <rtems/system.h>
#include <rtems/score/cpu.h>
#include <bspopts.h>
#include <bsp/linker-symbols.h>

View File

@@ -1,3 +1,7 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* Makefile.am: use common code for s3c24xx
2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* make/custom/smdk2410.cfg: Remove RTEMS_BSP_FAMILY.

View File

@@ -44,9 +44,9 @@ libbsp_a_SOURCES += ../shared/abort/abort.c
libbsp_a_SOURCES += ../gp32/smc/smc.c ../gp32/smc/smc.h
libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/shared/arm920.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/clock.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/timer.rel \
../../../libcpu/@RTEMS_CPU@/@RTEMS_CPU_MODEL@/irq.rel
../../../libcpu/@RTEMS_CPU@/s3c24xx/clock.rel \
../../../libcpu/@RTEMS_CPU@/s3c24xx/timer.rel \
../../../libcpu/@RTEMS_CPU@/s3c24xx/irq.rel
include $(srcdir)/preinstall.am
include $(top_srcdir)/../../../../automake/local.am

View File

@@ -1,3 +1,7 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* umon/umonrtemsglue.c: change type to avoid warning
2010-03-25 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* src/irq-generic.c: fix warning

View File

@@ -20,7 +20,7 @@ static int rtems_umon_connected = 0;
void rtems_umon_connect(void)
{
void *moncomptr;
int(*moncomptr)(int,void *,void *,void *);
if ( rtems_umon_connected )
return;
@@ -29,7 +29,7 @@ void rtems_umon_connect(void)
moncomptr = rtems_bsp_get_umon_monptr();
monConnect(
(int(*)())(*(unsigned long *)moncomptr), /* monitor base */
moncomptr, /* monitor base */
(void *)0, /* lock */
(void *)0 /* unlock */
);

View File

@@ -1,3 +1,25 @@
2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* configure.ac, Makefile.am, at91rm9200/clock/clock.c,
at91rm9200/irq/bsp_irq_init.c,
at91rm9200/irq/irq.h, at91rm9200/usart/usart.c,
lpc22xx/clock/clockdrv.c, lpc22xx/irq/bsp_irq_init.c,
lpc22xx/irq/irq.h, mc9328mxl/irq/bsp_irq_init.c,
mc9328mxl/irq/irq.h libcpu/arm/pxa255/clock/clock.c,
pxa255/irq/bsp_irq_init.c, pxa255/irq/irq.h,
s3c24xx/clock/clockdrv.c, s3c24xx/irq/bsp_irq_init.c,
s3c24xx/irq/irq.h: changes to consolidate s3c24xx support and to
make irq system warning-free
* s3c2400/clock/clockdrv.c, s3c2400/clock/support.c,
s3c2400/include/s3c2400.h, s3c2400/irq/bsp_irq_asm.S,
s3c2400/irq/bsp_irq_init.c, s3c2400/irq/irq.c
libcpu/arm/s3c2400/irq/irq.h, s3c2400/timer/timer.c,
s3c2410/include/s3c2410.h, s3c2410/irq/bsp_irq_asm.S,
s3c2410/irq/irq.h: removed after merge into s3c24xx
* s3c24xx/include/s3c2400.h, s3c24xx/include/s3c2410.h,
s3c24xx/rq/bsp_irq_asm.S: moved from s3c2400 or s3c2410 tree
2010-04-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
* shared/include/arm-cp15.h: Documentation. Fixed mask defines.

View File

@@ -134,56 +134,30 @@ mc9328mxl_irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
mc9328mxl_irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
if s3c2400
include_HEADERS = s3c24xx/include/s3c24xx.h s3c2400/include/s3c2400.h
if s3c24xx
include_HEADERS = s3c24xx/include/s3c24xx.h s3c24xx/include/s3c2400.h s3c24xx/include/s3c2410.h
## s3c2400/clock
noinst_PROGRAMS += s3c2400/clock.rel
s3c2400_clock_rel_SOURCES = s3c2400/clock/clockdrv.c s3c2400/clock/support.c
s3c2400_clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c2400_clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
## s3c24xx/clock
noinst_PROGRAMS += s3c24xx/clock.rel
s3c24xx_clock_rel_SOURCES = s3c24xx/clock/clockdrv.c s3c24xx/clock/support.c
s3c24xx_clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c24xx_clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
## s3c2400/timer
noinst_PROGRAMS += s3c2400/timer.rel
s3c2400_timer_rel_SOURCES = s3c2400/timer/timer.c
s3c2400_timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c2400_timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
## s3c24xx/timer
noinst_PROGRAMS += s3c24xx/timer.rel
s3c24xx_timer_rel_SOURCES = s3c24xx/timer/timer.c
s3c24xx_timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c24xx_timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
## s3c2400/interrupt
include_HEADERS += s3c2400/irq/irq.h
## s3c24xx/interrupt
include_HEADERS += s3c24xx/irq/irq.h
noinst_PROGRAMS += s3c2400/irq.rel
s3c2400_irq_rel_SOURCES = s3c24xx/irq/irq.c s3c24xx/irq/bsp_irq_init.c \
../../libbsp/arm/shared/irq/irq_init.c s3c2400/irq/bsp_irq_asm.S \
s3c2400/irq/irq.h
s3c2400_irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c2400_irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
if s3c2410
include_HEADERS = s3c24xx/include/s3c24xx.h s3c2410/include/s3c2410.h
## s3c2410/clock
noinst_PROGRAMS += s3c2410/clock.rel
s3c2410_clock_rel_SOURCES = s3c24xx/clock/clockdrv.c s3c24xx/clock/support.c
s3c2410_clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c2410_clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
## s3c2410/timer
noinst_PROGRAMS += s3c2410/timer.rel
s3c2410_timer_rel_SOURCES = s3c24xx/timer/timer.c
s3c2410_timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c2410_timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
## s3c2410/interrupt
include_HEADERS += s3c2410/irq/irq.h
noinst_PROGRAMS += s3c2410/irq.rel
s3c2410_irq_rel_SOURCES = s3c24xx/irq/irq.c s3c24xx/irq/bsp_irq_init.c \
../../libbsp/arm/shared/irq/irq_init.c s3c2410/irq/bsp_irq_asm.S \
s3c2410/irq/irq.h
s3c2410_irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c2410_irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
noinst_PROGRAMS += s3c24xx/irq.rel
s3c24xx_irq_rel_SOURCES = s3c24xx/irq/irq.c s3c24xx/irq/bsp_irq_init.c \
../../libbsp/arm/shared/irq/irq_init.c s3c24xx/irq/bsp_irq_asm.S \
s3c24xx/irq/irq.h
s3c24xx_irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
s3c24xx_irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
if lpc22xx

View File

@@ -66,15 +66,17 @@ rtems_isr Clock_isr(rtems_vector_number vector);
/* Replace the first value with the clock's interrupt name. */
rtems_irq_connect_data clock_isr_data = {AT91RM9200_INT_SYSIRQ,
(rtems_irq_hdl)Clock_isr,
NULL,
clock_isr_on,
clock_isr_off,
clock_isr_is_on,
3, /* unused for ARM cpus */
0 }; /* unused for ARM cpus */
clock_isr_is_on};
#define Clock_driver_support_install_isr( _new, _old ) \
BSP_install_rtems_irq_handler(&clock_isr_data)
do { \
(_old) = NULL; \
BSP_install_rtems_irq_handler(&clock_isr_data); \
} while(0)
uint16_t st_pimr_value;
void Clock_driver_support_initialize_hardware(void)

View File

@@ -15,8 +15,6 @@
#include <bsp.h>
#include <at91rm9200.h>
extern void default_int_handler(void);
/*
* Interrupt system initialization. Disable interrupts, clear
* any that are pending.

View File

@@ -25,10 +25,11 @@ extern "C" {
* Include some preprocessor value also used by assember code
*/
#include <rtems/irq.h>
#include <rtems.h>
#include <at91rm9200.h>
extern void default_int_handler();
extern void default_int_handler(rtems_irq_hdl_param unused);
/***********************************************************************
* Constants
**********************************************************************/
@@ -72,60 +73,11 @@ extern void default_int_handler();
/* a vector table */
#define VECTOR_TABLE AIC_SVR_BASE
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef unsigned int rtems_irq_number;
typedef void (*rtems_irq_hdl) (uint32_t vector);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
typedef int (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*);
typedef struct __rtems_irq_connect_data__ {
/* IRQ line */
rtems_irq_number name;
/* Handler */
rtems_irq_hdl hdl;
/* function for enabling interrupts at device level. */
rtems_irq_enable on;
/* function for disabling interrupts at device level. */
rtems_irq_disable off;
/* Function to test if interrupt is enabled */
rtems_irq_is_enabled isOn;
/* priority level of interrupt */
rtems_irq_level irqLevel;
/* Trigger method (rising/falling edge or high/low level) */
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
/*
* function to initialize the interrupt for a specific BSP
*/
void BSP_rtems_irq_mngt_init();
/*
* function to connect a particular irq handler.
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* function to get the current RTEMS irq handler for ptr->name.
*/
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/*
* function to disconnect the RTEMS irq handler for ptr->name.
*/
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
#endif /* __asm__ */
#ifdef __cplusplus

View File

@@ -257,6 +257,7 @@ static int usart_set_attributes(int minor, const struct termios *t)
usart->mr = mode;
usart->brgr = brgr;
return 0;
}
/*

View File

@@ -29,10 +29,10 @@ AM_CONDITIONAL(shared, test "$RTEMS_CPU_MODEL" = "at91rm9200" || \
AM_CONDITIONAL(at91rm9200, test "$RTEMS_CPU_MODEL" = "at91rm9200")
AM_CONDITIONAL(mc9328mxl, test "$RTEMS_CPU_MODEL" = "mc9328mxl")
AM_CONDITIONAL(s3c2400, test "$RTEMS_CPU_MODEL" = "s3c2400")
AM_CONDITIONAL(s3c2410, test "$RTEMS_CPU_MODEL" = "s3c2410")
AM_CONDITIONAL(lpc22xx, test "$RTEMS_CPU_MODEL" = "lpc22xx")
AM_CONDITIONAL(pxa255, test "$RTEMS_CPU_MODEL" = "pxa255")
AM_CONDITIONAL(s3c24xx, test "$RTEMS_CPU_MODEL" = "s3c2400" ||\
test "$RTEMS_CPU_MODEL" = "s3c2410")
RTEMS_AMPOLISH3

View File

@@ -29,11 +29,10 @@ static int clock_isr_is_on(const rtems_irq_connect_data *irq);
/* Replace the first value with the clock's interrupt name. */
rtems_irq_connect_data clock_isr_data = {LPC22xx_INTERRUPT_TIMER0,
(rtems_irq_hdl)Clock_isr,
NULL,
clock_isr_on,
clock_isr_off,
clock_isr_is_on,
3, /* unused for ARM cpus */
0 }; /* unused for ARM cpus */
clock_isr_is_on};
/* If you follow the code, this is never used, so any value
* should work

View File

@@ -14,8 +14,6 @@
#include <lpc22xx.h>
extern void default_int_handler(void);
/*
* Interrupt system initialization. Disable interrupts, clear
* any that are pending.

View File

@@ -25,11 +25,12 @@ extern "C" {
/*
* Include some preprocessor value also used by assember code
*/
#include <rtems/irq.h>
#include <rtems.h>
#include <lpc22xx.h>
extern void default_int_handler();
extern void default_int_handler(rtems_irq_hdl_param unused);
/***********************************************************************
* Constants
**********************************************************************/
@@ -78,63 +79,14 @@ extern void default_int_handler();
#define FIQ_ISR_ADDR (*(u_long *)0x0000003CL)
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
typedef unsigned int rtems_irq_number;
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef void (*rtems_irq_hdl) (void);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
typedef int (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*);
//extern rtems_irq_hdl bsp_vector_table[BSP_MAX_INT];
#define VECTOR_TABLE VICVectAddrBase
typedef struct __rtems_irq_connect_data__ {
/* IRQ line */
rtems_irq_number name;
/* Handler */
rtems_irq_hdl hdl;
/* function for enabling interrupts at device level. */
rtems_irq_enable on;
/* function for disabling interrupts at device level. */
rtems_irq_disable off;
/* Function to test if interrupt is enabled */
rtems_irq_is_enabled isOn;
/* priority level of interrupt */
rtems_irq_level irqLevel;
/* Trigger method (rising/falling edge or high/low level) */
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
/*
* function to initialize the interrupt for a specific BSP
*/
void BSP_rtems_irq_mngt_init();
/*
* function to connect a particular irq handler.
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* function to get the current RTEMS irq handler for ptr->name.
*/
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/*
* function to disconnect the RTEMS irq handler for ptr->name.
*/
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
void BSP_rtems_irq_mngt_init(void);
#endif /* __asm__ */

View File

@@ -13,9 +13,6 @@
*/
#include <irq.h>
#include <bsp.h>
#include <mc9328mxl.h>
extern void default_int_handler(void);
/*
* Interrupt system initialization. Disable interrupts, clear

View File

@@ -31,7 +31,7 @@ extern "C" {
#include <rtems.h>
#include <mc9328mxl.h>
extern void default_int_handler();
extern void default_int_handler(rtems_irq_hdl_param);
/***********************************************************************
* Constants
**********************************************************************/
@@ -115,8 +115,7 @@ extern mc9328mxl_irq_info_t bsp_vector_table[BSP_MAX_INT];
/*
* function to initialize the interrupt for a specific BSP
*/
void BSP_rtems_irq_mngt_init();
void BSP_rtems_irq_mngt_init(void);
#endif /* __asm__ */

View File

@@ -91,29 +91,20 @@ $(PROJECT_INCLUDE)/irq.h: mc9328mxl/irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/irq.h
endif
if s3c2400
if s3c24xx
$(PROJECT_INCLUDE)/s3c24xx.h: s3c24xx/include/s3c24xx.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/s3c24xx.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/s3c24xx.h
$(PROJECT_INCLUDE)/s3c2400.h: s3c2400/include/s3c2400.h $(PROJECT_INCLUDE)/$(dirstamp)
$(PROJECT_INCLUDE)/s3c2400.h: s3c24xx/include/s3c2400.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/s3c2400.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/s3c2400.h
$(PROJECT_INCLUDE)/irq.h: s3c2400/irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/irq.h
endif
if s3c2410
$(PROJECT_INCLUDE)/s3c24xx.h: s3c24xx/include/s3c24xx.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/s3c24xx.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/s3c24xx.h
$(PROJECT_INCLUDE)/s3c2410.h: s3c2410/include/s3c2410.h $(PROJECT_INCLUDE)/$(dirstamp)
$(PROJECT_INCLUDE)/s3c2410.h: s3c24xx/include/s3c2410.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/s3c2410.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/s3c2410.h
$(PROJECT_INCLUDE)/irq.h: s3c2410/irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp)
$(PROJECT_INCLUDE)/irq.h: s3c24xx/irq/irq.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/irq.h
endif

View File

@@ -92,16 +92,18 @@ rtems_isr Clock_isr(rtems_vector_number vector);
rtems_irq_connect_data clock_isr_data = {
XSCALE_IRQ_OS_TIMER,
(rtems_irq_hdl)Clock_isr,
NULL,
clock_isr_on,
clock_isr_off,
clock_isr_is_on,
3, /* unused for ARM cpus */
0 /* unused for ARM cpus */
clock_isr_is_on
};
#define Clock_driver_support_install_isr( _new, _old ) \
BSP_install_rtems_irq_handler(&clock_isr_data)
do { \
_old = NULL; \
BSP_install_rtems_irq_handler(&clock_isr_data); \
} while (0)
void Clock_driver_support_initialize_hardware(void)
{

View File

@@ -13,12 +13,12 @@
#include <bsp.h>
#include <pxa255.h>
void dummy_handler(uint32_t vector)
void dummy_handler(rtems_irq_hdl_param unused)
{
printk("I am dummy handler\n");
}
void (*IRQ_table[PRIMARY_IRQS])(uint32_t vector);
void (*IRQ_table[PRIMARY_IRQS])(rtems_irq_hdl_param param);
/*
* Interrupt system initialization. Disable interrupts, clear

View File

@@ -22,69 +22,15 @@ extern "C" {
* Include some preprocessor value also used by assember code
*/
#include <rtems/irq.h>
#include <rtems.h>
#include <pxa255.h>
extern void default_int_handler();
extern void (*IRQ_table[PRIMARY_IRQS])(uint32_t vector);
extern void dummy_handler(uint32_t vector);
extern void default_int_handler(rtems_irq_hdl_param unused);
extern void (*IRQ_table[PRIMARY_IRQS])(rtems_irq_hdl_param param);
extern void dummy_handler(rtems_irq_hdl_param unused);
/* vector table used by shared/irq_init.c */
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef unsigned int rtems_irq_number;
typedef void (*rtems_irq_hdl) (uint32_t vector);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
typedef int (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*);
typedef struct __rtems_irq_connect_data__ {
/* IRQ line */
rtems_irq_number name;
/* Handler */
rtems_irq_hdl hdl;
/* function for enabling interrupts at device level. */
rtems_irq_enable on;
/* function for disabling interrupts at device level. */
rtems_irq_disable off;
/* Function to test if interrupt is enabled */
rtems_irq_is_enabled isOn;
/* priority level of interrupt */
rtems_irq_level irqLevel;
/* Trigger method (rising/falling edge or high/low level) */
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
/*
* function to initialize the interrupt for a specific BSP
*/
void BSP_rtems_irq_mngt_init();
/*
* function to connect a particular irq handler.
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* function to get the current RTEMS irq handler for ptr->name.
*/
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/*
* function to disconnect the RTEMS irq handler for ptr->name.
*/
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
extern void BSP_rtems_irq_mngt_init(void);
#endif /* __asm__ */

View File

@@ -1,147 +0,0 @@
/*
* S3C2400 clock specific using the System Timer
*
* This is hardware specific part of the clock driver. At the end of this
* file, the generic part of the driver is #included.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
* http://www.rtems.com/license/LICENSE.
*
*
* $Id$
*/
#include <rtems.h>
#include <irq.h>
#include <bsp.h>
#include <s3c2400.h>
/* this is defined in ../../../shared/clockdrv_shell.h */
rtems_isr Clock_isr(rtems_vector_number vector);
static void clock_isr_on(const rtems_irq_connect_data *unused);
static void clock_isr_off(const rtems_irq_connect_data *unused);
static int clock_isr_is_on(const rtems_irq_connect_data *irq);
/* Replace the first value with the clock's interrupt name. */
rtems_irq_connect_data clock_isr_data = {BSP_INT_TIMER4,
(rtems_irq_hdl)Clock_isr,
clock_isr_on,
clock_isr_off,
clock_isr_is_on,
3, /* unused for ARM cpus */
0 }; /* unused for ARM cpus */
/* If you follow the code, this is never used, so any value
* should work
*/
#define CLOCK_VECTOR 0
/**
* Return the nanoseconds since last tick
*/
uint32_t clock_driver_get_nanoseconds_since_last_tick(void)
{
return 0;
}
#define Clock_driver_nanoseconds_since_last_tick \
clock_driver_get_nanoseconds_since_last_tick
/**
* When we get the clock interrupt
* - clear the interrupt bit?
* - restart the timer?
*/
#define Clock_driver_support_at_tick() \
do { \
ClearPending(BIT_TIMER4); \
} while(0)
/**
* Installs the clock ISR. You shouldn't need to change this.
*/
#define Clock_driver_support_install_isr( _new, _old ) \
do { \
_old = NULL; \
BSP_install_rtems_irq_handler(&clock_isr_data); \
} while(0)
/**
* Initialize the hardware for the clock
* - Set the frequency
* - enable it
* - clear any pending interrupts
*
* Since you may want the clock always running, you can
* enable interrupts here. If you do so, the clock_isr_on(),
* clock_isr_off(), and clock_isr_is_on() functions can be
* NOPs.
*/
#define Clock_driver_support_initialize_hardware() \
do { \
uint32_t cr; \
uint32_t freq,m,p,s; \
/* set MUX for Timer4 to 1/16 */ \
cr=rTCFG1 & 0xFFF0FFFF; \
rTCFG1=(cr | (3<<16)); \
freq = get_PCLK(); \
/* set TIMER4 counter, input freq=PLCK/16/16Mhz*/ \
freq = (freq /16)/16; \
rTCNTB4 = ((freq / 1000) * rtems_configuration_get_microseconds_per_tick()) / 1000; \
/*unmask TIMER4 irq*/ \
rINTMSK&=~BIT_TIMER4; \
/* start TIMER4 with autoreload */ \
cr=rTCON & 0xFF8FFFFF; \
rTCON=(cr|(0x6<<20)); \
rTCON=(cr|(0x5<<20)); \
} while (0)
/**
* Do whatever you need to shut the clock down and remove the
* interrupt handler. Since this normally only gets called on
* RTEMS shutdown, you may not need to do anything other than
* remove the ISR.
*/
#define Clock_driver_support_shutdown_hardware() \
do { \
/* Disable timer */ \
BSP_remove_rtems_irq_handler(&clock_isr_data); \
} while (0)
/**
* Enables clock interrupt.
*
* If the interrupt is always on, this can be a NOP.
*/
static void clock_isr_on(const rtems_irq_connect_data *unused)
{
return;
}
/**
* Disables clock interrupts
*
* If the interrupt is always on, this can be a NOP.
*/
static void clock_isr_off(const rtems_irq_connect_data *unused)
{
return;
}
/**
* Tests to see if clock interrupt is enabled, and returns 1 if so.
* If interrupt is not enabled, returns 0.
*
* If the interrupt is always on, this always returns 1.
*/
static int clock_isr_is_on(const rtems_irq_connect_data *irq)
{
return 1;
}
/* Make sure to include this, and only at the end of the file */
#include "../../../../libbsp/shared/clockdrv_shell.h"

View File

@@ -1,57 +0,0 @@
#include <rtems.h>
#include <bsp.h>
#include <s3c2400.h>
/* ------------------------------------------------------------------------- */
/* NOTE: This describes the proper use of this file.
*
* BSP_OSC_FREQ should be defined as the input frequency of the PLL.
*
* get_FCLK(), get_HCLK(), get_PCLK() and get_UCLK() return the clock of
* the specified bus in HZ.
*/
/* ------------------------------------------------------------------------- */
/* return FCLK frequency */
uint32_t get_FCLK(void)
{
uint32_t r, m, p, s;
r = rMPLLCON;
m = ((r & 0xFF000) >> 12) + 8;
p = ((r & 0x003F0) >> 4) + 2;
s = r & 0x3;
return((BSP_OSC_FREQ * m) / (p << s));
}
/* return UCLK frequency */
uint32_t get_UCLK(void)
{
uint32_t r, m, p, s;
r = rUPLLCON;
m = ((r & 0xFF000) >> 12) + 8;
p = ((r & 0x003F0) >> 4) + 2;
s = r & 0x3;
return((BSP_OSC_FREQ * m) / (p << s));
}
/* return HCLK frequency */
uint32_t get_HCLK(void)
{
if (rCLKDIVN & 0x2)
return get_FCLK()/2;
else
return get_FCLK();
}
/* return PCLK frequency */
uint32_t get_PCLK(void)
{
if (rCLKDIVN & 0x1)
return get_HCLK()/2;
else
return get_HCLK();
}

View File

@@ -1,40 +0,0 @@
/* bsp_irq_asm.S
*
* This file contains the implementation of the IRQ handler
* for a specific BSP
*
* CopyRight (C) 2000 Canon Research France SA.
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#define __asm__
/*
* Function to obtain, execute an IT handler and acknowledge the IT
*/
.globl bsp_interrupt_dispatch
bsp_interrupt_dispatch :
ldr r0, =0x14400014 /* Read rINTOFFSET */
ldr r1, [r0]
ldr r0, =bsp_vector_table
ldr r0, [r0, r1, LSL #2] /* Read the address */
stmdb sp!,{lr}
ldr lr, =IRQ_return /* prepare the return from handler */
mov pc, r0
IRQ_return:
ldmia sp!,{lr}
mov pc, lr

View File

@@ -1,37 +0,0 @@
/* irq_init.c
*
* This file contains the implementation of rtems initialization
* related to interrupt handling.
*
* CopyRight (C) 2000 Canon Research Centre France SA.
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <irq.h>
#include <bsp.h>
#include <s3c2400.h>
extern void default_int_handler();
void BSP_rtems_irq_mngt_init()
{
long *vectorTable;
int i;
vectorTable = (long *) VECTOR_TABLE;
/* Initialize the vector table contents with default handler */
for (i=0; i<BSP_MAX_INT; i++) {
*(vectorTable + i) = (long)(default_int_handler);
}
/*
* Here is the code to initialize the INT for
* the specified BSP
*/
}

View File

@@ -1,110 +0,0 @@
/* irq.c
*
* This file contains the implementation of the function described in irq.h
*
* CopyRight (C) 2000 Canon Research France SA.
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <bsp.h>
#include <irq.h>
#include <rtems/score/thread.h>
#include <rtems/score/apiext.h>
#include <s3c2400.h>
/*
* This function check that the value given for the irq line
* is valid.
*/
static int isValidInterrupt(int irq)
{
if ( (irq < 0) || (irq > BSP_MAX_INT)) {
return 0;
}
return 1;
}
/*
* ------------------- RTEMS Single Irq Handler Mngt Routines ----------------
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
rtems_irq_hdl *HdlTable;
rtems_interrupt_level level;
if (!isValidInterrupt(irq->name)) {
return 0;
}
/*
* Check if default handler is actually connected. If not issue an error.
*/
HdlTable = (rtems_irq_hdl *)VECTOR_TABLE;
if (*(HdlTable + irq->name) != default_int_handler) {
return 0;
}
rtems_interrupt_disable(level);
/*
* store the new handler
*/
*(HdlTable + irq->name) = irq->hdl;
/*
* Enable interrupt on device
*/
if(irq->on)
{
irq->on(irq);
}
rtems_interrupt_enable(level);
return 1;
}
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
rtems_irq_hdl *HdlTable;
rtems_interrupt_level level;
if (!isValidInterrupt(irq->name)) {
return 0;
}
/*
* Check if the handler is actually connected. If not issue an error.
*/
HdlTable = (rtems_irq_hdl *)VECTOR_TABLE;
if (*(HdlTable + irq->name) != irq->hdl) {
return 0;
}
rtems_interrupt_disable(level);
/*
* Disable interrupt on device
*/
if(irq->off) {
irq->off(irq);
}
/*
* restore the default irq value
*/
*(HdlTable + irq->name) = default_int_handler;
rtems_interrupt_enable(level);
return 1;
}

View File

@@ -1,204 +0,0 @@
/* irq.h
*
* This include file describe the data structure and the functions implemented
* by rtems to write interrupt handlers.
*
* Copyright (c) 2000 Canon Research Centre France SA.
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#ifndef _IRQ_H_
#define _IRQ_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Include some preprocessor value also used by assember code
*/
#include <rtems.h>
#include <s3c2400.h>
extern void default_int_handler();
/*-------------------------------------------------------------------------+
| Constants
+--------------------------------------------------------------------------*/
/* possible interrupt sources */
#define BSP_EINT0 0
#define BSP_EINT1 1
#define BSP_EINT2 2
#define BSP_EINT3 3
#define BSP_EINT4 4
#define BSP_EINT5 5
#define BSP_EINT6 6
#define BSP_EINT7 7
#define BSP_INT_TICK 8
#define BSP_INT_WDT 9
#define BSP_INT_TIMER0 10
#define BSP_INT_TIMER1 11
#define BSP_INT_TIMER2 12
#define BSP_INT_TIMER3 13
#define BSP_INT_TIMER4 14
#define BSP_INT_UERR01 15
#define _res0 16
#define BSP_INT_DMA0 17
#define BSP_INT_DMA1 18
#define BSP_INT_DMA2 19
#define BSP_INT_DMA3 20
#define BSP_INT_MMC 21
#define BSP_INT_SPI 22
#define BSP_INT_URXD0 23
#define BSP_INT_URXD1 24
#define BSP_INT_USBD 25
#define BSP_INT_USBH 26
#define BSP_INT_IIC 27
#define BSP_INT_UTXD0 28
#define BSP_INT_UTXD1 29
#define BSP_INT_RTC 30
#define BSP_INT_ADC 31
#define BSP_MAX_INT 32
extern void *bsp_vector_table;
#define VECTOR_TABLE &bsp_vector_table
/*
* Type definition for RTEMS managed interrupts
*/
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef unsigned int rtems_irq_number;
typedef void (*rtems_irq_hdl) (void);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
typedef int (*rtems_irq_is_enabled) (const struct __rtems_irq_connect_data__*);
typedef struct __rtems_irq_connect_data__ {
/*
* IRQ line
*/
rtems_irq_number name;
/*
* handler. See comment on handler properties below in function prototype.
*/
rtems_irq_hdl hdl;
/*
* function for enabling interrupts at device level (ONLY!).
* The BSP code will automatically enable it at i8259s level.
* RATIONALE : anyway such code has to exist in current driver code.
* It is usually called immediately AFTER connecting the interrupt handler.
* RTEMS may well need such a function when restoring normal interrupt
* processing after a debug session.
*
*/
rtems_irq_enable on;
/*
* function for disabling interrupts at device level (ONLY!).
* The code will disable it at i8259s level. RATIONALE : anyway
* such code has to exist for clean shutdown. It is usually called
* BEFORE disconnecting the interrupt. RTEMS may well need such
* a function when disabling normal interrupt processing for
* a debug session. May well be a NOP function.
*/
rtems_irq_disable off;
/*
* function enabling to know what interrupt may currently occur
* if someone manipulates the i8259s interrupt mask without care...
*/
rtems_irq_is_enabled isOn;
/*
* priority level at the vplus level
*/
rtems_irq_level irqLevel;
/*
* Trigger way : Rising or falling edge or High or low level
*/
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
/*-------------------------------------------------------------------------+
| Function Prototypes.
+--------------------------------------------------------------------------*/
/*
* ------------------ RTEMS Single Irq Handler Mngt Routines ----------------
*/
/*
* function to initialize the interrupt for a specific BSP
*/
void BSP_rtems_irq_mngt_init();
/*
* function to connect a particular irq handler. This hanlder will NOT be called
* directly as the result of the corresponding interrupt. Instead, a RTEMS
* irq prologue will be called that will :
*
* 1) save the C scratch registers,
* 2) switch to a interrupt stack if the interrupt is not nested,
* 3) store the current i8259s' interrupt masks
* 4) modify them to disable the current interrupt at 8259 level (and may
* be others depending on software priorities)
* 5) aknowledge the i8259s',
* 6) demask the processor,
* 7) call the application handler
*
* As a result the hdl function provided
*
* a) can perfectly be written is C,
* b) may also well directly call the part of the RTEMS API that can be used
* from interrupt level,
* c) It only responsible for handling the jobs that need to be done at
* the device level including (aknowledging/re-enabling the interrupt at device,
* level, getting the data,...)
*
* When returning from the function, the following will be performed by
* the RTEMS irq epilogue :
*
* 1) masks the interrupts again,
* 2) restore the original i8259s' interrupt masks
* 3) switch back on the orinal stack if needed,
* 4) perform rescheduling when necessary,
* 5) restore the C scratch registers...
* 6) restore initial execution flow
*
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* function to get the current RTEMS irq handler for ptr->name. It enables to
* define hanlder chain...
*/
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/*
* function to get disconnect the RTEMS irq handler for ptr->name.
* This function checks that the value given is the current one for safety reason.
* The user can use the previous function to get it.
*/
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
#ifdef __cplusplus
}
#endif
#endif /* _IRQ_H_ */
/* end of include file */

View File

@@ -1,108 +0,0 @@
/*
* S3C2400 Timer driver
*
* This uses timer 1 for timing measurments.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
*
* http://www.rtems.com/license/LICENSE.
*
* Notes:
* This file manages the benchmark timer used by the RTEMS Timing Test
* Suite. Each measured time period is demarcated by calls to
* benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
* the number of microseconds since benchmark_timer_initialize() exitted.
*
* It is important that the timer start/stop overhead be determined
* when porting or modifying this code.
*
* $Id$
*/
#include <rtems.h>
#include <bsp.h>
#include <s3c2400.h>
uint32_t g_start;
uint32_t g_freq;
bool benchmark_timer_find_average_overhead;
/*
* Set up Timer 1
*/
void benchmark_timer_initialize( void )
{
uint32_t cr;
/* stop TIMER1*/
cr=rTCON & 0xFFFFF0FF;
rTCON=(cr | (0x0 << 8));
/* set MUX for Timer1 to 1/2 */
cr=rTCFG1 & 0xFFFFFF0F;
rTCFG1=(cr | (0<<4));
/* input freq=PLCK/2 Mhz*/
g_freq = get_PCLK() / 2000;
rTCNTB1 = 0xFFFF;
/* start TIMER1 with manual reload */
cr=rTCON & 0xFFFFF0FF;
rTCON=(cr | (0x1 << 9));
rTCON=(cr | (0x1 << 8));
g_start = rTCNTO1;
}
/*
* The following controls the behavior of benchmark_timer_read().
*
* AVG_OVEREHAD is the overhead for starting and stopping the timer. It
* is usually deducted from the number returned.
*
* LEAST_VALID is the lowest number this routine should trust. Numbers
* below this are "noise" and zero is returned.
*/
#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */
/* (Y countdowns) to start/stop the timer. */
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
int benchmark_timer_read( void )
{
uint32_t t;
unsigned long long total;
t = rTCNTO1;
/*
* Total is calculated by taking into account the number of timer overflow
* interrupts since the timer was initialized and clicks since the last
* interrupts.
*/
total = (g_start - t);
/* convert to microseconds */
total = (total*1000) / g_freq;
if ( benchmark_timer_find_average_overhead == 1 ) {
return (int) total;
} else if ( total < LEAST_VALID ) {
return 0;
}
/*
* Somehow convert total into microseconds
*/
return (total - AVG_OVERHEAD);
}
void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{
benchmark_timer_find_average_overhead = find_flag;
}

View File

@@ -1,202 +0,0 @@
/* irq.h
*
* This include file describe the data structure and the functions implemented
* by rtems to write interrupt handlers.
*
* Copyright (c) 2000 Canon Research Centre France SA.
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#ifndef _IRQ_H_
#define _IRQ_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Include some preprocessor value also used by assember code
*/
#include <rtems.h>
#include <s3c2410.h>
extern void default_int_handler();
/*-------------------------------------------------------------------------+
| Constants
+--------------------------------------------------------------------------*/
/* possible interrupt sources */
#define BSP_EINT0 0
#define BSP_EINT1 1
#define BSP_EINT2 2
#define BSP_EINT3 3
#define BSP_EINT4_7 4
#define BSP_EINT8_23 5
#define BSP_nBATT_FLT 7
#define BSP_INT_TICK 8
#define BSP_INT_WDT 9
#define BSP_INT_TIMER0 10
#define BSP_INT_TIMER1 11
#define BSP_INT_TIMER2 12
#define BSP_INT_TIMER3 13
#define BSP_INT_TIMER4 14
#define BSP_INT_UART2 15
#define BSP_INT_LCD 16
#define BSP_INT_DMA0 17
#define BSP_INT_DMA1 18
#define BSP_INT_DMA2 19
#define BSP_INT_DMA3 20
#define BSP_INT_SDI 21
#define BSP_INT_SPI0 22
#define BSP_INT_UART1 23
#define BSP_INT_USBD 25
#define BSP_INT_USBH 26
#define BSP_INT_IIC 27
#define BSP_INT_UART0 28
#define BSP_INT_SPI1 29
#define BSP_INT_RTC 30
#define BSP_INT_ADC 31
#define BSP_MAX_INT 32
extern void *bsp_vector_table;
#define VECTOR_TABLE &bsp_vector_table
/*
* Type definition for RTEMS managed interrupts
*/
typedef unsigned char rtems_irq_level;
typedef unsigned char rtems_irq_trigger;
struct __rtems_irq_connect_data__; /* forward declaratiuon */
typedef unsigned int rtems_irq_number;
typedef void (*rtems_irq_hdl) (void);
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
typedef int (*rtems_irq_is_enabled) (const struct __rtems_irq_connect_data__*);
typedef struct __rtems_irq_connect_data__ {
/*
* IRQ line
*/
rtems_irq_number name;
/*
* handler. See comment on handler properties below in function prototype.
*/
rtems_irq_hdl hdl;
/*
* function for enabling interrupts at device level (ONLY!).
* The BSP code will automatically enable it at i8259s level.
* RATIONALE : anyway such code has to exist in current driver code.
* It is usually called immediately AFTER connecting the interrupt handler.
* RTEMS may well need such a function when restoring normal interrupt
* processing after a debug session.
*
*/
rtems_irq_enable on;
/*
* function for disabling interrupts at device level (ONLY!).
* The code will disable it at i8259s level. RATIONALE : anyway
* such code has to exist for clean shutdown. It is usually called
* BEFORE disconnecting the interrupt. RTEMS may well need such
* a function when disabling normal interrupt processing for
* a debug session. May well be a NOP function.
*/
rtems_irq_disable off;
/*
* function enabling to know what interrupt may currently occur
* if someone manipulates the i8259s interrupt mask without care...
*/
rtems_irq_is_enabled isOn;
/*
* priority level at the vplus level
*/
rtems_irq_level irqLevel;
/*
* Trigger way : Rising or falling edge or High or low level
*/
rtems_irq_trigger irqTrigger;
} rtems_irq_connect_data;
/*-------------------------------------------------------------------------+
| Function Prototypes.
+--------------------------------------------------------------------------*/
/*
* ------------------ RTEMS Single Irq Handler Mngt Routines ----------------
*/
/*
* function to initialize the interrupt for a specific BSP
*/
void BSP_rtems_irq_mngt_init();
/*
* function to connect a particular irq handler. This hanlder will NOT be called
* directly as the result of the corresponding interrupt. Instead, a RTEMS
* irq prologue will be called that will :
*
* 1) save the C scratch registers,
* 2) switch to a interrupt stack if the interrupt is not nested,
* 3) store the current i8259s' interrupt masks
* 4) modify them to disable the current interrupt at 8259 level (and may
* be others depending on software priorities)
* 5) aknowledge the i8259s',
* 6) demask the processor,
* 7) call the application handler
*
* As a result the hdl function provided
*
* a) can perfectly be written is C,
* b) may also well directly call the part of the RTEMS API that can be used
* from interrupt level,
* c) It only responsible for handling the jobs that need to be done at
* the device level including (aknowledging/re-enabling the interrupt at device,
* level, getting the data,...)
*
* When returning from the function, the following will be performed by
* the RTEMS irq epilogue :
*
* 1) masks the interrupts again,
* 2) restore the original i8259s' interrupt masks
* 3) switch back on the orinal stack if needed,
* 4) perform rescheduling when necessary,
* 5) restore the C scratch registers...
* 6) restore initial execution flow
*
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*);
/*
* function to get the current RTEMS irq handler for ptr->name. It enables to
* define hanlder chain...
*/
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr);
/*
* function to get disconnect the RTEMS irq handler for ptr->name.
* This function checks that the value given is the current one for safety reason.
* The user can use the previous function to get it.
*/
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*);
#ifdef __cplusplus
}
#endif
#endif /* _IRQ_H_ */
/* end of include file */

View File

@@ -26,11 +26,11 @@ static int clock_isr_is_on(const rtems_irq_connect_data *irq);
/* Replace the first value with the clock's interrupt name. */
rtems_irq_connect_data clock_isr_data = {BSP_INT_TIMER4,
(rtems_irq_hdl)Clock_isr,
NULL,
clock_isr_on,
clock_isr_off,
clock_isr_is_on,
3, /* unused for ARM cpus */
0 }; /* unused for ARM cpus */
clock_isr_is_on
};
/* If you follow the code, this is never used, so any value
* should work

View File

@@ -8,6 +8,8 @@
#ifndef S3C2400_H_
#define S3C2400_H_
/* to be used in assembly code */
#define rINTOFFSET_ADDR 0x14400014
/* Memory control */
#define rBWSCON (*(volatile unsigned *)0x14000000)
#define rBANKCON0 (*(volatile unsigned *)0x14000004)
@@ -427,7 +429,7 @@
}
/* Wait until rINTPND is changed for the case that the ISR is very short. */
#ifndef __asm__
#ifndef ASM
/* Typedefs */
typedef union {
struct _reg {
@@ -654,7 +656,7 @@ typedef union {
} reg;
unsigned long all;
} IISSFIF;
#endif //__asm__
#endif //ASM
#define LCD_WIDTH 240
#define LCD_HEIGHT 320

View File

@@ -7,6 +7,9 @@
#ifndef S3C2410_H_
#define S3C2410_H_
/* to be used in assembly code */
#define rINTOFFSET_ADDR 0x4A000014
/* Memory control */
#define rBWSCON (*(volatile unsigned *)0x48000000)
#define rBANKCON0 (*(volatile unsigned *)0x48000004)
@@ -576,7 +579,7 @@
rINTPND;\
}
/* Wait until rINTPND is changed for the case that the ISR is very short. */
#ifndef __asm__
#ifndef ASM
/* Typedefs */
typedef union {
struct _reg {
@@ -802,7 +805,7 @@ typedef union {
} reg;
unsigned long all;
} IISSFIF;
#endif //__asm__
#endif //ASM
#define LCD_WIDTH 240
#define LCD_HEIGHT 320

View File

@@ -6,6 +6,8 @@
* CopyRight (C) 2000 Canon Research France SA.
* Emmanuel Raguet, mailto:raguet@crf.canon.fr
*
* merged to common file for s32400 and s32410 by Thomas Doerfler, embedded brains
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
@@ -13,7 +15,7 @@
* $Id$
*/
#define __asm__
#include <s3c24xx.h>
/*
* Function to obtain, execute an IT handler and acknowledge the IT
@@ -23,7 +25,7 @@
bsp_interrupt_dispatch :
ldr r0, =0x4A000014 /* Read rINTOFFSET */
ldr r0, =rINTOFFSET_ADDR /* Read rINTOFFSET */
ldr r1, [r0]
ldr r0, =bsp_vector_table

View File

@@ -16,8 +16,6 @@
#include <bsp.h>
#include <s3c24xx.h>
extern void default_int_handler(void);
void BSP_rtems_irq_mngt_init(void)
{
long *vectorTable;

View File

@@ -1,16 +1,117 @@
/* irq.h
*
* Note: This file will not be compiled, it just a place holder by now
* Common file, merged from s3c2400/irq/irq.h and s3c2410/irq/irq.h
*/
#ifndef _IRQ_H_
#define _IRQ_H_
#ifdef __cplusplus
extern "C" {
#endif
// This file is a place holder
// The real irq.h preinstalled is s3c2410/irq/irq.h and s3c2410/irq/irq.h
// change/refer to this files
// TODO: clean irq.h in ARM BSP. there is lots of duplicated codes in cpu_name/irq/irq.h with cpukit/include/rtems/irq.h
//
/*
* Include some preprocessor value also used by assember code
*/
#include <rtems/irq.h>
#include <rtems.h>
#include <s3c24xx.h>
extern void default_int_handler(rtems_irq_hdl_param unused);
/*-------------------------------------------------------------------------+
| Constants
+--------------------------------------------------------------------------*/
#ifdef CPU_S3C2400
/* possible interrupt sources */
#define BSP_EINT0 0
#define BSP_EINT1 1
#define BSP_EINT2 2
#define BSP_EINT3 3
#define BSP_EINT4 4
#define BSP_EINT5 5
#define BSP_EINT6 6
#define BSP_EINT7 7
#define BSP_INT_TICK 8
#define BSP_INT_WDT 9
#define BSP_INT_TIMER0 10
#define BSP_INT_TIMER1 11
#define BSP_INT_TIMER2 12
#define BSP_INT_TIMER3 13
#define BSP_INT_TIMER4 14
#define BSP_INT_UERR01 15
#define _res0 16
#define BSP_INT_DMA0 17
#define BSP_INT_DMA1 18
#define BSP_INT_DMA2 19
#define BSP_INT_DMA3 20
#define BSP_INT_MMC 21
#define BSP_INT_SPI 22
#define BSP_INT_URXD0 23
#define BSP_INT_URXD1 24
#define BSP_INT_USBD 25
#define BSP_INT_USBH 26
#define BSP_INT_IIC 27
#define BSP_INT_UTXD0 28
#define BSP_INT_UTXD1 29
#define BSP_INT_RTC 30
#define BSP_INT_ADC 31
#define BSP_MAX_INT 32
#elif defined CPU_S3C2410
/* possible interrupt sources */
#define BSP_EINT0 0
#define BSP_EINT1 1
#define BSP_EINT2 2
#define BSP_EINT3 3
#define BSP_EINT4_7 4
#define BSP_EINT8_23 5
#define BSP_nBATT_FLT 7
#define BSP_INT_TICK 8
#define BSP_INT_WDT 9
#define BSP_INT_TIMER0 10
#define BSP_INT_TIMER1 11
#define BSP_INT_TIMER2 12
#define BSP_INT_TIMER3 13
#define BSP_INT_TIMER4 14
#define BSP_INT_UART2 15
#define BSP_INT_LCD 16
#define BSP_INT_DMA0 17
#define BSP_INT_DMA1 18
#define BSP_INT_DMA2 19
#define BSP_INT_DMA3 20
#define BSP_INT_SDI 21
#define BSP_INT_SPI0 22
#define BSP_INT_UART1 23
#define BSP_INT_USBD 25
#define BSP_INT_USBH 26
#define BSP_INT_IIC 27
#define BSP_INT_UART0 28
#define BSP_INT_SPI1 29
#define BSP_INT_RTC 30
#define BSP_INT_ADC 31
#define BSP_MAX_INT 32
#endif
extern void *bsp_vector_table;
#define VECTOR_TABLE &bsp_vector_table
/*-------------------------------------------------------------------------+
| Function Prototypes.
+--------------------------------------------------------------------------*/
/*
* ------------------ RTEMS Single Irq Handler Mngt Routines ----------------
*/
/*
* function to initialize the interrupt for a specific BSP
*/
void BSP_rtems_irq_mngt_init();
#ifdef __cplusplus
}
#endif
#endif /* _IRQ_H_ */
/* end of include file */