forked from Imagelibrary/rtems
powerpc/beatnik: Fix warnings
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* bsp.h -- contain BSP API definition.
|
* bsp.h -- contain BSP API definition.
|
||||||
*
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
* Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
|
* Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
@@ -11,9 +13,12 @@
|
|||||||
*
|
*
|
||||||
* Modified for the 'beatnik' BSP by T. Straumann, 2005-2007.
|
* Modified for the 'beatnik' BSP by T. Straumann, 2005-2007.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSP_BEATNIK_BSP_H
|
#ifndef LIBBSP_BEATNIK_BSP_H
|
||||||
#define LIBBSP_BEATNIK_BSP_H
|
#define LIBBSP_BEATNIK_BSP_H
|
||||||
|
|
||||||
|
#ifndef ASM
|
||||||
|
|
||||||
#include <bspopts.h>
|
#include <bspopts.h>
|
||||||
#include <bsp/default-initial-extension.h>
|
#include <bsp/default-initial-extension.h>
|
||||||
|
|
||||||
@@ -34,8 +39,7 @@ typedef enum {
|
|||||||
MVME6100
|
MVME6100
|
||||||
} BSP_BoardType;
|
} BSP_BoardType;
|
||||||
|
|
||||||
BSP_BoardType
|
BSP_BoardType BSP_getBoardType(void);
|
||||||
BSP_getBoardType();
|
|
||||||
|
|
||||||
/* Discovery Version */
|
/* Discovery Version */
|
||||||
|
|
||||||
@@ -52,9 +56,7 @@ typedef enum {
|
|||||||
* If a non-zero argument is passed, the routine panics
|
* If a non-zero argument is passed, the routine panics
|
||||||
* (BSP_panic) if no recognized bridge is found;
|
* (BSP_panic) if no recognized bridge is found;
|
||||||
*/
|
*/
|
||||||
|
DiscoveryVersion BSP_getDiscoveryVersion(int assertion);
|
||||||
DiscoveryVersion
|
|
||||||
BSP_getDiscoveryVersion(int assertion);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* confdefs.h overrides for this BSP:
|
* confdefs.h overrides for this BSP:
|
||||||
@@ -93,11 +95,15 @@ BSP_getDiscoveryVersion(int assertion);
|
|||||||
* and the deprecated inl()/outl() etc won't work!
|
* and the deprecated inl()/outl() etc won't work!
|
||||||
*/
|
*/
|
||||||
#define _IO_BASE 0x00000000
|
#define _IO_BASE 0x00000000
|
||||||
/* wonderful MotLoad has the base address as seen from the CPU programmed into config space :-) */
|
/* wonderful MotLoad has the base address as seen from the
|
||||||
|
* CPU programmed into config space :-)
|
||||||
|
*/
|
||||||
#define PCI_MEM_BASE 0
|
#define PCI_MEM_BASE 0
|
||||||
#define PCI_MEM_BASE_ADJUSTMENT 0
|
#define PCI_MEM_BASE_ADJUSTMENT 0
|
||||||
#define PCI_DRAM_OFFSET 0
|
#define PCI_DRAM_OFFSET 0
|
||||||
|
|
||||||
|
extern void BSP_motload_pci_fixup(void);
|
||||||
|
|
||||||
/* PCI <-> local address mapping - no sophisticated windows
|
/* PCI <-> local address mapping - no sophisticated windows
|
||||||
* (i.e., no support for cached regions etc. you read a BAR
|
* (i.e., no support for cached regions etc. you read a BAR
|
||||||
* from config space and that's 1:1 where the CPU sees it).
|
* from config space and that's 1:1 where the CPU sees it).
|
||||||
@@ -148,8 +154,7 @@ BSP_getDiscoveryVersion(int assertion);
|
|||||||
* /dev/i2c0.ds1621 (read-only; one byte: board-temp in degC)
|
* /dev/i2c0.ds1621 (read-only; one byte: board-temp in degC)
|
||||||
* /dev/i2c0.ds1621-raw (read-write; transfer bytes to/from the ds1621)
|
* /dev/i2c0.ds1621-raw (read-write; transfer bytes to/from the ds1621)
|
||||||
*/
|
*/
|
||||||
int
|
int BSP_i2c_initialize(void);
|
||||||
BSP_i2c_initialize();
|
|
||||||
|
|
||||||
/* Networking; */
|
/* Networking; */
|
||||||
#if defined(RTEMS_NETWORKING)
|
#if defined(RTEMS_NETWORKING)
|
||||||
@@ -165,12 +170,14 @@ BSP_i2c_initialize();
|
|||||||
#define BSP_DEV_AND_PCI_IO_BASE 0xf0000000
|
#define BSP_DEV_AND_PCI_IO_BASE 0xf0000000
|
||||||
#define BSP_DEV_AND_PCI_IO_SIZE 0x10000000
|
#define BSP_DEV_AND_PCI_IO_SIZE 0x10000000
|
||||||
|
|
||||||
/* maintain coherency between CPU and GT64340 ethernet (& possibly other discovery components) */
|
/* maintain coherency between CPU and GT64340 Ethernet
|
||||||
|
* (andpossibly other Discovery components).
|
||||||
|
*/
|
||||||
#define BSP_RW_PAGE_ATTRIBUTES TRIV121_ATTR_M
|
#define BSP_RW_PAGE_ATTRIBUTES TRIV121_ATTR_M
|
||||||
|
|
||||||
extern unsigned BSP_pci_hose1_bus_base;
|
extern unsigned BSP_pci_hose1_bus_base;
|
||||||
|
|
||||||
void BSP_pci_initialize();
|
void BSP_pci_initialize(void);
|
||||||
|
|
||||||
/* Exception Handling */
|
/* Exception Handling */
|
||||||
|
|
||||||
@@ -257,9 +264,30 @@ extern unsigned long _BSP_clear_hostbridge_errors(int enableMCP, int quiet);
|
|||||||
* 16-bit error status on error.
|
* 16-bit error status on error.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
extern unsigned short
|
extern unsigned short (*_BSP_clear_vmebridge_errors)(int);
|
||||||
(*_BSP_clear_vmebridge_errors)(int);
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prototypes for debug helpers
|
||||||
|
*/
|
||||||
|
void discovery_pic_set_debug_irq(int on);
|
||||||
|
void discovery_pic_install_debug_irq(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prototypes for methods called only from .S for dependency tracking
|
||||||
|
*/
|
||||||
|
char *save_boot_params(
|
||||||
|
void *r3,
|
||||||
|
void *r4,
|
||||||
|
void *r5,
|
||||||
|
char *cmdline_start,
|
||||||
|
char *cmdline_end
|
||||||
|
);
|
||||||
|
void zero_bss(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prototypes for methods in the BSP that cross file boundaries
|
||||||
|
*/
|
||||||
|
uint32_t probeMemoryEnd(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -267,4 +295,6 @@ extern unsigned short
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* !ASM */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ int i;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void discovery_dump_picregs(void)
|
static void discovery_dump_picregs(void)
|
||||||
{
|
{
|
||||||
printk(" ..GPP_IRQ. -- ..MAIN_HI. -- ..MAIN_LO.\n");
|
printk(" ..GPP_IRQ. -- ..MAIN_HI. -- ..MAIN_LO.\n");
|
||||||
printk("Cause:"); pregs(thePic.causes);
|
printk("Cause:"); pregs(thePic.causes);
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
*
|
*
|
||||||
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
|
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
#include <bsp/gtreg.h>
|
#include <bsp/gtreg.h>
|
||||||
#include <libcpu/io.h>
|
#include <libcpu/io.h>
|
||||||
@@ -80,6 +81,7 @@ static inline uint32_t gt_timer_bitmod(uint32_t off, uint32_t clr, uint32_t set)
|
|||||||
{
|
{
|
||||||
unsigned flags;
|
unsigned flags;
|
||||||
uint32_t rval;
|
uint32_t rval;
|
||||||
|
|
||||||
rtems_interrupt_disable(flags);
|
rtems_interrupt_disable(flags);
|
||||||
rval = gt_rd( off );
|
rval = gt_rd( off );
|
||||||
gt_wr( off, (rval & ~clr) | set );
|
gt_wr( off, (rval & ~clr) | set );
|
||||||
@@ -126,6 +128,7 @@ BSP_timer_setup(uint32_t timer, void (*isr)(void *arg), void *arg, int reload)
|
|||||||
TIMER_ARGCHECK(timer);
|
TIMER_ARGCHECK(timer);
|
||||||
if ( isr && gt_timer_isrs[timer].isr )
|
if ( isr && gt_timer_isrs[timer].isr )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
BSP_timer_stop(timer);
|
BSP_timer_stop(timer);
|
||||||
/* mask and clear */
|
/* mask and clear */
|
||||||
gt_timer_bitmod(GT_TIMER_0_3_Intr_Msk, GT_TIMER_0_Intr<<timer, 0);
|
gt_timer_bitmod(GT_TIMER_0_3_Intr_Msk, GT_TIMER_0_Intr<<timer, 0);
|
||||||
@@ -208,7 +211,8 @@ int i, ainc, arg;
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
#ifdef DEBUG_MODULAR
|
||||||
|
static int
|
||||||
BSP_timers_uninstall(void)
|
BSP_timers_uninstall(void)
|
||||||
{
|
{
|
||||||
rtems_irq_connect_data xx = {0};
|
rtems_irq_connect_data xx = {0};
|
||||||
@@ -242,6 +246,7 @@ int i;
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
BSP_timer_clock_get(uint32_t timer)
|
BSP_timer_clock_get(uint32_t timer)
|
||||||
@@ -254,13 +259,6 @@ int BSP_timer_instances(void)
|
|||||||
return GT_TIMER_MAX + 1;
|
return GT_TIMER_MAX + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
void BSP_timer_test_isr(void *arg)
|
|
||||||
{
|
|
||||||
printk("TIMER IRQ (user arg 0x%x)\n",arg);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* On a 64260A we can't read the status (on/off), apparently
|
/* On a 64260A we can't read the status (on/off), apparently
|
||||||
* so we maintain it locally and assume the firmware has
|
* so we maintain it locally and assume the firmware has
|
||||||
* not enabled the dog initially...
|
* not enabled the dog initially...
|
||||||
@@ -270,6 +268,7 @@ static uint32_t wdog_on = 0x00ffffff;
|
|||||||
static uint32_t rd_wdcnf(void)
|
static uint32_t rd_wdcnf(void)
|
||||||
{
|
{
|
||||||
uint32_t cnf = gt_rd(GT_WDOG_Config);
|
uint32_t cnf = gt_rd(GT_WDOG_Config);
|
||||||
|
|
||||||
/* BSD driver says that on the 64260A we always
|
/* BSD driver says that on the 64260A we always
|
||||||
* read 0xffffffff so we have to maintain the
|
* read 0xffffffff so we have to maintain the
|
||||||
* status locally (and hope we get the initial
|
* status locally (and hope we get the initial
|
||||||
@@ -385,6 +384,7 @@ uint32_t ctl = rd_wdcnf();
|
|||||||
int BSP_watchdog_pet(void)
|
int BSP_watchdog_pet(void)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if ( !wdog_on )
|
if ( !wdog_on )
|
||||||
return -1;
|
return -1;
|
||||||
rtems_interrupt_disable(flags);
|
rtems_interrupt_disable(flags);
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include <rtems/bspIo.h>
|
#include <rtems/bspIo.h>
|
||||||
#include <bsp/pci.h>
|
#include <bsp/pci.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "pci_io_remap.h"
|
||||||
|
|
||||||
#ifndef PCI_MULTI_FUN
|
#ifndef PCI_MULTI_FUN
|
||||||
#define PCI_MULTI_FUN 0x80
|
#define PCI_MULTI_FUN 0x80
|
||||||
@@ -71,15 +72,12 @@
|
|||||||
* Devices behind such a bridge are not accessible through I/O
|
* Devices behind such a bridge are not accessible through I/O
|
||||||
* and should probably be switched off (not done by this code).
|
* and should probably be switched off (not done by this code).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
rtems_pci_io_remap(int bus_from, int bus_to, uint32_t offset)
|
rtems_pci_io_remap(int bus_from, int bus_to, uint32_t offset)
|
||||||
{
|
{
|
||||||
int rval = 0;
|
int rval = 0;
|
||||||
|
|
||||||
int bus, dev, fun, maxf;
|
int bus, dev, fun, maxf;
|
||||||
int bar, numBars = 0;
|
int bar, numBars = 0;
|
||||||
|
|
||||||
uint8_t b;
|
uint8_t b;
|
||||||
uint16_t s;
|
uint16_t s;
|
||||||
uint32_t d;
|
uint32_t d;
|
||||||
|
|||||||
@@ -143,8 +143,13 @@ char *BSP_commandline_string = cmdline_buf;
|
|||||||
/* this routine is called early and must be safe with a not properly
|
/* this routine is called early and must be safe with a not properly
|
||||||
* aligned stack
|
* aligned stack
|
||||||
*/
|
*/
|
||||||
char *
|
char *save_boot_params(
|
||||||
save_boot_params(void *r3, void *r4, void* r5, char *cmdline_start, char *cmdline_end)
|
void *r3,
|
||||||
|
void *r4,
|
||||||
|
void *r5,
|
||||||
|
char *cmdline_start,
|
||||||
|
char *cmdline_end
|
||||||
|
)
|
||||||
{
|
{
|
||||||
int i=cmdline_end-cmdline_start;
|
int i=cmdline_end-cmdline_start;
|
||||||
if ( i >= CMDLINE_BUF_SIZE )
|
if ( i >= CMDLINE_BUF_SIZE )
|
||||||
|
|||||||
@@ -75,6 +75,9 @@
|
|||||||
*/
|
*/
|
||||||
#define _VME_DRAM_OFFSET 0x90000000
|
#define _VME_DRAM_OFFSET 0x90000000
|
||||||
|
|
||||||
|
extern int BSP_VMEInit(void);
|
||||||
|
extern int BSP_VMEIrqMgrInstall(void);
|
||||||
|
|
||||||
#define BSP_VME_INSTALL_IRQ_MGR(err) \
|
#define BSP_VME_INSTALL_IRQ_MGR(err) \
|
||||||
do { \
|
do { \
|
||||||
err = -1; \
|
err = -1; \
|
||||||
|
|||||||
Reference in New Issue
Block a user