Add some bootrom system calls.

This commit is contained in:
Eric Norum
2005-02-01 17:16:41 +00:00
parent 891aa12e43
commit 7eab0f78ec
4 changed files with 40 additions and 17 deletions

View File

@@ -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.

View File

@@ -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(

View File

@@ -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],

View File

@@ -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)