forked from Imagelibrary/rtems
Remove stray white spaces.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| bsp.h - ARM BSP
|
||||
| bsp.h - ARM BSP
|
||||
+--------------------------------------------------------------------------+
|
||||
| This include file contains definitions related to the ARM BSP.
|
||||
+--------------------------------------------------------------------------+
|
||||
@@ -10,7 +10,7 @@
|
||||
| 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$
|
||||
+--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -28,7 +28,7 @@ extern "C" {
|
||||
#include <rtems/iosupp.h>
|
||||
#include <rtems/console.h>
|
||||
#include <rtems/clockdrv.h>
|
||||
|
||||
|
||||
/*
|
||||
* Define the interrupt mechanism for Time Test 27
|
||||
*
|
||||
@@ -38,11 +38,11 @@ extern "C" {
|
||||
|
||||
#define MUST_WAIT_FOR_INTERRUPT 0
|
||||
|
||||
#define Install_tm27_vector( handler )
|
||||
#define Install_tm27_vector( handler )
|
||||
|
||||
#define Cause_tm27_intr()
|
||||
#define Cause_tm27_intr()
|
||||
|
||||
#define Clear_tm27_intr()
|
||||
#define Clear_tm27_intr()
|
||||
|
||||
#define Lower_tm27_intr()
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
|
||||
|
||||
#ifndef __REGS_H__
|
||||
#define __REGS_H__
|
||||
#define __REGS_H__
|
||||
|
||||
/*
|
||||
* VARIABLE DECLARATION
|
||||
* VARIABLE DECLARATION
|
||||
*/
|
||||
|
||||
#ifndef __asm__
|
||||
|
||||
@@ -15,33 +15,33 @@
|
||||
|
||||
#define __asm__
|
||||
#include <registers.h>
|
||||
|
||||
/*
|
||||
* Function to obtain, execute an IT handler and acknowledge the IT
|
||||
|
||||
/*
|
||||
* Function to obtain, execute an IT handler and acknowledge the IT
|
||||
*/
|
||||
|
||||
.globl ExecuteITHandler
|
||||
|
||||
ExecuteITHandler :
|
||||
|
||||
ExecuteITHandler :
|
||||
|
||||
/*
|
||||
* Here is the code to execute the appropriate INT handler
|
||||
* Here is the code to execute the appropriate INT handler
|
||||
*/
|
||||
|
||||
|
||||
mov pc, r0
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Function to acknowledge the IT controller
|
||||
#if 0
|
||||
/*
|
||||
* Function to acknowledge the IT controller
|
||||
*/
|
||||
.globl AckControler
|
||||
|
||||
AckControler:
|
||||
|
||||
AckControler:
|
||||
|
||||
/*
|
||||
* Here is the code to acknowledge the PIC
|
||||
*/
|
||||
|
||||
|
||||
b ReturnFromAck /* return to ISR handler */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,5 +23,5 @@ void BSP_rtems_irq_mngt_init() {
|
||||
* Here is the code to initialize the INT for
|
||||
* the specified BSP
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ 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;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
if (*(HdlTable + irq->name) != default_int_handler) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
|
||||
/*
|
||||
@@ -74,7 +74,7 @@ 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;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
* restore the default irq value
|
||||
*/
|
||||
*(HdlTable + irq->name) = default_int_handler;
|
||||
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -22,7 +22,7 @@ extern "C" {
|
||||
/*
|
||||
* Include some preprocessor value also used by assember code
|
||||
*/
|
||||
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
extern void default_int_handler();
|
||||
@@ -39,9 +39,9 @@ typedef enum {
|
||||
} rtems_irq_symbolic_name;
|
||||
|
||||
/* define that can be useful (the values are just examples) */
|
||||
#define INTMASK 0x01
|
||||
#define INTMASK 0x01
|
||||
#define VECTOR_TABLE 0x00
|
||||
|
||||
|
||||
/*
|
||||
* Type definition for RTEMS managed interrupts
|
||||
*/
|
||||
@@ -71,9 +71,9 @@ typedef struct __rtems_irq_connect_data__ {
|
||||
* 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;
|
||||
rtems_irq_enable on;
|
||||
/*
|
||||
* function for disabling interrupts at device level (ONLY!).
|
||||
* The code will disable it at i8259s level. RATIONALE : anyway
|
||||
@@ -143,7 +143,7 @@ void BSP_rtems_irq_mngt_init();
|
||||
* 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*);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
.equ IRQ_Stack, 0x100
|
||||
.equ FIQ_Stack, 0x200
|
||||
.equ SVC_Stack, 0x300
|
||||
|
||||
|
||||
/* Some standard definitions...*/
|
||||
|
||||
.equ Mode_USR, 0x10
|
||||
@@ -33,20 +33,20 @@
|
||||
.text
|
||||
.globl _start
|
||||
|
||||
|
||||
|
||||
_start:
|
||||
|
||||
/*
|
||||
* Here is the code to initialize the low-level BSP environment
|
||||
* (Chip Select, PLL, ....?)
|
||||
|
||||
|
||||
|
||||
/* Copy data from FLASH to RAM */
|
||||
LDR r0, =_initdata /* load address of region */
|
||||
LDR r1, =0x400000 /* execution address of region */
|
||||
LDR r2, =_edata /* copy execution address into r2 */
|
||||
|
||||
copy:
|
||||
copy:
|
||||
CMP r1, r2 /* loop whilst r1 < r2 */
|
||||
LDRLO r3, [r0], #4
|
||||
STRLO r3, [r1], #4
|
||||
@@ -55,15 +55,15 @@ copy:
|
||||
/* zero the bss */
|
||||
LDR r1, =__bss_end__ /* get end of ZI region */
|
||||
LDR r0, =__bss_start__ /* load base address of ZI region */
|
||||
zi_init:
|
||||
zi_init:
|
||||
MOV r2, #0
|
||||
CMP r0, r1 /* loop whilst r0 < r1 */
|
||||
STRLOT r2, [r0], #4
|
||||
BLO zi_init
|
||||
BLO zi_init
|
||||
|
||||
|
||||
|
||||
/* Load basic ARM7 interrupt table */
|
||||
VectorInit:
|
||||
VectorInit:
|
||||
MOV R8, #0
|
||||
ADR R9, Vector_Init_Block
|
||||
LDMIA R9!, {R0-R7} /* Copy the Vectors (8 words) */
|
||||
@@ -75,10 +75,10 @@ VectorInit:
|
||||
|
||||
/*******************************************************
|
||||
standard exception vectors table
|
||||
*** Must be located at address 0
|
||||
********************************************************/
|
||||
*** Must be located at address 0
|
||||
********************************************************/
|
||||
|
||||
Vector_Init_Block:
|
||||
Vector_Init_Block:
|
||||
LDR PC, Reset_Addr
|
||||
LDR PC, Undefined_Addr
|
||||
LDR PC, SWI_Addr
|
||||
@@ -89,36 +89,36 @@ Vector_Init_Block:
|
||||
LDR PC, FIQ_Addr
|
||||
|
||||
.globl Reset_Addr
|
||||
Reset_Addr: .long _start
|
||||
Reset_Addr: .long _start
|
||||
Undefined_Addr: .long Undefined_Handler
|
||||
SWI_Addr: .long SWI_Handler
|
||||
Prefetch_Addr: .long Prefetch_Handler
|
||||
Abort_Addr: .long Abort_Handler
|
||||
.long 0
|
||||
.long 0
|
||||
IRQ_Addr: .long IRQ_Handler
|
||||
FIQ_Addr: .long FIQ_Handler
|
||||
|
||||
|
||||
/* The following handlers do not do anything useful */
|
||||
.globl Undefined_Handler
|
||||
Undefined_Handler:
|
||||
Undefined_Handler:
|
||||
B Undefined_Handler
|
||||
.globl SWI_Handler
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
.globl Prefetch_Handler
|
||||
Prefetch_Handler:
|
||||
Prefetch_Handler:
|
||||
B Prefetch_Handler
|
||||
.globl Abort_Handler
|
||||
Abort_Handler:
|
||||
Abort_Handler:
|
||||
B Abort_Handler
|
||||
.globl IRQ_Handler
|
||||
IRQ_Handler:
|
||||
IRQ_Handler:
|
||||
B IRQ_Handler
|
||||
.globl FIQ_Handler
|
||||
FIQ_Handler:
|
||||
FIQ_Handler:
|
||||
B FIQ_Handler
|
||||
|
||||
init2 :
|
||||
init2 :
|
||||
/* --- Initialise stack pointer registers
|
||||
Set up the ABORT stack pointer last and stay in SVC mode */
|
||||
MOV r0, #(Mode_ABORT | I_Bit | F_Bit) /* No interrupts */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| This file contains the ARM BSP startup package. It includes application,
|
||||
| board, and monitor specific initialization and configuration. The generic CPU
|
||||
| dependent initialization has been performed before this routine is invoked.
|
||||
| dependent initialization has been performed before this routine is invoked.
|
||||
+--------------------------------------------------------------------------+
|
||||
|
|
||||
| Copyright (c) 2000 Canon Research Centre France SA.
|
||||
@@ -30,11 +30,11 @@
|
||||
volatile unsigned long *Regs = (unsigned long*)0xdeadbeef; /* Chip registers */
|
||||
|
||||
extern uint32_t _end; /* End of BSS. Defined in 'linkcmds'. */
|
||||
/*
|
||||
* Size of heap if it is 0 it will be dynamically defined by memory size,
|
||||
* otherwise the value should be changed by binary patch
|
||||
/*
|
||||
* Size of heap if it is 0 it will be dynamically defined by memory size,
|
||||
* otherwise the value should be changed by binary patch
|
||||
*/
|
||||
uint32_t _heap_size = 0;
|
||||
uint32_t _heap_size = 0;
|
||||
|
||||
/* Size of stack used during initialization. Defined in 'start.s'. */
|
||||
extern uint32_t _stack_size;
|
||||
@@ -67,7 +67,7 @@ void bsp_postdriver_hook(void);
|
||||
| since drivers are not yet initialized.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
@@ -76,9 +76,9 @@ void bsp_pretasking_hook(void)
|
||||
{
|
||||
_heap_size = 0x420000 - rtemsFreeMemStart;
|
||||
}
|
||||
|
||||
|
||||
bsp_libc_init((void *)rtemsFreeMemStart, _heap_size, 0);
|
||||
|
||||
|
||||
rtemsFreeMemStart += _heap_size; /* HEAP_SIZE in KBytes */
|
||||
|
||||
|
||||
@@ -89,14 +89,14 @@ void bsp_pretasking_hook(void)
|
||||
#endif /* RTEMS_DEBUG */
|
||||
|
||||
} /* bsp_pretasking_hook */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: bsp_start
|
||||
| Description: Called before main is invoked.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void bsp_start_default( void )
|
||||
{
|
||||
@@ -116,7 +116,7 @@ void bsp_start_default( void )
|
||||
|
||||
/* Place RTEMS workspace at beginning of free memory. */
|
||||
BSP_Configuration.work_space_start = (void *)rtemsFreeMemStart;
|
||||
|
||||
|
||||
rtemsFreeMemStart += BSP_Configuration.work_space_size;
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| exit.c - ARM BSP
|
||||
| exit.c - ARM BSP
|
||||
+--------------------------------------------------------------------------+
|
||||
| Routines to shutdown and reboot the BSP.
|
||||
+--------------------------------------------------------------------------+
|
||||
|
||||
@@ -55,7 +55,7 @@ void console_outbyte_polled(
|
||||
}
|
||||
|
||||
/*
|
||||
* console_inbyte_nonblocking
|
||||
* console_inbyte_nonblocking
|
||||
*
|
||||
* This routine polls for a character.
|
||||
*/
|
||||
|
||||
@@ -68,7 +68,7 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
/*
|
||||
* NOTE: Use the standard Console driver entry
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Clock driver entry
|
||||
*/
|
||||
|
||||
@@ -59,11 +59,11 @@ _mainCRTStartup:
|
||||
mov a2, #0 /* Second arg: fill value */
|
||||
mov fp, a2 /* Null frame pointer */
|
||||
mov r7, a2 /* Null frame pointer for Thumb */
|
||||
|
||||
|
||||
ldr a1, .LC1 /* First arg: start of memory block */
|
||||
ldr a3, .LC2
|
||||
ldr a3, .LC2
|
||||
sub a3, a3, a1 /* Third arg: length of block */
|
||||
|
||||
|
||||
|
||||
#ifdef __thumb__ /* Enter Thumb mode.... */
|
||||
|
||||
@@ -73,9 +73,9 @@ _mainCRTStartup:
|
||||
.code 16
|
||||
.global __change_mode
|
||||
.thumb_func
|
||||
__change_mode:
|
||||
__change_mode:
|
||||
#endif
|
||||
|
||||
|
||||
bl FUNCTION (memset)
|
||||
#if !defined (ARM_RDP_MONITOR) && !defined (ARM_RDI_MONITOR)
|
||||
mov r0, #0 /* no arguments */
|
||||
@@ -83,9 +83,9 @@ __change_mode:
|
||||
#else
|
||||
/* Need to set up standard file handles */
|
||||
bl FUNCTION (initialize_monitor_handles)
|
||||
|
||||
|
||||
/* XXX for now let's just get the code up :) */
|
||||
#if 0
|
||||
#if 0
|
||||
#ifdef ARM_RDP_MONITOR
|
||||
swi SWI_GetEnv /* sets r0 to point to the command line */
|
||||
mov r1, r0
|
||||
@@ -171,7 +171,7 @@ __change_mode:
|
||||
str r4, [r3]
|
||||
add r3, #4
|
||||
b .LC15
|
||||
.LC14:
|
||||
.LC14:
|
||||
#else
|
||||
add r2, sp, r0, LSL #2 /* End of args */
|
||||
mov r3, sp /* Start of args */
|
||||
@@ -206,10 +206,10 @@ change_back:
|
||||
*/
|
||||
swi SWI_Exit
|
||||
#endif
|
||||
|
||||
/* For Thumb, constants must be after the code since only
|
||||
|
||||
/* For Thumb, constants must be after the code since only
|
||||
positive offsets are supported for PC relative addresses. */
|
||||
|
||||
|
||||
.align 0
|
||||
.LC0:
|
||||
#ifdef ARM_RDI_MONITOR
|
||||
@@ -241,9 +241,9 @@ StackLimit: .word 0
|
||||
CommandLine: .space 256,0 /* Maximum length of 255 chars handled */
|
||||
#endif
|
||||
.globl SWI_Handler
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
|
||||
#ifdef __pe__
|
||||
.section .idata$3
|
||||
.long 0,0,0,0,0,0,0,0
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include <bsp.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
|
||||
/*
|
||||
* The original table from the application and our copy of it with
|
||||
* some changes.
|
||||
@@ -36,7 +36,7 @@ char *rtems_progname;
|
||||
/*
|
||||
* Use the shared implementations of the following routines
|
||||
*/
|
||||
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, uint32_t, int );
|
||||
|
||||
@@ -53,7 +53,7 @@ void bsp_libc_init( void *, uint32_t, int );
|
||||
* not yet initialized.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int HeapBase;
|
||||
@@ -68,7 +68,7 @@ void bsp_pretasking_hook(void)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Support files for GNU libc. Files in the C namespace go here.
|
||||
Files in the system namespace (ie those that start with an underscore)
|
||||
go in syscalls.c.
|
||||
|
||||
|
||||
Note: These functions are in a seperate file so that OS providers can
|
||||
overrride the system call stubs (defined in syscalls.c) without having
|
||||
to provide libc funcitons as well. */
|
||||
|
||||
@@ -40,7 +40,7 @@ initialize_monitor_handles (void)
|
||||
{
|
||||
#ifdef ARM_RDI_MONITOR
|
||||
int volatile block[3];
|
||||
|
||||
|
||||
block[0] = (int) ":tt";
|
||||
block[2] = 3; /* length of filename */
|
||||
block[1] = 0; /* mode "r" */
|
||||
@@ -80,11 +80,11 @@ _swiread (int file,
|
||||
int fh = file;
|
||||
#ifdef ARM_RDI_MONITOR
|
||||
int block[3];
|
||||
|
||||
|
||||
block[0] = fh;
|
||||
block[1] = (int) ptr;
|
||||
block[2] = len;
|
||||
|
||||
|
||||
return do_AngelSWI (AngelSWI_Reason_Read, block);
|
||||
#else
|
||||
asm ("mov r0, %1; mov r1, %2;mov r2, %3; swi %a0"
|
||||
@@ -104,11 +104,11 @@ _swiwrite (
|
||||
int fh = file;
|
||||
#ifdef ARM_RDI_MONITOR
|
||||
int block[3];
|
||||
|
||||
|
||||
block[0] = fh;
|
||||
block[1] = (int) ptr;
|
||||
block[2] = len;
|
||||
|
||||
|
||||
return do_AngelSWI (AngelSWI_Reason_Write, block);
|
||||
#else
|
||||
asm ("mov r0, %1; mov r1, %2;mov r2, %3; swi %a0"
|
||||
@@ -119,14 +119,14 @@ _swiwrite (
|
||||
}
|
||||
|
||||
/*
|
||||
* Move me
|
||||
* Move me
|
||||
*/
|
||||
|
||||
void
|
||||
bsp_cleanup (void )
|
||||
{
|
||||
/* FIXME: return code is thrown away */
|
||||
|
||||
|
||||
#ifdef ARM_RDI_MONITOR
|
||||
do_AngelSWI (AngelSWI_Reason_ReportException,
|
||||
(void *) ADP_Stopped_ApplicationExit);
|
||||
|
||||
@@ -78,7 +78,7 @@ __rt_stkovf_split_big:
|
||||
@ dummy space on the stack and passing in a "phantom" arg1 into
|
||||
@ the function. This means that we do not need to worry about
|
||||
@ preserving the stack under "sp" even on function return.
|
||||
@
|
||||
@
|
||||
@ Code should never poke values beneath sp. The sp register
|
||||
@ should always be "dropped" first to cover the data. This
|
||||
@ protects the data against any events that may try and use
|
||||
|
||||
@@ -44,7 +44,7 @@ rtems_irq_connect_data clock_isr_data = {BSP_TC1OI,
|
||||
} while(0)
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Set up the clock hardware
|
||||
*/
|
||||
#define Clock_driver_support_initialize_hardware() \
|
||||
|
||||
@@ -34,8 +34,8 @@ static int uart_set_attributes(int minor, const struct termios *t);
|
||||
unsigned long Console_Port_Count = NUM_DEVS;
|
||||
console_data Console_Port_Data[NUM_DEVS];
|
||||
rtems_device_minor_number Console_Port_Minor = 0;
|
||||
console_fns uart_fns =
|
||||
{
|
||||
console_fns uart_fns =
|
||||
{
|
||||
libchip_serial_default_probe,
|
||||
uart_first_open,
|
||||
uart_last_close,
|
||||
@@ -69,7 +69,7 @@ console_tbl Console_Port_Tbl[] = {
|
||||
|
||||
static int uart_first_open(int major, int minor, void *arg) {return 0;}
|
||||
static int uart_last_close(int major, int minor, void *arg) {return 0;}
|
||||
static int uart_read(int minor)
|
||||
static int uart_read(int minor)
|
||||
{
|
||||
return uart_poll_read(minor);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ static void uart_write_polled(int minor, char c)
|
||||
uart_write(minor, &c, 1);
|
||||
}
|
||||
|
||||
static int uart_set_attributes(int minor, const struct termios *t)
|
||||
static int uart_set_attributes(int minor, const struct termios *t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ int uart_poll_read(int minor)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
err = *data_reg;
|
||||
c = err & 0xff;
|
||||
@@ -133,7 +133,7 @@ static int uart_write(int minor, const char *buf, int len)
|
||||
c = (char) buf[i];
|
||||
*data_reg = c;
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ static void uart_init(int minor)
|
||||
volatile uint32_t *data_reg;
|
||||
volatile uint32_t *ctrl_reg1;
|
||||
volatile uint32_t *ctrl_reg2;
|
||||
|
||||
|
||||
data_reg = (uint32_t*)Console_Port_Tbl[minor].ulDataPort;
|
||||
ctrl_reg1 = (uint32_t*)Console_Port_Tbl[minor].ulCtrlPort1;
|
||||
ctrl_reg2 = (uint32_t*)Console_Port_Tbl[minor].ulCtrlPort2;
|
||||
@@ -156,6 +156,6 @@ static void uart_init(int minor)
|
||||
*ctrl_reg1 = (EP7312_UART_WRDLEN8 |
|
||||
EP7312_UART_FIFOEN |
|
||||
0x17); /* 9600 baud */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ extern "C" {
|
||||
#include <rtems/iosupp.h>
|
||||
#include <rtems/console.h>
|
||||
#include <rtems/clockdrv.h>
|
||||
|
||||
|
||||
/*
|
||||
* Define the interrupt mechanism for Time Test 27
|
||||
*
|
||||
@@ -42,16 +42,16 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
#define MUST_WAIT_FOR_INTERRUPT 0
|
||||
|
||||
#define Install_tm27_vector( handler )
|
||||
#define Install_tm27_vector( handler )
|
||||
|
||||
#define Cause_tm27_intr()
|
||||
#define Cause_tm27_intr()
|
||||
|
||||
#define Clear_tm27_intr()
|
||||
#define Clear_tm27_intr()
|
||||
|
||||
#define Lower_tm27_intr()
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Network driver configuration
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 register declarations
|
||||
*
|
||||
* Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 Intererrupt handler
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
#define __asm__
|
||||
#include "irq.h"
|
||||
|
||||
|
||||
#define VECTOR_TABLE 0x40
|
||||
|
||||
/*
|
||||
* Function to obtain, execute an IT handler and acknowledge the IT
|
||||
|
||||
/*
|
||||
* Function to obtain, execute an IT handler and acknowledge the IT
|
||||
*/
|
||||
|
||||
.globl ExecuteITHandler
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 Intererrupt handler
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 Intererrupt handler
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -39,7 +39,7 @@ 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;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
if (*(HdlTable + irq->name) != default_int_handler) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
|
||||
/*
|
||||
@@ -81,7 +81,7 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
/* interrupt managed by INTMR3 and INTSR3 */
|
||||
*EP7312_INTMR3 |= (1 << (irq->name - 21));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Enable interrupt on device
|
||||
*/
|
||||
@@ -89,9 +89,9 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
{
|
||||
irq->on(irq);
|
||||
}
|
||||
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ 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;
|
||||
}
|
||||
@@ -135,18 +135,18 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
/* interrupt managed by INTMR3 and INTSR3 */
|
||||
*EP7312_INTMR3 &= ~(1 << (irq->name - 21));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Disable interrupt on device
|
||||
*/
|
||||
if(irq->off)
|
||||
irq->off(irq);
|
||||
|
||||
|
||||
/*
|
||||
* restore the default irq value
|
||||
*/
|
||||
*(HdlTable + irq->name) = default_int_handler;
|
||||
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 Intererrupt handler
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -29,7 +29,7 @@ extern "C" {
|
||||
/*
|
||||
* Include some preprocessor value also used by assember code
|
||||
*/
|
||||
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
extern void default_int_handler();
|
||||
@@ -68,7 +68,7 @@ typedef enum {
|
||||
} rtems_irq_symbolic_name;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Type definition for RTEMS managed interrupts
|
||||
*/
|
||||
@@ -98,9 +98,9 @@ typedef struct __rtems_irq_connect_data__ {
|
||||
* 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;
|
||||
rtems_irq_enable on;
|
||||
/*
|
||||
* function for disabling interrupts at device level (ONLY!).
|
||||
* The code will disable it at i8259s level. RATIONALE : anyway
|
||||
@@ -170,7 +170,7 @@ void BSP_rtems_irq_mngt_init();
|
||||
* 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*);
|
||||
|
||||
@@ -28,8 +28,8 @@ void cs8900_io_set_reg (int dev, unsigned short reg, unsigned short data)
|
||||
{
|
||||
/* works the same for all values of dev */
|
||||
/*
|
||||
printf("cs8900_io_set_reg: reg: %#6x, val %#6x\n",
|
||||
CS8900_BASE + reg,
|
||||
printf("cs8900_io_set_reg: reg: %#6x, val %#6x\n",
|
||||
CS8900_BASE + reg,
|
||||
data);
|
||||
*/
|
||||
*(unsigned short *)(CS8900_BASE + reg) = data;
|
||||
@@ -47,7 +47,7 @@ unsigned short cs8900_io_get_reg (int dev, unsigned short reg)
|
||||
return val;
|
||||
}
|
||||
|
||||
/* cs8900_mem_set_reg - sets one of the registers mapped through
|
||||
/* cs8900_mem_set_reg - sets one of the registers mapped through
|
||||
* PacketPage
|
||||
*/
|
||||
void cs8900_mem_set_reg (int dev, unsigned long reg, unsigned short data)
|
||||
@@ -57,7 +57,7 @@ void cs8900_mem_set_reg (int dev, unsigned long reg, unsigned short data)
|
||||
cs8900_io_set_reg(dev, CS8900_IO_PP_DATA_PORT0, data);
|
||||
}
|
||||
|
||||
/* cs8900_mem_get_reg - reads one of the registers mapped through
|
||||
/* cs8900_mem_get_reg - reads one of the registers mapped through
|
||||
* PacketPage
|
||||
*/
|
||||
unsigned short cs8900_mem_get_reg (int dev, unsigned long reg)
|
||||
@@ -96,7 +96,7 @@ unsigned short cs8900_get_data_block (int dev, unsigned char *data)
|
||||
len = cs8900_mem_get_reg(dev, CS8900_PP_RxLength);
|
||||
|
||||
for (i = 0; i < ((len + 1) / 2); i++) {
|
||||
((short *)data)[i] = cs8900_io_get_reg(dev,
|
||||
((short *)data)[i] = cs8900_io_get_reg(dev,
|
||||
CS8900_IO_RX_TX_DATA_PORT0);
|
||||
}
|
||||
return len;
|
||||
@@ -115,10 +115,10 @@ void cs8900_tx_load (int dev, struct mbuf *m)
|
||||
len += m->m_len;
|
||||
m = m->m_next;
|
||||
} while (m != 0);
|
||||
|
||||
|
||||
data = (unsigned short *) &g_enetbuf[0];
|
||||
for (i = 0; i < ((len + 1) / 2); i++) {
|
||||
cs8900_io_set_reg(dev,
|
||||
cs8900_io_set_reg(dev,
|
||||
CS8900_IO_RX_TX_DATA_PORT0,
|
||||
data[i]);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 Startup code
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -14,7 +14,7 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Some standard definitions...*/
|
||||
|
||||
.equ Mode_USR, 0x10
|
||||
@@ -33,7 +33,7 @@
|
||||
.text
|
||||
.globl _start
|
||||
|
||||
|
||||
|
||||
_start:
|
||||
/* store the sp */
|
||||
mov r12, sp
|
||||
@@ -41,19 +41,19 @@ _start:
|
||||
* Here is the code to initialize the low-level BSP environment
|
||||
* (Chip Select, PLL, ....?)
|
||||
*/
|
||||
|
||||
|
||||
/* zero the bss */
|
||||
LDR r1, =_bss_end_ /* get end of ZI region */
|
||||
LDR r0, =_bss_start_ /* load base address of ZI region */
|
||||
|
||||
zi_init:
|
||||
zi_init:
|
||||
MOV r2, #0
|
||||
CMP r0, r1 /* loop whilst r0 < r1 */
|
||||
STRLOT r2, [r0], #4
|
||||
BLO zi_init
|
||||
|
||||
BLO zi_init
|
||||
|
||||
/* Load basic ARM7 interrupt table */
|
||||
VectorInit:
|
||||
VectorInit:
|
||||
MOV R0, #0
|
||||
ADR R1, Vector_Init_Block
|
||||
LDMIA R1!, {R2, r3} /* Copy the Vectors (8 words) */
|
||||
@@ -78,10 +78,10 @@ VectorInit:
|
||||
|
||||
/*******************************************************
|
||||
standard exception vectors table
|
||||
*** Must be located at address 0
|
||||
********************************************************/
|
||||
*** Must be located at address 0
|
||||
********************************************************/
|
||||
|
||||
Vector_Init_Block:
|
||||
Vector_Init_Block:
|
||||
LDR PC, Reset_Addr
|
||||
LDR PC, Undefined_Addr
|
||||
LDR PC, SWI_Addr
|
||||
@@ -92,45 +92,45 @@ Vector_Init_Block:
|
||||
LDR PC, FIQ_Addr
|
||||
|
||||
.globl Reset_Addr
|
||||
Reset_Addr: .long _start
|
||||
Reset_Addr: .long _start
|
||||
Undefined_Addr: .long Undefined_Handler
|
||||
SWI_Addr: .long SWI_Handler
|
||||
Prefetch_Addr: .long Prefetch_Handler
|
||||
Abort_Addr: .long Abort_Handler
|
||||
.long 0
|
||||
.long 0
|
||||
IRQ_Addr: .long IRQ_Handler
|
||||
FIQ_Addr: .long FIQ_Handler
|
||||
|
||||
|
||||
/* The following handlers do not do anything useful */
|
||||
.globl Undefined_Handler
|
||||
Undefined_Handler:
|
||||
Undefined_Handler:
|
||||
B Undefined_Handler
|
||||
.globl SWI_Handler
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
.globl Prefetch_Handler
|
||||
Prefetch_Handler:
|
||||
Prefetch_Handler:
|
||||
B Prefetch_Handler
|
||||
.globl Abort_Handler
|
||||
Abort_Handler:
|
||||
Abort_Handler:
|
||||
B Abort_Handler
|
||||
.globl IRQ_Handler
|
||||
IRQ_Handler:
|
||||
IRQ_Handler:
|
||||
B IRQ_Handler
|
||||
.globl FIQ_Handler
|
||||
FIQ_Handler:
|
||||
FIQ_Handler:
|
||||
B FIQ_Handler
|
||||
|
||||
init2 :
|
||||
init2 :
|
||||
/* --- Initialise stack pointer registers */
|
||||
|
||||
|
||||
/* Enter IRQ mode and set up the IRQ stack pointer */
|
||||
MOV r0, #Mode_IRQ | I_Bit | F_Bit /* No interrupts */
|
||||
MSR cpsr, r0
|
||||
ldr r1, =_irq_stack_size
|
||||
LDR sp, =_irq_stack
|
||||
add sp, sp, r1
|
||||
sub sp, sp, #0x64
|
||||
sub sp, sp, #0x64
|
||||
|
||||
/* Enter FIQ mode and set up the FIQ stack pointer */
|
||||
MOV r0, #Mode_FIQ | I_Bit | F_Bit /* No interrupts */
|
||||
@@ -138,7 +138,7 @@ init2 :
|
||||
ldr r1, =_fiq_stack_size
|
||||
LDR sp, =_fiq_stack
|
||||
add sp, sp, r1
|
||||
sub sp, sp, #0x64
|
||||
sub sp, sp, #0x64
|
||||
|
||||
/* Enter ABT mode and set up the ABT stack pointer */
|
||||
MOV r0, #Mode_ABT | I_Bit | F_Bit /* No interrupts */
|
||||
@@ -146,15 +146,15 @@ init2 :
|
||||
ldr r1, =_abt_stack_size
|
||||
LDR sp, =_abt_stack
|
||||
add sp, sp, r1
|
||||
sub sp, sp, #0x64
|
||||
|
||||
sub sp, sp, #0x64
|
||||
|
||||
/* Set up the SVC stack pointer last and stay in SVC mode */
|
||||
MOV r0, #Mode_SVC | I_Bit | F_Bit /* No interrupts */
|
||||
MSR cpsr, r0
|
||||
ldr r1, =_svc_stack_size
|
||||
LDR sp, =_svc_stack
|
||||
add sp, sp, r1
|
||||
sub sp, sp, #0x64
|
||||
sub sp, sp, #0x64
|
||||
|
||||
/* save the original registers */
|
||||
stmdb sp!, {r4-r12, lr}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 Startup code
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
*
|
||||
@@ -79,12 +79,12 @@ void bsp_pretasking_hook(void)
|
||||
uint32_t heap_size;
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Set up the heap. It uses all free SDRAM except that reserved
|
||||
* for non-cached uses.
|
||||
*/
|
||||
heap_start = free_mem_start;
|
||||
|
||||
|
||||
/* heap_size = (free_mem_end - heap_start - MEM_NOCACHE_SIZE); */
|
||||
heap_size = 0x200000;
|
||||
|
||||
@@ -97,7 +97,7 @@ void bsp_pretasking_hook(void)
|
||||
#endif /* RTEMS_DEBUG */
|
||||
|
||||
} /* bsp_pretasking_hook */
|
||||
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
@@ -133,26 +133,26 @@ void bsp_start_default( void )
|
||||
Cpu_table.pretasking_hook = bsp_pretasking_hook;
|
||||
Cpu_table.postdriver_hook = bsp_postdriver_hook;
|
||||
Cpu_table.do_zero_of_workspace = TRUE;
|
||||
|
||||
|
||||
/* Place RTEMS workspace at beginning of free memory. */
|
||||
BSP_Configuration.work_space_start = (void *)&_bss_free_start;
|
||||
|
||||
free_mem_start = ((uint32_t)&_bss_free_start +
|
||||
|
||||
free_mem_start = ((uint32_t)&_bss_free_start +
|
||||
BSP_Configuration.work_space_size);
|
||||
|
||||
|
||||
free_mem_end = ((uint32_t)&_sdram_base + (uint32_t)&_sdram_size);
|
||||
|
||||
|
||||
/*
|
||||
* Init rtems exceptions management
|
||||
*/
|
||||
rtems_exception_init_mngt();
|
||||
|
||||
|
||||
/*
|
||||
* Init rtems interrupt management
|
||||
*/
|
||||
rtems_irq_mngt_init();
|
||||
|
||||
|
||||
rtems_irq_mngt_init();
|
||||
|
||||
|
||||
/*
|
||||
* The following information is very useful when debugging.
|
||||
*/
|
||||
@@ -168,7 +168,7 @@ void bsp_start_default( void )
|
||||
BSP_Configuration.number_of_device_drivers );
|
||||
printk( "Device_driver_table = 0x%x\n",
|
||||
BSP_Configuration.Device_driver_table );
|
||||
|
||||
|
||||
/* printk( "_stack_size = 0x%x\n", _stack_size );*/
|
||||
printk( "work_space_start = 0x%x\n", BSP_Configuration.work_space_start );
|
||||
printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 BSP Shutdown code
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Cirrus EP7312 Timer driver
|
||||
*
|
||||
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
|
||||
*
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
*
|
||||
@@ -14,7 +14,7 @@
|
||||
* Timer_initialize() and Read_timer(). Read_timer() usually returns
|
||||
* the number of microseconds since Timer_initialize() exitted.
|
||||
*
|
||||
* It is important that the timer start/stop overhead be determined
|
||||
* It is important that the timer start/stop overhead be determined
|
||||
* when porting or modifying this code.
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| console.c - ARM BSP
|
||||
| console.c - ARM BSP
|
||||
+--------------------------------------------------------------------------+
|
||||
| This file contains the ARM console I/O package.
|
||||
+--------------------------------------------------------------------------+
|
||||
| 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.
|
||||
@@ -65,9 +65,9 @@ static int isr_is_on(const rtems_irq_connect_data *);
|
||||
*/
|
||||
|
||||
/* for printk support */
|
||||
BSP_output_char_function_type BSP_output_char =
|
||||
BSP_output_char_function_type BSP_output_char =
|
||||
(BSP_output_char_function_type) BSP_output_char_via_serial;
|
||||
BSP_polling_getchar_function_type BSP_poll_char =
|
||||
BSP_polling_getchar_function_type BSP_poll_char =
|
||||
(BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ isr_on(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
isr_off(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
@@ -102,9 +102,9 @@ void __assert (const char *file, int line, const char *msg)
|
||||
{
|
||||
static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
|
||||
unsigned char ch;
|
||||
|
||||
|
||||
/*
|
||||
* Note we cannot call exit or printf from here,
|
||||
* Note we cannot call exit or printf from here,
|
||||
* assert can fail inside ISR too
|
||||
*/
|
||||
|
||||
@@ -121,7 +121,7 @@ void __assert (const char *file, int line, const char *msg)
|
||||
printk(exit_msg);
|
||||
ch = BSP_poll_char();
|
||||
printk("\n\n");
|
||||
rtemsReboot();
|
||||
rtemsReboot();
|
||||
|
||||
}
|
||||
|
||||
@@ -142,21 +142,21 @@ console_initialize(rtems_device_major_number major,
|
||||
* Set up TERMIOS
|
||||
*/
|
||||
rtems_termios_initialize ();
|
||||
|
||||
|
||||
/*
|
||||
* Do device-specific initialization
|
||||
*/
|
||||
|
||||
|
||||
/* 38400-8-N-1 */
|
||||
BSP_uart_init(BSPConsolePort, 38400, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Set interrupt handler */
|
||||
console_isr_data.name = BSP_UART;
|
||||
console_isr_data.hdl = BSP_uart_termios_isr_com1;
|
||||
console_isr_data.irqLevel = 3;
|
||||
console_isr_data.irqTrigger = 0;
|
||||
|
||||
|
||||
status = BSP_install_rtems_irq_handler(&console_isr_data);
|
||||
|
||||
if (!status){
|
||||
@@ -196,7 +196,7 @@ console_open(rtems_device_major_number major,
|
||||
void *arg)
|
||||
{
|
||||
rtems_status_code status;
|
||||
static rtems_termios_callbacks cb =
|
||||
static rtems_termios_callbacks cb =
|
||||
{
|
||||
NULL, /* firstOpen */
|
||||
console_last_close, /* lastClose */
|
||||
@@ -219,9 +219,9 @@ console_open(rtems_device_major_number major,
|
||||
/*
|
||||
* Pass data area info down to driver
|
||||
*/
|
||||
BSP_uart_termios_set(BSPConsolePort,
|
||||
BSP_uart_termios_set(BSPConsolePort,
|
||||
((rtems_libio_open_close_args_t *)arg)->iop->data1);
|
||||
|
||||
|
||||
/* Enable interrupts on channel */
|
||||
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
|
||||
|
||||
@@ -243,7 +243,7 @@ console_close(rtems_device_major_number major,
|
||||
return res;
|
||||
} /* console_close */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Console device driver READ entry point.
|
||||
+--------------------------------------------------------------------------+
|
||||
@@ -256,9 +256,9 @@ console_read(rtems_device_major_number major,
|
||||
{
|
||||
|
||||
return rtems_termios_read (arg);
|
||||
|
||||
|
||||
} /* console_read */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Console device driver WRITE entry point.
|
||||
@@ -272,20 +272,20 @@ console_write(rtems_device_major_number major,
|
||||
{
|
||||
|
||||
return rtems_termios_write (arg);
|
||||
|
||||
|
||||
} /* console_write */
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Handle ioctl request.
|
||||
*/
|
||||
rtems_device_driver
|
||||
rtems_device_driver
|
||||
console_control(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg
|
||||
)
|
||||
{
|
||||
{
|
||||
return rtems_termios_ioctl (arg);
|
||||
}
|
||||
|
||||
@@ -294,45 +294,45 @@ conSetAttr(int minor, const struct termios *t)
|
||||
{
|
||||
int baud;
|
||||
|
||||
switch (t->c_cflag & CBAUD)
|
||||
switch (t->c_cflag & CBAUD)
|
||||
{
|
||||
case B50:
|
||||
case B50:
|
||||
baud = 50;
|
||||
break;
|
||||
case B75:
|
||||
baud = 75;
|
||||
case B75:
|
||||
baud = 75;
|
||||
break;
|
||||
case B110:
|
||||
baud = 110;
|
||||
case B110:
|
||||
baud = 110;
|
||||
break;
|
||||
case B134:
|
||||
baud = 134;
|
||||
case B134:
|
||||
baud = 134;
|
||||
break;
|
||||
case B150:
|
||||
baud = 150;
|
||||
case B150:
|
||||
baud = 150;
|
||||
break;
|
||||
case B200:
|
||||
baud = 200;
|
||||
baud = 200;
|
||||
break;
|
||||
case B300:
|
||||
case B300:
|
||||
baud = 300;
|
||||
break;
|
||||
case B600:
|
||||
baud = 600;
|
||||
case B600:
|
||||
baud = 600;
|
||||
break;
|
||||
case B1200:
|
||||
case B1200:
|
||||
baud = 1200;
|
||||
break;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
break;
|
||||
case B2400:
|
||||
case B2400:
|
||||
baud = 2400;
|
||||
break;
|
||||
case B4800:
|
||||
case B4800:
|
||||
baud = 4800;
|
||||
break;
|
||||
case B9600:
|
||||
case B9600:
|
||||
baud = 9600;
|
||||
break;
|
||||
case B19200:
|
||||
@@ -341,7 +341,7 @@ conSetAttr(int minor, const struct termios *t)
|
||||
case B38400:
|
||||
baud = 38400;
|
||||
break;
|
||||
case B57600:
|
||||
case B57600:
|
||||
baud = 57600;
|
||||
break;
|
||||
case B115200:
|
||||
|
||||
@@ -33,10 +33,10 @@ struct uart_data
|
||||
|
||||
static struct uart_data uart_data[2];
|
||||
|
||||
/*
|
||||
/*
|
||||
* Macros to read/wirte register of uart, if configuration is
|
||||
* different just rewrite these macros
|
||||
*/
|
||||
*/
|
||||
|
||||
static inline unsigned char
|
||||
uread(int uart, unsigned int reg)
|
||||
@@ -44,11 +44,11 @@ uread(int uart, unsigned int reg)
|
||||
register unsigned char val;
|
||||
|
||||
val = Regs[reg];
|
||||
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static inline void
|
||||
uwrite(int uart, int reg, unsigned int val)
|
||||
{
|
||||
|
||||
@@ -81,13 +81,13 @@ uartError(int uart)
|
||||
inline void uartError(int uart)
|
||||
{
|
||||
unsigned char uartStatus;
|
||||
|
||||
|
||||
uartStatus = uread(uart, LSR);
|
||||
uartStatus = uread(uart, RBR);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* Uart initialization, it is hardcoded to 8 bit, no parity,
|
||||
* one stop bit, FIFO, things to be changed
|
||||
* are baud rate and nad hw flow control,
|
||||
@@ -97,10 +97,10 @@ void
|
||||
BSP_uart_init(int uart, int baud, int hwFlow)
|
||||
{
|
||||
unsigned char tmp;
|
||||
|
||||
|
||||
/* Sanity check */
|
||||
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
|
||||
|
||||
|
||||
switch(baud)
|
||||
{
|
||||
case 50:
|
||||
@@ -121,20 +121,20 @@ BSP_uart_init(int uart, int baud, int hwFlow)
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Enable UART block */
|
||||
uwrite(uart, CNT, UART_ENABLE | PAD_ENABLE);
|
||||
|
||||
/* Set DLAB bit to 1 */
|
||||
uwrite(uart, LCR, DLAB);
|
||||
|
||||
|
||||
/* Set baud rate */
|
||||
uwrite(uart, DLL, (BSPBaseBaud/baud) & 0xff);
|
||||
uwrite(uart, DLM, ((BSPBaseBaud/baud) >> 8) & 0xff);
|
||||
uwrite(uart, DLL, (BSPBaseBaud/baud) & 0xff);
|
||||
uwrite(uart, DLM, ((BSPBaseBaud/baud) >> 8) & 0xff);
|
||||
|
||||
/* 8-bit, no parity , 1 stop */
|
||||
uwrite(uart, LCR, CHR_8_BITS);
|
||||
|
||||
|
||||
/* Enable FIFO */
|
||||
uwrite(uart, FCR, FIFO_EN | XMIT_RESET | RCV_RESET | RECEIVE_FIFO_TRIGGER12);
|
||||
|
||||
@@ -151,7 +151,7 @@ BSP_uart_init(int uart, int baud, int hwFlow)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Set baud
|
||||
*/
|
||||
void
|
||||
@@ -161,10 +161,10 @@ BSP_uart_set_baud(int uart, int baud)
|
||||
|
||||
/* Sanity check */
|
||||
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* This function may be called whenever TERMIOS parameters
|
||||
* are changed, so we have to make sure that baud change is
|
||||
* are changed, so we have to make sure that baud change is
|
||||
* indeed required
|
||||
*/
|
||||
|
||||
@@ -178,14 +178,14 @@ BSP_uart_set_baud(int uart, int baud)
|
||||
BSP_uart_init(uart, baud, uart_data[uart].hwFlow);
|
||||
|
||||
uwrite(uart, IER, ier);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable/disable interrupts
|
||||
* Enable/disable interrupts
|
||||
*/
|
||||
void
|
||||
void
|
||||
BSP_uart_intr_ctrl(int uart, int cmd)
|
||||
{
|
||||
|
||||
@@ -218,7 +218,7 @@ BSP_uart_intr_ctrl(int uart, int cmd)
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -227,12 +227,12 @@ BSP_uart_intr_ctrl(int uart, int cmd)
|
||||
* Status function, -1 if error
|
||||
* detected, 0 if no received chars available,
|
||||
* 1 if received char available, 2 if break
|
||||
* is detected, it will eat break and error
|
||||
* chars. It ignores overruns - we cannot do
|
||||
* is detected, it will eat break and error
|
||||
* chars. It ignores overruns - we cannot do
|
||||
* anything about - it execpt count statistics
|
||||
* and we are not counting it.
|
||||
*/
|
||||
int
|
||||
int
|
||||
BSP_uart_polled_status(int uart)
|
||||
{
|
||||
unsigned char val;
|
||||
@@ -250,7 +250,7 @@ BSP_uart_polled_status(int uart)
|
||||
|
||||
if((val & (DR | OE | FE)) == 1)
|
||||
{
|
||||
/* No error, character present */
|
||||
/* No error, character present */
|
||||
return BSP_UART_STATUS_CHAR;
|
||||
}
|
||||
|
||||
@@ -260,12 +260,12 @@ BSP_uart_polled_status(int uart)
|
||||
return BSP_UART_STATUS_NOCHAR;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Framing or parity error
|
||||
* eat character
|
||||
*/
|
||||
uread(uart, RBR);
|
||||
|
||||
|
||||
return BSP_UART_STATUS_ERROR;
|
||||
}
|
||||
|
||||
@@ -273,24 +273,24 @@ BSP_uart_polled_status(int uart)
|
||||
/*
|
||||
* Polled mode write function
|
||||
*/
|
||||
void
|
||||
void
|
||||
BSP_uart_polled_write(int uart, int val)
|
||||
{
|
||||
unsigned char val1;
|
||||
|
||||
|
||||
/* Sanity check */
|
||||
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
|
||||
|
||||
|
||||
for(;;)
|
||||
{
|
||||
if((val1=uread(uart, LSR)) & THRE)
|
||||
if((val1=uread(uart, LSR)) & THRE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uwrite(uart, THR, val & 0xff);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -301,16 +301,16 @@ BSP_output_char_via_serial(int val)
|
||||
if (val == '\n') BSP_uart_polled_write(BSPConsolePort,'\r');
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Polled mode read function
|
||||
*/
|
||||
int
|
||||
int
|
||||
BSP_uart_polled_read(int uart)
|
||||
{
|
||||
unsigned char val;
|
||||
|
||||
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
|
||||
|
||||
|
||||
for(;;)
|
||||
{
|
||||
if(uread(uart, LSR) & DR)
|
||||
@@ -318,13 +318,13 @@ BSP_uart_polled_read(int uart)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val = uread(uart, RBR);
|
||||
|
||||
return (int)(val & 0xff);
|
||||
}
|
||||
|
||||
unsigned
|
||||
unsigned
|
||||
BSP_poll_char_via_serial()
|
||||
{
|
||||
return BSP_uart_polled_read(BSPConsolePort);
|
||||
@@ -346,19 +346,19 @@ static char termios_tx_hold_com2 = 0;
|
||||
static volatile char termios_tx_hold_valid_com2 = 0;
|
||||
|
||||
/*
|
||||
* Set channel parameters
|
||||
* Set channel parameters
|
||||
*/
|
||||
void
|
||||
BSP_uart_termios_set(int uart, void *ttyp)
|
||||
{
|
||||
assert(uart == BSP_UART_COM1 || uart == BSP_UART_COM2);
|
||||
|
||||
|
||||
if(uart == BSP_UART_COM1)
|
||||
{
|
||||
termios_stopped_com1 = 0;
|
||||
termios_tx_active_com1 = 0;
|
||||
termios_ttyp_com1 = ttyp;
|
||||
termios_tx_hold_com1 = 0;
|
||||
termios_tx_hold_com1 = 0;
|
||||
termios_tx_hold_valid_com1 = 0;
|
||||
}
|
||||
else
|
||||
@@ -366,7 +366,7 @@ BSP_uart_termios_set(int uart, void *ttyp)
|
||||
termios_stopped_com2 = 0;
|
||||
termios_tx_active_com2 = 0;
|
||||
termios_ttyp_com2 = ttyp;
|
||||
termios_tx_hold_com2 = 0;
|
||||
termios_tx_hold_com2 = 0;
|
||||
termios_tx_hold_valid_com2 = 0;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ BSP_uart_termios_write_com1(int minor, const char *buf, int len)
|
||||
}
|
||||
|
||||
/* If there TX buffer is busy - something is royally screwed up */
|
||||
assert((uread(BSP_UART_COM1, LSR) & THRE) != 0);
|
||||
assert((uread(BSP_UART_COM1, LSR) & THRE) != 0);
|
||||
|
||||
if(termios_stopped_com1)
|
||||
{
|
||||
@@ -401,7 +401,7 @@ BSP_uart_termios_write_com1(int minor, const char *buf, int len)
|
||||
if(!termios_tx_active_com1)
|
||||
{
|
||||
termios_tx_active_com1 = 1;
|
||||
uwrite(BSP_UART_COM1, IER,
|
||||
uwrite(BSP_UART_COM1, IER,
|
||||
(RECEIVE_ENABLE |
|
||||
TRANSMIT_ENABLE |
|
||||
RECEIVER_LINE_ST_ENABLE
|
||||
@@ -465,7 +465,7 @@ BSP_uart_termios_isr_com1(void)
|
||||
for(;;)
|
||||
{
|
||||
vect = uread(BSP_UART_COM1, IIR) & 0xf;
|
||||
|
||||
|
||||
switch(vect)
|
||||
{
|
||||
case NO_MORE_INTR :
|
||||
@@ -479,9 +479,9 @@ BSP_uart_termios_isr_com1(void)
|
||||
}
|
||||
return;
|
||||
case TRANSMITTER_HODING_REGISTER_EMPTY :
|
||||
/*
|
||||
* TX holding empty: we have to disable these interrupts
|
||||
* if there is nothing more to send.
|
||||
/*
|
||||
* TX holding empty: we have to disable these interrupts
|
||||
* if there is nothing more to send.
|
||||
*/
|
||||
|
||||
ret = rtems_termios_dequeue_characters(termios_ttyp_com1, 1);
|
||||
@@ -514,7 +514,7 @@ BSP_uart_termios_isr_com1(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BSP_uart_termios_isr_com2()
|
||||
{
|
||||
@@ -526,7 +526,7 @@ BSP_uart_termios_isr_com2()
|
||||
for(;;)
|
||||
{
|
||||
vect = uread(BSP_UART_COM2, IIR) & 0xf;
|
||||
|
||||
|
||||
switch(vect)
|
||||
{
|
||||
case NO_MORE_INTR :
|
||||
@@ -540,8 +540,8 @@ BSP_uart_termios_isr_com2()
|
||||
}
|
||||
return;
|
||||
case TRANSMITTER_HODING_REGISTER_EMPTY :
|
||||
/*
|
||||
* TX holding empty: we have to disable these interrupts
|
||||
/*
|
||||
* TX holding empty: we have to disable these interrupts
|
||||
* if there is nothing more to send.
|
||||
*/
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ extern int BSPConsolePort;
|
||||
extern int BSPBaseBaud;
|
||||
/*
|
||||
* Command values for BSP_uart_intr_ctrl(),
|
||||
* values are strange in order to catch errors
|
||||
* values are strange in order to catch errors
|
||||
* with assert
|
||||
*/
|
||||
#define BSP_UART_INTR_CTRL_DISABLE (0)
|
||||
@@ -71,20 +71,20 @@ extern int BSPBaseBaud;
|
||||
#define RBR RSRBR /* Rx Buffer Register (read) */
|
||||
#define THR RSTHR /* Tx Buffer Register (write) */
|
||||
#define IER RSIER /* Interrupt Enable Register */
|
||||
|
||||
|
||||
/* DLAB X */
|
||||
#define IIR RSIIR /* Interrupt Ident Register (read) */
|
||||
#define FCR RSFCR /* FIFO Control Register (write) */
|
||||
#define LCR RSLCR /* Line Control Register */
|
||||
#define LSR RSLSR /* Line Status Register */
|
||||
|
||||
|
||||
/* DLAB 1 */
|
||||
#define DLL RSDLL /* Divisor Latch, LSB */
|
||||
#define DLM RSDLH /* Divisor Latch, MSB */
|
||||
|
||||
|
||||
/* Uart control */
|
||||
#define CNT RSCNT /* General Control register */
|
||||
|
||||
|
||||
/*
|
||||
* define bit for CNT
|
||||
*/
|
||||
|
||||
@@ -25,16 +25,16 @@
|
||||
_ISR_Handler:
|
||||
stmdb sp!, {r0, r1, r2, r3, r12} /* save regs on INT stack */
|
||||
stmdb sp!, {lr} /* now safe to call C funcs */
|
||||
|
||||
|
||||
|
||||
/* one nest level deeper */
|
||||
ldr r0, =_ISR_Nest_level
|
||||
ldr r0, =_ISR_Nest_level
|
||||
ldr r1, [r0]
|
||||
add r1, r1,#1
|
||||
str r1, [r0]
|
||||
|
||||
|
||||
/* disable multitasking */
|
||||
ldr r0, =_Thread_Dispatch_disable_level
|
||||
ldr r0, =_Thread_Dispatch_disable_level
|
||||
ldr r1, [r0]
|
||||
add r1, r1,#1
|
||||
str r1, [r0]
|
||||
@@ -42,14 +42,14 @@ _ISR_Handler:
|
||||
/* BSP specific function to INT handler */
|
||||
/* FIXME: I'm not sure why I can't save just r12. I'm also */
|
||||
/* not sure which of r1-r3 are important. */
|
||||
bl ExecuteITHandler
|
||||
bl ExecuteITHandler
|
||||
|
||||
/* one less nest level */
|
||||
/* one less nest level */
|
||||
ldr r0, =_ISR_Nest_level
|
||||
ldr r1, [r0]
|
||||
sub r1, r1,#1
|
||||
str r1, [r0]
|
||||
|
||||
|
||||
/* unnest multitasking */
|
||||
ldr r0, =_Thread_Dispatch_disable_level
|
||||
ldr r1, [r0]
|
||||
@@ -59,7 +59,7 @@ _ISR_Handler:
|
||||
/* check to see if we interrupted nd INT (with FIQ?) */
|
||||
mrs r0, spsr
|
||||
and r0, r0, #0x1f
|
||||
cmp r0, #0x12 /* is it INT mode? */
|
||||
cmp r0, #0x12 /* is it INT mode? */
|
||||
beq exitit
|
||||
|
||||
/* If thread dispatching is disabled, exit */
|
||||
@@ -70,18 +70,18 @@ _ISR_Handler:
|
||||
ldr r0, =_Context_Switch_necessary
|
||||
ldr r1, [r0]
|
||||
cmp r1, #0
|
||||
|
||||
|
||||
/* since bframe is going to clear _ISR_Signals_to_thread_executing, */
|
||||
/* we need to load it here */
|
||||
ldr r0, =_ISR_Signals_to_thread_executing
|
||||
ldr r0, =_ISR_Signals_to_thread_executing
|
||||
ldr r1, [r0]
|
||||
bne bframe
|
||||
|
||||
|
||||
/* If a signals to be sent (_ISR_Signals_to_thread_executing != 0), */
|
||||
/* call scheduler */
|
||||
cmp r1, #0
|
||||
beq exitit
|
||||
|
||||
|
||||
/* _ISR_Signals_to_thread_executing = FALSE */
|
||||
mov r1, #0
|
||||
str r1, [r0]
|
||||
@@ -94,7 +94,7 @@ bframe:
|
||||
mrs r0, spsr
|
||||
ldmia sp!, {r1} /* get lr off stack */
|
||||
stmdb sp!, {r1}
|
||||
mrs r2, cpsr
|
||||
mrs r2, cpsr
|
||||
orr r3, r2, #0x1 /* change to SVC mode */
|
||||
msr cpsr_c, r3
|
||||
|
||||
@@ -111,10 +111,10 @@ bframe:
|
||||
ldmia sp!, {r1} /* out with the old */
|
||||
stmdb sp!, {lr} /* in with the new (lr) */
|
||||
|
||||
|
||||
|
||||
orr r0, r0, #0xc0
|
||||
msr spsr, r0
|
||||
|
||||
|
||||
exitit:
|
||||
ldmia sp!, {lr} /* restore regs from INT stack */
|
||||
ldmia sp!, {r0, r1, r2, r3, r12} /* restore regs from INT stack */
|
||||
@@ -122,7 +122,7 @@ exitit:
|
||||
|
||||
|
||||
|
||||
/* on entry to _ISR_Dispatch, we're in SVC mode */
|
||||
/* on entry to _ISR_Dispatch, we're in SVC mode */
|
||||
.globl _ISR_Dispatch
|
||||
_ISR_Dispatch:
|
||||
stmdb sp!, {r0-r3, r12,lr} /* save regs on SVC stack */
|
||||
@@ -130,15 +130,15 @@ _ISR_Dispatch:
|
||||
/* we don't save lr, since */
|
||||
/* it's just going to get */
|
||||
/* overwritten */
|
||||
_ISR_Dispatch_p_4:
|
||||
_ISR_Dispatch_p_4:
|
||||
bl _Thread_Dispatch
|
||||
ldmia sp!, {r0-r3, r12, lr}
|
||||
|
||||
stmdb sp!, {r0-r2}
|
||||
/* Now we have to screw with the stack */
|
||||
mov r0, sp /* copy the SVC stack pointer */
|
||||
|
||||
mrs r1, cpsr
|
||||
|
||||
mrs r1, cpsr
|
||||
bic r2, r1, #0x1 /* change to INT mode */
|
||||
orr r2, r2, #0xc0 /* disable interrupts */
|
||||
msr cpsr_c, r2
|
||||
@@ -147,7 +147,7 @@ _ISR_Dispatch_p_4:
|
||||
stmdb sp!, {r4, r5, r6} /* save temp vars on INT stack */
|
||||
ldmia r0!, {r4, r5, r6} /* Get r0-r3 from SVC stack */
|
||||
stmdb sp!, {r4, r5, r6} /* and save them on INT stack */
|
||||
|
||||
|
||||
ldmia r0!, {r4, r5} /* get saved values from SVC stack */
|
||||
/* r4=spsr, r5=lr */
|
||||
mov lr, r5 /* restore lr_int */
|
||||
|
||||
@@ -32,14 +32,14 @@ void rtems_irq_mngt_init()
|
||||
int i;
|
||||
long *vectorTable;
|
||||
rtems_interrupt_level level;
|
||||
|
||||
|
||||
vectorTable = (long *) VECTOR_TABLE;
|
||||
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
|
||||
/* First, connect the ISR_Handler for IRQ and FIQ interrupts */
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ISR_Handler, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_FIQ, _ISR_Handler, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ISR_Handler, NULL);
|
||||
_CPU_ISR_install_vector(ARM_EXCEPTION_FIQ, _ISR_Handler, NULL);
|
||||
|
||||
/* Initialize the vector table contents with default handler */
|
||||
for (i=0; i<BSP_MAX_INT; i++)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| bsp.h - ARM BSP
|
||||
| bsp.h - ARM BSP
|
||||
+--------------------------------------------------------------------------+
|
||||
| This include file contains definitions related to the ARM BSP.
|
||||
+--------------------------------------------------------------------------+
|
||||
@@ -10,7 +10,7 @@
|
||||
| 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$
|
||||
+--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -28,7 +28,7 @@ extern "C" {
|
||||
#include <rtems/iosupp.h>
|
||||
#include <rtems/console.h>
|
||||
#include <rtems/clockdrv.h>
|
||||
|
||||
|
||||
/*
|
||||
* Define the interrupt mechanism for Time Test 27
|
||||
*
|
||||
@@ -38,11 +38,11 @@ extern "C" {
|
||||
|
||||
#define MUST_WAIT_FOR_INTERRUPT 0
|
||||
|
||||
#define Install_tm27_vector( handler )
|
||||
#define Install_tm27_vector( handler )
|
||||
|
||||
#define Cause_tm27_intr()
|
||||
#define Cause_tm27_intr()
|
||||
|
||||
#define Clear_tm27_intr()
|
||||
#define Clear_tm27_intr()
|
||||
|
||||
#define Lower_tm27_intr()
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
|
||||
|
||||
#ifndef __LMREGS_H__
|
||||
#define __LMREGS_H__
|
||||
#define __LMREGS_H__
|
||||
|
||||
/*
|
||||
* VARIABLE DECLARATION
|
||||
* VARIABLE DECLARATION
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* register area size */
|
||||
#define LM_REG_AREA_SIZ (0x4000/4)
|
||||
#define LM_REG_AREA_SIZ (0x4000/4)
|
||||
|
||||
/*** Register mapping : defined by indexes in an array ***/
|
||||
/*** NOTE : only 1 register every 4 byte address location (+ some holes) */
|
||||
@@ -216,7 +216,7 @@ extern volatile unsigned long *Regs; /* Chip registers */
|
||||
#define RINGCNTL ((MISC_BASE+0x90)/4)
|
||||
#define RINGFREQ ((MISC_BASE+0x94)/4)
|
||||
#define RSCNTL ((MISC_BASE+0xA0)/4)
|
||||
/*#ifndef PRODUCT_VERSION*/
|
||||
/*#ifndef PRODUCT_VERSION*/
|
||||
#define RSRXD ((MISC_BASE+0xA4)/4)
|
||||
#define RSTXD ((MISC_BASE+0xA8)/4)
|
||||
/*#endif*/
|
||||
@@ -235,7 +235,7 @@ extern volatile unsigned long *Regs; /* Chip registers */
|
||||
#define CLKCNTL ((MISC_BASE+0xF4)/4)
|
||||
#define OSCCOR ((MISC_BASE+0xF8)/4)
|
||||
|
||||
/* PRODUCT_VERSION */
|
||||
/* PRODUCT_VERSION */
|
||||
/* Added 30/08/99 : New Control register for UART control */
|
||||
#define UART_BASE 0x3000
|
||||
#define RSRBR ((UART_BASE+0x00)/4)
|
||||
@@ -248,7 +248,7 @@ extern volatile unsigned long *Regs; /* Chip registers */
|
||||
#define RSDLL ((UART_BASE+0x00)/4)
|
||||
#define RSDLH ((UART_BASE+0x04)/4)
|
||||
#define RSCNT ((UART_BASE+0x20)/4)
|
||||
/*PRODUCT_VERSION*/
|
||||
/*PRODUCT_VERSION*/
|
||||
|
||||
|
||||
/** THUMB and INTERFACES BLOCK 0x3400 - 0x4FFF */
|
||||
@@ -830,12 +830,12 @@ extern volatile unsigned long *Regs; /* Chip registers */
|
||||
|
||||
|
||||
/* DCC register */
|
||||
/* bit ENABLE=0x80 already defined */
|
||||
/* bit ENABLE=0x80 already defined */
|
||||
#define DCC_ENABLE 0x80
|
||||
|
||||
|
||||
/* TIMERCNTL[0:1] register */
|
||||
/* bit ENABLE=0x80 already defined */
|
||||
/* bit ENABLE=0x80 already defined */
|
||||
#define TIMER_ENABLE 0x80
|
||||
#define RELOAD 0x0040
|
||||
#define MSK_FREQ 0x0003 /* mask on FREQ field */
|
||||
@@ -882,7 +882,7 @@ extern volatile unsigned long *Regs; /* Chip registers */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Memory Mapping definition
|
||||
* Memory Mapping definition
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -901,7 +901,7 @@ extern volatile unsigned long *Regs; /* Chip registers */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Slot Control bloc
|
||||
* Slot Control bloc
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -915,7 +915,7 @@ typedef volatile struct /* normal Slot Control Block */
|
||||
unsigned char CNTL0;
|
||||
unsigned char CNTL1;
|
||||
unsigned char CNTL2;
|
||||
unsigned char STAT0;
|
||||
unsigned char STAT0;
|
||||
unsigned char STAT1;
|
||||
unsigned char STAT2;
|
||||
unsigned char CRYPT;
|
||||
@@ -1051,7 +1051,7 @@ typedef LM_SCB *LM_SCB_P; /* pointer to Slot Control Block */
|
||||
#define ZFIELD 0x01
|
||||
|
||||
/* AMSG parameter */
|
||||
#define PP_FP 0x80
|
||||
#define PP_FP 0x80
|
||||
#define CT 0x40
|
||||
#define NT 0x20 /* NT/CTSEND mapped on same bit */
|
||||
#define CTSEND 0x20
|
||||
@@ -1071,8 +1071,8 @@ typedef LM_SCB *LM_SCB_P; /* pointer to Slot Control Block */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Some macros to mask the VEGA+ interrupt sources
|
||||
/*
|
||||
* Some macros to mask the VEGA+ interrupt sources
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
|
||||
#define __asm__
|
||||
#include <registers.h>
|
||||
|
||||
/*
|
||||
* Function to obtain, execute an IT handler and acknowledge the IT
|
||||
|
||||
/*
|
||||
* Function to obtain, execute an IT handler and acknowledge the IT
|
||||
*/
|
||||
|
||||
.globl ExecuteITHandler
|
||||
|
||||
ExecuteITHandler :
|
||||
|
||||
ExecuteITHandler :
|
||||
ldr r0, =INTPHAI3 /* read the vector number */
|
||||
ldr r0, [r0]
|
||||
ldr r0, [r0]
|
||||
ldr r0, [r0] /* extract the IT handler @ */
|
||||
|
||||
/*
|
||||
@@ -52,14 +52,14 @@ IRQ_return:
|
||||
msr cpsr, r0
|
||||
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
* Function to acknowledge the IT controller
|
||||
|
||||
/*
|
||||
* Function to acknowledge the IT controller
|
||||
*/
|
||||
.globl AckControler
|
||||
|
||||
#if 0
|
||||
AckControler:
|
||||
#if 0
|
||||
AckControler:
|
||||
ldr r0, =INTEOI3
|
||||
mov r1, #EOI
|
||||
str r1, [r0]
|
||||
|
||||
@@ -21,7 +21,7 @@ void BSP_rtems_irq_mngt_init() {
|
||||
|
||||
/* Initialize the vector table address in internal RAM */
|
||||
Regs[INTTAB] = VECTOR_TABLE;
|
||||
|
||||
|
||||
/* Initialize the GLOBAL INT CONTROL register */
|
||||
Regs[INTGCNTL] = 0x00;
|
||||
|
||||
@@ -33,7 +33,7 @@ void BSP_rtems_irq_mngt_init() {
|
||||
|
||||
/* Ack pending interrupt */
|
||||
while ( ( Regs[INTSTAT] & 0xF433 ) != 0 ) {
|
||||
Regs[INTACK] = 0xFFFF;
|
||||
Regs[INTACK] = 0xFFFF;
|
||||
Regs[INTEOI] = EOI;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ 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;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
if (*(HdlTable + irq->name) != default_int_handler) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
|
||||
/*
|
||||
@@ -60,7 +60,7 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
*(HdlTable + irq->name) = irq->hdl;
|
||||
|
||||
/*
|
||||
* initialize the control register for the concerned interrupt
|
||||
* initialize the control register for the concerned interrupt
|
||||
*/
|
||||
Regs[(INTCNTL0 + irq->name)] = (long)(irq->irqTrigger) | (long)(irq->irqLevel) ;
|
||||
|
||||
@@ -68,17 +68,17 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
* ack pending interrupt
|
||||
*/
|
||||
Regs[INTACK] |= (long)(1 << irq->name);
|
||||
|
||||
|
||||
/*
|
||||
* unmask at INT controler level level
|
||||
*/
|
||||
Regs[INTMASK] &= ~(long)(1 << irq->name);
|
||||
|
||||
|
||||
/*
|
||||
* Enable interrupt on device
|
||||
*/
|
||||
irq->on(irq);
|
||||
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
|
||||
return 1;
|
||||
@@ -88,7 +88,7 @@ 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;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
* restore the default irq value
|
||||
*/
|
||||
*(HdlTable + irq->name) = default_int_handler;
|
||||
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -22,7 +22,7 @@ extern "C" {
|
||||
/*
|
||||
* Include some preprocessor value also used by assember code
|
||||
*/
|
||||
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
extern void default_int_handler();
|
||||
@@ -62,11 +62,11 @@ typedef enum {
|
||||
|
||||
#define MASKIRQ 0x80
|
||||
#define MASKFIQ 0x40
|
||||
|
||||
|
||||
#define END_OF_INT 0x80
|
||||
|
||||
#define VECTOR_TABLE 0x40
|
||||
|
||||
|
||||
/*
|
||||
* Type definition for RTEMS managed interrupts
|
||||
*/
|
||||
@@ -96,9 +96,9 @@ typedef struct __rtems_irq_connect_data__ {
|
||||
* 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;
|
||||
rtems_irq_enable on;
|
||||
/*
|
||||
* function for disabling interrupts at device level (ONLY!).
|
||||
* The code will disable it at i8259s level. RATIONALE : anyway
|
||||
@@ -168,7 +168,7 @@ void BSP_rtems_irq_mngt_init();
|
||||
* 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*);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Register definition */
|
||||
|
||||
.equ CNTL_BASE_ADR, 0xF3000 /* Base address of registers */
|
||||
@@ -22,7 +22,7 @@
|
||||
.equ CSCNTL1_2, 0x0C28 /* Offset of CS0CNTL */
|
||||
.equ CNTL_CLK_ADR, 0xF2000 /* Base address of registers */
|
||||
.equ CLKCNTL, 0x08F4 /* Offset of CS0CNTL */
|
||||
.equ INTHPAI, 0x0800
|
||||
.equ INTHPAI, 0x0800
|
||||
.equ INTEOI, 0x0808
|
||||
.equ EOI, 0x80
|
||||
|
||||
@@ -47,37 +47,37 @@
|
||||
|
||||
|
||||
.equ MARK_STACK, 0 /*Fill every stack with a pattern for debug (0 or 1)*/
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Definitions
|
||||
----------------------------------------------------------------------------*/
|
||||
.equ PID_RAM_Limit, 0x1800
|
||||
|
||||
/* stack size definition */
|
||||
.equ FIQ_StackSize, 0x400 /* FIQ stack size */
|
||||
.equ IRQ_StackSize, 0xE00 /* IRQ stack size */
|
||||
.equ SVC_StackSize, 0x200 /* SVC stack size */
|
||||
.equ ABORT_StackSize, 0x100 /* ABORT stack size */
|
||||
.equ UNDEF_StackSize, 0x100 /* UNDEF stack size */
|
||||
.equ FIQ_StackSize, 0x400 /* FIQ stack size */
|
||||
.equ IRQ_StackSize, 0xE00 /* IRQ stack size */
|
||||
.equ SVC_StackSize, 0x200 /* SVC stack size */
|
||||
.equ ABORT_StackSize, 0x100 /* ABORT stack size */
|
||||
.equ UNDEF_StackSize, 0x100 /* UNDEF stack size */
|
||||
|
||||
/* sack size address */
|
||||
.equ Stack_Limit, PID_RAM_Limit
|
||||
.equ Stack_Limit, PID_RAM_Limit
|
||||
.equ SVC_Stack, Stack_Limit
|
||||
.equ ABORT_Stack, Stack_Limit - SVC_StackSize
|
||||
.equ UNDEF_Stack, ABORT_Stack - ABORT_StackSize
|
||||
.equ IRQ_Stack, UNDEF_Stack - UNDEF_StackSize
|
||||
.equ FIQ_Stack, IRQ_Stack - IRQ_StackSize
|
||||
.equ ABORT_Stack, Stack_Limit - SVC_StackSize
|
||||
.equ UNDEF_Stack, ABORT_Stack - ABORT_StackSize
|
||||
.equ IRQ_Stack, UNDEF_Stack - UNDEF_StackSize
|
||||
.equ FIQ_Stack, IRQ_Stack - IRQ_StackSize
|
||||
.equ END_FIQ, FIQ_Stack - FIQ_StackSize
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
|
||||
/*
|
||||
/*
|
||||
* This "strange" code is used to switch the memory access
|
||||
* from 8 bits to 16 bits, because the vega plus accesses
|
||||
* from 8 bits to 16 bits, because the vega plus accesses
|
||||
* the memory via 8 bits at reset time
|
||||
*/
|
||||
|
||||
|
||||
_start:
|
||||
.long 0x00300010 /*LDR r3,0x18*/
|
||||
.long 0x00E5009F
|
||||
@@ -106,7 +106,7 @@ _start:
|
||||
.code 32
|
||||
|
||||
/* --- Initialise external bus*/
|
||||
Real_start:
|
||||
Real_start:
|
||||
MOV r0,#CNTL_BASE_ADR
|
||||
|
||||
/*Load timing configuration of CS0*/
|
||||
@@ -116,7 +116,7 @@ Real_start:
|
||||
STR r1, [r0,#CSCNTL1_0]
|
||||
|
||||
/* Load timing configuration and access mode of CS1
|
||||
NOTE : Important for macro REGION_INIT of Region_init.s
|
||||
NOTE : Important for macro REGION_INIT of Region_init.s
|
||||
if initialisation of data in external RAM */
|
||||
LDR r1, =0x2200
|
||||
STR r1, [r0,#CSCNTL0_1]
|
||||
@@ -128,7 +128,7 @@ Real_start:
|
||||
STR r1, [r0,#CSCNTL0_2]
|
||||
LDR r1, =0xA2
|
||||
STR r1, [r0,#CSCNTL1_2]
|
||||
|
||||
|
||||
|
||||
MOV r0,#CNTL_CLK_ADR
|
||||
/* Load clock mode 55 MHz */
|
||||
@@ -140,7 +140,7 @@ Real_start:
|
||||
LDR r1, =0x400000 /* execution address of region */
|
||||
LDR r2, =_edata /* copy execution address into r2 */
|
||||
|
||||
copy:
|
||||
copy:
|
||||
CMP r1, r2 /* loop whilst r1 < r2 */
|
||||
LDRLO r3, [r0], #4
|
||||
STRLO r3, [r1], #4
|
||||
@@ -149,15 +149,15 @@ copy:
|
||||
/* zero the bss */
|
||||
LDR r1, =__bss_end__ /* get end of ZI region */
|
||||
LDR r0, =__bss_start__ /* load base address of ZI region */
|
||||
zi_init:
|
||||
zi_init:
|
||||
MOV r2, #0
|
||||
CMP r0, r1 /* loop whilst r0 < r1 */
|
||||
STRLOT r2, [r0], #4
|
||||
BLO zi_init
|
||||
BLO zi_init
|
||||
|
||||
|
||||
|
||||
/* Load basic ARM7 interrupt table */
|
||||
VectorInit:
|
||||
VectorInit:
|
||||
MOV R8, #0
|
||||
ADR R9, Vector_Init_Block
|
||||
LDMIA R9!, {R0-R7} /* Copy the Vectors (8 words) */
|
||||
@@ -169,10 +169,10 @@ VectorInit:
|
||||
|
||||
/*******************************************************
|
||||
standard exception vectors table
|
||||
*** Must be located at address 0
|
||||
********************************************************/
|
||||
*** Must be located at address 0
|
||||
********************************************************/
|
||||
|
||||
Vector_Init_Block:
|
||||
Vector_Init_Block:
|
||||
LDR PC, Reset_Addr
|
||||
LDR PC, Undefined_Addr
|
||||
LDR PC, SWI_Addr
|
||||
@@ -183,36 +183,36 @@ Vector_Init_Block:
|
||||
LDR PC, FIQ_Addr
|
||||
|
||||
.globl Reset_Addr
|
||||
Reset_Addr: .long _start
|
||||
Reset_Addr: .long _start
|
||||
Undefined_Addr: .long Undefined_Handler
|
||||
SWI_Addr: .long SWI_Handler
|
||||
Prefetch_Addr: .long Prefetch_Handler
|
||||
Abort_Addr: .long Abort_Handler
|
||||
.long 0
|
||||
.long 0
|
||||
IRQ_Addr: .long IRQ_Handler
|
||||
FIQ_Addr: .long FIQ_Handler
|
||||
|
||||
|
||||
/* The following handlers do not do anything useful */
|
||||
.globl Undefined_Handler
|
||||
Undefined_Handler:
|
||||
Undefined_Handler:
|
||||
B Undefined_Handler
|
||||
.globl SWI_Handler
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
SWI_Handler:
|
||||
B SWI_Handler
|
||||
.globl Prefetch_Handler
|
||||
Prefetch_Handler:
|
||||
Prefetch_Handler:
|
||||
B Prefetch_Handler
|
||||
.globl Abort_Handler
|
||||
Abort_Handler:
|
||||
Abort_Handler:
|
||||
B Abort_Handler
|
||||
.globl IRQ_Handler
|
||||
IRQ_Handler:
|
||||
IRQ_Handler:
|
||||
B IRQ_Handler
|
||||
.globl FIQ_Handler
|
||||
FIQ_Handler:
|
||||
FIQ_Handler:
|
||||
B FIQ_Handler
|
||||
|
||||
init2 :
|
||||
init2 :
|
||||
/* --- Initialise stack pointer registers
|
||||
Set up the ABORT stack pointer last and stay in SVC mode */
|
||||
MOV r0, #(Mode_ABORT | I_Bit | F_Bit) /* No interrupts */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| This file contains the ARM BSP startup package. It includes application,
|
||||
| board, and monitor specific initialization and configuration. The generic CPU
|
||||
| dependent initialization has been performed before this routine is invoked.
|
||||
| dependent initialization has been performed before this routine is invoked.
|
||||
+--------------------------------------------------------------------------+
|
||||
|
|
||||
| Copyright (c) 2000 Canon Research Centre France SA.
|
||||
@@ -26,11 +26,11 @@
|
||||
volatile unsigned long *Regs = (unsigned long*)0xF0000; /* Chip registers */
|
||||
|
||||
extern uint32_t _end; /* End of BSS. Defined in 'linkcmds'. */
|
||||
/*
|
||||
* Size of heap if it is 0 it will be dynamically defined by memory size,
|
||||
* otherwise the value should be changed by binary patch
|
||||
/*
|
||||
* Size of heap if it is 0 it will be dynamically defined by memory size,
|
||||
* otherwise the value should be changed by binary patch
|
||||
*/
|
||||
uint32_t _heap_size = 0;
|
||||
uint32_t _heap_size = 0;
|
||||
|
||||
/* Size of stack used during initialization. Defined in 'start.s'. */
|
||||
extern uint32_t _stack_size;
|
||||
@@ -63,7 +63,7 @@ void bsp_postdriver_hook(void);
|
||||
| since drivers are not yet initialized.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
@@ -72,9 +72,9 @@ void bsp_pretasking_hook(void)
|
||||
{
|
||||
_heap_size = 0x420000 - rtemsFreeMemStart;
|
||||
}
|
||||
|
||||
|
||||
bsp_libc_init((void *)rtemsFreeMemStart, _heap_size, 0);
|
||||
|
||||
|
||||
rtemsFreeMemStart += _heap_size; /* HEAP_SIZE in KBytes */
|
||||
|
||||
|
||||
@@ -85,14 +85,14 @@ void bsp_pretasking_hook(void)
|
||||
#endif /* RTEMS_DEBUG */
|
||||
|
||||
} /* bsp_pretasking_hook */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: bsp_start
|
||||
| Description: Called before main is invoked.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void bsp_start_default( void )
|
||||
{
|
||||
@@ -112,7 +112,7 @@ void bsp_start_default( void )
|
||||
|
||||
/* Place RTEMS workspace at beginning of free memory. */
|
||||
BSP_Configuration.work_space_start = (void *)rtemsFreeMemStart;
|
||||
|
||||
|
||||
rtemsFreeMemStart += BSP_Configuration.work_space_size;
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| exit.c - ARM BSP
|
||||
| exit.c - ARM BSP
|
||||
+--------------------------------------------------------------------------+
|
||||
| Routines to shutdown and reboot the BSP.
|
||||
+--------------------------------------------------------------------------+
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __BARE_BSP_h
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
|
||||
#define MUST_WAIT_FOR_INTERRUPT 0
|
||||
|
||||
#define Install_tm27_vector( handler )
|
||||
#define Install_tm27_vector( handler )
|
||||
|
||||
#define Cause_tm27_intr()
|
||||
|
||||
@@ -81,7 +81,7 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
/*
|
||||
* NOTE: Use the standard Console driver entry
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Clock driver entry
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
##
|
||||
|
||||
## Explicitly set CPPASCOMPILE
|
||||
# to be able to use it for compilation of *.S even if automake
|
||||
# doesn't generate this variable. (automake-1.8.2+ only generates
|
||||
# to be able to use it for compilation of *.S even if automake
|
||||
# doesn't generate this variable. (automake-1.8.2+ only generates
|
||||
# this rule if *_SOURCES contain *.S.)
|
||||
CPPASCOMPILE = $(CCAS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
|
||||
|
||||
@@ -5,4 +5,3 @@ $(ARCH)/%$(LIB_VARIANT).$(OBJEXT): %.c $(ARCH)/$(dirstamp)
|
||||
${COMPILE} -o $@ -c $<
|
||||
$(ARCH)/%$(LIB_VARIANT).$(OBJEXT): %.S $(ARCH)/$(dirstamp)
|
||||
${CCASCOMPILE} -DASM -o $@ -c $<
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ volatile uint32_t Clock_driver_ticks;
|
||||
/*
|
||||
* These are set by clock driver during its init
|
||||
*/
|
||||
|
||||
|
||||
rtems_device_major_number rtems_clock_major = ~0;
|
||||
rtems_device_minor_number rtems_clock_minor;
|
||||
|
||||
@@ -68,7 +68,7 @@ rtems_isr Clock_isr(
|
||||
)
|
||||
{
|
||||
/*
|
||||
* The counter register gets reset automatically as well as the
|
||||
* The counter register gets reset automatically as well as the
|
||||
* interrupt occurred flag so we should not have to do anything
|
||||
* with the hardware.
|
||||
*/
|
||||
@@ -127,7 +127,7 @@ void Install_clock(
|
||||
|
||||
Clock_counter_register_value = (unsigned int) tmp;
|
||||
#if 0
|
||||
Clock_counter_register_value =
|
||||
Clock_counter_register_value =
|
||||
(uint32_t) ((float) BSP_Configuration.microseconds_per_tick /
|
||||
((float)_ClockFrequency / 2.0)));
|
||||
#endif
|
||||
@@ -185,14 +185,14 @@ rtems_device_driver Clock_initialize(
|
||||
)
|
||||
{
|
||||
Install_clock( Clock_isr );
|
||||
|
||||
|
||||
/*
|
||||
* make major/minor avail to others such as shared memory driver
|
||||
*/
|
||||
|
||||
|
||||
rtems_clock_major = major;
|
||||
rtems_clock_minor = minor;
|
||||
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -204,15 +204,15 @@ rtems_device_driver Clock_control(
|
||||
{
|
||||
uint32_t isrlevel;
|
||||
rtems_libio_ioctl_args_t *args = pargp;
|
||||
|
||||
|
||||
if (args == 0)
|
||||
goto done;
|
||||
|
||||
|
||||
/*
|
||||
* This is hokey, but until we get a defined interface
|
||||
* to do this, it will just be this simple...
|
||||
*/
|
||||
|
||||
|
||||
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
|
||||
{
|
||||
Clock_isr(CLOCK_VECTOR);
|
||||
@@ -223,7 +223,7 @@ rtems_device_driver Clock_control(
|
||||
(void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
|
||||
rtems_interrupt_enable( isrlevel );
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void console_outbyte_polled(
|
||||
);
|
||||
|
||||
/*
|
||||
* console_inbyte_nonblocking
|
||||
* console_inbyte_nonblocking
|
||||
*
|
||||
* This routine polls for a character.
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ int console_write_support (
|
||||
* Console Device Driver Entry Points
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
rtems_device_driver console_initialize(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
@@ -111,12 +111,12 @@ rtems_device_driver console_open(
|
||||
assert( minor <= 1 );
|
||||
if ( minor > 2 )
|
||||
return RTEMS_INVALID_NUMBER;
|
||||
|
||||
|
||||
sc = rtems_termios_open (major, minor, arg, &pollCallbacks );
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
rtems_device_driver console_close(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
@@ -125,7 +125,7 @@ rtems_device_driver console_close(
|
||||
{
|
||||
return rtems_termios_close (arg);
|
||||
}
|
||||
|
||||
|
||||
rtems_device_driver console_read(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
@@ -134,7 +134,7 @@ rtems_device_driver console_read(
|
||||
{
|
||||
return rtems_termios_read (arg);
|
||||
}
|
||||
|
||||
|
||||
rtems_device_driver console_write(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
@@ -143,7 +143,7 @@ rtems_device_driver console_write(
|
||||
{
|
||||
return rtems_termios_write (arg);
|
||||
}
|
||||
|
||||
|
||||
rtems_device_driver console_control(
|
||||
rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
|
||||
@@ -43,7 +43,7 @@ C4X_BSP_output_char( int c )
|
||||
}
|
||||
|
||||
/*
|
||||
* console_inbyte_nonblocking
|
||||
* console_inbyte_nonblocking
|
||||
*
|
||||
* This routine polls for a character.
|
||||
*/
|
||||
|
||||
@@ -74,15 +74,15 @@ extern "C" {
|
||||
/*
|
||||
* Device Driver Table Entries
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Console driver entry
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Clock driver entry
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Information placed in the linkcmds file.
|
||||
|
||||
@@ -22,7 +22,7 @@ _start:
|
||||
ldi 0800h,st
|
||||
ldp @mem_control
|
||||
ldi @mem_control,ar0
|
||||
ldp @mem_data
|
||||
ldp @mem_data
|
||||
ldi @mem_data,r0
|
||||
sti r0,*+ar0(0)
|
||||
sti r0,*+ar0(4)
|
||||
@@ -42,7 +42,7 @@ _start:
|
||||
ldi 0800h,st
|
||||
ldp @mem_control
|
||||
ldi @mem_control,ar0
|
||||
ldp @mem_data
|
||||
ldp @mem_data
|
||||
ldi @mem_data,r0
|
||||
sti r0,*+ar0(0)
|
||||
sti r0,*+ar0(4)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* The original table from the application and our copy of it with
|
||||
* some changes.
|
||||
*/
|
||||
|
||||
|
||||
extern rtems_configuration_table Configuration;
|
||||
rtems_configuration_table BSP_Configuration;
|
||||
|
||||
@@ -33,7 +33,7 @@ rtems_cpu_table Cpu_table;
|
||||
/*
|
||||
* Use the shared implementations of the following routines
|
||||
*/
|
||||
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, uint32_t, int );
|
||||
extern void bsp_spurious_initialize();
|
||||
@@ -102,7 +102,7 @@ void bsp_start( void )
|
||||
|
||||
if ( BSP_Configuration.work_space_size > (int) &_WorkspaceMax )
|
||||
rtems_fatal_error_occurred( 0x43218765 );
|
||||
|
||||
|
||||
BSP_output_char = C4X_BSP_output_char;
|
||||
BSP_poll_char = (BSP_polling_getchar_function_type) NULL;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* CXX Simulator Spurious Trap Handler Assistant
|
||||
*
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* the likely source of the trap was.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
|
||||
@@ -35,7 +35,7 @@ void Timer_initialize( void )
|
||||
* implemenations of timer but ....
|
||||
*/
|
||||
|
||||
|
||||
|
||||
c4x_timer_stop(C4X_TIMER_0);
|
||||
c4x_timer_set_period(C4X_TIMER_0, 0xffffffff); /* so no interupts */
|
||||
c4x_timer_start(C4X_TIMER_0);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* CXX Spurious Trap Handler Install Routine
|
||||
*
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* the likely source of the trap was.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
@@ -20,7 +20,7 @@
|
||||
/*
|
||||
* bsp_spurious_initialize
|
||||
*
|
||||
* Install the spurious handler for most vectors.
|
||||
* Install the spurious handler for most vectors.
|
||||
*/
|
||||
|
||||
rtems_isr bsp_spurious_handler(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* C3X Spurious Trap Handler
|
||||
*
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* the likely source of the trap was.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* C4X Spurious Trap Handler
|
||||
*
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* This is just enough of a trap handler to let us know what
|
||||
* the likely source of the trap was.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
|
||||
@@ -40,12 +40,12 @@ void console_outbyte_polled(
|
||||
char ch
|
||||
)
|
||||
{
|
||||
asm volatile( "mov.b #0,r1l ; mov.b %0l,r2l ; jsr @@0xc4"
|
||||
: : "r" (ch) : "r1", "r2");
|
||||
asm volatile( "mov.b #0,r1l ; mov.b %0l,r2l ; jsr @@0xc4"
|
||||
: : "r" (ch) : "r1", "r2");
|
||||
}
|
||||
|
||||
/*
|
||||
* console_inbyte_nonblocking
|
||||
* console_inbyte_nonblocking
|
||||
*
|
||||
* This routine polls for a character.
|
||||
*/
|
||||
|
||||
@@ -85,7 +85,7 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
/*
|
||||
* NOTE: Use the standard Console driver entry
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Clock driver entry
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ _start:
|
||||
jmp @_start ; restart
|
||||
#else
|
||||
|
||||
#if defined(__H8300H__)
|
||||
#if defined(__H8300H__)
|
||||
.h8300h
|
||||
#else /* must be __H300S__ */
|
||||
.h8300s
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <bsp.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
|
||||
/*
|
||||
* The original table from the application and our copy of it with
|
||||
* some changes.
|
||||
@@ -36,7 +36,7 @@ char *rtems_progname;
|
||||
/*
|
||||
* Use the shared implementations of the following routines
|
||||
*/
|
||||
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, uint32_t, int );
|
||||
|
||||
@@ -53,7 +53,7 @@ void bsp_libc_init( void *, uint32_t, int );
|
||||
* not yet initialized.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
void *heapStart;
|
||||
@@ -72,7 +72,7 @@ void bsp_pretasking_hook(void)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
|
||||
@@ -41,7 +41,7 @@ void Clock_exit( void );
|
||||
/*
|
||||
* These are set by clock driver during its init
|
||||
*/
|
||||
|
||||
|
||||
rtems_device_major_number rtems_clock_major = ~0;
|
||||
rtems_device_major_number rtems_clock_minor = 0;
|
||||
|
||||
@@ -91,28 +91,28 @@ rtems_device_driver Clock_initialize(
|
||||
{
|
||||
unsigned timer_counter_init_value;
|
||||
unsigned char clock_lsb, clock_msb;
|
||||
|
||||
|
||||
Clock_driver_ticks = 0;
|
||||
|
||||
Clock_isrs =
|
||||
Clock_initial_isr_value =
|
||||
Clock_isrs =
|
||||
Clock_initial_isr_value =
|
||||
BSP_Configuration.microseconds_per_tick / 1000; /* ticks per clock_isr */
|
||||
|
||||
|
||||
/*
|
||||
* configure the counter timer ( should be based on microsecs/tick )
|
||||
* NB. The divisor(Clock_isrs) resolves the is the same number that appears in confdefs.h
|
||||
* when setting the microseconds_per_tick value.
|
||||
*/
|
||||
ClockOff ( &clockIrqData );
|
||||
|
||||
|
||||
timer_counter_init_value = BSP_Configuration.microseconds_per_tick / Clock_isrs;
|
||||
clock_lsb = (unsigned char)timer_counter_init_value;
|
||||
clock_msb = timer_counter_init_value >> 8;
|
||||
|
||||
outport_byte ( TMRCON , 0x34 );
|
||||
|
||||
outport_byte ( TMRCON , 0x34 );
|
||||
outport_byte ( TMR0 , clock_lsb ); /* load LSB first */
|
||||
outport_byte ( TMR0 , clock_msb ); /* then MSB */
|
||||
|
||||
|
||||
if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
|
||||
printk("Unable to initialize system clock\n");
|
||||
rtems_fatal_error_occurred(1);
|
||||
@@ -121,10 +121,10 @@ rtems_device_driver Clock_initialize(
|
||||
/*
|
||||
* make major/minor avail to others such as shared memory driver
|
||||
*/
|
||||
|
||||
|
||||
rtems_clock_major = major;
|
||||
rtems_clock_minor = minor;
|
||||
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -135,15 +135,15 @@ rtems_device_driver Clock_control(
|
||||
)
|
||||
{
|
||||
rtems_libio_ioctl_args_t *args = pargp;
|
||||
|
||||
|
||||
if (args == 0)
|
||||
goto done;
|
||||
|
||||
|
||||
/*
|
||||
* This is hokey, but until we get a defined interface
|
||||
* to do this, it will just be this simple...
|
||||
*/
|
||||
|
||||
|
||||
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
|
||||
{
|
||||
Clock_isr();
|
||||
@@ -159,13 +159,13 @@ rtems_device_driver Clock_control(
|
||||
printk("Clock installed AGAIN\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void Clock_exit()
|
||||
{
|
||||
ClockOff(&clockIrqData);
|
||||
ClockOff(&clockIrqData);
|
||||
BSP_remove_rtems_irq_handler (&clockIrqData);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*-------------------------------------------------------------------------+
|
||||
| console.c v1.1 - i386ex BSP - 1997/08/07
|
||||
+--------------------------------------------------------------------------+
|
||||
| This file contains the i386ex console I/O package. It is just a termios
|
||||
| This file contains the i386ex console I/O package. It is just a termios
|
||||
| wrapper.
|
||||
+--------------------------------------------------------------------------+
|
||||
| (C) Copyright 1997 -
|
||||
@@ -48,7 +48,7 @@
|
||||
* Possible value for console input/output :
|
||||
* BSP_UART_COM1
|
||||
* BSP_UART_COM2
|
||||
* BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
|
||||
* BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
|
||||
* All references to either keyboard or video handling have been removed.
|
||||
*/
|
||||
|
||||
@@ -67,7 +67,7 @@ static int isr_is_on(const rtems_irq_connect_data *);
|
||||
* Change references to com2 if required.
|
||||
*/
|
||||
|
||||
static rtems_irq_connect_data console_isr_data =
|
||||
static rtems_irq_connect_data console_isr_data =
|
||||
{ BSP_UART_COM2_IRQ,
|
||||
BSP_uart_termios_isr_com2,
|
||||
isr_on,
|
||||
@@ -79,7 +79,7 @@ isr_on(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
isr_off(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
@@ -108,21 +108,21 @@ console_initialize(rtems_device_major_number major,
|
||||
* Set up TERMIOS
|
||||
*/
|
||||
rtems_termios_initialize ();
|
||||
|
||||
|
||||
/*
|
||||
* Do device-specific initialization
|
||||
*/
|
||||
|
||||
|
||||
/* 9600-8-N-1, no hardware flow control */
|
||||
BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Set interrupt handler */
|
||||
if(BSPConsolePort == BSP_UART_COM1)
|
||||
{
|
||||
console_isr_data.name = BSP_UART_COM1_IRQ;
|
||||
console_isr_data.hdl = BSP_uart_termios_isr_com1;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -130,9 +130,9 @@ console_initialize(rtems_device_major_number major,
|
||||
console_isr_data.name = BSP_UART_COM2_IRQ;
|
||||
console_isr_data.hdl = BSP_uart_termios_isr_com2;
|
||||
}
|
||||
|
||||
|
||||
status = BSP_install_rtems_irq_handler(&console_isr_data);
|
||||
|
||||
|
||||
if (!status){
|
||||
printk("Error installing serial console interrupt handler!\n");
|
||||
rtems_fatal_error_occurred(status);
|
||||
@@ -146,7 +146,7 @@ console_initialize(rtems_device_major_number major,
|
||||
printk("Error registering console device!\n");
|
||||
rtems_fatal_error_occurred (status);
|
||||
}
|
||||
|
||||
|
||||
if(BSPConsolePort == BSP_UART_COM1)
|
||||
{
|
||||
printk("Initialized console on port COM1 9600-8-N-1\n\n");
|
||||
@@ -176,7 +176,7 @@ console_open(rtems_device_major_number major,
|
||||
void *arg)
|
||||
{
|
||||
rtems_status_code status;
|
||||
static rtems_termios_callbacks cb =
|
||||
static rtems_termios_callbacks cb =
|
||||
{
|
||||
NULL, /* firstOpen */
|
||||
console_last_close, /* lastClose */
|
||||
@@ -204,9 +204,9 @@ console_open(rtems_device_major_number major,
|
||||
/*
|
||||
* Pass data area info down to driver
|
||||
*/
|
||||
BSP_uart_termios_set(BSPConsolePort,
|
||||
BSP_uart_termios_set(BSPConsolePort,
|
||||
((rtems_libio_open_close_args_t *)arg)->iop->data1);
|
||||
|
||||
|
||||
/* Enable interrupts on channel */
|
||||
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
|
||||
|
||||
@@ -223,10 +223,10 @@ console_close(rtems_device_major_number major,
|
||||
{
|
||||
|
||||
return (rtems_termios_close (arg));
|
||||
|
||||
|
||||
} /* console_close */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Console device driver READ entry point.
|
||||
+--------------------------------------------------------------------------+
|
||||
@@ -248,7 +248,7 @@ console_read(rtems_device_major_number major,
|
||||
return sc;
|
||||
|
||||
} /* console_read */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Console device driver WRITE entry point.
|
||||
@@ -261,20 +261,20 @@ console_write(rtems_device_major_number major,
|
||||
void * arg)
|
||||
{
|
||||
return rtems_termios_write (arg);
|
||||
|
||||
|
||||
} /* console_write */
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Handle ioctl request.
|
||||
*/
|
||||
rtems_device_driver
|
||||
rtems_device_driver
|
||||
console_control(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg
|
||||
)
|
||||
{
|
||||
{
|
||||
return rtems_termios_ioctl (arg);
|
||||
}
|
||||
|
||||
@@ -283,45 +283,45 @@ conSetAttr(int minor, const struct termios *t)
|
||||
{
|
||||
int baud;
|
||||
|
||||
switch (t->c_cflag & CBAUD)
|
||||
switch (t->c_cflag & CBAUD)
|
||||
{
|
||||
case B50:
|
||||
case B50:
|
||||
baud = 50;
|
||||
break;
|
||||
case B75:
|
||||
baud = 75;
|
||||
case B75:
|
||||
baud = 75;
|
||||
break;
|
||||
case B110:
|
||||
baud = 110;
|
||||
case B110:
|
||||
baud = 110;
|
||||
break;
|
||||
case B134:
|
||||
baud = 134;
|
||||
case B134:
|
||||
baud = 134;
|
||||
break;
|
||||
case B150:
|
||||
baud = 150;
|
||||
case B150:
|
||||
baud = 150;
|
||||
break;
|
||||
case B200:
|
||||
baud = 200;
|
||||
baud = 200;
|
||||
break;
|
||||
case B300:
|
||||
case B300:
|
||||
baud = 300;
|
||||
break;
|
||||
case B600:
|
||||
baud = 600;
|
||||
case B600:
|
||||
baud = 600;
|
||||
break;
|
||||
case B1200:
|
||||
case B1200:
|
||||
baud = 1200;
|
||||
break;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
break;
|
||||
case B2400:
|
||||
case B2400:
|
||||
baud = 2400;
|
||||
break;
|
||||
case B4800:
|
||||
case B4800:
|
||||
baud = 4800;
|
||||
break;
|
||||
case B9600:
|
||||
case B9600:
|
||||
baud = 9600;
|
||||
break;
|
||||
case B19200:
|
||||
@@ -330,7 +330,7 @@ conSetAttr(int minor, const struct termios *t)
|
||||
case B38400:
|
||||
baud = 38400;
|
||||
break;
|
||||
case B57600:
|
||||
case B57600:
|
||||
baud = 57600;
|
||||
break;
|
||||
case B115200:
|
||||
@@ -351,13 +351,13 @@ conSetAttr(int minor, const struct termios *t)
|
||||
* BSP initialization
|
||||
*/
|
||||
|
||||
BSP_output_char_function_type BSP_output_char =
|
||||
BSP_output_char_function_type BSP_output_char =
|
||||
(BSP_output_char_function_type) BSP_output_char_via_serial;
|
||||
|
||||
BSP_polling_getchar_function_type BSP_poll_char =
|
||||
BSP_polling_getchar_function_type BSP_poll_char =
|
||||
(BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
|
||||
|
||||
int BSP_poll_read(int ttyMinor){
|
||||
|
||||
|
||||
return BSP_poll_char_via_serial();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ extern "C" {
|
||||
#include <rtems/bspIo.h>
|
||||
#include <libcpu/cpu.h>
|
||||
#include <irq.h>
|
||||
|
||||
|
||||
/*
|
||||
* confdefs.h overrides for this BSP:
|
||||
* - number of termios serial ports (defaults to 1)
|
||||
@@ -120,15 +120,15 @@ extern "C" {
|
||||
/*
|
||||
* Device Driver Table Entries
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Console driver entry
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Clock driver entry
|
||||
*/
|
||||
|
||||
|
||||
/* miscellaneous stuff assumed to exist */
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
extern int uti596_attach(struct rtems_bsdnet_ifconfig *);
|
||||
extern int uti596dump(char * );
|
||||
extern void uti596reset(void);
|
||||
extern void uti596reset(void);
|
||||
extern void uti596Diagnose(int);
|
||||
extern void uti596_request_reset(void);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -58,13 +58,13 @@ struct enet_statistics{
|
||||
|
||||
|
||||
enum commands {
|
||||
CmdNOp = 0,
|
||||
CmdSASetup = 1,
|
||||
CmdConfigure = 2,
|
||||
CmdNOp = 0,
|
||||
CmdSASetup = 1,
|
||||
CmdConfigure = 2,
|
||||
CmdMulticastList = 3,
|
||||
CmdTx = 4,
|
||||
CmdTDR = 5,
|
||||
CmdDump = 6,
|
||||
CmdTx = 4,
|
||||
CmdTDR = 5,
|
||||
CmdDump = 6,
|
||||
CmdDiagnose = 7
|
||||
};
|
||||
|
||||
@@ -142,7 +142,7 @@ struct i596_tbd {
|
||||
unsigned short size;
|
||||
unsigned short pad;
|
||||
struct i596_tbd *next;
|
||||
char *data;
|
||||
char *data;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -153,7 +153,7 @@ struct i596_rbd {
|
||||
unsigned short count;
|
||||
unsigned short offset;
|
||||
struct i596_rbd *next;
|
||||
char *data;
|
||||
char *data;
|
||||
unsigned short size;
|
||||
unsigned short pad;
|
||||
};
|
||||
@@ -176,10 +176,10 @@ struct i596_rfd {
|
||||
volatile unsigned short stat;
|
||||
volatile unsigned short cmd;
|
||||
struct i596_rfd *next;
|
||||
struct i596_rbd *pRbd;
|
||||
struct i596_rbd *pRbd;
|
||||
unsigned short count;
|
||||
unsigned short size;
|
||||
char data [1532 ];
|
||||
char data [1532 ];
|
||||
} ;
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ struct i596_scb {
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* Intermediate System Control Block
|
||||
*/
|
||||
struct i596_iscp {
|
||||
@@ -253,7 +253,7 @@ struct uti596_softc {
|
||||
struct i596_set_add set_add;
|
||||
struct i596_configure set_conf;
|
||||
struct i596_tdr tdr;
|
||||
struct i596_nop nop;
|
||||
struct i596_nop nop;
|
||||
unsigned long stat;
|
||||
struct tx_cmd *pTxCmd;
|
||||
struct i596_tbd *pTbd;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 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$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
* This file is the main boot and configuration file for the i386ex. It is
|
||||
* solely responsible for initializing the internal register set to reflect
|
||||
* the proper board configuration. This version is the "generic" i386ex
|
||||
* startup:
|
||||
* startup:
|
||||
*
|
||||
* 1) 512K flask ROM @3f80000
|
||||
* 2) 1 Mb RAM @ 0x0
|
||||
* 3) Timer0 used as RTEMS clock ticker, 1 msec tick rate.
|
||||
* 4) READY# is generated by CPU
|
||||
*
|
||||
* The file is a multi-section file, with sections as follows:
|
||||
* The file is a multi-section file, with sections as follows:
|
||||
* 1) interrupt gates, in section "ints"
|
||||
* 2) interrupt descriptor table, in section "idt"
|
||||
* 3) global descriptor table, in section "gdt"
|
||||
@@ -28,11 +28,11 @@
|
||||
*
|
||||
* $Id$
|
||||
|
||||
|
||||
changes:
|
||||
|
||||
changes:
|
||||
SetExRegByte(ICW3S , 0x02 ) # MUST be 0x02 according to intel
|
||||
SetExRegByte(ICW3M , 0x04 ) # IR2 is cascaded internally: was 0x02 => IR1 is cascaded
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -43,56 +43,56 @@ changes:
|
||||
|
||||
/*
|
||||
* NEW_GAS Needed for binutils 2.9.1.0.7 and higher
|
||||
*/
|
||||
*/
|
||||
|
||||
EXTERN (boot_card) /* exits to bspstart */
|
||||
EXTERN (boot_card) /* exits to bspstart */
|
||||
EXTERN (stack_start) /* defined in startup/linkcmds */
|
||||
EXTERN (Clock_exit)
|
||||
|
||||
PUBLIC (Interrupt_descriptor_table)
|
||||
PUBLIC ( SYM(IDTR) )
|
||||
/* PUBLIC( SYM(_initInternalRegisters) ) */
|
||||
|
||||
BEGIN_DATA
|
||||
|
||||
BEGIN_DATA
|
||||
SYM(IDTR): DESC3( SYM(Interrupt_descriptor_table), 0x07ff );
|
||||
|
||||
|
||||
SYM(Interrupt_descriptor_table): /* Now in data section */
|
||||
.rept 256
|
||||
.word 0,0,0,0
|
||||
.endr
|
||||
|
||||
END_DATA
|
||||
|
||||
END_DATA
|
||||
|
||||
BEGIN_DATA
|
||||
PUBLIC (_Global_descriptor_table)
|
||||
|
||||
|
||||
SYM(GDTR): DESC3( GDT_TABLE, 0x1f ); # one less than the size
|
||||
SYM (_Global_descriptor_table):
|
||||
SYM (_Global_descriptor_table):
|
||||
SYM(GDT_TABLE): DESC2(0,0,0,0,0,0);
|
||||
SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
|
||||
SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
|
||||
SYM(GDT_CODE): DESC2(0xffff,0,0x0,0x9B,0xDF,0x00);
|
||||
SYM(GDT_DATA): DESC2(0xffff,0,0x0,0x92,0xDF,0x00); # was CF
|
||||
SYM(GDT_END):
|
||||
|
||||
END_DATA
|
||||
|
||||
|
||||
|
||||
/* This section is the section that is used by the interrupt
|
||||
descriptor table. It is used to provide the IDT with the
|
||||
correct vector offsets. It is for symbol definition only.
|
||||
*/
|
||||
|
||||
|
||||
.code16
|
||||
.section .reset, "ax"
|
||||
PUBLIC ( SYM(reset) )
|
||||
PUBLIC ( SYM(reset) )
|
||||
SYM(reset):
|
||||
nop
|
||||
cli
|
||||
#ifdef NEW_GAS
|
||||
#ifdef NEW_GAS
|
||||
data32 addr32 jmp SYM(_initInternalRegisters) /* different section in this file */
|
||||
#else
|
||||
jmp SYM(_initInternalRegisters) /* different section in this file */
|
||||
#endif
|
||||
#endif
|
||||
/* .code32 in case this section moves */
|
||||
nop /* required by CHIP LAB to pad out size */
|
||||
nop
|
||||
@@ -105,27 +105,27 @@ SYM(reset):
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
|
||||
.section .initial, "ax"
|
||||
/* nop */ /* required for linker -- initial jump is to "label - 2" */
|
||||
/* nop */ /* ie. _initInternalRegisters -2 ( which now == .initial ) */
|
||||
/* nop */ /* ie. _initInternalRegisters -2 ( which now == .initial ) */
|
||||
/*
|
||||
* Enable access to peripheral register at expanded I/O addresses
|
||||
*/
|
||||
SYM(_initInternalRegisters):
|
||||
SYM(_initInternalRegisters):
|
||||
|
||||
/* .code16 */
|
||||
movw $0x8000 , ax
|
||||
movw $0x8000 , ax
|
||||
outb al , $REMAPCFGH
|
||||
xchg al , ah
|
||||
outb al,$REMAPCFGL
|
||||
outw ax, $REMAPCFG ;
|
||||
/*
|
||||
* Configure operation of the A20 Address Line
|
||||
*/
|
||||
*/
|
||||
SYM(A20):
|
||||
movw $PORT92 , dx
|
||||
|
||||
|
||||
inb dx , al # clear A20 port reset
|
||||
andb $0xfe , al # b0 Fast Reset(0)=disabled,(1)=reset triggered
|
||||
orb $0x02 , al # Bit 1 Fast A20 = 0 (always 0) else enabled.
|
||||
@@ -135,11 +135,11 @@ SYM(A20):
|
||||
SYM(Watchdog):
|
||||
movw $WDTSTATUS , dx # address the WDT status port
|
||||
inb dx , al # get the WDT status
|
||||
orb $0x01 , al # set the CLKDIS bit
|
||||
orb $0x01 , al # set the CLKDIS bit
|
||||
outb al , dx # disable the clock to the WDT
|
||||
|
||||
/*
|
||||
* Initialize Refresh Control Unit for:
|
||||
* Initialize Refresh Control Unit for:
|
||||
* Refresh Address = 0x0000
|
||||
|
||||
* Refresh gate between rows is 15.6 uSec
|
||||
@@ -148,20 +148,20 @@ SYM(Watchdog):
|
||||
* The refresh pin is not used.
|
||||
*/
|
||||
|
||||
SYM(InitRCU):
|
||||
SYM(InitRCU):
|
||||
SetExRegWord( RFSCIR , 390) # refresh interval was 390, tried 312
|
||||
SetExRegWord( RFSBAD , 0x0) # base address
|
||||
SetExRegWord( RFSADD , 0x0) # address register
|
||||
SetExRegWord( RFSCON , 0x8000) # enable bit
|
||||
|
||||
/*
|
||||
* Initialize clock and power mgmt unit for:
|
||||
* Initialize clock and power mgmt unit for:
|
||||
* Clock Frequency = 50 Mhz
|
||||
* Prescaled clock output = 1 Mhz
|
||||
* Normal halt instructions
|
||||
*/
|
||||
|
||||
SYM(InitClk):
|
||||
|
||||
SYM(InitClk):
|
||||
SetExRegByte( PWRCON, 0x0 )
|
||||
SetExRegWord( CLKPRS, 0x17) # 0x13 for 1.19318 MHz. 0x17 for 1MHz.
|
||||
|
||||
@@ -170,7 +170,7 @@ SYM(InitClk):
|
||||
*************************************************************/
|
||||
|
||||
/*
|
||||
* Initialize I/O port 1 for:
|
||||
* Initialize I/O port 1 for:
|
||||
* PIN 0 = 1, DCD0# to package pin
|
||||
* PIN 1 = 1, RTS0# to package pin
|
||||
* PIN 2 = 1, DTR0# to package pin
|
||||
@@ -181,15 +181,15 @@ SYM(InitClk):
|
||||
* PIN 7 = 0, Outport (P17_HOLD to 386ex option header JP7 pin 3)
|
||||
*/
|
||||
|
||||
SYM(InitPort1):
|
||||
SYM(InitPort1):
|
||||
SetExRegByte( P1LTC , 0xff )
|
||||
SetExRegByte( P1DIR , 0x0 )
|
||||
SetExRegByte( P1CFG , 0x1f)
|
||||
|
||||
|
||||
/*
|
||||
* Initialize I/O port 2 for:
|
||||
* PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
|
||||
* PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
|
||||
* Initialize I/O port 2 for:
|
||||
* PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
|
||||
* PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
|
||||
* PIN 2 = 1, CS2# (SMRAM) If not using CS2 can be configured as.?
|
||||
* PIN 3 = 0, Outport ( no connect )
|
||||
* PIN 4 = 1, CS#4 (DRAM)
|
||||
@@ -197,34 +197,34 @@ SYM(InitPort1):
|
||||
* PIN 6 = 1, TXD0 output.
|
||||
* PIN 7 = 1, CTS0# input.
|
||||
*/
|
||||
|
||||
SYM(InitPort2):
|
||||
|
||||
SYM(InitPort2):
|
||||
SetExRegByte( P2LTC , 0xff )
|
||||
SetExRegByte( P2DIR , 0x0 )
|
||||
SetExRegByte( P2CFG , 0xfe)
|
||||
|
||||
|
||||
/*
|
||||
* Initialize I/O port 3 P3CFG
|
||||
* Initialize I/O port 3 P3CFG
|
||||
* PIN 0 = 1, TMROUT0 to package pin
|
||||
* PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
|
||||
* PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
|
||||
* PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
|
||||
* PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
|
||||
* PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
|
||||
* PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
|
||||
* PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
|
||||
* PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
|
||||
* PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
|
||||
* PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
|
||||
* PIN 6 = 0, Inport (Debugger Break P3.6/PWRD to package pin )
|
||||
* P3.6 selected
|
||||
* PIN 7 = 0, COMCLK output disabled, 1.8432 Mhz OSC1 oscillator.
|
||||
* ( Debbugger uses COMCLK as the clocking source )
|
||||
* P3.7 connected to package pin.
|
||||
*/
|
||||
|
||||
SYM(InitPort3):
|
||||
|
||||
SYM(InitPort3):
|
||||
SetExRegByte( P3LTC , 0xff )
|
||||
SetExRegByte( P3DIR , 0x41 )
|
||||
SetExRegByte( P3CFG , 0x09 ) # can check TMROUT0
|
||||
/*
|
||||
* Initialize Peripheral Pin Configurations:
|
||||
* PIN 0 = 1, RTS1# to package pin
|
||||
* Initialize Peripheral Pin Configurations:
|
||||
* PIN 0 = 1, RTS1# to package pin
|
||||
* PIN 1 = 1, DTR1# to package pin
|
||||
* PIN 2 = 1, TXD1 out to package pin
|
||||
* PIN 3 = 0, EOP#/TC
|
||||
@@ -233,20 +233,20 @@ SYM(InitPort3):
|
||||
* PIN 6 = 0, 0 => CS6# connected to package pin
|
||||
* PIN 7 = 0, Don't care
|
||||
*/
|
||||
|
||||
SYM(InitPeriph):
|
||||
SetExRegByte( PINCFG , 0x24)
|
||||
|
||||
|
||||
SYM(InitPeriph):
|
||||
SetExRegByte( PINCFG , 0x24)
|
||||
|
||||
/*
|
||||
* Initialize the Asynchronous Serial Ports:
|
||||
* Initialize the Asynchronous Serial Ports:
|
||||
* BIT 7 = 1, Internal SIO1 modem signals
|
||||
* BIT 6 = 1, Internal SIO0 modem signals
|
||||
* BIT 2 = 0, PSCLK for SSIO clock
|
||||
* BIT 1 = 1, SERCLK for SIO1 clock
|
||||
* BIT 1 = 1, SERCLK for SIO1 clock
|
||||
* BIT 0 = 1, SERCLK for SIO0 clock
|
||||
*/
|
||||
|
||||
SYM(InitSIO):
|
||||
SYM(InitSIO):
|
||||
SetExRegByte( SIOCFG, 0xC3 ) # SIOn clocked internally
|
||||
|
||||
SetExRegByte( LCR0, 0x80 ) # latch DLL0, DLH0
|
||||
@@ -255,48 +255,48 @@ SYM(InitSIO):
|
||||
SetExRegByte( LCR0, 0x03 ) # enable r/w buffers, IER0 accessible
|
||||
# mode 8-n-1
|
||||
SetExRegByte( IER0, 0x00 ) # was 0x0f All interrupts detected
|
||||
|
||||
SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
|
||||
|
||||
SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
|
||||
SetExRegByte( DLL1, 0x51 ) # 0x51 set to 9600 baud, 0x7 = 115200
|
||||
SetExRegByte( DLH1, 0x00 ) # 0x145 is 2400 baud
|
||||
SetExRegByte( LCR1, 0x03 ) # enable r/w buffers, IER1 accessible
|
||||
# reg 8-n-1
|
||||
SetExRegByte( IER1, 0x00 ) # was 0x0f - All interrupts detected
|
||||
|
||||
SYM(InitMCR):
|
||||
SYM(InitMCR):
|
||||
/*
|
||||
* Initialize Timer for:
|
||||
* Initialize Timer for:
|
||||
* BIT 7 = 1, Timer clocks disabled
|
||||
* BIT 6 = 0, Reserved
|
||||
* BIT 5 = 1, TMRCLK2 instead of Vcc to Gate2
|
||||
* BIT 4 = 0, PSCLK to CLK2
|
||||
* BIT 3 = 1, TMRCLK1 instead of Vcc to Gate1
|
||||
* BIT 2 = 0, PSCLK to Gate1
|
||||
* BIT 1 = 0, Vcc to Gate0
|
||||
* BIT 1 = 0, Vcc to Gate0
|
||||
* BIT 0 = 0, PSCLK to Gate0
|
||||
*/
|
||||
|
||||
SYM(InitTimer):
|
||||
SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
|
||||
SYM(InitTimer):
|
||||
SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
|
||||
# and 2 are set to Vcc
|
||||
|
||||
SetExRegByte(TMRCON , 0x34 ) # prepare to write counter 0 LSB,MSB
|
||||
SetExRegByte(TMR0 , 0x00 ) # sfa
|
||||
SetExRegByte(TMR0 , 0x00 ) # sfa
|
||||
SetExRegByte(TMR0 , 0x00 ) # sfa
|
||||
|
||||
|
||||
|
||||
SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc
|
||||
SetExRegByte(TMR1 , 0x00 ) # sfa
|
||||
SetExRegByte(TMR1 , 0x00 ) # sfa
|
||||
|
||||
SetExRegByte(TMR1 , 0x00 ) # sfa
|
||||
|
||||
SetExRegByte(TMRCON , 0xB0 ) # mode 0 disables on gate =Vcc
|
||||
SetExRegByte(TMR2 , 0x00 ) #
|
||||
SetExRegByte(TMR2 , 0x00 ) #
|
||||
SetExRegByte(TMR2 , 0x00 ) #
|
||||
SetExRegByte(TMR2 , 0x00 ) #
|
||||
|
||||
SetExRegByte(TMRCFG , 0x80 ) # Enable = 0x00
|
||||
|
||||
/*
|
||||
* Initialize the DMACFG register for:
|
||||
* Initialize the DMACFG register for:
|
||||
* BIT 7 = 1 , Disable DACK#1
|
||||
* BITs 6:4 = 100, TMROUT2 connected to DRQ1
|
||||
* BIT 3 = 1 , Disable DACK0#
|
||||
@@ -316,17 +316,17 @@ SYM(InitTimer):
|
||||
*/
|
||||
|
||||
SYM(InitInt):
|
||||
|
||||
|
||||
cli # !
|
||||
/* SetExRegByte(OCW3S, 0x20) # address the Slave status port
|
||||
movw $OCW3S , dx
|
||||
movw $OCW3S , dx
|
||||
inb dx , al # Read the IRR.
|
||||
|
||||
SetExRegByte(OCW3M, 0x20) # address the Master status port
|
||||
movw $OCW3M , dx
|
||||
SetExRegByte(OCW3M, 0x20) # address the Master status port
|
||||
movw $OCW3M , dx
|
||||
inb dx , al # Read the IRR.
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
SetExRegByte(ICW1S , 0x11 ) # EDGE TRIGGERED
|
||||
SetExRegByte(ICW2S , 0x28 ) # Slave base vector after Master
|
||||
SetExRegByte(ICW3S , 0x02 ) # slave cascaded to IR2 on master
|
||||
@@ -336,65 +336,65 @@ SYM(InitInt):
|
||||
SetExRegByte(ICW2M , 0x20 ) # base vector starts at byte 32
|
||||
SetExRegByte(ICW3M , 0x04) # IR2 is cascaded internally
|
||||
SetExRegByte(ICW4M , 0x01 ) # fully nested mode
|
||||
|
||||
SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe.
|
||||
|
||||
SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe.
|
||||
# for IR5 and IR0 active use 0xde
|
||||
# for IR0 and IR2 use 0xfa
|
||||
SetExRegByte(INTCFG , 0x00 )
|
||||
|
||||
|
||||
SYM(SetCS4):
|
||||
|
||||
|
||||
SYM(SetCS4):
|
||||
SetExRegWord(CS4ADL , 0x702) #Configure chip select 4
|
||||
SetExRegWord(CS4ADH , 0x00)
|
||||
SetExRegWord(CS4MSKH, 0x03F)
|
||||
SetExRegWord(CS4MSKL, 0xFC01)
|
||||
SetExRegWord(CS4MSKH, 0x03F)
|
||||
SetExRegWord(CS4MSKL, 0xFC01)
|
||||
|
||||
SYM(SetUCS1):
|
||||
SYM(SetUCS1):
|
||||
SetExRegWord(UCSADL , 0x0304) # 512K block starting at 0x80000 until 0x3f80000
|
||||
SetExRegWord(UCSADH , 0x03F8)
|
||||
SetExRegWord(UCSMSKH, 0x03F7)
|
||||
SetExRegWord(UCSMSKH, 0x03F7)
|
||||
SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
|
||||
|
||||
/******************************************************
|
||||
* The GDT must be in RAM since it must be writeable,
|
||||
* So, move the whole data section down.
|
||||
********************************************************/
|
||||
|
||||
|
||||
movw $ _ram_data_offset , di
|
||||
movw $ _ram_data_segment, cx
|
||||
movw $ _ram_data_segment, cx
|
||||
mov cx , es
|
||||
|
||||
movw $ _data_size , cx
|
||||
movw $ _rom_data_segment, ax
|
||||
movw $ _rom_data_offset , si
|
||||
movw $ _data_size , cx
|
||||
movw $ _rom_data_segment, ax
|
||||
movw $ _rom_data_offset , si
|
||||
mov ax , ds
|
||||
|
||||
|
||||
repne
|
||||
movsb
|
||||
|
||||
|
||||
/*****************************
|
||||
* Load the Global Descriptor
|
||||
* Table Register
|
||||
****************************/
|
||||
|
||||
#ifdef NEW_GAS
|
||||
|
||||
#ifdef NEW_GAS
|
||||
data32 addr32 lgdt SYM(GDTR) # location of GDT
|
||||
#else
|
||||
lgdt SYM(GDTR) # location of GDT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
SYM(SetUCS):
|
||||
SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
|
||||
|
||||
SYM(SetUCS):
|
||||
SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
|
||||
SetExRegWord(UCSADH, 0x03f8)
|
||||
SetExRegWord(UCSMSKH, 0x0007)
|
||||
SetExRegWord(UCSMSKH, 0x0007)
|
||||
SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
|
||||
|
||||
|
||||
/*
|
||||
* SRAM chip select: 16 bit bus size,starting 16Mb, size 512k,
|
||||
* 4 waits
|
||||
*/
|
||||
|
||||
|
||||
#ifdef UT_I386EX
|
||||
|
||||
SYM(SetCS1):
|
||||
@@ -411,7 +411,7 @@ SYM(SetCS2):
|
||||
|
||||
/*
|
||||
* Real-time clock: 8 bit bus size, starting@16Mb+512K, size 32k
|
||||
* 4 waits
|
||||
* 4 waits
|
||||
*/
|
||||
SYM(SetCS3):
|
||||
SetExRegWord(CS3ADL, 0x0504)
|
||||
@@ -427,25 +427,25 @@ SYM(SetCS3):
|
||||
mov cr0, eax
|
||||
orw $0x1, ax
|
||||
mov eax, cr0
|
||||
|
||||
|
||||
/**************************
|
||||
* Flush prefetch queue,
|
||||
* and load CS selector
|
||||
*********************/
|
||||
|
||||
ljmpl $ GDT_CODE_PTR , $ SYM(_load_segment_registers) # sets the code selector
|
||||
|
||||
|
||||
/*
|
||||
* Load the segment registers
|
||||
*/
|
||||
SYM(_load_segment_registers):
|
||||
SYM(_load_segment_registers):
|
||||
.code32
|
||||
pLOAD_SEGMENT( GDT_DATA_PTR, fs)
|
||||
pLOAD_SEGMENT( GDT_DATA_PTR, gs)
|
||||
pLOAD_SEGMENT( GDT_DATA_PTR, ss)
|
||||
pLOAD_SEGMENT( GDT_DATA_PTR, ds)
|
||||
pLOAD_SEGMENT( GDT_DATA_PTR, es)
|
||||
|
||||
|
||||
/*
|
||||
* Set up the stack
|
||||
*/
|
||||
@@ -481,7 +481,7 @@ SYM (zero_bss):
|
||||
pushl $0 # argc
|
||||
|
||||
movw $0xFFFB, SYM(i8259s_cache) # ICU mask values reflect
|
||||
# initial ICU state
|
||||
# initial ICU state
|
||||
call SYM(boot_card)
|
||||
addl $12,esp
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
*
|
||||
* Ported to the i386ex and submitted by:
|
||||
*
|
||||
* Erik Ivanenko
|
||||
* Erik Ivanenko
|
||||
* University of Toronto
|
||||
* erik.ivanenko@utoronto.ca
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ extern uint32_t rdb_start;
|
||||
/*
|
||||
* Use the shared implementations of the following routines
|
||||
*/
|
||||
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, uint32_t, int );
|
||||
|
||||
@@ -63,7 +63,7 @@ void bsp_libc_init( void *, uint32_t, int );
|
||||
* not yet initialized.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int heap_bottom;
|
||||
|
||||
@@ -48,7 +48,7 @@ void TimerOn(const rtems_raw_irq_connect_data* used)
|
||||
outport_byte ( TMRCON , 0xb0 ); /* select tmr2, stay in mode 0 */
|
||||
outport_byte ( TMR1 , 0xfa ); /* set to 250 usec interval */
|
||||
outport_byte ( TMR1 , 0x00 );
|
||||
outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
|
||||
outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
|
||||
/* interrupts ARE enabled */
|
||||
/* outport_byte( IERA, 0x41 ); enable interrupt */
|
||||
/*
|
||||
@@ -116,7 +116,7 @@ int Read_timer()
|
||||
/* outport_byte( TBCR, 0x00 ); stop the timer -- not needed on intel */
|
||||
|
||||
outport_byte ( TMRCON, 0x40 ); /* latch the count */
|
||||
inport_byte ( TMR1, clicks ); /* read the count */
|
||||
inport_byte ( TMR1, clicks ); /* read the count */
|
||||
|
||||
total = Ttimer_val + 250 - clicks;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* e-mail: rdasilva@connecttel.com
|
||||
*
|
||||
* MODULE DESCRIPTION:
|
||||
* RTEMS driver for 3COM 3C509 Ethernet Card.
|
||||
* RTEMS driver for 3COM 3C509 Ethernet Card.
|
||||
* The driver has been tested on PC with a single network card.
|
||||
*
|
||||
*
|
||||
@@ -54,10 +54,13 @@
|
||||
* Saskatoon, Saskatchewan, CANADA
|
||||
* eric@skatter.usask.ca
|
||||
*******************************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
* MODIFICATION/HISTORY:
|
||||
* $Log$
|
||||
* Revision 1.2 1999/12/13 21:21:31 joel
|
||||
* Warning removal patch from Philip A. Prindeville <philipp@zembu.com>.
|
||||
*
|
||||
* Revision 1.1 1999/05/14 16:23:42 joel
|
||||
* Added 3COM 3C509 driver from Rosimildo DaSilva <rdasilva@connecttel.com>.
|
||||
*
|
||||
@@ -140,7 +143,7 @@
|
||||
* more powerful mechanism for detecting and dealing with multiple types
|
||||
* of non-fatal conflict. -jkh XXX
|
||||
*/
|
||||
struct isa_device
|
||||
struct isa_device
|
||||
{
|
||||
int id_id; /* device id */
|
||||
int id_unit; /* unit number */
|
||||
@@ -149,7 +152,7 @@ struct isa_device
|
||||
};
|
||||
|
||||
|
||||
struct ep_board
|
||||
struct ep_board
|
||||
{
|
||||
int epb_addr; /* address of this board */
|
||||
char epb_used; /* was this entry already used for configuring ? */
|
||||
@@ -163,7 +166,7 @@ struct ep_board
|
||||
/*
|
||||
* Ethernet software status per interface.
|
||||
*/
|
||||
struct ep_softc
|
||||
struct ep_softc
|
||||
{
|
||||
struct arpcom arpcom; /* Ethernet common part */
|
||||
int ep_io_addr; /* i/o bus address */
|
||||
@@ -194,7 +197,7 @@ struct ep_softc
|
||||
static volatile unsigned long overrun;
|
||||
static volatile unsigned long resend;
|
||||
static struct ep_softc ep_softc[ NWDDRIVER ];
|
||||
static struct isa_device isa_dev[ NWDDRIVER ] =
|
||||
static struct isa_device isa_dev[ NWDDRIVER ] =
|
||||
{
|
||||
{ 0, /* device id */
|
||||
0, /* unit number */
|
||||
@@ -230,7 +233,7 @@ extern void Wait_X_ms( unsigned int timeToWait ); /* timer.c ??? */
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Writes a buffer of data to the I/O port. The data is sent to the
|
||||
* port as 32 bits units( 4 bytes ).
|
||||
*
|
||||
@@ -239,7 +242,7 @@ extern void Wait_X_ms( unsigned int timeToWait ); /* timer.c ??? */
|
||||
**********************************************************************************/
|
||||
static __inline void outsl( unsigned short io_addr, unsigned char *out_data, int len )
|
||||
{
|
||||
u_long *pl = ( u_long *)out_data;
|
||||
u_long *pl = ( u_long *)out_data;
|
||||
while( len-- )
|
||||
{
|
||||
outport_long( io_addr, *pl );
|
||||
@@ -248,7 +251,7 @@ static __inline void outsl( unsigned short io_addr, unsigned char *out_data, int
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Writes a buffer of data to the I/O port. The data is sent to the
|
||||
* port as 16 bits units( 2 bytes ).
|
||||
*
|
||||
@@ -257,7 +260,7 @@ static __inline void outsl( unsigned short io_addr, unsigned char *out_data, int
|
||||
**********************************************************************************/
|
||||
static __inline void outsw( unsigned short io_addr, unsigned char *out_data, int len )
|
||||
{
|
||||
u_short *ps = ( u_short *)out_data;
|
||||
u_short *ps = ( u_short *)out_data;
|
||||
while( len-- )
|
||||
{
|
||||
outport_word( io_addr, *ps );
|
||||
@@ -266,7 +269,7 @@ static __inline void outsw( unsigned short io_addr, unsigned char *out_data, int
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Writes a buffer of data to the I/O port. The data is sent to the
|
||||
* port as 8 bits units( 1 byte ).
|
||||
*
|
||||
@@ -284,7 +287,7 @@ static __inline void outsb( unsigned short io_addr, unsigned char *out_data, int
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Read a buffer of data from an I/O port. The data is read as 16 bits
|
||||
* units or 2 bytes.
|
||||
*
|
||||
@@ -293,7 +296,7 @@ static __inline void outsb( unsigned short io_addr, unsigned char *out_data, int
|
||||
**********************************************************************************/
|
||||
static __inline void insw( unsigned short io_addr, unsigned char *in_data, int len )
|
||||
{
|
||||
u_short *ps = ( u_short *)in_data;
|
||||
u_short *ps = ( u_short *)in_data;
|
||||
while( len-- )
|
||||
{
|
||||
inport_word( io_addr, *ps );
|
||||
@@ -302,7 +305,7 @@ static __inline void insw( unsigned short io_addr, unsigned char *in_data, int l
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Read a buffer of data from an I/O port. The data is read as 32 bits
|
||||
* units or 4 bytes.
|
||||
*
|
||||
@@ -311,7 +314,7 @@ static __inline void insw( unsigned short io_addr, unsigned char *in_data, int l
|
||||
**********************************************************************************/
|
||||
static __inline void insl( unsigned short io_addr, unsigned char *in_data, int len )
|
||||
{
|
||||
u_long *pl = ( u_long *)in_data;
|
||||
u_long *pl = ( u_long *)in_data;
|
||||
while( len-- )
|
||||
{
|
||||
inport_long( io_addr, *pl );
|
||||
@@ -320,7 +323,7 @@ static __inline void insl( unsigned short io_addr, unsigned char *in_data, int l
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Read a buffer of data from an I/O port. The data is read as 8 bits
|
||||
* units or 1 bytes.
|
||||
*
|
||||
@@ -337,7 +340,7 @@ static __inline void insb( unsigned short io_addr, unsigned char *in_data, int l
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Writes a word to the I/O port.
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -353,7 +356,7 @@ static __inline void outw( unsigned short io_addr, unsigned short out_data )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Routine to read a word as defined in FreeBSD.
|
||||
*
|
||||
* RETURNS: nothing
|
||||
@@ -367,7 +370,7 @@ static __inline unsigned short inw( unsigned short io_addr )
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Routine to output a word as defined in FreeBSD.
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -379,7 +382,7 @@ void __inline outb( unsigned short io_addr, unsigned char out_data )
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Routine to read a word as defined in FreeBSD.
|
||||
*
|
||||
* RETURNS: byte read.
|
||||
@@ -394,7 +397,7 @@ static __inline unsigned char inb( unsigned short io_addr )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* We get eeprom data from the id_port given an offset into the eeprom.
|
||||
* Basically; after the ID_sequence is sent to all of the cards; they enter
|
||||
@@ -422,7 +425,7 @@ static int get_eeprom_data( int id_port, int offset )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Waits until the EEPROM of the card is ready to be accessed.
|
||||
*
|
||||
* RETURNS: 0 - not ready; 1 - ok
|
||||
@@ -434,7 +437,7 @@ static int eeprom_rdy( struct ep_softc *sc )
|
||||
|
||||
for (i = 0; is_eeprom_busy(BASE) && i < MAX_EEPROMBUSY; i++)
|
||||
continue;
|
||||
if (i >= MAX_EEPROMBUSY)
|
||||
if (i >= MAX_EEPROMBUSY)
|
||||
{
|
||||
printf("ep%d: eeprom failed to come ready.\n", sc->unit);
|
||||
return (0);
|
||||
@@ -443,9 +446,9 @@ static int eeprom_rdy( struct ep_softc *sc )
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* get_e: gets a 16 bits word from the EEPROM.
|
||||
* get_e: gets a 16 bits word from the EEPROM.
|
||||
* We must have set the window before call this routine.
|
||||
*
|
||||
* RETURNS: data from EEPROM
|
||||
@@ -463,7 +466,7 @@ u_short get_e( struct ep_softc *sc, int offset )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* Driver interrupt handler. This routine is called by the RTEMS kernel when this
|
||||
* interrupt is raised.
|
||||
@@ -477,14 +480,14 @@ static rtems_isr ap_interrupt_handler( rtems_vector_number v )
|
||||
|
||||
/* de-activate any pending interrrupt, and sent and event to interrupt task
|
||||
* to process all events required by this interrupt.
|
||||
*/
|
||||
*/
|
||||
outw( BASE + EP_COMMAND, SET_INTR_MASK ); /* disable all Ints */
|
||||
rtems_event_send( sc->rxDaemonTid, INTERRUPT_EVENT );
|
||||
rtems_event_send( sc->rxDaemonTid, INTERRUPT_EVENT );
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* RETURNS:
|
||||
@@ -496,7 +499,7 @@ static void nopOn(const rtems_irq_connect_data* notUsed)
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* RETURNS:
|
||||
@@ -509,7 +512,7 @@ static int _3c509_IsOn(const rtems_irq_connect_data* irq)
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* Initializes the ethernet hardware.
|
||||
*
|
||||
@@ -521,15 +524,15 @@ static void _3c509_initialize_hardware (struct ep_softc *sc)
|
||||
rtems_status_code st;
|
||||
|
||||
epinit( sc );
|
||||
|
||||
|
||||
/*
|
||||
* Set up interrupts
|
||||
* Set up interrupts
|
||||
*/
|
||||
sc->irqInfo.hdl = ( rtems_irq_hdl )ap_interrupt_handler;
|
||||
sc->irqInfo.on = nopOn;
|
||||
sc->irqInfo.off = nopOn;
|
||||
sc->irqInfo.isOn = _3c509_IsOn;
|
||||
|
||||
|
||||
printf ("3c509: IRQ with Kernel: %d\n", sc->irqInfo.name );
|
||||
st = BSP_install_rtems_irq_handler( &sc->irqInfo );
|
||||
if( !st )
|
||||
@@ -539,7 +542,7 @@ static void _3c509_initialize_hardware (struct ep_softc *sc)
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Driver interrupt daemon.
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -561,13 +564,13 @@ static void _3c509_rxDaemon (void *arg)
|
||||
/* printk( "R+" ); */
|
||||
ep_intr( dp );
|
||||
epstart( &dp->arpcom.ac_if );
|
||||
}
|
||||
}
|
||||
printf ("3C509: RX Daemon is finishing.\n");
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Driver transmit daemon
|
||||
*
|
||||
* RETURNS:
|
||||
@@ -578,7 +581,7 @@ static void _3c509_txDaemon (void *arg)
|
||||
struct ep_softc *sc = (struct ep_softc *)&ep_softc[0];
|
||||
struct ifnet *ifp = &sc->arpcom.ac_if;
|
||||
rtems_event_set events;
|
||||
|
||||
|
||||
printf ("3C509: TX Daemon is starting.\n");
|
||||
for( ;; )
|
||||
{
|
||||
@@ -586,9 +589,9 @@ static void _3c509_txDaemon (void *arg)
|
||||
* Wait for packet
|
||||
*/
|
||||
/* printk( "T-\n" ); */
|
||||
rtems_bsdnet_event_receive( START_TRANSMIT_EVENT,
|
||||
RTEMS_EVENT_ANY | RTEMS_WAIT,
|
||||
RTEMS_NO_TIMEOUT,
|
||||
rtems_bsdnet_event_receive( START_TRANSMIT_EVENT,
|
||||
RTEMS_EVENT_ANY | RTEMS_WAIT,
|
||||
RTEMS_NO_TIMEOUT,
|
||||
&events );
|
||||
/* printk( "T+\n" ); */
|
||||
epstart( ifp );
|
||||
@@ -600,7 +603,7 @@ static void _3c509_txDaemon (void *arg)
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Activates the trabsmitter task...
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -615,7 +618,7 @@ static void _3c509_start (struct ifnet *ifp)
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Initialize and start the device
|
||||
*
|
||||
* RETURNS:
|
||||
@@ -628,11 +631,11 @@ static void _3c509_init (void *arg)
|
||||
|
||||
printf ("3C509: Initialization called.\n");
|
||||
if (sc->txDaemonTid == 0) {
|
||||
|
||||
|
||||
/*
|
||||
* Set up WD hardware
|
||||
*/
|
||||
_3c509_initialize_hardware (sc);
|
||||
_3c509_initialize_hardware (sc);
|
||||
printf ("3C509: starting network driver tasks..\n");
|
||||
/*
|
||||
* Start driver tasks
|
||||
@@ -648,7 +651,7 @@ static void _3c509_init (void *arg)
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Stop the device
|
||||
*
|
||||
* RETURNS:
|
||||
@@ -679,7 +682,7 @@ static void _3c509_stop (struct ep_softc *sc)
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Show interface statistics
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -697,10 +700,10 @@ static void _3c509_stats (struct ep_softc *sc)
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Driver ioctl handler
|
||||
*
|
||||
* RETURNS:
|
||||
* RETURNS:
|
||||
*
|
||||
**********************************************************************************/
|
||||
static int _3c509_ioctl (struct ifnet *ifp, int command, caddr_t data)
|
||||
@@ -738,7 +741,7 @@ static int _3c509_ioctl (struct ifnet *ifp, int command, caddr_t data)
|
||||
case SIO_RTEMS_SHOW_STATS:
|
||||
_3c509_stats( sc );
|
||||
break;
|
||||
|
||||
|
||||
/*
|
||||
* FIXME: All sorts of multicast commands need to be added here!
|
||||
*/
|
||||
@@ -750,7 +753,7 @@ static int _3c509_ioctl (struct ifnet *ifp, int command, caddr_t data)
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* Attaches this network driver to the system. This function is called by the network
|
||||
* interface during the initialization of the system.
|
||||
@@ -784,7 +787,7 @@ int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *config )
|
||||
if (ifp->if_softc == NULL)
|
||||
break;
|
||||
}
|
||||
if (i >= NWDDRIVER)
|
||||
if (i >= NWDDRIVER)
|
||||
{
|
||||
printf ("Too many 3C509 drivers.\n");
|
||||
return 0;
|
||||
@@ -793,11 +796,11 @@ int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *config )
|
||||
/*
|
||||
* Process options
|
||||
*/
|
||||
if( config->hardware_address )
|
||||
if( config->hardware_address )
|
||||
{
|
||||
memcpy (sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
/* set it to something ... */
|
||||
memset (sc->arpcom.ac_enaddr, 0x08,ETHER_ADDR_LEN);
|
||||
@@ -856,11 +859,11 @@ int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *config )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* This function looks for a 3COM card 3c5x9 in an isa bus. If a board is found, it
|
||||
* returns a structure describing the caracteristics of the card. It returns zero when
|
||||
* card can not be found.
|
||||
* card can not be found.
|
||||
*
|
||||
* RETURNS: 0 - fail - could not find a card...
|
||||
* <> description of the card.
|
||||
@@ -871,7 +874,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
|
||||
int data, i, j, id_port = ELINK_ID_PORT;
|
||||
int count = 0;
|
||||
|
||||
if(ep_current_tag == (EP_LAST_TAG + 1) )
|
||||
if(ep_current_tag == (EP_LAST_TAG + 1) )
|
||||
{
|
||||
/* Come here just one time */
|
||||
ep_current_tag--;
|
||||
@@ -883,7 +886,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
|
||||
elink_idseq(0xCF);
|
||||
elink_reset();
|
||||
Wait_X_ms( 10 ); /* RPS: assuming delay in miliseconds */
|
||||
for (i = 0; i < EP_MAX_BOARDS; i++)
|
||||
for (i = 0; i < EP_MAX_BOARDS; i++)
|
||||
{
|
||||
outb(id_port, 0);
|
||||
outb(id_port, 0);
|
||||
@@ -923,7 +926,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
|
||||
ep_current_tag--;
|
||||
}
|
||||
ep_board[ep_boards].epb_addr = 0;
|
||||
if( count )
|
||||
if( count )
|
||||
{
|
||||
printf("%d 3C5x9 board(s) on ISA found at", count);
|
||||
for (j = 0; ep_board[j].epb_addr; j++)
|
||||
@@ -943,7 +946,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
|
||||
*
|
||||
*/
|
||||
|
||||
if (IS_BASE == -1)
|
||||
if (IS_BASE == -1)
|
||||
{ /* port? */
|
||||
for (i = 0; ep_board[i].epb_addr && ep_board[i].epb_used; i++) ;
|
||||
if (ep_board[i].epb_addr == 0)
|
||||
@@ -952,15 +955,15 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
|
||||
IS_BASE = ep_board[i].epb_addr;
|
||||
ep_board[i].epb_used = 1;
|
||||
return &ep_board[ i ];
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; ep_board[i].epb_addr && ep_board[i].epb_addr != IS_BASE; i++ ) ;
|
||||
if (ep_board[i].epb_used || ep_board[i].epb_addr != IS_BASE)
|
||||
return 0;
|
||||
if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE)
|
||||
if (inw(IS_BASE + EP_W0_EEPROM_COMMAND) & EEPROM_TST_MODE)
|
||||
{
|
||||
printf("ep%d: 3c5x9 at 0x%x in PnP mode. Disable PnP mode!\n",
|
||||
printf("ep%d: 3c5x9 at 0x%x in PnP mode. Disable PnP mode!\n",
|
||||
is->id_unit, IS_BASE );
|
||||
}
|
||||
ep_board[i].epb_used = 1;
|
||||
@@ -971,7 +974,7 @@ static struct ep_board *ep_look_for_board_at( struct isa_device *is )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* This routine checks if there card installed on the machine.
|
||||
*
|
||||
@@ -989,7 +992,7 @@ static int ep_isa_probe( struct isa_device *is )
|
||||
if( (epb = ep_look_for_board_at(is)) == 0 )
|
||||
return (0);
|
||||
|
||||
sc = &ep_softc[ 0 ];
|
||||
sc = &ep_softc[ 0 ];
|
||||
sc->ep_io_addr = epb->epb_addr;
|
||||
sc->epb = epb;
|
||||
|
||||
@@ -1001,10 +1004,10 @@ static int ep_isa_probe( struct isa_device *is )
|
||||
GO_WINDOW(0);
|
||||
k = sc->epb->prod_id;
|
||||
#ifdef PC98
|
||||
if ((k & 0xf0f0) != (PROD_ID & 0xf0f0))
|
||||
if ((k & 0xf0f0) != (PROD_ID & 0xf0f0))
|
||||
{
|
||||
#else
|
||||
if ((k & 0xf0ff) != (PROD_ID & 0xf0ff))
|
||||
if ((k & 0xf0ff) != (PROD_ID & 0xf0ff))
|
||||
{
|
||||
#endif
|
||||
printf("ep_isa_probe: ignoring model %04x\n", k );
|
||||
@@ -1024,7 +1027,7 @@ static int ep_isa_probe( struct isa_device *is )
|
||||
*
|
||||
*/
|
||||
|
||||
if (is->id_irq == 0)
|
||||
if (is->id_irq == 0)
|
||||
{ /* irq? */
|
||||
is->id_irq = ( k == 2 ) ? 9 : k;
|
||||
}
|
||||
@@ -1039,9 +1042,9 @@ static int ep_isa_probe( struct isa_device *is )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* This routine attaches this network driver and the network interface routines.
|
||||
* This routine attaches this network driver and the network interface routines.
|
||||
*
|
||||
* RETURNS: 0 - failed to attach
|
||||
* 1 - success
|
||||
@@ -1055,15 +1058,15 @@ static int ep_isa_attach( struct isa_device *is )
|
||||
|
||||
sc->ep_connectors = 0;
|
||||
config = inw( IS_BASE + EP_W0_CONFIG_CTRL );
|
||||
if (config & IS_AUI)
|
||||
if (config & IS_AUI)
|
||||
{
|
||||
sc->ep_connectors |= AUI;
|
||||
}
|
||||
if (config & IS_BNC)
|
||||
if (config & IS_BNC)
|
||||
{
|
||||
sc->ep_connectors |= BNC;
|
||||
}
|
||||
if (config & IS_UTP)
|
||||
if (config & IS_UTP)
|
||||
{
|
||||
sc->ep_connectors |= UTP;
|
||||
}
|
||||
@@ -1082,7 +1085,7 @@ static int ep_isa_attach( struct isa_device *is )
|
||||
GO_WINDOW( 0 );
|
||||
SET_IRQ( BASE, irq );
|
||||
|
||||
printf( "3C509: I/O=0x%x, IRQ=%d, CONNECTOR=%s, ",
|
||||
printf( "3C509: I/O=0x%x, IRQ=%d, CONNECTOR=%s, ",
|
||||
sc->ep_io_addr, sc->irqInfo.name,ep_conn_type[ sc->ep_connector ] );
|
||||
|
||||
ep_attach( sc );
|
||||
@@ -1090,7 +1093,7 @@ static int ep_isa_attach( struct isa_device *is )
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Completes the initialization/attachement of the driver.
|
||||
*
|
||||
* RETURNS: 0 - ok.
|
||||
@@ -1100,21 +1103,21 @@ static int ep_attach( struct ep_softc *sc )
|
||||
{
|
||||
u_short *p;
|
||||
int i;
|
||||
|
||||
|
||||
/*
|
||||
* Setup the station address
|
||||
*/
|
||||
p = (u_short *) &sc->arpcom.ac_enaddr;
|
||||
GO_WINDOW(2);
|
||||
printf("ADDRESS=" );
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
p[i] = htons( sc->epb->eth_addr[i] );
|
||||
outw( BASE + EP_W2_ADDR_0 + (i * 2), ntohs( p[i] ) );
|
||||
printf("%04x ", (u_short)ntohs( p[i] ) );
|
||||
}
|
||||
printf("\n" );
|
||||
|
||||
|
||||
sc->rx_no_first = sc->rx_no_mbuf =
|
||||
sc->rx_bpf_disc = sc->rx_overrunf = sc->rx_overrunl =
|
||||
sc->tx_underrun = 0;
|
||||
@@ -1126,7 +1129,7 @@ static int ep_attach( struct ep_softc *sc )
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* Initializes the card.
|
||||
* The order in here seems important. Otherwise we may not receive interrupts. ?!
|
||||
@@ -1199,19 +1202,19 @@ static void epinit( struct ep_softc *sc )
|
||||
*/
|
||||
|
||||
/* Set the xcvr. */
|
||||
if (ifp->if_flags & IFF_LINK0 && sc->ep_connectors & AUI)
|
||||
if (ifp->if_flags & IFF_LINK0 && sc->ep_connectors & AUI)
|
||||
{
|
||||
i = ACF_CONNECTOR_AUI;
|
||||
}
|
||||
else if (ifp->if_flags & IFF_LINK1 && sc->ep_connectors & BNC)
|
||||
}
|
||||
else if (ifp->if_flags & IFF_LINK1 && sc->ep_connectors & BNC)
|
||||
{
|
||||
i = ACF_CONNECTOR_BNC;
|
||||
}
|
||||
else if (ifp->if_flags & IFF_LINK2 && sc->ep_connectors & UTP)
|
||||
}
|
||||
else if (ifp->if_flags & IFF_LINK2 && sc->ep_connectors & UTP)
|
||||
{
|
||||
i = ACF_CONNECTOR_UTP;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
i = sc->ep_connector;
|
||||
}
|
||||
@@ -1219,10 +1222,10 @@ static void epinit( struct ep_softc *sc )
|
||||
j = inw(BASE + EP_W0_ADDRESS_CFG) & 0x3fff;
|
||||
outw(BASE + EP_W0_ADDRESS_CFG, j | (i << ACF_CONNECTOR_BITS));
|
||||
|
||||
switch(i)
|
||||
switch(i)
|
||||
{
|
||||
case ACF_CONNECTOR_UTP:
|
||||
if (sc->ep_connectors & UTP)
|
||||
if (sc->ep_connectors & UTP)
|
||||
{
|
||||
GO_WINDOW(4);
|
||||
outw(BASE + EP_W4_MEDIA_TYPE, ENABLE_UTP);
|
||||
@@ -1230,7 +1233,7 @@ static void epinit( struct ep_softc *sc )
|
||||
break;
|
||||
|
||||
case ACF_CONNECTOR_BNC:
|
||||
if (sc->ep_connectors & BNC)
|
||||
if (sc->ep_connectors & BNC)
|
||||
{
|
||||
outw(BASE + EP_COMMAND, START_TRANSCEIVER);
|
||||
Wait_X_ms( 1 );
|
||||
@@ -1258,7 +1261,7 @@ static void epinit( struct ep_softc *sc )
|
||||
sc->tx_underrun = 0;
|
||||
|
||||
ep_fset(F_RX_FIRST);
|
||||
if( sc->top )
|
||||
if( sc->top )
|
||||
{
|
||||
m_freem( sc->top );
|
||||
sc->top = sc->mcur = 0;
|
||||
@@ -1279,7 +1282,7 @@ static void epinit( struct ep_softc *sc )
|
||||
static const char padmap[] = {0, 3, 2, 1};
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Routine to transmit frames to the card.
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -1293,14 +1296,14 @@ static void epstart( struct ifnet *ifp )
|
||||
struct mbuf *top;
|
||||
int pad;
|
||||
|
||||
while( inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS )
|
||||
while( inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS )
|
||||
;
|
||||
startagain:
|
||||
/* printk( "S-" ); */
|
||||
|
||||
/* Sneak a peek at the next packet */
|
||||
m = ifp->if_snd.ifq_head;
|
||||
if (m == 0)
|
||||
if (m == 0)
|
||||
{
|
||||
ifp->if_flags &= ~IFF_OACTIVE;
|
||||
return;
|
||||
@@ -1316,7 +1319,7 @@ startagain:
|
||||
* but we drop packets that are too large. Perhaps we should truncate
|
||||
* them instead?
|
||||
*/
|
||||
if( len + pad > ETHER_MAX_LEN )
|
||||
if( len + pad > ETHER_MAX_LEN )
|
||||
{
|
||||
/* packet is obviously too large: toss it */
|
||||
++ifp->if_oerrors;
|
||||
@@ -1324,30 +1327,30 @@ startagain:
|
||||
m_freem( m );
|
||||
goto readcheck;
|
||||
}
|
||||
if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
|
||||
if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
|
||||
{
|
||||
/* no room in FIFO */
|
||||
outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | (len + pad + 4));
|
||||
/* make sure */
|
||||
if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
|
||||
if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4)
|
||||
{
|
||||
ifp->if_flags |= IFF_OACTIVE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
IF_DEQUEUE( &ifp->if_snd, m );
|
||||
outw(BASE + EP_W1_TX_PIO_WR_1, len);
|
||||
outw(BASE + EP_W1_TX_PIO_WR_1, len);
|
||||
outw(BASE + EP_W1_TX_PIO_WR_1, 0x0); /* Second dword meaningless */
|
||||
|
||||
for (top = m; m != 0; m = m->m_next)
|
||||
{
|
||||
if( ep_ftst(F_ACCESS_32_BITS ) )
|
||||
if( ep_ftst(F_ACCESS_32_BITS ) )
|
||||
{
|
||||
outsl( BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 4 );
|
||||
if( m->m_len & 3 )
|
||||
outsb(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t) + (m->m_len & (~3)), m->m_len & 3 );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
outsw( BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 2 );
|
||||
if( m->m_len & 1 )
|
||||
@@ -1368,13 +1371,13 @@ startagain:
|
||||
* fifo.
|
||||
*/
|
||||
readcheck:
|
||||
if( inw(BASE + EP_W1_RX_STATUS) & RX_BYTES_MASK )
|
||||
if( inw(BASE + EP_W1_RX_STATUS) & RX_BYTES_MASK )
|
||||
{
|
||||
/*
|
||||
* we check if we have packets left, in that case we prepare to come
|
||||
* back later
|
||||
*/
|
||||
if( ifp->if_snd.ifq_head )
|
||||
if( ifp->if_snd.ifq_head )
|
||||
{
|
||||
outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | 8);
|
||||
}
|
||||
@@ -1386,7 +1389,7 @@ readcheck:
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Routine to read frames from the card.
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -1407,10 +1410,10 @@ static void epread( register struct ep_softc *sc )
|
||||
|
||||
read_again:
|
||||
|
||||
if (status & ERR_RX)
|
||||
if (status & ERR_RX)
|
||||
{
|
||||
++ifp->if_ierrors;
|
||||
if( status & ERR_RX_OVERRUN )
|
||||
if( status & ERR_RX_OVERRUN )
|
||||
{
|
||||
/*
|
||||
* we can think the rx latency is actually greather than we
|
||||
@@ -1426,7 +1429,7 @@ read_again:
|
||||
}
|
||||
rx_fifo = rx_fifo2 = status & RX_BYTES_MASK;
|
||||
|
||||
if( ep_ftst( F_RX_FIRST ) )
|
||||
if( ep_ftst( F_RX_FIRST ) )
|
||||
{
|
||||
MGETHDR( m, M_DONTWAIT, MT_DATA );
|
||||
if( !m )
|
||||
@@ -1443,8 +1446,8 @@ read_again:
|
||||
top->m_len = sizeof(struct ether_header);
|
||||
rx_fifo -= sizeof(struct ether_header);
|
||||
sc->cur_len = rx_fifo2;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
/* come here if we didn't have a complete packet last time */
|
||||
top = sc->top;
|
||||
@@ -1453,10 +1456,10 @@ read_again:
|
||||
}
|
||||
|
||||
/* Reads what is left in the RX FIFO */
|
||||
while (rx_fifo > 0)
|
||||
while (rx_fifo > 0)
|
||||
{
|
||||
lenthisone = min( rx_fifo, M_TRAILINGSPACE(m) );
|
||||
if( lenthisone == 0 )
|
||||
if( lenthisone == 0 )
|
||||
{ /* no room in this one */
|
||||
mcur = m;
|
||||
MGET(m, M_WAIT, MT_DATA);
|
||||
@@ -1468,15 +1471,15 @@ read_again:
|
||||
mcur->m_next = m;
|
||||
lenthisone = min(rx_fifo, M_TRAILINGSPACE(m));
|
||||
}
|
||||
if( ep_ftst( F_ACCESS_32_BITS ) )
|
||||
if( ep_ftst( F_ACCESS_32_BITS ) )
|
||||
{ /* default for EISA configured cards*/
|
||||
insl( BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len, lenthisone / 4);
|
||||
m->m_len += (lenthisone & ~3);
|
||||
if (lenthisone & 3)
|
||||
insb(BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len, lenthisone & 3);
|
||||
m->m_len += (lenthisone & 3);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
insw(BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len, lenthisone / 2);
|
||||
m->m_len += lenthisone;
|
||||
@@ -1486,12 +1489,12 @@ read_again:
|
||||
rx_fifo -= lenthisone;
|
||||
}
|
||||
|
||||
if( status & ERR_RX_INCOMPLETE)
|
||||
if( status & ERR_RX_INCOMPLETE)
|
||||
{ /* we haven't received the complete packet */
|
||||
sc->mcur = m;
|
||||
sc->rx_no_first++; /* to know how often we come here */
|
||||
ep_frst( F_RX_FIRST );
|
||||
if( !((status = inw(BASE + EP_W1_RX_STATUS)) & ERR_RX_INCOMPLETE) )
|
||||
if( !((status = inw(BASE + EP_W1_RX_STATUS)) & ERR_RX_INCOMPLETE) )
|
||||
{
|
||||
/* we see if by now, the packet has completly arrived */
|
||||
goto read_again;
|
||||
@@ -1516,7 +1519,7 @@ read_again:
|
||||
|
||||
out:
|
||||
outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK);
|
||||
if (sc->top)
|
||||
if (sc->top)
|
||||
{
|
||||
m_freem(sc->top);
|
||||
sc->top = 0;
|
||||
@@ -1530,10 +1533,10 @@ out:
|
||||
|
||||
|
||||
/**********************************************************************************
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* This routine handles interrupts. It is called from the "RX" task whenever
|
||||
* the ISR post an event to the task.
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* This routine handles interrupts. It is called from the "RX" task whenever
|
||||
* the ISR post an event to the task.
|
||||
* This is basically the "isr" from the FreeBSD driver.
|
||||
*
|
||||
* RETURNS: nothing.
|
||||
@@ -1548,17 +1551,17 @@ static void ep_intr( struct ep_softc *sc )
|
||||
rescan:
|
||||
|
||||
/* printk( "I-" ); */
|
||||
while( ( status = inw(BASE + EP_STATUS)) & S_5_INTS )
|
||||
while( ( status = inw(BASE + EP_STATUS)) & S_5_INTS )
|
||||
{
|
||||
/* first acknowledge all interrupt sources */
|
||||
outw( BASE + EP_COMMAND, ACK_INTR | ( status & S_MASK ) );
|
||||
|
||||
if( status & ( S_RX_COMPLETE | S_RX_EARLY ) )
|
||||
if( status & ( S_RX_COMPLETE | S_RX_EARLY ) )
|
||||
{
|
||||
epread( sc );
|
||||
continue;
|
||||
}
|
||||
if (status & S_TX_AVAIL)
|
||||
if (status & S_TX_AVAIL)
|
||||
{
|
||||
/* we need ACK */
|
||||
ifp->if_timer = 0;
|
||||
@@ -1567,7 +1570,7 @@ rescan:
|
||||
inw(BASE + EP_W1_FREE_TX);
|
||||
epstart(ifp);
|
||||
}
|
||||
if (status & S_CARD_FAILURE)
|
||||
if (status & S_CARD_FAILURE)
|
||||
{
|
||||
ifp->if_timer = 0;
|
||||
printf("\nep%d:\n\tStatus: %x\n", sc->unit, status);
|
||||
@@ -1584,7 +1587,7 @@ rescan:
|
||||
epinit(sc);
|
||||
return;
|
||||
}
|
||||
if (status & S_TX_COMPLETE)
|
||||
if (status & S_TX_COMPLETE)
|
||||
{
|
||||
ifp->if_timer = 0;
|
||||
/* we need ACK. we do it at the end */
|
||||
@@ -1592,18 +1595,18 @@ rescan:
|
||||
* We need to read TX_STATUS until we get a 0 status in order to
|
||||
* turn off the interrupt flag.
|
||||
*/
|
||||
while ((status = inb(BASE + EP_W1_TX_STATUS)) & TXS_COMPLETE)
|
||||
while ((status = inb(BASE + EP_W1_TX_STATUS)) & TXS_COMPLETE)
|
||||
{
|
||||
if (status & TXS_SUCCES_INTR_REQ)
|
||||
;
|
||||
else if( status & (TXS_UNDERRUN | TXS_JABBER | TXS_MAX_COLLISION ) )
|
||||
else if( status & (TXS_UNDERRUN | TXS_JABBER | TXS_MAX_COLLISION ) )
|
||||
{
|
||||
outw(BASE + EP_COMMAND, TX_RESET);
|
||||
if (status & TXS_UNDERRUN)
|
||||
if (status & TXS_UNDERRUN)
|
||||
{
|
||||
sc->tx_underrun++;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( status & TXS_JABBER )
|
||||
;
|
||||
@@ -1616,7 +1619,7 @@ rescan:
|
||||
* To have a tx_avail_int but giving the chance to the
|
||||
* Reception
|
||||
*/
|
||||
if( ifp->if_snd.ifq_head )
|
||||
if( ifp->if_snd.ifq_head )
|
||||
{
|
||||
outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | 8);
|
||||
}
|
||||
@@ -1632,7 +1635,7 @@ rescan:
|
||||
outw(BASE + EP_COMMAND, C_INTR_LATCH); /* ACK int Latch */
|
||||
if( (status = inw(BASE + EP_STATUS) ) & S_5_INTS )
|
||||
goto rescan;
|
||||
|
||||
|
||||
/* re-enable Ints */
|
||||
outw( BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS );
|
||||
/* printk( "I+" ); */
|
||||
|
||||
@@ -64,7 +64,7 @@ rtems_device_minor_number rtems_clock_minor;
|
||||
| Description: Interrupt Service Routine for clock (0h) interruption.
|
||||
| Global Variables: Clock_driver_ticks, Clock_isrs.
|
||||
| Arguments: vector - standard RTEMS argument - see documentation.
|
||||
| Returns: standard return value - see documentation.
|
||||
| Returns: standard return value - see documentation.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void clockIsr()
|
||||
{
|
||||
@@ -99,7 +99,7 @@ static void clockIsr()
|
||||
| not really necessary, since there will be a reset at exit.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void clockOff(const rtems_irq_connect_data* unused)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ void clockOff(const rtems_irq_connect_data* unused)
|
||||
| Description: Initialize and install clock interrupt handler.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static void clockOn(const rtems_irq_connect_data* unused)
|
||||
{
|
||||
@@ -162,9 +162,9 @@ static void clockOn(const rtems_irq_connect_data* unused)
|
||||
outport_byte(TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN);
|
||||
outport_byte(TIMER_CNTR0, count >> 0 & 0xff);
|
||||
outport_byte(TIMER_CNTR0, count >> 8 & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int clockIsOn(const rtems_irq_connect_data* unused)
|
||||
{
|
||||
@@ -176,8 +176,8 @@ static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
|
||||
clockOn,
|
||||
clockOff,
|
||||
clockIsOn};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Clock device driver INITIALIZE entry point.
|
||||
@@ -195,14 +195,14 @@ Clock_initialize(rtems_device_major_number major,
|
||||
rtems_fatal_error_occurred(1);
|
||||
}
|
||||
/* make major/minor avail to others such as shared memory driver */
|
||||
|
||||
|
||||
rtems_clock_major = major;
|
||||
rtems_clock_minor = minor;
|
||||
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
} /* Clock_initialize */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Console device driver CONTROL entry point
|
||||
+--------------------------------------------------------------------------*/
|
||||
@@ -214,12 +214,12 @@ Clock_control(rtems_device_major_number major,
|
||||
if (pargp != NULL)
|
||||
{
|
||||
rtems_libio_ioctl_args_t *args = pargp;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| This is hokey, but until we get a defined interface to do this, it will
|
||||
| just be this simple...
|
||||
+-------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
|
||||
clockIsr();
|
||||
else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
|
||||
|
||||
@@ -79,9 +79,9 @@
|
||||
| Description: Convert 2 digit number to its BCD representation.
|
||||
| Global Variables: None.
|
||||
| Arguments: i - Number to convert.
|
||||
| Returns: BCD representation of number.
|
||||
| Returns: BCD representation of number.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static inline uint8_t
|
||||
static inline uint8_t
|
||||
bcd(uint8_t i)
|
||||
{
|
||||
return ((i / 16) * 10 + (i % 16));
|
||||
@@ -99,9 +99,9 @@ bcd(uint8_t i)
|
||||
| Description: Convert years to seconds (since 1970).
|
||||
| Global Variables: None.
|
||||
| Arguments: y - year to convert (1970 <= y <= 2100).
|
||||
| Returns: number of seconds since 1970.
|
||||
| Returns: number of seconds since 1970.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static inline uint32_t
|
||||
static inline uint32_t
|
||||
ytos(uint16_t y)
|
||||
{ /* v NUM LEAP YEARS v */
|
||||
return ((y - 1970) * SECS_PER_REG_YEAR + (y - 1970 + 1) / 4 * SECS_PER_DAY);
|
||||
@@ -113,9 +113,9 @@ ytos(uint16_t y)
|
||||
| Description: Convert months to seconds since January.
|
||||
| Global Variables: None.
|
||||
| Arguments: m - month to convert, leap - is this a month of a leap year.
|
||||
| Returns: number of seconds since January.
|
||||
| Returns: number of seconds since January.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static inline uint32_t
|
||||
static inline uint32_t
|
||||
mtos(uint8_t m, rtems_boolean leap)
|
||||
{
|
||||
static uint16_t daysMonth[] = { 0, 0, 31, 59, 90, 120, 151, 181,
|
||||
@@ -132,9 +132,9 @@ mtos(uint8_t m, rtems_boolean leap)
|
||||
| Description: Perform action on RTC and return its result.
|
||||
| Global Variables: None.
|
||||
| Arguments: what - what to write to RTC port (what to do).
|
||||
| Returns: result received from RTC port after action performed.
|
||||
| Returns: result received from RTC port after action performed.
|
||||
+--------------------------------------------------------------------------*/
|
||||
static inline uint8_t
|
||||
static inline uint8_t
|
||||
rtcin(uint8_t what)
|
||||
{
|
||||
uint8_t r;
|
||||
@@ -153,7 +153,7 @@ rtcin(uint8_t what)
|
||||
| Description: Initialize real-time clock (RTC).
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void
|
||||
init_rtc(void)
|
||||
@@ -181,7 +181,7 @@ init_rtc(void)
|
||||
| Description: Read present time from RTC and return it.
|
||||
| Global Variables: None.
|
||||
| Arguments: tod - to return present time in 'rtems_time_of_day' format.
|
||||
| Returns: number of seconds from 1970/01/01 corresponding to 'tod'.
|
||||
| Returns: number of seconds from 1970/01/01 corresponding to 'tod'.
|
||||
+--------------------------------------------------------------------------*/
|
||||
long int
|
||||
rtc_read(rtems_time_of_day *tod)
|
||||
@@ -201,7 +201,7 @@ rtc_read(rtems_time_of_day *tod)
|
||||
sa = rtcin(RTC_STATUSA);
|
||||
|
||||
tod->year = bcd(rtcin(RTC_YEAR)) + 1900; /* year */
|
||||
if (tod->year < 1970) tod->year += 100;
|
||||
if (tod->year < 1970) tod->year += 100;
|
||||
tod->month = bcd(rtcin(RTC_MONTH)); /* month */
|
||||
tod->day = bcd(rtcin(RTC_DAY)); /* day */
|
||||
(void) bcd(rtcin(RTC_WDAY)); /* weekday */
|
||||
|
||||
@@ -96,7 +96,7 @@ isr_on(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
isr_off(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
@@ -151,9 +151,9 @@ void __assert (const char *file, int line, const char *msg)
|
||||
{
|
||||
static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot...";
|
||||
unsigned char ch;
|
||||
|
||||
|
||||
/*
|
||||
* Note we cannot call exit or printf from here,
|
||||
* Note we cannot call exit or printf from here,
|
||||
* assert can fail inside ISR too
|
||||
*/
|
||||
|
||||
@@ -218,13 +218,13 @@ console_initialize(rtems_device_major_number major,
|
||||
{
|
||||
/* Install keyboard interrupt handler */
|
||||
status = BSP_install_rtems_irq_handler(&console_isr_data);
|
||||
|
||||
|
||||
if (!status)
|
||||
{
|
||||
printk("Error installing keyboard interrupt handler!\n");
|
||||
rtems_fatal_error_occurred(status);
|
||||
}
|
||||
|
||||
|
||||
status = rtems_io_register_name("/dev/console", major, 0);
|
||||
if (status != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
@@ -240,14 +240,14 @@ console_initialize(rtems_device_major_number major,
|
||||
*/
|
||||
/* 9600-8-N-1 */
|
||||
BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Set interrupt handler */
|
||||
if(BSPConsolePort == BSP_UART_COM1)
|
||||
{
|
||||
console_isr_data.name = BSP_UART_COM1_IRQ;
|
||||
console_isr_data.hdl = BSP_uart_termios_isr_com1;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -322,7 +322,7 @@ console_open(rtems_device_major_number major,
|
||||
void *arg)
|
||||
{
|
||||
rtems_status_code status;
|
||||
static rtems_termios_callbacks cb =
|
||||
static rtems_termios_callbacks cb =
|
||||
{
|
||||
NULL, /* firstOpen */
|
||||
console_last_close, /* lastClose */
|
||||
@@ -338,7 +338,7 @@ console_open(rtems_device_major_number major,
|
||||
{
|
||||
|
||||
/* Let's set the routines for termios to poll the
|
||||
* Kbd queue for data
|
||||
* Kbd queue for data
|
||||
*/
|
||||
cb.pollRead = kbd_poll_read;
|
||||
cb.outputUsesInterrupts = 0;
|
||||
@@ -371,9 +371,9 @@ console_open(rtems_device_major_number major,
|
||||
/*
|
||||
* Pass data area info down to driver
|
||||
*/
|
||||
BSP_uart_termios_set(BSPConsolePort,
|
||||
BSP_uart_termios_set(BSPConsolePort,
|
||||
((rtems_libio_open_close_args_t *)arg)->iop->data1);
|
||||
|
||||
|
||||
/* Enable interrupts on channel */
|
||||
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
|
||||
|
||||
@@ -391,7 +391,7 @@ console_close(rtems_device_major_number major,
|
||||
return rtems_termios_close (arg);
|
||||
} /* console_close */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Console device driver READ entry point.
|
||||
+--------------------------------------------------------------------------+
|
||||
@@ -404,7 +404,7 @@ console_read(rtems_device_major_number major,
|
||||
{
|
||||
return rtems_termios_read( arg );
|
||||
} /* console_read */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Console device driver WRITE entry point.
|
||||
@@ -424,7 +424,7 @@ console_write(rtems_device_major_number major,
|
||||
{
|
||||
return rtems_termios_write (arg);
|
||||
}
|
||||
|
||||
|
||||
/* write data to VGA */
|
||||
ibmpc_console_write( minor, buffer, maximum );
|
||||
rw_args->bytes_moved = maximum;
|
||||
@@ -433,18 +433,18 @@ console_write(rtems_device_major_number major,
|
||||
|
||||
|
||||
extern int vt_ioctl( unsigned int cmd, unsigned long arg);
|
||||
|
||||
|
||||
/*
|
||||
* Handle ioctl request.
|
||||
*/
|
||||
rtems_device_driver
|
||||
rtems_device_driver
|
||||
console_control(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg
|
||||
)
|
||||
{
|
||||
{
|
||||
rtems_libio_ioctl_args_t *args = arg;
|
||||
switch (args->command)
|
||||
switch (args->command)
|
||||
{
|
||||
default:
|
||||
if( vt_ioctl( args->command, (unsigned long)args->buffer ) != 0 )
|
||||
@@ -469,45 +469,45 @@ conSetAttr(int minor, const struct termios *t)
|
||||
{
|
||||
unsigned long baud, databits, parity, stopbits;
|
||||
|
||||
switch (t->c_cflag & CBAUD)
|
||||
switch (t->c_cflag & CBAUD)
|
||||
{
|
||||
case B50:
|
||||
case B50:
|
||||
baud = 50;
|
||||
break;
|
||||
case B75:
|
||||
baud = 75;
|
||||
case B75:
|
||||
baud = 75;
|
||||
break;
|
||||
case B110:
|
||||
baud = 110;
|
||||
case B110:
|
||||
baud = 110;
|
||||
break;
|
||||
case B134:
|
||||
baud = 134;
|
||||
case B134:
|
||||
baud = 134;
|
||||
break;
|
||||
case B150:
|
||||
baud = 150;
|
||||
case B150:
|
||||
baud = 150;
|
||||
break;
|
||||
case B200:
|
||||
baud = 200;
|
||||
baud = 200;
|
||||
break;
|
||||
case B300:
|
||||
case B300:
|
||||
baud = 300;
|
||||
break;
|
||||
case B600:
|
||||
baud = 600;
|
||||
case B600:
|
||||
baud = 600;
|
||||
break;
|
||||
case B1200:
|
||||
case B1200:
|
||||
baud = 1200;
|
||||
break;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
break;
|
||||
case B2400:
|
||||
case B2400:
|
||||
baud = 2400;
|
||||
break;
|
||||
case B4800:
|
||||
case B4800:
|
||||
baud = 4800;
|
||||
break;
|
||||
case B9600:
|
||||
case B9600:
|
||||
baud = 9600;
|
||||
break;
|
||||
case B19200:
|
||||
@@ -516,7 +516,7 @@ conSetAttr(int minor, const struct termios *t)
|
||||
case B38400:
|
||||
baud = 38400;
|
||||
break;
|
||||
case B57600:
|
||||
case B57600:
|
||||
baud = 57600;
|
||||
break;
|
||||
case B115200:
|
||||
@@ -542,7 +542,7 @@ conSetAttr(int minor, const struct termios *t)
|
||||
/* No parity */
|
||||
parity = 0;
|
||||
}
|
||||
|
||||
|
||||
switch (t->c_cflag & CSIZE) {
|
||||
case CS5: databits = CHR_5_BITS; break;
|
||||
case CS6: databits = CHR_6_BITS; break;
|
||||
@@ -569,7 +569,7 @@ conSetAttr(int minor, const struct termios *t)
|
||||
* BSP initialization
|
||||
*/
|
||||
|
||||
BSP_output_char_function_type BSP_output_char =
|
||||
BSP_output_char_function_type BSP_output_char =
|
||||
(BSP_output_char_function_type) _IBMPC_outch;
|
||||
|
||||
BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
|
||||
|
||||
@@ -154,34 +154,34 @@ unsigned int keymap_count = 7;
|
||||
*/
|
||||
|
||||
char func_buf[] = {
|
||||
'\033', '[', '[', 'A', 0,
|
||||
'\033', '[', '[', 'B', 0,
|
||||
'\033', '[', '[', 'C', 0,
|
||||
'\033', '[', '[', 'D', 0,
|
||||
'\033', '[', '[', 'E', 0,
|
||||
'\033', '[', '1', '7', '~', 0,
|
||||
'\033', '[', '1', '8', '~', 0,
|
||||
'\033', '[', '1', '9', '~', 0,
|
||||
'\033', '[', '2', '0', '~', 0,
|
||||
'\033', '[', '2', '1', '~', 0,
|
||||
'\033', '[', '2', '3', '~', 0,
|
||||
'\033', '[', '2', '4', '~', 0,
|
||||
'\033', '[', '2', '5', '~', 0,
|
||||
'\033', '[', '2', '6', '~', 0,
|
||||
'\033', '[', '2', '8', '~', 0,
|
||||
'\033', '[', '2', '9', '~', 0,
|
||||
'\033', '[', '3', '1', '~', 0,
|
||||
'\033', '[', '3', '2', '~', 0,
|
||||
'\033', '[', '3', '3', '~', 0,
|
||||
'\033', '[', '3', '4', '~', 0,
|
||||
'\033', '[', '1', '~', 0,
|
||||
'\033', '[', '2', '~', 0,
|
||||
'\033', '[', '3', '~', 0,
|
||||
'\033', '[', '4', '~', 0,
|
||||
'\033', '[', '5', '~', 0,
|
||||
'\033', '[', '6', '~', 0,
|
||||
'\033', '[', 'M', 0,
|
||||
'\033', '[', 'P', 0,
|
||||
'\033', '[', '[', 'A', 0,
|
||||
'\033', '[', '[', 'B', 0,
|
||||
'\033', '[', '[', 'C', 0,
|
||||
'\033', '[', '[', 'D', 0,
|
||||
'\033', '[', '[', 'E', 0,
|
||||
'\033', '[', '1', '7', '~', 0,
|
||||
'\033', '[', '1', '8', '~', 0,
|
||||
'\033', '[', '1', '9', '~', 0,
|
||||
'\033', '[', '2', '0', '~', 0,
|
||||
'\033', '[', '2', '1', '~', 0,
|
||||
'\033', '[', '2', '3', '~', 0,
|
||||
'\033', '[', '2', '4', '~', 0,
|
||||
'\033', '[', '2', '5', '~', 0,
|
||||
'\033', '[', '2', '6', '~', 0,
|
||||
'\033', '[', '2', '8', '~', 0,
|
||||
'\033', '[', '2', '9', '~', 0,
|
||||
'\033', '[', '3', '1', '~', 0,
|
||||
'\033', '[', '3', '2', '~', 0,
|
||||
'\033', '[', '3', '3', '~', 0,
|
||||
'\033', '[', '3', '4', '~', 0,
|
||||
'\033', '[', '1', '~', 0,
|
||||
'\033', '[', '2', '~', 0,
|
||||
'\033', '[', '3', '~', 0,
|
||||
'\033', '[', '4', '~', 0,
|
||||
'\033', '[', '5', '~', 0,
|
||||
'\033', '[', '6', '~', 0,
|
||||
'\033', '[', 'M', 0,
|
||||
'\033', '[', 'P', 0,
|
||||
};
|
||||
|
||||
char *funcbufptr = func_buf;
|
||||
|
||||
@@ -3,14 +3,47 @@
|
||||
// $Header$
|
||||
//
|
||||
// Copyright (c) 2000 - Rosimildo da Silva ( rdasilva@connecttel.com )
|
||||
//
|
||||
//
|
||||
// MODULE DESCRIPTION:
|
||||
// This module implements the micro FB driver for "Bare VGA". It uses the
|
||||
// This module implements the micro FB driver for "Bare VGA". It uses the
|
||||
// routines for "bare hardware" that comes with MicroWindows.
|
||||
//
|
||||
// MODIFICATION/HISTORY:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.1 2000/08/30 08:15:30 joel
|
||||
// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
|
||||
//
|
||||
// * Major rework of the "/dev/console" driver.
|
||||
// * Added termios support for stdin ( keyboard ).
|
||||
// * Added ioctls() to support modes similar to Linux( XLATE,
|
||||
// RAW, MEDIUMRAW ).
|
||||
// * Added Keyboard mapping and handling of the keyboard's leds.
|
||||
// * Added Micro FrameBuffer driver ( "/dev/fb0" ) for bare VGA
|
||||
// controller ( 16 colors ).
|
||||
// * Added PS/2 and Serial mouse support for PC386 BSP.
|
||||
// * console/defkeymap.c: New file.
|
||||
// * console/fb_vga.c: New file.
|
||||
// * console/fb_vga.h: New file.
|
||||
// * console/i386kbd.h: New file.
|
||||
// * console/kd.h: New file.
|
||||
// * console/keyboard.c: New file.
|
||||
// * console/keyboard.h: New file.
|
||||
// * console/mouse_parser.c: New file.
|
||||
// * console/mouse_parser.h: New file.
|
||||
// * console/pc_keyb.c: New file.
|
||||
// * console/ps2_drv.h: New file.
|
||||
// * console/ps2_mouse.c: New file.
|
||||
// * console/ps2_mouse.h: New file.
|
||||
// * console/serial_mouse.c: New file.
|
||||
// * console/serial_mouse.h: New file.
|
||||
// * console/vgainit.c: New file.
|
||||
// * console/vt.c: New file.
|
||||
// * console/Makefile.am: Reflect new files.
|
||||
// * console/console.c, console/inch.c, console/outch.c: Console
|
||||
// functionality modifications.
|
||||
// * startup/Makefile.am: Pick up tty_drv.c and gdb_glue.c
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
@@ -28,14 +61,14 @@
|
||||
|
||||
/* these routines are defined in the microwindows code. This
|
||||
driver is here more as an example of how to implement and
|
||||
use the micro FB interface
|
||||
use the micro FB interface
|
||||
*/
|
||||
extern void ega_hwinit( void );
|
||||
extern void ega_hwterm( void );
|
||||
|
||||
|
||||
/* screen information for the VGA driver */
|
||||
static struct fb_screeninfo fb_info =
|
||||
static struct fb_screeninfo fb_info =
|
||||
{
|
||||
640, 480, /* screen size x, y */
|
||||
4, /* bits per pixel */
|
||||
@@ -109,7 +142,7 @@ fbvga_close(rtems_device_major_number major,
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* fbvga device driver READ entry point.
|
||||
* Read characters from the PS/2 mouse.
|
||||
@@ -124,7 +157,7 @@ fbvga_read( rtems_device_major_number major,
|
||||
rw_args->bytes_moved = 0;
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* fbvga device driver WRITE entry point.
|
||||
@@ -187,15 +220,15 @@ static int set_palette( struct fb_cmap *cmap )
|
||||
* IOCTL entry point -- This method is called to carry
|
||||
* all services of this interface.
|
||||
*/
|
||||
rtems_device_driver
|
||||
rtems_device_driver
|
||||
fbvga_control( rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg
|
||||
)
|
||||
{
|
||||
{
|
||||
rtems_libio_ioctl_args_t *args = arg;
|
||||
printk( "FBVGA ioctl called, cmd=%x\n", args->command );
|
||||
switch( args->command )
|
||||
switch( args->command )
|
||||
{
|
||||
case FB_SCREENINFO:
|
||||
args->ioctl_return = get_screen_info( args->buffer );
|
||||
@@ -208,7 +241,7 @@ fbvga_control( rtems_device_major_number major,
|
||||
break;
|
||||
|
||||
/* this function would execute one of the routines of the
|
||||
* interface based on the operation requested
|
||||
* interface based on the operation requested
|
||||
*/
|
||||
case FB_EXEC_FUNCTION:
|
||||
{
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* $Header$
|
||||
*
|
||||
* Copyright (c) 2000 -- Rosimildo da Silva.
|
||||
*
|
||||
* MODULE DESCRIPTION:
|
||||
*
|
||||
* MODULE DESCRIPTION:
|
||||
* Prototype routines for the fbvga driver.
|
||||
*
|
||||
* by: Rosimildo da Silva:
|
||||
@@ -16,6 +16,9 @@
|
||||
* MODIFICATION/HISTORY:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 2004/04/15 13:26:12 ralf
|
||||
* Remove stray white spaces.
|
||||
*
|
||||
* Revision 1.1 2000/08/30 08:15:30 joel
|
||||
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
|
||||
*
|
||||
|
||||
@@ -183,6 +183,6 @@ extern unsigned char aux_device_present;
|
||||
but then the read function would need
|
||||
a lock etc - ick */
|
||||
|
||||
#define mark_bh(x)
|
||||
#define mark_bh(x)
|
||||
|
||||
#endif /* _I386_KEYBOARD_H */
|
||||
|
||||
@@ -64,7 +64,7 @@ static char shift_map[] =
|
||||
'*',0x80,' ',0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
|
||||
0x80,0x80,0x80,0x80,'7','8','9',0x80,'4','5','6',0x80,
|
||||
'1','2','3','0',177
|
||||
}; /* Keyboard scancode -> character map with SHIFT key modifier. */
|
||||
}; /* Keyboard scancode -> character map with SHIFT key modifier. */
|
||||
|
||||
|
||||
static unsigned short kbd_buffer[KBD_BUF_SIZE];
|
||||
@@ -175,7 +175,7 @@ _IBMPC_scankey(char *outChar)
|
||||
break;
|
||||
|
||||
case 0x53:
|
||||
if (ctrl_pressed && alt_pressed)
|
||||
if (ctrl_pressed && alt_pressed)
|
||||
rtemsReboot(); /* ctrl+alt+del -> reboot */
|
||||
break;
|
||||
|
||||
@@ -256,11 +256,11 @@ _IBMPC_inch(void)
|
||||
return c;
|
||||
} /* _IBMPC_inch */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Routine that can be used before interrupt management is initialized.
|
||||
*/
|
||||
|
||||
|
||||
char
|
||||
BSP_wait_polled_input(void)
|
||||
{
|
||||
|
||||
@@ -5,11 +5,44 @@
|
||||
// MODULE DESCRIPTION:
|
||||
//
|
||||
// This module was based on the Linux version kd.h
|
||||
//
|
||||
//
|
||||
// by: Rosimildo da Silva: rdasilva@connecttel.com
|
||||
//
|
||||
// MODIFICATION/HISTORY:
|
||||
// $Log$
|
||||
// Revision 1.1 2000/08/30 08:15:30 joel
|
||||
// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
|
||||
//
|
||||
// * Major rework of the "/dev/console" driver.
|
||||
// * Added termios support for stdin ( keyboard ).
|
||||
// * Added ioctls() to support modes similar to Linux( XLATE,
|
||||
// RAW, MEDIUMRAW ).
|
||||
// * Added Keyboard mapping and handling of the keyboard's leds.
|
||||
// * Added Micro FrameBuffer driver ( "/dev/fb0" ) for bare VGA
|
||||
// controller ( 16 colors ).
|
||||
// * Added PS/2 and Serial mouse support for PC386 BSP.
|
||||
// * console/defkeymap.c: New file.
|
||||
// * console/fb_vga.c: New file.
|
||||
// * console/fb_vga.h: New file.
|
||||
// * console/i386kbd.h: New file.
|
||||
// * console/kd.h: New file.
|
||||
// * console/keyboard.c: New file.
|
||||
// * console/keyboard.h: New file.
|
||||
// * console/mouse_parser.c: New file.
|
||||
// * console/mouse_parser.h: New file.
|
||||
// * console/pc_keyb.c: New file.
|
||||
// * console/ps2_drv.h: New file.
|
||||
// * console/ps2_mouse.c: New file.
|
||||
// * console/ps2_mouse.h: New file.
|
||||
// * console/serial_mouse.c: New file.
|
||||
// * console/serial_mouse.h: New file.
|
||||
// * console/vgainit.c: New file.
|
||||
// * console/vt.c: New file.
|
||||
// * console/Makefile.am: Reflect new files.
|
||||
// * console/console.c, console/inch.c, console/outch.c: Console
|
||||
// functionality modifications.
|
||||
// * startup/Makefile.am: Pick up tty_drv.c and gdb_glue.c
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* `Sticky' modifier keys, 951006.
|
||||
*
|
||||
* 11-11-96: SAK should now work in the raw mode (Martin Mares)
|
||||
*
|
||||
*
|
||||
* Modified to provide 'generic' keyboard support by Hamish Macdonald
|
||||
* Merge with the m68k keyboard driver and split-off of the PC low-level
|
||||
* parts by Geert Uytterhoeven, May 1997
|
||||
@@ -24,7 +24,7 @@
|
||||
* -------------------------------------------------------------------
|
||||
* End of Linux - Copyright notes...
|
||||
*
|
||||
* Ported to RTEMS to provide the basic fuctionality to the console driver.
|
||||
* Ported to RTEMS to provide the basic fuctionality to the console driver.
|
||||
* by: Rosimildo da Silva: rdasilva@connecttel.com
|
||||
*
|
||||
*/
|
||||
@@ -110,9 +110,9 @@ static unsigned char k_down[NR_SHIFT] = {0, };
|
||||
static unsigned long key_down[256/BITS_PER_LONG] = { 0, };
|
||||
|
||||
static int dead_key_next = 0;
|
||||
/*
|
||||
/*
|
||||
* In order to retrieve the shift_state (for the mouse server), either
|
||||
* the variable must be global, or a new procedure must be created to
|
||||
* the variable must be global, or a new procedure must be created to
|
||||
* return the value. I chose the former way.
|
||||
*/
|
||||
int shift_state = 0;
|
||||
|
||||
@@ -5,11 +5,17 @@
|
||||
// MODULE DESCRIPTION:
|
||||
//
|
||||
// This module was based on the Linux version keyboard.h + kbd_kern.h
|
||||
//
|
||||
//
|
||||
// by: Rosimildo da Silva: rdasilva@connecttel.com
|
||||
//
|
||||
// MODIFICATION/HISTORY:
|
||||
// $Log$
|
||||
// Revision 1.2 2000/08/30 17:06:23 joel
|
||||
// 2000-08-30 Joel Sherrill <joel@OARcorp.com>
|
||||
//
|
||||
// * console/keyboard.h: Changed numerous routines from extern inline
|
||||
// to static inline.
|
||||
//
|
||||
// Revision 1.1 2000/08/30 08:15:30 joel
|
||||
// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
|
||||
//
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* provided that this copyright notice remains intact.
|
||||
*
|
||||
* UNIX Serial Port Mouse Driver
|
||||
*
|
||||
*
|
||||
* This driver opens a serial port directly, and interprets serial data.
|
||||
* Microsoft, PC, Logitech and PS/2 mice are supported.
|
||||
* The PS/2 mouse is only supported if the OS runs the mouse
|
||||
@@ -148,7 +148,7 @@ int MOU_Data( int ch, COORD *dx, COORD *dy, COORD *dz, BUTTON *bptr)
|
||||
* When a complete state has been read, return the results,
|
||||
* leaving further bytes in the buffer for later calls.
|
||||
*/
|
||||
if( (*parse)( ch ) )
|
||||
if( (*parse)( ch ) )
|
||||
{
|
||||
*dx = xd;
|
||||
*dy = yd;
|
||||
@@ -268,7 +268,7 @@ static int ParsePS2(int byte)
|
||||
switch (state) {
|
||||
case IDLE:
|
||||
if (byte & PS2_CTRL_BYTE) {
|
||||
buttons = byte &
|
||||
buttons = byte &
|
||||
(PS2_LEFT_BUTTON|PS2_RIGHT_BUTTON);
|
||||
state = XSET;
|
||||
}
|
||||
@@ -372,7 +372,7 @@ static void kbd_parser( void *ptr, unsigned short keycode, unsigned long mods )
|
||||
m.m.kbd.modifiers = kbd->ledflagstate;
|
||||
m.m.kbd.mode = kbd->kbdmode;
|
||||
/* printk( "kbd: msg: keycode=%X, mod=%X\n", keycode, mods ); */
|
||||
rtems_message_queue_send( queue_id, ( void * )&m,
|
||||
rtems_message_queue_send( queue_id, ( void * )&m,
|
||||
sizeof( struct MW_UID_MESSAGE ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* Use the same definitions as the user interface */
|
||||
#define RBUTTON MV_BUTTON_RIGHT
|
||||
#define MBUTTON MV_BUTTON_CENTER
|
||||
#define LBUTTON MV_BUTTON_LEFT
|
||||
#define RBUTTON MV_BUTTON_RIGHT
|
||||
#define MBUTTON MV_BUTTON_CENTER
|
||||
#define LBUTTON MV_BUTTON_LEFT
|
||||
|
||||
typedef int COORD; /* device coordinates*/
|
||||
typedef unsigned int BUTTON; /* mouse button mask*/
|
||||
|
||||
@@ -37,12 +37,12 @@ static unsigned char column;
|
||||
static unsigned short attribute;
|
||||
static unsigned int nLines;
|
||||
|
||||
static void
|
||||
static void
|
||||
scroll(void)
|
||||
{
|
||||
int i, j; /* Counters */
|
||||
unsigned short *pt_scroll, *pt_bitmap; /* Pointers on the bit-map */
|
||||
|
||||
|
||||
pt_bitmap = bitMapBaseAddr;
|
||||
j = 0;
|
||||
pt_bitmap = pt_bitmap + j;
|
||||
@@ -50,11 +50,11 @@ scroll(void)
|
||||
for (i = j; i < (maxRow - 1) * maxCol; i++) {
|
||||
*pt_bitmap++ = *pt_scroll++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Blank characters are displayed on the last line.
|
||||
*/
|
||||
for (i = 0; i < maxCol; i++) {
|
||||
*/
|
||||
for (i = 0; i < maxCol; i++) {
|
||||
*pt_bitmap++ = (short) (' ' | attribute);
|
||||
}
|
||||
}
|
||||
@@ -63,9 +63,9 @@ static void
|
||||
doCRNL(int cr, int nl)
|
||||
{
|
||||
if (nl) {
|
||||
if (++row == maxRow) {
|
||||
if (++row == maxRow) {
|
||||
scroll(); /* Scroll the screen now */
|
||||
row = maxRow - 1;
|
||||
row = maxRow - 1;
|
||||
}
|
||||
nLines++;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ gotorc(int r, int c)
|
||||
#define BLANK ((char)0x7f)
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
videoPutChar(char car)
|
||||
{
|
||||
unsigned short *pt_bitmap = bitMapBaseAddr + row * maxCol + column;
|
||||
@@ -123,7 +123,7 @@ videoPutChar(char car)
|
||||
doCRNL(1,1);
|
||||
return;
|
||||
}
|
||||
while (i--) *pt_bitmap++ = ' ' | attribute;
|
||||
while (i--) *pt_bitmap++ = ' ' | attribute;
|
||||
wr_cursor(row * maxCol + column, ioCrtBaseAddr);
|
||||
return;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ videoPutChar(char car)
|
||||
case 7: { /* Bell code must be inserted here */
|
||||
return;
|
||||
}
|
||||
case '\r' : {
|
||||
case '\r' : {
|
||||
doCRNL(1,0);
|
||||
return;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ videoPutChar(char car)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* trivial state machine to handle escape sequences:
|
||||
*
|
||||
@@ -161,9 +161,9 @@ videoPutChar(char car)
|
||||
* ^\ \ \ \
|
||||
* KEY: | \other \ other \ other \ other
|
||||
* <-------------------------------------
|
||||
*
|
||||
*
|
||||
* in state '-1', the DCABHKJ cases are handled
|
||||
*
|
||||
*
|
||||
* (cursor motion and screen clearing)
|
||||
*/
|
||||
|
||||
@@ -262,7 +262,7 @@ clear_screen(void)
|
||||
| Description: Higher level (console) interface to consPutc.
|
||||
| Global Variables: None.
|
||||
| Arguments: c - character to write to console.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void
|
||||
_IBMPC_outch(char c)
|
||||
@@ -280,7 +280,7 @@ static int escaped = 0;
|
||||
| Global Variables: bitMapBaseAddr, ioCrtBaseAddr, maxCol, maxRow, row
|
||||
| column, attribute, nLines;
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void
|
||||
_IBMPC_initVideo(void)
|
||||
@@ -301,7 +301,7 @@ _IBMPC_initVideo(void)
|
||||
attribute = ((BLACK << 4) | WHITE)<<8;
|
||||
nLines = 0;
|
||||
clear_screen();
|
||||
#ifdef DEBUG_EARLY_STAGE
|
||||
#ifdef DEBUG_EARLY_STAGE
|
||||
printk("bitMapBaseAddr = %X, display controller base IO = %X\n",
|
||||
(unsigned) bitMapBaseAddr,
|
||||
(unsigned) ioCrtBaseAddr);
|
||||
|
||||
@@ -369,7 +369,7 @@ static unsigned char handle_kbd_event(void)
|
||||
}
|
||||
|
||||
status = kbd_read_status();
|
||||
|
||||
|
||||
if(!work--)
|
||||
{
|
||||
printk( "pc_keyb: controller jammed (0x%02X).\n", status);
|
||||
@@ -378,10 +378,10 @@ static unsigned char handle_kbd_event(void)
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* the commands to set the leds for some reason, returns 0x14, 0x16
|
||||
/*
|
||||
* the commands to set the leds for some reason, returns 0x14, 0x16
|
||||
* and I am intepreting as an ACK, because the original code from
|
||||
* Linux was timeing out here...
|
||||
* Linux was timeing out here...
|
||||
*/
|
||||
acknowledge = 1;
|
||||
reply_expected = 0;
|
||||
@@ -595,7 +595,7 @@ static char * initialize_kbd(void)
|
||||
kbd_wait_for_input();
|
||||
}
|
||||
|
||||
|
||||
|
||||
kbd_write_output_w(KBD_CMD_ENABLE);
|
||||
if (kbd_wait_for_input() != KBD_REPLY_ACK)
|
||||
return "Enable keyboard: no ACK";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $Header$
|
||||
*
|
||||
* Copyright (c) 1999 ConnectTel, Inc. All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* MODULE DESCRIPTION: Prototype routines for the paux driver.
|
||||
*
|
||||
* by: Rosimildo da Silva:
|
||||
@@ -15,6 +15,9 @@
|
||||
* MODIFICATION/HISTORY:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 2004/04/15 13:26:12 ralf
|
||||
* Remove stray white spaces.
|
||||
*
|
||||
* Revision 1.1 2000/08/30 08:15:30 joel
|
||||
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
|
||||
*
|
||||
|
||||
@@ -82,7 +82,7 @@ isr_on(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
isr_off(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
@@ -126,7 +126,7 @@ static void kb_wait(void)
|
||||
if (! (status & KBD_STAT_IBF))
|
||||
return;
|
||||
|
||||
mdelay(1);
|
||||
mdelay(1);
|
||||
|
||||
timeout--;
|
||||
} while (timeout);
|
||||
@@ -463,11 +463,11 @@ size_t read_aux(char * buffer, size_t count )
|
||||
size_t i = count;
|
||||
unsigned char c;
|
||||
|
||||
if (queue_empty())
|
||||
if (queue_empty())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
while (i > 0 && !queue_empty())
|
||||
while (i > 0 && !queue_empty())
|
||||
{
|
||||
c = get_from_queue();
|
||||
*buffer++ = c;
|
||||
@@ -591,7 +591,7 @@ static int paux_last_close(int major, int minor, void *arg)
|
||||
* It does nothing write now.
|
||||
*/
|
||||
static int write_aux_echo( int minor, const char * buffer, int count )
|
||||
{
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ paux_open(rtems_device_major_number major,
|
||||
void *arg)
|
||||
{
|
||||
rtems_status_code status;
|
||||
static rtems_termios_callbacks cb =
|
||||
static rtems_termios_callbacks cb =
|
||||
{
|
||||
NULL, /* firstOpen */
|
||||
paux_last_close, /* lastClose */
|
||||
@@ -645,7 +645,7 @@ paux_close(rtems_device_major_number major,
|
||||
return (rtems_termios_close (arg));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* paux device driver READ entry point.
|
||||
* Read characters from the PS/2 mouse.
|
||||
@@ -657,7 +657,7 @@ paux_read(rtems_device_major_number major,
|
||||
{
|
||||
return rtems_termios_read (arg);
|
||||
} /* tty_read */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* paux device driver WRITE entry point.
|
||||
@@ -675,18 +675,18 @@ paux_write(rtems_device_major_number major,
|
||||
return RTEMS_SUCCESSFUL;
|
||||
} /* tty_write */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Handle ioctl request.
|
||||
*/
|
||||
rtems_device_driver
|
||||
rtems_device_driver
|
||||
paux_control(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg
|
||||
)
|
||||
{
|
||||
{
|
||||
rtems_libio_ioctl_args_t *args = arg;
|
||||
switch( args->command )
|
||||
switch( args->command )
|
||||
{
|
||||
default:
|
||||
return rtems_termios_ioctl (arg);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* RTEMS port: by Rosimildo da Silva.
|
||||
*
|
||||
* This module was ported from Linux.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* as /dev/ttyS1 for COM1 and /dev/ttyS2 as COM2. If one of the ports
|
||||
* is used as the console, this driver would fail to initialize.
|
||||
*
|
||||
* This code was based on the console driver. It is based on the
|
||||
* This code was based on the console driver. It is based on the
|
||||
* current termios framework. This is just a shell around the
|
||||
* termios support.
|
||||
*
|
||||
@@ -18,6 +18,12 @@
|
||||
* MODIFICATION/HISTORY:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 2000/12/05 16:37:38 joel
|
||||
* 2000-12-01 Joel Sherrill <joel@OARcorp.com>
|
||||
*
|
||||
* * pc386/console/console.c, pc386/console/serial_mouse.c,
|
||||
* pc386/console/vgainit.c, shared/comm/tty_drv.c: Remove warnings.
|
||||
*
|
||||
* Revision 1.4 2000/10/23 14:10:25 joel
|
||||
* 2000-10-23 Joel Sherrill <joel@OARcorp.com>
|
||||
*
|
||||
@@ -80,8 +86,8 @@ extern int BSPConsolePort;
|
||||
/*
|
||||
* Interrupt structure for serial_mouse
|
||||
*/
|
||||
static rtems_irq_connect_data serial_mouse_isr_data =
|
||||
{
|
||||
static rtems_irq_connect_data serial_mouse_isr_data =
|
||||
{
|
||||
BSP_UART_IRQ,
|
||||
BSP_ISR_FUNC,
|
||||
isr_on,
|
||||
@@ -92,7 +98,7 @@ static void isr_on(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void isr_off(const rtems_irq_connect_data *unused)
|
||||
{
|
||||
return;
|
||||
@@ -131,7 +137,7 @@ serial_mouse_initialize(rtems_device_major_number major,
|
||||
* Set up TERMIOS
|
||||
*/
|
||||
rtems_termios_initialize();
|
||||
|
||||
|
||||
/*
|
||||
* Do device-specific initialization
|
||||
*/
|
||||
@@ -172,7 +178,7 @@ serial_mouse_open(rtems_device_major_number major,
|
||||
void *arg)
|
||||
{
|
||||
rtems_status_code status;
|
||||
static rtems_termios_callbacks cb =
|
||||
static rtems_termios_callbacks cb =
|
||||
{
|
||||
NULL, /* firstOpen */
|
||||
serial_mouse_last_close, /* lastClose */
|
||||
@@ -194,7 +200,7 @@ serial_mouse_open(rtems_device_major_number major,
|
||||
/*
|
||||
* Pass data area info down to driver
|
||||
*/
|
||||
BSP_uart_termios_set( BSP_UART_PORT,
|
||||
BSP_uart_termios_set( BSP_UART_PORT,
|
||||
((rtems_libio_open_close_args_t *)arg)->iop->data1 );
|
||||
/* Enable interrupts on channel */
|
||||
BSP_uart_intr_ctrl( BSP_UART_PORT, BSP_UART_INTR_CTRL_TERMIOS);
|
||||
@@ -211,10 +217,10 @@ serial_mouse_close(rtems_device_major_number major,
|
||||
{
|
||||
|
||||
return (rtems_termios_close (arg));
|
||||
|
||||
|
||||
} /* tty_close */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* TTY device driver READ entry point.
|
||||
* Read characters from the tty device.
|
||||
@@ -226,7 +232,7 @@ serial_mouse_read(rtems_device_major_number major,
|
||||
{
|
||||
return rtems_termios_read (arg);
|
||||
} /* tty_read */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* TTY device driver WRITE entry point.
|
||||
@@ -238,7 +244,7 @@ serial_mouse_write(rtems_device_major_number major,
|
||||
void * arg)
|
||||
{
|
||||
return rtems_termios_write (arg);
|
||||
|
||||
|
||||
} /* tty_write */
|
||||
|
||||
/*
|
||||
@@ -246,9 +252,9 @@ serial_mouse_write(rtems_device_major_number major,
|
||||
* routine to handle both devices.
|
||||
*/
|
||||
static rtems_device_driver serial_mouse_control_internal( int port, void *arg )
|
||||
{
|
||||
{
|
||||
rtems_libio_ioctl_args_t *args = arg;
|
||||
switch( args->command )
|
||||
switch( args->command )
|
||||
{
|
||||
default:
|
||||
return rtems_termios_ioctl (arg);
|
||||
@@ -271,12 +277,12 @@ static rtems_device_driver serial_mouse_control_internal( int port, void *arg )
|
||||
/*
|
||||
* Handle ioctl request for ttyS1.
|
||||
*/
|
||||
rtems_device_driver
|
||||
rtems_device_driver
|
||||
serial_mouse_control(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg
|
||||
)
|
||||
{
|
||||
{
|
||||
return serial_mouse_control_internal( BSP_UART_PORT, arg );
|
||||
}
|
||||
|
||||
@@ -287,45 +293,45 @@ conSetAttr(int port, int minor, const struct termios *t)
|
||||
{
|
||||
unsigned long baud, databits, parity, stopbits;
|
||||
|
||||
switch (t->c_cflag & CBAUD)
|
||||
switch (t->c_cflag & CBAUD)
|
||||
{
|
||||
case B50:
|
||||
case B50:
|
||||
baud = 50;
|
||||
break;
|
||||
case B75:
|
||||
baud = 75;
|
||||
case B75:
|
||||
baud = 75;
|
||||
break;
|
||||
case B110:
|
||||
baud = 110;
|
||||
case B110:
|
||||
baud = 110;
|
||||
break;
|
||||
case B134:
|
||||
baud = 134;
|
||||
case B134:
|
||||
baud = 134;
|
||||
break;
|
||||
case B150:
|
||||
baud = 150;
|
||||
case B150:
|
||||
baud = 150;
|
||||
break;
|
||||
case B200:
|
||||
baud = 200;
|
||||
baud = 200;
|
||||
break;
|
||||
case B300:
|
||||
case B300:
|
||||
baud = 300;
|
||||
break;
|
||||
case B600:
|
||||
baud = 600;
|
||||
case B600:
|
||||
baud = 600;
|
||||
break;
|
||||
case B1200:
|
||||
case B1200:
|
||||
baud = 1200;
|
||||
break;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
case B1800:
|
||||
baud = 1800;
|
||||
break;
|
||||
case B2400:
|
||||
case B2400:
|
||||
baud = 2400;
|
||||
break;
|
||||
case B4800:
|
||||
case B4800:
|
||||
baud = 4800;
|
||||
break;
|
||||
case B9600:
|
||||
case B9600:
|
||||
baud = 9600;
|
||||
break;
|
||||
case B19200:
|
||||
@@ -334,7 +340,7 @@ conSetAttr(int port, int minor, const struct termios *t)
|
||||
case B38400:
|
||||
baud = 38400;
|
||||
break;
|
||||
case B57600:
|
||||
case B57600:
|
||||
baud = 57600;
|
||||
break;
|
||||
case B115200:
|
||||
@@ -360,7 +366,7 @@ conSetAttr(int port, int minor, const struct termios *t)
|
||||
/* No parity */
|
||||
parity = 0;
|
||||
}
|
||||
|
||||
|
||||
switch (t->c_cflag & CSIZE) {
|
||||
case CS5: databits = CHR_5_BITS; break;
|
||||
case CS6: databits = CHR_6_BITS; break;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $Header$
|
||||
*
|
||||
* Copyright (c) 1999 ConnectTel, Inc. All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* MODULE DESCRIPTION: Prototype routines for the /dev/mouse driver.
|
||||
*
|
||||
* by: Rosimildo da Silva:
|
||||
@@ -15,6 +15,9 @@
|
||||
* MODIFICATION/HISTORY:
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 2004/04/15 13:26:12 ralf
|
||||
* Remove stray white spaces.
|
||||
*
|
||||
* Revision 1.1 2000/08/30 08:15:30 joel
|
||||
* 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
|
||||
*
|
||||
@@ -98,7 +101,7 @@ rtems_device_driver serial_mouse_write(
|
||||
|
||||
|
||||
/* Select the mouse type: "ms","pc","ps2" */
|
||||
#define MOUSE_TYPE "ms"
|
||||
#define MOUSE_TYPE "ms"
|
||||
|
||||
/* Select the serial port for the serial mouse driver */
|
||||
#define SERIAL_MOUSE_COM1 1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* videoAsm.S - This file contains code for displaying cursor on the console
|
||||
*
|
||||
* Copyright (C) 1998 valette@crf.canon.fr
|
||||
* Copyright (C) 1998 valette@crf.canon.fr
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
|
||||
@@ -73,7 +73,7 @@ _kd_mksound(unsigned int hz, unsigned int ticks)
|
||||
|
||||
if (hz > 20 && hz < 32767)
|
||||
count = 1193180 / hz;
|
||||
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
/* del_timer(&sound_timer); */
|
||||
if (count) {
|
||||
@@ -121,7 +121,7 @@ do_kdsk_ioctl(int cmd, struct kbentry *user_kbe, int perm, struct kbd_struct *kb
|
||||
|
||||
tmp = *user_kbe;
|
||||
if (i >= NR_KEYS || s >= MAX_NR_KEYMAPS)
|
||||
return -EINVAL;
|
||||
return -EINVAL;
|
||||
|
||||
switch (cmd) {
|
||||
case KDGKBENT:
|
||||
@@ -147,7 +147,7 @@ do_kdsk_ioctl(int cmd, struct kbentry *user_kbe, int perm, struct kbd_struct *kb
|
||||
|
||||
#define HZ 100
|
||||
|
||||
static inline int
|
||||
static inline int
|
||||
do_kbkeycode_ioctl(int cmd, struct kbkeycode *user_kbkc, int perm)
|
||||
{
|
||||
struct kbkeycode tmp;
|
||||
@@ -177,7 +177,7 @@ do_kdgkb_ioctl(int cmd, struct kbsentry *user_kdgkb, int perm)
|
||||
|
||||
/*
|
||||
* We handle the console-specific ioctl's here. We allow the
|
||||
* capability to modify any console, not just the fg_console.
|
||||
* capability to modify any console, not just the fg_console.
|
||||
*/
|
||||
int vt_ioctl( unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
@@ -207,7 +207,7 @@ int vt_ioctl( unsigned int cmd, unsigned long arg)
|
||||
return -EPERM;
|
||||
{
|
||||
unsigned int ticks, count;
|
||||
|
||||
|
||||
/*
|
||||
* Generate the tone for the appropriate number of ticks.
|
||||
* If the time is zero, turn off sound ourselves.
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include <libchip/ide_ctrl_io.h>
|
||||
|
||||
/* #define DEBUG_OUT */
|
||||
/*
|
||||
* support functions for IDE harddisk IF
|
||||
/*
|
||||
* support functions for IDE harddisk IF
|
||||
*/
|
||||
/*=========================================================================*\
|
||||
| Function: |
|
||||
@@ -52,7 +52,7 @@ boolean pc386_ide_probe
|
||||
\*=========================================================================*/
|
||||
{
|
||||
boolean ide_card_plugged = TRUE; /* assume: we have a disk here */
|
||||
|
||||
|
||||
return ide_card_plugged;
|
||||
}
|
||||
|
||||
@@ -160,9 +160,9 @@ void pc386_ide_read_block
|
||||
+---------------------------------------------------------------------------+
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
int minor,
|
||||
uint16_t block_size,
|
||||
blkdev_sg_buffer *bufs,
|
||||
int minor,
|
||||
uint16_t block_size,
|
||||
blkdev_sg_buffer *bufs,
|
||||
uint32_t *cbuf,
|
||||
uint32_t *pos
|
||||
)
|
||||
@@ -179,7 +179,7 @@ void pc386_ide_read_block
|
||||
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
|
||||
inport_byte(port+IDE_REGISTER_STATUS,status_val);
|
||||
while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
|
||||
while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
|
||||
(cnt < block_size)) {
|
||||
inport_word(port+IDE_REGISTER_DATA,*lbuf);
|
||||
|
||||
@@ -187,7 +187,7 @@ void pc386_ide_read_block
|
||||
printk("0x%x ",*lbuf);
|
||||
#endif
|
||||
lbuf++;
|
||||
cnt += sizeof(*lbuf);
|
||||
cnt += sizeof(*lbuf);
|
||||
(*pos) += sizeof(*lbuf);
|
||||
if ((*pos) == llength) {
|
||||
(*pos) = 0;
|
||||
@@ -196,7 +196,7 @@ void pc386_ide_read_block
|
||||
llength = bufs[(*cbuf)].length;
|
||||
}
|
||||
inport_byte(port+IDE_REGISTER_STATUS,status_val);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_OUT
|
||||
printk("pc386_ide_read_block()\r\n");
|
||||
#endif
|
||||
@@ -213,9 +213,9 @@ void pc386_ide_write_block
|
||||
+---------------------------------------------------------------------------+
|
||||
| Input Parameters: |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
int minor,
|
||||
uint16_t block_size,
|
||||
blkdev_sg_buffer *bufs,
|
||||
int minor,
|
||||
uint16_t block_size,
|
||||
blkdev_sg_buffer *bufs,
|
||||
uint32_t *cbuf,
|
||||
uint32_t *pos
|
||||
)
|
||||
@@ -230,19 +230,19 @@ void pc386_ide_write_block
|
||||
uint8_t status_val;
|
||||
uint16_t *lbuf = (uint16_t*)
|
||||
((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));
|
||||
|
||||
|
||||
#ifdef DEBUG_OUT
|
||||
printk("pc386_ide_write_block()\r\n");
|
||||
#endif
|
||||
inport_byte(port+IDE_REGISTER_STATUS,status_val);
|
||||
while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
|
||||
while ((status_val & IDE_REGISTER_STATUS_DRQ) &&
|
||||
(cnt < block_size)) {
|
||||
#ifdef DEBUG_OUT
|
||||
printk("0x%x ",*lbuf);
|
||||
#endif
|
||||
outport_word(port+IDE_REGISTER_DATA,*lbuf);
|
||||
lbuf++;
|
||||
cnt += sizeof(*lbuf);
|
||||
cnt += sizeof(*lbuf);
|
||||
(*pos) += sizeof(*lbuf);
|
||||
if ((*pos) == llength) {
|
||||
(*pos) = 0;
|
||||
@@ -300,7 +300,7 @@ rtems_status_code pc386_ide_config_io_speed
|
||||
}
|
||||
|
||||
/*
|
||||
* The following table configures the functions used for IDE drivers
|
||||
* The following table configures the functions used for IDE drivers
|
||||
* in this BSP.
|
||||
*/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* The following table configures the functions used for IDE drivers
|
||||
* The following table configures the functions used for IDE drivers
|
||||
* in this BSP.
|
||||
*/
|
||||
|
||||
@@ -48,5 +48,5 @@ ide_controller_bsp_table_t IDE_Controller_Table[] = {
|
||||
};
|
||||
|
||||
/* Number of rows in IDE_Controller_Table */
|
||||
unsigned long IDE_Controller_Count =
|
||||
unsigned long IDE_Controller_Count =
|
||||
sizeof(IDE_Controller_Table)/sizeof(IDE_Controller_Table[0]);
|
||||
|
||||
@@ -54,7 +54,7 @@ extern "C" {
|
||||
#include <rtems/clockdrv.h>
|
||||
#include <libcpu/cpu.h>
|
||||
#include <rtems/bspIo.h>
|
||||
|
||||
|
||||
/*
|
||||
* confdefs.h overrides for this BSP:
|
||||
* - number of termios serial ports
|
||||
@@ -104,8 +104,8 @@ extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int);
|
||||
| Video (console) related constants.
|
||||
+--------------------------------------------------------------------------*/
|
||||
|
||||
#include <crt.h>
|
||||
|
||||
#include <crt.h>
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Constants relating to the 8254 (or 8253) programmable interval timers.
|
||||
+--------------------------------------------------------------------------*/
|
||||
@@ -192,7 +192,7 @@ extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int);
|
||||
|
||||
extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
|
||||
extern segment_descriptors Global_descriptor_table [GDT_SIZE];
|
||||
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
/* User provided BSP configuration table. */
|
||||
extern uint32_t rtemsFreeMemStart;
|
||||
@@ -204,8 +204,8 @@ extern uint32_t rtemsFreeMemStart;
|
||||
+--------------------------------------------------------------------------*/
|
||||
void _IBMPC_initVideo(void); /* from 'outch.c' */
|
||||
void _IBMPC_outch (char); /* from 'outch.c' */
|
||||
char _IBMPC_inch (void); /* from 'inch.c' */
|
||||
char _IBMPC_inch_sleep (void); /* from 'inch.c' */
|
||||
char _IBMPC_inch (void); /* from 'inch.c' */
|
||||
char _IBMPC_inch_sleep (void); /* from 'inch.c' */
|
||||
|
||||
void rtemsReboot(void); /* from 'exit.c' */
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/* In monochrome */
|
||||
#define V_MONO 0xb0000
|
||||
#define V_MONO 0xb0000
|
||||
/* In color */
|
||||
#define V_COLOR 0xb8000
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
#define ON 1
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* CRT Controller register offset definitions
|
||||
*/
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* page 0 read or read/write registers */
|
||||
|
||||
#define CMDR 0x00+RO
|
||||
#define CMDR 0x00+RO
|
||||
#define CLDA0 0x01+RO /* current local dma addr 0 for read */
|
||||
#define CLDA1 0x02+RO /* current local dma addr 1 for read */
|
||||
#define BNRY 0x03+RO /* boundary reg for rd and wr */
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
/*-----CMDR command bits-----*/
|
||||
#define MSK_STP 0x01 /* stop the chip */
|
||||
#define MSK_STA 0x02 /* start the chip */
|
||||
#define MSK_STA 0x02 /* start the chip */
|
||||
#define MSK_TXP 0x04 /* initial txing of a frm */
|
||||
#define MSK_RRE 0x08 /* remote read */
|
||||
#define MSK_RWR 0x10 /* remote write */
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
|
||||
| **************************************************************************
|
||||
| * COPYRIGHT (c) 1989-1999.
|
||||
| * On-Line Applications Research Corporation (OAR).
|
||||
| * On-Line Applications Research Corporation (OAR).
|
||||
| *
|
||||
| * The license and distribution terms for this file may be
|
||||
| * found in the file LICENSE in this distribution or at
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <rtems/asm.h>
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| Size of heap and stack:
|
||||
| Size of heap and stack:
|
||||
+----------------------------------------------------------------------------*/
|
||||
|
||||
.set STACK_SIZE, 0x1000
|
||||
@@ -63,7 +63,7 @@ BEGIN_CODE
|
||||
EXTERN (_IBMPC_initVideo)
|
||||
EXTERN (debugPollingGetChar)
|
||||
EXTERN (checkCPUtypeSetCr0)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* In case this crashes on your machine and this is not due
|
||||
@@ -75,7 +75,7 @@ BEGIN_CODE
|
||||
SYM (start):
|
||||
/*
|
||||
* When things are really, REALLY!, bad -- turn on the speaker and
|
||||
* lock up. This shows whether or not we make it to a certain
|
||||
* lock up. This shows whether or not we make it to a certain
|
||||
* location.
|
||||
*/
|
||||
#if 0
|
||||
@@ -91,7 +91,7 @@ speakl: jmp speakl # and SPIN!!!
|
||||
#ifdef DEBUG_EARLY_START
|
||||
/*
|
||||
* Must get video attribute to have a working printk.
|
||||
* Note that the following code assume we already have
|
||||
* Note that the following code assume we already have
|
||||
* valid segments and a stack. It should be true for
|
||||
* any loader starting RTEMS in protected mode (or
|
||||
* at least I hope so : -)).
|
||||
@@ -105,13 +105,13 @@ speakl: jmp speakl # and SPIN!!!
|
||||
addl $4, esp
|
||||
|
||||
/* call debugPollingGetChar */
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| Load the segment registers (this is done by the board's BSP) and perform any
|
||||
| other board specific initialization procedures, this piece of code
|
||||
| does not know anything about
|
||||
| does not know anything about
|
||||
|
|
||||
| NOTE: Upon return, gs will contain the segment descriptor for a segment which
|
||||
| maps directly to all of physical memory.
|
||||
@@ -153,12 +153,12 @@ SYM (zero_bss):
|
||||
| So from now we can use printk
|
||||
+-------------------------------------------------------------------*/
|
||||
call _IBMPC_initVideo
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------+
|
||||
| Check CPU type. Enable Cache and init coprocessor if needed.
|
||||
+---------------------------------------------------------------------*/
|
||||
call checkCPUtypeSetCr0
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------+
|
||||
| Transfer control to User's Board Support Package
|
||||
+---------------------------------------------------------------------*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user