mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 22:44:02 +08:00
2005-04-26 Joel Sherrill <joel@OARcorp.com>
* clock/clockdrv.c: Add include of rtems/bspIo.h. * include/tm27.h: Delete TX3904 code and leave stub. * network/network.c: Eliminate warnings. * startup/bspclean.c: Add include of rtems/bspIo.h. Reformat.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2005-04-26 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* clock/clockdrv.c: Add include of rtems/bspIo.h.
|
||||
* include/tm27.h: Delete TX3904 code and leave stub.
|
||||
* network/network.c: Eliminate warnings.
|
||||
* startup/bspclean.c: Add include of rtems/bspIo.h. Reformat.
|
||||
|
||||
2005-03-14 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* include/.cvsignore: Fixed typo.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <rtems.h>
|
||||
#include <bsp.h>
|
||||
#include <libcpu/au1x00.h>
|
||||
|
||||
#include <rtems/bspIo.h>
|
||||
|
||||
unsigned32 tick_interval;
|
||||
unsigned32 last_match;
|
||||
|
||||
@@ -21,43 +21,18 @@
|
||||
|
||||
#define MUST_WAIT_FOR_INTERRUPT 1
|
||||
|
||||
#if 0
|
||||
#define Install_tm27_vector( handler ) \
|
||||
(void) set_vector( handler, TX3904_IRQ_SOFTWARE_1, 1 ); \
|
||||
|
||||
#define Cause_tm27_intr() \
|
||||
asm volatile ( "syscall 0x01" : : );
|
||||
|
||||
#define CLOCK_VECTOR TX3904_IRQ_TMR0
|
||||
|
||||
#define Clear_tm27_intr() /* empty */
|
||||
|
||||
#define Lower_tm27_intr() /* empty */
|
||||
#else
|
||||
#define Install_tm27_vector( handler ) \
|
||||
(void) set_vector( handler, TX3904_IRQ_TMR0, 1 ); \
|
||||
#define Install_tm27_vector( handler )
|
||||
|
||||
#define Cause_tm27_intr() \
|
||||
do { \
|
||||
uint32_t _clicks = 20; \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR, 0xC0 ); \
|
||||
*((volatile uint32_t*) 0xFFFFC01C) = 0x00000700; \
|
||||
; \
|
||||
} while(0)
|
||||
|
||||
#define Clear_tm27_intr() \
|
||||
do { \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x0001 ); \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
|
||||
TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
|
||||
; \
|
||||
} while(0)
|
||||
|
||||
#define Lower_tm27_intr() \
|
||||
mips_enable_in_interrupt_mask( 0xff01 );
|
||||
|
||||
#endif
|
||||
#define Lower_tm27_intr()
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <rtems.h>
|
||||
#include <rtems/rtems_bsdnet.h>
|
||||
#include <bsp.h>
|
||||
#include <rtems/bspIo.h>
|
||||
#include <libcpu/au1x00.h>
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -131,7 +132,7 @@ typedef struct
|
||||
unsigned long tx_pkts;
|
||||
} au1x00_emac_softc_t;
|
||||
|
||||
static volatile au1x00_emac_softc_t softc[NUM_IFACES];
|
||||
static au1x00_emac_softc_t softc[NUM_IFACES];
|
||||
|
||||
|
||||
/* function prototypes */
|
||||
@@ -240,7 +241,7 @@ int rtems_au1x00_emac_attach (
|
||||
* zero out the control structure
|
||||
*/
|
||||
|
||||
memset(sc, 0, sizeof(*sc));
|
||||
memset((void *)sc, 0, sizeof(*sc));
|
||||
|
||||
sc->unitnumber = unitnumber;
|
||||
sc->int_ctrlr = AU1X00_IC0_ADDR;
|
||||
@@ -458,7 +459,7 @@ void au1x00_emac_init_hw(au1x00_emac_softc_t *sc)
|
||||
* boundary.
|
||||
*/
|
||||
if (mtod(m, unsigned32) & 0x1f) {
|
||||
unsigned32 *p = &mtod(m, unsigned32);
|
||||
unsigned32 *p = mtod(m, unsigned32 *);
|
||||
*p = (mtod(m, unsigned32) + 0x1f) & 0x1f;
|
||||
}
|
||||
sc->rx_dma[i].addr = (mtod(m, unsigned32) & ~0xe0000000);
|
||||
@@ -653,7 +654,8 @@ void au1x00_emac_rx_daemon (void *arg)
|
||||
* The receive buffer must be aligned with a cache line
|
||||
* boundary.
|
||||
*/
|
||||
{ unsigned32 *p = &mtod(m, unsigned32);
|
||||
{
|
||||
unsigned32 *p = mtod(m, unsigned32 *);
|
||||
*p = (mtod(m, unsigned32) + 0x1f) & ~0x1f;
|
||||
}
|
||||
|
||||
@@ -828,14 +830,12 @@ au1x00_emac_ioctl (struct ifnet *ifp, int command, caddr_t data)
|
||||
rtems_isr au1x00_emac_isr (rtems_vector_number v)
|
||||
{
|
||||
volatile au1x00_emac_softc_t *sc;
|
||||
int index;
|
||||
int tx_flag = 0;
|
||||
int rx_flag = 0;
|
||||
|
||||
if (v == AU1X00_IRQ_MAC0) {
|
||||
sc = &softc[0];
|
||||
} else {
|
||||
assert(v == AU1X00_IRQ_MAC0);
|
||||
sc = &softc[0];
|
||||
if (v != AU1X00_IRQ_MAC0) {
|
||||
assert(v == AU1X00_IRQ_MAC0);
|
||||
}
|
||||
|
||||
sc->interrupts++;
|
||||
|
||||
@@ -10,21 +10,22 @@
|
||||
*/
|
||||
#include <rtems.h>
|
||||
#include <libcpu/au1x00.h>
|
||||
#include <rtems/bspIo.h>
|
||||
|
||||
void bsp_cleanup( void )
|
||||
{
|
||||
void (*reset_func)(void);
|
||||
int console_inbyte_nonblocking(int);
|
||||
void (*reset_func)(void);
|
||||
|
||||
reset_func = (void *)0xbfc00000;
|
||||
reset_func = (void *)0xbfc00000;
|
||||
|
||||
mips_set_sr( 0x00200000 ); /* all interrupts off, boot exception vectors */
|
||||
mips_set_sr( 0x00200000 ); /* all interrupts off, boot exception vectors */
|
||||
|
||||
printk("\nEXECUTIVE SHUTDOWN! Any key to reboot...");
|
||||
while (console_inbyte_nonblocking(0) < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Try to restart bootloader */
|
||||
reset_func();
|
||||
printk("\nEXECUTIVE SHUTDOWN! Any key to reboot...");
|
||||
while (console_inbyte_nonblocking(0) < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Try to restart bootloader */
|
||||
reset_func();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user