forked from Imagelibrary/rtems
powerpc/ep1a: Fix multiple warnings
This commit is contained in:
@@ -25,7 +25,8 @@
|
|||||||
|
|
||||||
#define DEBUG_PRINT 1
|
#define DEBUG_PRINT 1
|
||||||
|
|
||||||
void M360SetupMemory( M68360_t ptr ){
|
void M360SetupMemory( M68360_t ptr )
|
||||||
|
{
|
||||||
volatile m360_t *m360;
|
volatile m360_t *m360;
|
||||||
|
|
||||||
m360 = ptr->m360;
|
m360 = ptr->m360;
|
||||||
@@ -34,19 +35,19 @@ void M360SetupMemory( M68360_t ptr ){
|
|||||||
printk("m360->mcr:0x%08x Q1_360_SIM_MCR:0x%08x\n",
|
printk("m360->mcr:0x%08x Q1_360_SIM_MCR:0x%08x\n",
|
||||||
(unsigned int)&(m360->mcr), ((unsigned int)m360+Q1_360_SIM_MCR));
|
(unsigned int)&(m360->mcr), ((unsigned int)m360+Q1_360_SIM_MCR));
|
||||||
#endif
|
#endif
|
||||||
ptr->bdregions[0].base = (char *)&m360->dpram1[0];
|
ptr->bdregions[0].base = &m360->dpram1[0];
|
||||||
ptr->bdregions[0].size = sizeof m360->dpram1;
|
ptr->bdregions[0].size = sizeof m360->dpram1;
|
||||||
ptr->bdregions[0].used = 0;
|
ptr->bdregions[0].used = 0;
|
||||||
|
|
||||||
ptr->bdregions[1].base = (char *)&m360->dpram3[0];
|
ptr->bdregions[1].base = &m360->dpram3[0];
|
||||||
ptr->bdregions[1].size = sizeof m360->dpram3;
|
ptr->bdregions[1].size = sizeof m360->dpram3;
|
||||||
ptr->bdregions[1].used = 0;
|
ptr->bdregions[1].used = 0;
|
||||||
|
|
||||||
ptr->bdregions[2].base = (char *)&m360->dpram0[0];
|
ptr->bdregions[2].base = &m360->dpram0[0];
|
||||||
ptr->bdregions[2].size = sizeof m360->dpram0;
|
ptr->bdregions[2].size = sizeof m360->dpram0;
|
||||||
ptr->bdregions[2].used = 0;
|
ptr->bdregions[2].used = 0;
|
||||||
|
|
||||||
ptr->bdregions[3].base = (char *)&m360->dpram2[0];
|
ptr->bdregions[3].base = &m360->dpram2[0];
|
||||||
ptr->bdregions[3].size = sizeof m360->dpram2;
|
ptr->bdregions[3].size = sizeof m360->dpram2;
|
||||||
ptr->bdregions[3].used = 0;
|
ptr->bdregions[3].used = 0;
|
||||||
}
|
}
|
||||||
@@ -59,8 +60,8 @@ void *
|
|||||||
M360AllocateBufferDescriptors (M68360_t ptr, int count)
|
M360AllocateBufferDescriptors (M68360_t ptr, int count)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
ISR_Level level;
|
rtems_interrupt_level level;
|
||||||
void *bdp = NULL;
|
volatile unsigned char *bdp = NULL;
|
||||||
unsigned int want = count * sizeof(m360BufferDescriptor_t);
|
unsigned int want = count * sizeof(m360BufferDescriptor_t);
|
||||||
int have;
|
int have;
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ M360AllocateBufferDescriptors (M68360_t ptr, int count)
|
|||||||
* form, but this routine is probably being run as part of an
|
* form, but this routine is probably being run as part of an
|
||||||
* initialization sequence so the effect shouldn't be too severe.
|
* initialization sequence so the effect shouldn't be too severe.
|
||||||
*/
|
*/
|
||||||
_ISR_Disable (level);
|
rtems_interrupt_disable(level);
|
||||||
|
|
||||||
for (i = 0 ; i < M360_NUM_DPRAM_REAGONS ; i++) {
|
for (i = 0 ; i < M360_NUM_DPRAM_REAGONS ; i++) {
|
||||||
|
|
||||||
@@ -100,10 +101,10 @@ M360AllocateBufferDescriptors (M68360_t ptr, int count)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ISR_Enable (level);
|
rtems_interrupt_enable(level);
|
||||||
if (bdp == NULL){
|
if (bdp == NULL){
|
||||||
printk("rtems_panic can't allocate %d buffer descriptor(s).\n");
|
printk("rtems_panic can't allocate %d buffer descriptor(s).\n");
|
||||||
rtems_panic ("Can't allocate %d buffer descriptor(s).\n", count);
|
rtems_panic ("Can't allocate %d buffer descriptor(s).\n", count);
|
||||||
}
|
}
|
||||||
return bdp;
|
return (void *)bdp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -933,7 +933,7 @@ typedef struct m360_ {
|
|||||||
} m360_t;
|
} m360_t;
|
||||||
|
|
||||||
struct bdregions_t {
|
struct bdregions_t {
|
||||||
char *base;
|
volatile unsigned char *base;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
unsigned int used;
|
unsigned int used;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/* This file contains the termios TTY driver for the
|
/* This file contains the termios TTY driver for the
|
||||||
* Motorola MC68360 SCC ports.
|
* Motorola MC68360 SCC ports.
|
||||||
*
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
* COPYRIGHT (c) 1989-2008.
|
* COPYRIGHT (c) 1989-2008.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
@@ -34,24 +36,32 @@ int EP1A_READ_LENGTH_GREATER_THAN_1 = 0;
|
|||||||
int mc68360_length_array[ MC68360_LENGTH_SIZE ];
|
int mc68360_length_array[ MC68360_LENGTH_SIZE ];
|
||||||
int mc68360_length_count=0;
|
int mc68360_length_count=0;
|
||||||
|
|
||||||
void mc68360_Show_length_array(void) {
|
#if 0
|
||||||
|
/*
|
||||||
|
* This is a debug method which is not currently used.
|
||||||
|
*/
|
||||||
|
static void mc68360_Show_length_array(void)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<MC68360_LENGTH_SIZE; i++)
|
for (i=0; i<MC68360_LENGTH_SIZE; i++)
|
||||||
printf(" %d", mc68360_length_array[i] );
|
printf(" %d", mc68360_length_array[i] );
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
M68360_t M68360_chips = NULL;
|
M68360_t M68360_chips = NULL;
|
||||||
|
|
||||||
#define SYNC eieio
|
#define SYNC eieio
|
||||||
#define mc68360_scc_Is_422( _minor ) (Console_Port_Tbl[minor]->sDeviceName[7] == '4' )
|
#define mc68360_scc_Is_422( _minor ) \
|
||||||
|
(Console_Port_Tbl[minor]->sDeviceName[7] == '4' )
|
||||||
|
|
||||||
|
#if 0
|
||||||
void mc68360_scc_nullFunc(void) {}
|
/*
|
||||||
|
* This method is included for completeness but not currently used.
|
||||||
uint8_t scc_read8(
|
*/
|
||||||
|
static uint8_t scc_read8(
|
||||||
const char *name,
|
const char *name,
|
||||||
volatile uint8_t *address
|
volatile uint8_t *address
|
||||||
)
|
)
|
||||||
@@ -68,8 +78,9 @@ uint8_t scc_read8(
|
|||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void scc_write8(
|
static void scc_write8(
|
||||||
const char *name,
|
const char *name,
|
||||||
volatile uint8_t *address,
|
volatile uint8_t *address,
|
||||||
uint8_t value
|
uint8_t value
|
||||||
@@ -81,8 +92,7 @@ void scc_write8(
|
|||||||
*address = value;
|
*address = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint16_t scc_read16(
|
||||||
uint16_t scc_read16(
|
|
||||||
const char *name,
|
const char *name,
|
||||||
volatile uint16_t *address
|
volatile uint16_t *address
|
||||||
)
|
)
|
||||||
@@ -100,7 +110,7 @@ uint16_t scc_read16(
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void scc_write16(
|
static void scc_write16(
|
||||||
const char *name,
|
const char *name,
|
||||||
volatile uint16_t *address,
|
volatile uint16_t *address,
|
||||||
uint16_t value
|
uint16_t value
|
||||||
@@ -112,8 +122,7 @@ void scc_write16(
|
|||||||
*address = value;
|
*address = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t scc_read32(
|
||||||
uint32_t scc_read32(
|
|
||||||
const char *name,
|
const char *name,
|
||||||
volatile uint32_t *address
|
volatile uint32_t *address
|
||||||
)
|
)
|
||||||
@@ -131,7 +140,7 @@ uint32_t scc_read32(
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void scc_write32(
|
static void scc_write32(
|
||||||
const char *name,
|
const char *name,
|
||||||
volatile uint32_t *address,
|
volatile uint32_t *address,
|
||||||
uint32_t value
|
uint32_t value
|
||||||
@@ -143,7 +152,12 @@ void scc_write32(
|
|||||||
*address = value;
|
*address = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mc68360_sccShow_Regs(int minor){
|
#if 0
|
||||||
|
/*
|
||||||
|
* This is a debug method which is not currently used.
|
||||||
|
*/
|
||||||
|
static void mc68360_sccShow_Regs(int minor)
|
||||||
|
{
|
||||||
M68360_serial_ports_t ptr;
|
M68360_serial_ports_t ptr;
|
||||||
ptr = Console_Port_Tbl[minor]->pDeviceParams;
|
ptr = Console_Port_Tbl[minor]->pDeviceParams;
|
||||||
|
|
||||||
@@ -151,6 +165,7 @@ void mc68360_sccShow_Regs(int minor){
|
|||||||
printk( " 0x%04x\n", ptr->pSCCR->scce );
|
printk( " 0x%04x\n", ptr->pSCCR->scce );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TX_BUFFER_ADDRESS( _ptr ) \
|
#define TX_BUFFER_ADDRESS( _ptr ) \
|
||||||
((char *)ptr->txBuf - (char *)ptr->chip->board_data->baseaddr)
|
((char *)ptr->txBuf - (char *)ptr->chip->board_data->baseaddr)
|
||||||
@@ -325,8 +340,7 @@ if (length > 1)
|
|||||||
*
|
*
|
||||||
* Default state is 9600 baud, 8 bits, No parity, and 1 stop bit.
|
* Default state is 9600 baud, 8 bits, No parity, and 1 stop bit.
|
||||||
*/
|
*/
|
||||||
|
static int mc68360_scc_open(
|
||||||
int mc68360_scc_open(
|
|
||||||
int major,
|
int major,
|
||||||
int minor,
|
int minor,
|
||||||
void * arg
|
void * arg
|
||||||
@@ -653,10 +667,10 @@ void mc68360_scc_initialize_interrupts(int minor)
|
|||||||
* Console Termios output entry point when using interrupt driven output.
|
* Console Termios output entry point when using interrupt driven output.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int mc68360_scc_write_support_int(
|
ssize_t mc68360_scc_write_support_int(
|
||||||
int minor,
|
int minor,
|
||||||
const char *buf,
|
const char *buf,
|
||||||
int len
|
size_t len
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_interrupt_level Irql;
|
rtems_interrupt_level Irql;
|
||||||
@@ -953,7 +967,7 @@ int mc68360_scc_create_chip( PPMCQ1BoardData BoardData, uint8_t int_vector )
|
|||||||
chip->board_data->slotNo,
|
chip->board_data->slotNo,
|
||||||
chip->board_data->funcNo,
|
chip->board_data->funcNo,
|
||||||
&mc68360_sccInterruptHandler,
|
&mc68360_sccInterruptHandler,
|
||||||
chip
|
(uintptr_t) chip
|
||||||
);
|
);
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* This include file contains all console driver definations for the nc16550
|
* This include file contains all console driver definitions for the ns16550.
|
||||||
*
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
* COPYRIGHT (c) 1989-2008.
|
* COPYRIGHT (c) 1989-2008.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
@@ -9,10 +11,11 @@
|
|||||||
* http://www.rtems.org/license/LICENSE.
|
* http://www.rtems.org/license/LICENSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rtems.h>
|
#include <bsp.h>
|
||||||
#include <libchip/serial.h>
|
#include <libchip/serial.h>
|
||||||
#include <libchip/ns16550.h>
|
#include <libchip/ns16550.h>
|
||||||
#include <bsp.h>
|
|
||||||
|
#include "ns16550cfg.h"
|
||||||
|
|
||||||
typedef struct uart_reg
|
typedef struct uart_reg
|
||||||
{
|
{
|
||||||
@@ -21,19 +24,20 @@ typedef struct uart_reg
|
|||||||
} uartReg;
|
} uartReg;
|
||||||
|
|
||||||
uint8_t Read_ns16550_register(
|
uint8_t Read_ns16550_register(
|
||||||
uint32_t ulCtrlPort,
|
uintptr_t ulCtrlPort,
|
||||||
uint8_t ucRegNum
|
uint8_t ucRegNum
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
|
volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
|
||||||
uint8_t ucData;
|
uint8_t ucData;
|
||||||
|
|
||||||
ucData = p[ucRegNum].reg;
|
ucData = p[ucRegNum].reg;
|
||||||
__asm__ volatile("sync");
|
__asm__ volatile("sync");
|
||||||
return ucData;
|
return ucData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Write_ns16550_register(
|
void Write_ns16550_register(
|
||||||
uint32_t ulCtrlPort,
|
uintptr_t ulCtrlPort,
|
||||||
uint8_t ucRegNum,
|
uint8_t ucRegNum,
|
||||||
uint8_t ucData
|
uint8_t ucData
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* This include file contains all console driver definations for the nc16550
|
* This include file contains all console driver definitions for the ns16550.
|
||||||
*
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
* COPYRIGHT (c) 1989-2008.
|
* COPYRIGHT (c) 1989-2008.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
@@ -21,12 +23,12 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
uint8_t Read_ns16550_register(
|
uint8_t Read_ns16550_register(
|
||||||
uint32_t ulCtrlPort,
|
uintptr_t ulCtrlPort,
|
||||||
uint8_t ucRegNum
|
uint8_t ucRegNum
|
||||||
);
|
);
|
||||||
|
|
||||||
void Write_ns16550_register(
|
void Write_ns16550_register(
|
||||||
uint32_t ulCtrlPort,
|
uintptr_t ulCtrlPort,
|
||||||
uint8_t ucRegNum,
|
uint8_t ucRegNum,
|
||||||
uint8_t ucData
|
uint8_t ucData
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ static unsigned char rsPMCQ1Initialized = FALSE;
|
|||||||
|
|
||||||
/* forward declarations */
|
/* forward declarations */
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* local Qspan II serial eeprom table */
|
/* local Qspan II serial eeprom table */
|
||||||
static unsigned char rsPMCQ1eeprom[] =
|
static unsigned char rsPMCQ1eeprom[] =
|
||||||
{
|
{
|
||||||
@@ -79,30 +80,33 @@ static unsigned char rsPMCQ1eeprom[] =
|
|||||||
0xC0, /* Byte 21 - PCI_PMC */
|
0xC0, /* Byte 21 - PCI_PMC */
|
||||||
0x00 /* Byte 22 - PCI_BST */
|
0x00 /* Byte 22 - PCI_BST */
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
void MsDelay(void)
|
static void MsDelay(void)
|
||||||
{
|
{
|
||||||
printk(".");
|
printk(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
void write8( int addr, int data ){
|
static void write8( int addr, int data ){
|
||||||
out_8((void *)addr, (unsigned char)data);
|
out_8((void *)addr, (unsigned char)data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void write16( int addr, int data ) {
|
static void write16( int addr, int data ) {
|
||||||
out_be16((void *)addr, (short)data );
|
out_be16((void *)addr, (short)data );
|
||||||
}
|
}
|
||||||
|
|
||||||
void write32( int addr, int data ) {
|
static void write32( int addr, int data ) {
|
||||||
out_be32((unsigned int *)addr, data );
|
out_be32((unsigned int *)addr, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
int read32( int addr){
|
#if 0
|
||||||
|
static int read32( int addr){
|
||||||
return in_be32((unsigned int *)addr);
|
return in_be32((unsigned int *)addr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void rsPMCQ1_scc_nullFunc(void) {}
|
static void rsPMCQ1_scc_nullFunc(void) {}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* rsPMCQ1Int - handle a PMCQ1 interrupt
|
* rsPMCQ1Int - handle a PMCQ1 interrupt
|
||||||
@@ -113,7 +117,7 @@ void rsPMCQ1_scc_nullFunc(void) {}
|
|||||||
* RETURNS: NONE.
|
* RETURNS: NONE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void rsPMCQ1Int( void *ptr )
|
static void rsPMCQ1Int( void *ptr )
|
||||||
{
|
{
|
||||||
unsigned long status;
|
unsigned long status;
|
||||||
unsigned long status1;
|
unsigned long status1;
|
||||||
@@ -156,6 +160,7 @@ void rsPMCQ1Int( void *ptr )
|
|||||||
|
|
||||||
/* read back the status register to ensure that the pci write has completed */
|
/* read back the status register to ensure that the pci write has completed */
|
||||||
status1 = *(volatile unsigned long *)(boardData->bridgeaddr + 0x600);
|
status1 = *(volatile unsigned long *)(boardData->bridgeaddr + 0x600);
|
||||||
|
(void) status1; /* avoid set but not used warning */
|
||||||
RTEMS_COMPILER_MEMORY_BARRIER();
|
RTEMS_COMPILER_MEMORY_BARRIER();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -175,8 +180,8 @@ unsigned int rsPMCQ1MaIntConnect (
|
|||||||
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
||||||
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
||||||
unsigned long funcNo, /* Pci Function number of PMCQ1 */
|
unsigned long funcNo, /* Pci Function number of PMCQ1 */
|
||||||
FUNCION_PTR routine,/* interrupt routine */
|
FUNCTION_PTR routine,/* interrupt routine */
|
||||||
int arg /* argument to pass to interrupt routine */
|
uintptr_t arg /* argument to pass to interrupt routine */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PPMCQ1BoardData boardData;
|
PPMCQ1BoardData boardData;
|
||||||
@@ -207,6 +212,8 @@ unsigned int rsPMCQ1MaIntConnect (
|
|||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* This method is apparently unused. --joel 9 Oct 2014 */
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* rsPMCQ1MaIntDisconnect - disconnect a MiniAce interrupt routine
|
* rsPMCQ1MaIntDisconnect - disconnect a MiniAce interrupt routine
|
||||||
@@ -216,8 +223,7 @@ unsigned int rsPMCQ1MaIntConnect (
|
|||||||
*
|
*
|
||||||
* RETURNS: OK if PMCQ1 found, ERROR if not.
|
* RETURNS: OK if PMCQ1 found, ERROR if not.
|
||||||
*/
|
*/
|
||||||
|
static unsigned int rsPMCQ1MaIntDisconnect(
|
||||||
unsigned int rsPMCQ1MaIntDisconnect(
|
|
||||||
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
||||||
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
||||||
unsigned long funcNo /* Pci Function number of PMCQ1 */
|
unsigned long funcNo /* Pci Function number of PMCQ1 */
|
||||||
@@ -239,6 +245,7 @@ unsigned int rsPMCQ1MaIntDisconnect(
|
|||||||
|
|
||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
@@ -249,13 +256,12 @@ unsigned int rsPMCQ1MaIntDisconnect(
|
|||||||
*
|
*
|
||||||
* RETURNS: OK if PMCQ1 found, ERROR if not.
|
* RETURNS: OK if PMCQ1 found, ERROR if not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned int rsPMCQ1QuiccIntConnect(
|
unsigned int rsPMCQ1QuiccIntConnect(
|
||||||
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
||||||
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
||||||
unsigned long funcNo, /* Pci Function number of PMCQ1 */
|
unsigned long funcNo, /* Pci Function number of PMCQ1 */
|
||||||
FUNCION_PTR routine,/* interrupt routine */
|
FUNCTION_PTR routine,/* interrupt routine */
|
||||||
int arg /* argument to pass to interrupt routine */
|
uintptr_t arg /* argument to pass to interrupt routine */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PPMCQ1BoardData boardData;
|
PPMCQ1BoardData boardData;
|
||||||
@@ -275,6 +281,8 @@ unsigned int rsPMCQ1QuiccIntConnect(
|
|||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* This method is apparently unused. --joel 9 Oct 2014 */
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* rsPMCQ1QuiccIntDisconnect - disconnect a Quicc interrupt routine
|
* rsPMCQ1QuiccIntDisconnect - disconnect a Quicc interrupt routine
|
||||||
@@ -284,8 +292,7 @@ unsigned int rsPMCQ1QuiccIntConnect(
|
|||||||
*
|
*
|
||||||
* RETURNS: OK if PMCQ1 found, ERROR if not.
|
* RETURNS: OK if PMCQ1 found, ERROR if not.
|
||||||
*/
|
*/
|
||||||
|
static unsigned int rsPMCQ1QuiccIntDisconnect(
|
||||||
unsigned int rsPMCQ1QuiccIntDisconnect(
|
|
||||||
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
||||||
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
||||||
unsigned long funcNo /* Pci Function number of PMCQ1 */
|
unsigned long funcNo /* Pci Function number of PMCQ1 */
|
||||||
@@ -308,6 +315,8 @@ unsigned int rsPMCQ1QuiccIntDisconnect(
|
|||||||
|
|
||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
/* This method is apparently unused. --joel 9 Oct 2014 */
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@@ -323,20 +332,22 @@ unsigned int rsPMCQ1Init(void)
|
|||||||
{
|
{
|
||||||
int busNo;
|
int busNo;
|
||||||
int slotNo;
|
int slotNo;
|
||||||
unsigned int baseaddr = 0;
|
uint32_t baseaddr = 0;
|
||||||
unsigned int bridgeaddr = 0;
|
uint32_t bridgeaddr = 0;
|
||||||
unsigned long pbti0_ctl;
|
unsigned long pbti0_ctl;
|
||||||
int i;
|
int i;
|
||||||
unsigned char int_vector;
|
unsigned char int_vector;
|
||||||
int fun;
|
int fun;
|
||||||
int temp;
|
uint32_t temp;
|
||||||
PPMCQ1BoardData boardData;
|
PPMCQ1BoardData boardData;
|
||||||
rtems_irq_connect_data IrqData = {0,
|
rtems_irq_connect_data IrqData = {
|
||||||
rsPMCQ1Int,
|
.name = 0,
|
||||||
rsPMCQ1_scc_nullFunc,
|
.hdl = rsPMCQ1Int,
|
||||||
rsPMCQ1_scc_nullFunc,
|
.handle = NULL,
|
||||||
rsPMCQ1_scc_nullFunc,
|
.on = (rtems_irq_enable) rsPMCQ1_scc_nullFunc,
|
||||||
NULL};
|
.off = (rtems_irq_disable) rsPMCQ1_scc_nullFunc,
|
||||||
|
.isOn = (rtems_irq_is_enabled) rsPMCQ1_scc_nullFunc,
|
||||||
|
};
|
||||||
|
|
||||||
if (rsPMCQ1Initialized)
|
if (rsPMCQ1Initialized)
|
||||||
{
|
{
|
||||||
@@ -480,6 +491,8 @@ unsigned int rsPMCQ1Init(void)
|
|||||||
return((i > 0) ? RTEMS_SUCCESSFUL : RTEMS_IO_ERROR);
|
return((i > 0) ? RTEMS_SUCCESSFUL : RTEMS_IO_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* This method is apparently unused. --joel 9 Oct 2014 */
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* rsPMCQ1Commission - initialize the serial EEPROM on the QSPAN
|
* rsPMCQ1Commission - initialize the serial EEPROM on the QSPAN
|
||||||
@@ -489,8 +502,10 @@ unsigned int rsPMCQ1Init(void)
|
|||||||
* found with apparently uninitialised EEPROM's or PMCQ1's (to allow
|
* found with apparently uninitialised EEPROM's or PMCQ1's (to allow
|
||||||
* EEPROM modifications to be performed).
|
* EEPROM modifications to be performed).
|
||||||
*/
|
*/
|
||||||
|
static unsigned int rsPMCQ1Commission(
|
||||||
unsigned int rsPMCQ1Commission( unsigned long busNo, unsigned long slotNo )
|
unsigned long busNo,
|
||||||
|
unsigned long slotNo
|
||||||
|
)
|
||||||
{
|
{
|
||||||
unsigned int status = RTEMS_IO_ERROR;
|
unsigned int status = RTEMS_IO_ERROR;
|
||||||
uint32_t bridgeaddr = 0;
|
uint32_t bridgeaddr = 0;
|
||||||
@@ -555,6 +570,7 @@ unsigned int rsPMCQ1Commission( unsigned long busNo, unsigned long slotNo )
|
|||||||
}
|
}
|
||||||
return(status);
|
return(status);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
uint32_t PMCQ1_Read_EPLD( uint32_t base, uint32_t reg )
|
uint32_t PMCQ1_Read_EPLD( uint32_t base, uint32_t reg )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ void PMCQ1_Write_EPLD( uint32_t base, uint32_t reg, uint32_t data );
|
|||||||
|
|
||||||
#define QSPAN2_INT_STATUS 0x00000600
|
#define QSPAN2_INT_STATUS 0x00000600
|
||||||
|
|
||||||
typedef void (*FUNCION_PTR) (int);
|
typedef void (*FUNCTION_PTR) (int);
|
||||||
|
|
||||||
#define PCI_ID(v, d) ((d << 16) | v)
|
#define PCI_ID(v, d) ((d << 16) | v)
|
||||||
|
|
||||||
@@ -131,10 +131,10 @@ typedef struct _PMCQ1BoardData
|
|||||||
unsigned long funcNo;
|
unsigned long funcNo;
|
||||||
unsigned long baseaddr;
|
unsigned long baseaddr;
|
||||||
unsigned long bridgeaddr;
|
unsigned long bridgeaddr;
|
||||||
FUNCION_PTR quiccInt;
|
FUNCTION_PTR quiccInt;
|
||||||
int quiccArg;
|
uintptr_t quiccArg;
|
||||||
FUNCION_PTR maInt;
|
FUNCTION_PTR maInt;
|
||||||
int maArg;
|
uintptr_t maArg;
|
||||||
} PMCQ1BoardData, *PPMCQ1BoardData;
|
} PMCQ1BoardData, *PPMCQ1BoardData;
|
||||||
|
|
||||||
extern PPMCQ1BoardData pmcq1BoardData;
|
extern PPMCQ1BoardData pmcq1BoardData;
|
||||||
@@ -146,16 +146,18 @@ extern unsigned int rsPMCQ1QuiccIntConnect(
|
|||||||
unsigned long busNo,
|
unsigned long busNo,
|
||||||
unsigned long slotNo,
|
unsigned long slotNo,
|
||||||
unsigned long funcNo,
|
unsigned long funcNo,
|
||||||
FUNCION_PTR routine,
|
FUNCTION_PTR routine,
|
||||||
int arg
|
uintptr_t arg
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned int rsPMCQ1Init(void);
|
unsigned int rsPMCQ1Init(void);
|
||||||
|
|
||||||
unsigned int rsPMCQ1MaIntConnect (
|
unsigned int rsPMCQ1MaIntConnect (
|
||||||
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
unsigned long busNo, /* Pci Bus number of PMCQ1 */
|
||||||
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
unsigned long slotNo, /* Pci Slot number of PMCQ1 */
|
||||||
unsigned long funcNo, /* Pci Function number of PMCQ1 */
|
unsigned long funcNo, /* Pci Function number of PMCQ1 */
|
||||||
FUNCION_PTR routine,/* interrupt routine */
|
FUNCTION_PTR routine,/* interrupt routine */
|
||||||
int arg /* argument to pass to interrupt routine */
|
uintptr_t arg /* argument to pass to interrupt routine */
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* __INCPMCQ1H */
|
#endif /* __INCPMCQ1H */
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT (c) 1989-2007.
|
* COPYRIGHT (c) 1989-2014.
|
||||||
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -51,37 +51,32 @@ uint8_t LightIdx = 0;
|
|||||||
extern int RAM_END;
|
extern int RAM_END;
|
||||||
unsigned int BSP_mem_size = (unsigned int)&RAM_END;
|
unsigned int BSP_mem_size = (unsigned int)&RAM_END;
|
||||||
|
|
||||||
void BSP_Increment_Light(void){
|
static void BSP_Increment_Light(void)
|
||||||
|
{
|
||||||
uint8_t data;
|
uint8_t data;
|
||||||
|
|
||||||
data = *GENERAL_REGISTER1;
|
data = *GENERAL_REGISTER1;
|
||||||
data &= 0xf0;
|
data &= 0xf0;
|
||||||
data |= LightIdx++;
|
data |= LightIdx++;
|
||||||
*GENERAL_REGISTER1 = data;
|
*GENERAL_REGISTER1 = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BSP_Fatal_Fault_Light(void) {
|
#if 0
|
||||||
|
static void BSP_Fatal_Fault_Light(void)
|
||||||
|
{
|
||||||
uint8_t data;
|
uint8_t data;
|
||||||
|
|
||||||
data = *GENERAL_REGISTER1;
|
data = *GENERAL_REGISTER1;
|
||||||
data &= 0xf0;
|
data &= 0xf0;
|
||||||
data |= 0x7;
|
data |= 0x7;
|
||||||
while(1)
|
while(1)
|
||||||
*GENERAL_REGISTER1 = data;
|
*GENERAL_REGISTER1 = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_to_Q2ram(int offset, unsigned int data )
|
|
||||||
{
|
|
||||||
printk("0x%x ==> %d\n", offset, data );
|
|
||||||
#if 0
|
|
||||||
unsigned int *ptr = 0x82000000;
|
|
||||||
ptr += offset;
|
|
||||||
*ptr = data;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Vital Board data Start using DATA RESIDUAL
|
* Vital Board data Start using DATA RESIDUAL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint32_t VME_Slot1 = FALSE;
|
uint32_t VME_Slot1 = FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -160,27 +155,10 @@ void bsp_pretasking_hook(void)
|
|||||||
rsPMCQ1Init();
|
rsPMCQ1Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void zero_bss(void)
|
|
||||||
{
|
|
||||||
memset(__SBSS_START__, 0, ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__));
|
|
||||||
memset(__SBSS2_START__, 0, ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__));
|
|
||||||
memset(__bss_start, 0, ((unsigned) __rtems_end) - ((unsigned)__bss_start));
|
|
||||||
}
|
|
||||||
|
|
||||||
char * save_boot_params(RESIDUAL* r3, void *r4, void* r5, char *additional_boot_options)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
residualCopy = *r3;
|
|
||||||
strncpy(loaderParam, additional_boot_options, MAX_LOADER_ADD_PARM);
|
|
||||||
loaderParam[MAX_LOADER_ADD_PARM - 1] ='\0';
|
|
||||||
return loaderParam;
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int EUMBBAR;
|
unsigned int EUMBBAR;
|
||||||
|
|
||||||
unsigned int get_eumbbar(void) {
|
static unsigned int get_eumbbar(void)
|
||||||
|
{
|
||||||
register int a, e;
|
register int a, e;
|
||||||
|
|
||||||
__asm__ volatile( "lis %0,0xfec0; ori %0,%0,0x0000": "=r" (a) );
|
__asm__ volatile( "lis %0,0xfec0; ori %0,%0,0x0000": "=r" (a) );
|
||||||
@@ -198,7 +176,7 @@ unsigned int get_eumbbar(void) {
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Read_ep1a_config_registers( ppc_cpu_id_t myCpu ) {
|
static void Read_ep1a_config_registers( ppc_cpu_id_t myCpu ) {
|
||||||
unsigned char value;
|
unsigned char value;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -273,7 +251,6 @@ void Read_ep1a_config_registers( ppc_cpu_id_t myCpu ) {
|
|||||||
*
|
*
|
||||||
* This routine does the bulk of the system initialization.
|
* This routine does the bulk of the system initialization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void bsp_start( void )
|
void bsp_start( void )
|
||||||
{
|
{
|
||||||
uintptr_t intrStackStart;
|
uintptr_t intrStackStart;
|
||||||
@@ -290,6 +267,7 @@ void bsp_start( void )
|
|||||||
BSP_Increment_Light();
|
BSP_Increment_Light();
|
||||||
myCpu = get_ppc_cpu_type();
|
myCpu = get_ppc_cpu_type();
|
||||||
myCpuRevision = get_ppc_cpu_revision();
|
myCpuRevision = get_ppc_cpu_revision();
|
||||||
|
(void) myCpuRevision; /* avoid set but not used warning */
|
||||||
|
|
||||||
EUMBBAR = get_eumbbar();
|
EUMBBAR = get_eumbbar();
|
||||||
printk("EUMBBAR 0x%08x\n", EUMBBAR );
|
printk("EUMBBAR 0x%08x\n", EUMBBAR );
|
||||||
|
|||||||
Reference in New Issue
Block a user