forked from Imagelibrary/rtems
Add some bootrom system calls.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2005-02-01 Eric Norum <norume@aps.anl.gov>
|
||||
|
||||
* include/bsp.h, network/network.c, startup/bspstart.c: Add some
|
||||
bootprom system calls.
|
||||
|
||||
2005-02-01 Eric Norum <norume@aps.anl.gov>
|
||||
|
||||
* start/start.S, network/network.c: Place FEC buffer descriptors in SRAM.
|
||||
|
||||
@@ -68,6 +68,9 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
/* functions */
|
||||
|
||||
unsigned32 get_CPU_clock_speed(void);
|
||||
unsigned const char *uC5282_gethwaddr(int a);
|
||||
char *uC5282_getbenv(const char *a);
|
||||
|
||||
void bsp_cleanup(void);
|
||||
|
||||
m68k_isr_entry set_vector(
|
||||
|
||||
@@ -139,22 +139,6 @@ mcf5282_bd_allocate(unsigned int count)
|
||||
return p;
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve MAC address from bootloader environment variable area.
|
||||
* Parameter is interface number (0 or 1).
|
||||
*/
|
||||
static unsigned char *
|
||||
gethwaddr(int a)
|
||||
{
|
||||
register long __res __asm__ ("%d2") = 12;
|
||||
register long __a __asm__ ("%d1") = (long)a;
|
||||
__asm__ __volatile__ ("trap #2" \
|
||||
: "=g" (__res) \
|
||||
: "0" (__res), "d" (__a) \
|
||||
: "%d0");
|
||||
return (unsigned char *)(__res);
|
||||
}
|
||||
|
||||
static void
|
||||
mcf5282_fec_initialize_hardware(struct mcf5282_enet_struct *sc)
|
||||
{
|
||||
@@ -794,7 +778,7 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching )
|
||||
if (config->hardware_address)
|
||||
hwaddr = config->hardware_address;
|
||||
else
|
||||
hwaddr = gethwaddr(unitNumber - 1);
|
||||
hwaddr = uC5282_gethwaddr(unitNumber - 1);
|
||||
printf("%s%d: Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
unitName, unitNumber,
|
||||
hwaddr[0], hwaddr[1], hwaddr[2],
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
/*
|
||||
* The original table from the application and our copy of it with
|
||||
@@ -250,3 +251,33 @@ unsigned32 get_CPU_clock_speed(void)
|
||||
extern char _CPUClockSpeed[];
|
||||
return( (unsigned32)_CPUClockSpeed);
|
||||
}
|
||||
|
||||
/*
|
||||
* Arcturus routines for getting value from bootloader
|
||||
*/
|
||||
#define __bsc_return(type, res) \
|
||||
do { \
|
||||
if ((unsigned long)(res) >= (unsigned long)(-64)) { \
|
||||
errno = -(res); \
|
||||
res = -1; \
|
||||
} \
|
||||
return (type)(res); \
|
||||
} while (0)
|
||||
#define _bsc1(type,name,atype,a) \
|
||||
type uC5282_##name(atype a) \
|
||||
{ \
|
||||
long __res; \
|
||||
register long __a __asm__ ("%d1") = (long)a; \
|
||||
__asm__ __volatile__ ("move.l %0,%%d0\n\t" \
|
||||
"trap #2\n\t" \
|
||||
"move.l %%d0,%0" \
|
||||
: "=d" (__res) \
|
||||
: "0" (__BN_##name), "d" (__a) \
|
||||
: "d0" ); \
|
||||
__bsc_return(type,__res); \
|
||||
}
|
||||
#define __BN_gethwaddr 12 /* get the hardware address of my interfaces */
|
||||
#define __BN_getbenv 14 /* get a bootloader envvar */
|
||||
#define __BN_setbenv 15 /* get a bootloader envvar */
|
||||
_bsc1(unsigned const char *, gethwaddr, int, a)
|
||||
_bsc1(char *, getbenv, const char *, a)
|
||||
|
||||
Reference in New Issue
Block a user