With the kind permission of Marconi Communications (Formerly "Fore Communication"
include a copy of the 3.0.1 firmware for the PCA200E card in the fore_dnld program. There are various and subtle compatibility issues between the hfa driver and the microcode, this version is belived to work best. If a file is specified on the command line it will be used instead of the embedded image. Approved by: jkh
This commit is contained in:
parent
b12cbb5f48
commit
12d9b60f3b
38
sbin/atm/fore_dnld/COPYRIGHT
Normal file
38
sbin/atm/fore_dnld/COPYRIGHT
Normal file
@ -0,0 +1,38 @@
|
||||
$FreeBSD$
|
||||
|
||||
This copyright applies to the microcode image in the file pca200e.c.
|
||||
|
||||
(Copyright Notice)
|
||||
|
||||
Copyright (c) 1995-2000 FORE Systems, Inc., as an unpublished work.
|
||||
|
||||
This notice does not imply unrestricted or public access to these
|
||||
materials which are a trade secret of FORE Systems, Inc. or its
|
||||
subsidiaries or affiliates (together referred to as "FORE"), and
|
||||
which may not be reproduced, used, sold or transferred to any third
|
||||
party without FORE's prior written consent. All rights reserved.
|
||||
|
||||
U.S. Government Restricted Rights.
|
||||
|
||||
If you are licensing the Software on behalf of the U.S. Government
|
||||
("Government"), the following provisions apply to you. If the
|
||||
software is supplied to the Department of Defense ("DoD"), it is
|
||||
classified as "Commercial Computer Software" under paragraph
|
||||
252.227-7014 of the DoD Supplement to the Federal Acquisition
|
||||
Regulations ("DFARS") (or any successor regulations) and the
|
||||
Government is acquiring only the license rights granted herein (the
|
||||
license rights customarily provided to non-Government users). If
|
||||
the Software is supplied to any unit or agency of the Government
|
||||
other than the DoD, it is classified as "Restricted Computer
|
||||
Software" and the Government's rights in the Software are defined
|
||||
in paragraph 52.227-19 of the Federal Acquisition Regulations
|
||||
("FAR") (or any successor regulations) or, in the cases of NASA,
|
||||
in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or
|
||||
any successor regulations).
|
||||
|
||||
FORE Systems is a registered trademark, and ForeRunner, ForeRunnerLE,
|
||||
and ForeThought are trademarks of FORE Systems, Inc. All other
|
||||
brands or product names are trademarks or registered trademarks of
|
||||
their respective holders.
|
||||
|
||||
(End Copyright Notice)
|
@ -29,6 +29,7 @@
|
||||
|
||||
PROG= fore_dnld
|
||||
MAN8= fore_dnld.8
|
||||
SRCS= fore_dnld.c pca200e.c
|
||||
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys
|
||||
LDADD+= -latm
|
||||
|
@ -70,10 +70,15 @@ Specify the microcode binary file. Defaults are:
|
||||
.fi
|
||||
.SH NOTES
|
||||
.PP
|
||||
For the PCA200E adapter, if no file is specified on the command
|
||||
line a built-in copy of version 3.0.1 microcode is used.
|
||||
.PP
|
||||
Microcode as distributed by FORE Systems is not ready for downloading
|
||||
directly into SBA host ATM adapters. Instead, the supplied microcode needs
|
||||
to be processed with the "objcopy" command to create an image suitable
|
||||
for downloading. Arguments to "objcopy" are "-S -l -Fcoff". Microcode as
|
||||
for downloading. Arguments to "objcopy" are "-S -l -Fcoff".
|
||||
.PP
|
||||
Microcode as
|
||||
distibuted by FORE Systems for the PCA host ATM adapter does not need
|
||||
to be processed.
|
||||
.SH "SEE ALSO"
|
||||
|
@ -67,6 +67,8 @@
|
||||
__RCSID("@(#) $FreeBSD$");
|
||||
#endif
|
||||
|
||||
extern u_char pca200e_microcode[];
|
||||
extern int pca200e_microcode_size;
|
||||
|
||||
#ifdef sun
|
||||
#define DEV_NAME "/dev/sbus%d"
|
||||
@ -662,6 +664,107 @@ char *filename;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
loadmicrocode ( ucode, size, ram )
|
||||
u_char *ucode;
|
||||
int size;
|
||||
u_char *ram;
|
||||
{
|
||||
struct {
|
||||
u_long Id;
|
||||
u_long fver;
|
||||
u_long start;
|
||||
u_long entry;
|
||||
} binhdr;
|
||||
#ifdef sun
|
||||
union {
|
||||
u_long w;
|
||||
char c[4];
|
||||
} w1, w2;
|
||||
#endif
|
||||
int n;
|
||||
int cnt = 0;
|
||||
u_char *bufp;
|
||||
u_long *lp;
|
||||
|
||||
|
||||
/*
|
||||
* Check that we understand this header
|
||||
*/
|
||||
memcpy(&binhdr, ucode, sizeof(binhdr));
|
||||
if ( strncmp ( (caddr_t)&binhdr.Id, "fore", 4 ) != 0 ) {
|
||||
fprintf ( stderr, "Unrecognized format in micorcode file." );
|
||||
return ( -1 );
|
||||
}
|
||||
|
||||
#ifdef sun
|
||||
/*
|
||||
* We always swap the SunOS microcode file...
|
||||
*/
|
||||
endian = 1;
|
||||
|
||||
/*
|
||||
* We need to swap the header start/entry words...
|
||||
*/
|
||||
w1.w = binhdr.start;
|
||||
for ( n = 0; n < sizeof(u_long); n++ )
|
||||
w2.c[3-n] = w1.c[n];
|
||||
binhdr.start = w2.w;
|
||||
w1.w = binhdr.entry;
|
||||
for ( n = 0; n < sizeof(u_long); n++ )
|
||||
w2.c[3-n] = w1.c[n];
|
||||
binhdr.entry = w2.w;
|
||||
#endif /* sun */
|
||||
|
||||
/*
|
||||
* Set pointer to RAM load location
|
||||
*/
|
||||
bufp = (ram + binhdr.start);
|
||||
|
||||
/*
|
||||
* Load file
|
||||
*/
|
||||
if ( endian ) {
|
||||
int i;
|
||||
|
||||
lp = (u_long *) ucode;
|
||||
/* Swap buffer */
|
||||
for ( i = 0; i < size / sizeof(long); i++ )
|
||||
#ifndef sun
|
||||
lp[i] = CP_WRITE(lp[i]);
|
||||
#else
|
||||
{
|
||||
int j;
|
||||
|
||||
w1.w = lp[i];
|
||||
for ( j = 0; j < 4; j++ )
|
||||
w2.c[3-j] = w1.c[j];
|
||||
lp[i] = w2.w;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
bcopy ( (caddr_t)ucode, bufp, size );
|
||||
|
||||
/*
|
||||
* With .bin extension, we need to specify start address on 'go'
|
||||
* command.
|
||||
*/
|
||||
{
|
||||
char cmd[80];
|
||||
|
||||
sprintf ( cmd, "go %lx\r\n", binhdr.entry );
|
||||
|
||||
xmit_to_i960 ( cmd, strlen ( cmd ), 0 );
|
||||
|
||||
while ( strncmp ( line, cmd, strlen(cmd) - 3 ) != 0 )
|
||||
getline ( verbose );
|
||||
|
||||
if ( verbose )
|
||||
printf("\n");
|
||||
}
|
||||
return ( 0 );
|
||||
}
|
||||
|
||||
int
|
||||
sendbinfile ( fname, ram )
|
||||
char *fname;
|
||||
@ -829,7 +932,9 @@ char *argv[];
|
||||
char *devname = "\0"; /* Device to download */
|
||||
char *dirname = NULL; /* Directory path to objd files */
|
||||
char *objfile = NULL; /* Command line object filename */
|
||||
char *sndfile; /* Object filename to download */
|
||||
u_char *ucode = NULL; /* Pointer to microcode */
|
||||
int ucode_size = 0; /* Length of microcode */
|
||||
char *sndfile = NULL; /* Object filename to download */
|
||||
char filename[64]; /* Constructed object filename */
|
||||
char base[64]; /* sba200/sba200e/pca200e basename */
|
||||
int ext = 0; /* 0 == bin 1 == objd */
|
||||
@ -1195,15 +1300,9 @@ char *argv[];
|
||||
sndfile = filename;
|
||||
break;
|
||||
case DEV_FORE_PCA200E:
|
||||
sprintf ( filename, "%s.bin", base );
|
||||
if ( stat ( filename, &sbuf ) == -1 ) {
|
||||
sprintf ( filename, "%s/%s.bin",
|
||||
dirname, base );
|
||||
if ( stat ( filename, &sbuf ) != -1 ) {
|
||||
sndfile = filename;
|
||||
}
|
||||
} else
|
||||
sndfile = filename;
|
||||
/* Use compiled in microcode */
|
||||
ucode = pca200e_microcode;
|
||||
ucode_size = pca200e_microcode_size;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -1213,8 +1312,10 @@ char *argv[];
|
||||
|
||||
if ( ext && !binary )
|
||||
err = xmitfile ( sndfile );
|
||||
else
|
||||
else if (sndfile != NULL)
|
||||
err = sendbinfile ( sndfile, ram );
|
||||
else
|
||||
err = loadmicrocode( ucode, ucode_size, ram );
|
||||
|
||||
if ( err ) {
|
||||
fprintf(stderr, "%s download failed\n",
|
||||
|
1749
sbin/atm/fore_dnld/pca200e.c
Normal file
1749
sbin/atm/fore_dnld/pca200e.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user