forked from Imagelibrary/rtems
2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* console/debugputs.c, include/bsp.h, leon_smc91111/leon_smc91111.c, startup/spurious.c: Remove debug print methods that are redundant with prntk and replace their use with printk.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* console/debugputs.c, include/bsp.h, leon_smc91111/leon_smc91111.c,
|
||||||
|
startup/spurious.c: Remove debug print methods that are redundant
|
||||||
|
with prntk and replace their use with printk.
|
||||||
|
|
||||||
2007-05-03 Joel Sherrill <joel@OARcorp.com>
|
2007-05-03 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* startup/linkcmds: Handle .data.* sections
|
* startup/linkcmds: Handle .data.* sections
|
||||||
|
|||||||
@@ -75,35 +75,3 @@ int console_inbyte_nonblocking( int port )
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* DEBUG_puts
|
|
||||||
*
|
|
||||||
* This should be safe in the event of an error. It attempts to insure
|
|
||||||
* that no TX empty interrupts occur while it is doing polled IO. Then
|
|
||||||
* it restores the state of that external interrupt.
|
|
||||||
*
|
|
||||||
* Input parameters:
|
|
||||||
* string - pointer to debug output string
|
|
||||||
*
|
|
||||||
* Output parameters: NONE
|
|
||||||
*
|
|
||||||
* Return values: NONE
|
|
||||||
*/
|
|
||||||
|
|
||||||
void DEBUG_puts(
|
|
||||||
char *string
|
|
||||||
)
|
|
||||||
{
|
|
||||||
char *s;
|
|
||||||
uint32_t old_level;
|
|
||||||
|
|
||||||
LEON_Disable_interrupt( LEON_INTERRUPT_UART_1_RX_TX, old_level );
|
|
||||||
LEON_REG.UART_Control_1 = LEON_REG_UART_CTRL_TE;
|
|
||||||
for ( s = string ; *s ; s++ )
|
|
||||||
console_outbyte_polled( 0, *s );
|
|
||||||
|
|
||||||
console_outbyte_polled( 0, '\r' );
|
|
||||||
console_outbyte_polled( 0, '\n' );
|
|
||||||
LEON_Restore_interrupt( LEON_INTERRUPT_UART_1_RX_TX, old_level );
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -96,8 +96,6 @@ rtems_isr_entry set_vector( /* returns old vector */
|
|||||||
int type /* RTEMS or RAW intr */
|
int type /* RTEMS or RAW intr */
|
||||||
);
|
);
|
||||||
|
|
||||||
void DEBUG_puts( char *string );
|
|
||||||
|
|
||||||
void BSP_fatal_return( void );
|
void BSP_fatal_return( void );
|
||||||
|
|
||||||
void bsp_spurious_initialize( void );
|
void bsp_spurious_initialize( void );
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig *config)
|
|||||||
leon_scmv91111_configuration.ctl_rspeed = 100;
|
leon_scmv91111_configuration.ctl_rspeed = 100;
|
||||||
|
|
||||||
/* activate io area */
|
/* activate io area */
|
||||||
DEBUG_puts("Activating Leon2 io port\n");
|
printk("Activating Leon2 io port\n");
|
||||||
/*configure pio */
|
/*configure pio */
|
||||||
*((volatile unsigned int *)0x80000000) |= 0x10f80000;
|
*((volatile unsigned int *)0x80000000) |= 0x10f80000;
|
||||||
*((volatile unsigned int *)0x800000A8) |=
|
*((volatile unsigned int *)0x800000A8) |=
|
||||||
|
|||||||
@@ -16,21 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
|
#include <rtems/bspIo.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
static const char digits[16] = "0123456789abcdef";
|
|
||||||
|
|
||||||
/* Simple integer-to-string conversion */
|
|
||||||
|
|
||||||
void itos(uint32_t u, char *s)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i=0; i<8; i++) {
|
|
||||||
s[i] = digits[(u >> (28 - (i*4))) & 0x0f];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bsp_spurious_handler
|
* bsp_spurious_handler
|
||||||
@@ -43,16 +29,11 @@ rtems_isr bsp_spurious_handler(
|
|||||||
CPU_Interrupt_frame *isf
|
CPU_Interrupt_frame *isf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
char line[ 80 ];
|
|
||||||
uint32_t real_trap;
|
uint32_t real_trap;
|
||||||
|
|
||||||
real_trap = SPARC_REAL_TRAP_NUMBER(trap);
|
real_trap = SPARC_REAL_TRAP_NUMBER(trap);
|
||||||
|
|
||||||
strcpy(line, "Unexpected trap (0x ) at address 0x ");
|
printk( "Unexpected trap (0x%2d) at address 0x%08x\n", real_trap, isf->tpc);
|
||||||
line[ 19 ] = digits[ real_trap >> 4 ];
|
|
||||||
line[ 20 ] = digits[ real_trap & 0xf ];
|
|
||||||
itos(isf->tpc, &line[36]);
|
|
||||||
DEBUG_puts( line );
|
|
||||||
|
|
||||||
switch (real_trap) {
|
switch (real_trap) {
|
||||||
|
|
||||||
@@ -61,33 +42,32 @@ rtems_isr bsp_spurious_handler(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
case 0x00:
|
case 0x00:
|
||||||
DEBUG_puts( "reset" );
|
printk( "reset\n" );
|
||||||
break;
|
break;
|
||||||
case 0x01:
|
case 0x01:
|
||||||
DEBUG_puts( "instruction access exception" );
|
printk( "instruction access exception\n" );
|
||||||
break;
|
break;
|
||||||
case 0x02:
|
case 0x02:
|
||||||
DEBUG_puts( "illegal instruction" );
|
printk( "illegal instruction\n" );
|
||||||
break;
|
break;
|
||||||
case 0x03:
|
case 0x03:
|
||||||
DEBUG_puts( "privileged instruction" );
|
printk( "privileged instruction\n" );
|
||||||
break;
|
break;
|
||||||
case 0x04:
|
case 0x04:
|
||||||
DEBUG_puts( "fp disabled" );
|
printk( "fp disabled\n" );
|
||||||
break;
|
break;
|
||||||
case 0x07:
|
case 0x07:
|
||||||
DEBUG_puts( "memory address not aligned" );
|
printk( "memory address not aligned\n" );
|
||||||
break;
|
break;
|
||||||
case 0x08:
|
case 0x08:
|
||||||
DEBUG_puts( "fp exception" );
|
printk( "fp exception\n" );
|
||||||
break;
|
break;
|
||||||
case 0x09:
|
case 0x09:
|
||||||
strcpy(line, "data access exception at 0x " );
|
printk("data access exception at 0x%08x\n",
|
||||||
itos(LEON_REG.Failed_Address, &line[27]);
|
LEON_REG.First_Failing_Address );
|
||||||
DEBUG_puts( line );
|
|
||||||
break;
|
break;
|
||||||
case 0x0A:
|
case 0x0A:
|
||||||
DEBUG_puts( "tag overflow" );
|
printk( "tag overflow\n" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -95,31 +75,31 @@ rtems_isr bsp_spurious_handler(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR" );
|
printk( "LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_2_RX_TX ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_2_RX_TX ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_UART_2_RX_TX" );
|
printk( "LEON_INTERRUPT_UART_2_RX_TX\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_1_RX_TX ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_1_RX_TX ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_UART_1_RX_TX" );
|
printk( "LEON_INTERRUPT_UART_1_RX_TX\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_0 ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_0 ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_0" );
|
printk( "LEON_INTERRUPT_EXTERNAL_0\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_1 ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_1 ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_1" );
|
printk( "LEON_INTERRUPT_EXTERNAL_1\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_2 ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_2 ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_2" );
|
printk( "LEON_INTERRUPT_EXTERNAL_2\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_3 ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_3 ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_3" );
|
printk( "LEON_INTERRUPT_EXTERNAL_3\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER1 ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER1 ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_TIMER1" );
|
printk( "LEON_INTERRUPT_TIMER1\n" );
|
||||||
break;
|
break;
|
||||||
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER2 ):
|
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER2 ):
|
||||||
DEBUG_puts( "LEON_INTERRUPT_TIMER2" );
|
printk( "LEON_INTERRUPT_TIMER2\n" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user