From 558f2f176e094c33ddb3ed8530e2ba07e6e02f39 Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 29 Jul 2000 19:22:54 +0000 Subject: [PATCH] update the network support to etherboot-4.6.4. --- ChangeLog | 22 ++++++ NEWS | 1 + THANKS | 1 + configure | 173 ++++++++++++++++++++++------------------- configure.in | 7 ++ netboot/3c509.c | 100 ++++++++++-------------- netboot/3c509.h | 100 ++++++++++++------------ netboot/README.netboot | 6 ++ netboot/cards.h | 5 ++ netboot/config.c | 19 ++++- netboot/epic100.c | 4 +- netboot/main.c | 12 +-- netboot/ns8390.c | 2 +- netboot/pci.h | 10 ++- netboot/sk_g16.h | 4 +- netboot/tulip.c | 51 +++++++++++- 16 files changed, 308 insertions(+), 209 deletions(-) diff --git a/ChangeLog b/ChangeLog index d47d5af6d..63a9272d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2000-07-30 OKUJI Yoshinori + + Update the network support to Etherboot-4.6.4. + + From Daniel Wagner : + * netboot/3c509.c: Copied from Etherboot-4.6.4. + * netboot/3c509.h: Likewise. + * netboot/cards.h: Likewise. + * netboot/ns8390.c: Likewise. + * netboot/sk_g16.c: Likewise. + * netboot/sk_g16.h: Likewise. + * netboot/tulip.c: Likewise. + * netboot/pci.h: Likewise. + * netboot/main.c (dhcpdiscover): Updated. + (dhcprequest): Likewise. + (bootp): Likewise. + * netboot/README.netboot: Added the information about the new + option --enable-ns8390-force-16bit. + * configure.in (--enable-ns8390-force-16bit): New option. + + * netboot/config.c: Updated. + 2000-07-29 OKUJI Yoshinori The Linux zImage support is working now. diff --git a/NEWS b/NEWS index 5242ab2cb..6c29df7ca 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ New in 0.5.96 - XXXX-XX-XX: * You can specify `--no-mem-option' to the command "kernel", if you want GRUB not to pass a Linux's mem option automatically. * Now GRUB is compliant with the Linux/i386 boot protocol version 2.02. +* The network support is updated to Etherboot-4.6.4. New in 0.5.95 - 2000-06-27: * NetBSD ELF kernel support is added. You have to specify the new option diff --git a/THANKS b/THANKS index 901d9aac8..7e06b2c10 100644 --- a/THANKS +++ b/THANKS @@ -14,6 +14,7 @@ Bryan Ford Chip Salzenberg Christoph Plattner Dan J. Walters +Daniel Wagner Edmund GRIMLEY EVANS Edward Killips Eric Hanchrow diff --git a/configure b/configure index 74ec472c5..282180812 100644 --- a/configure +++ b/configure @@ -99,6 +99,9 @@ ac_help="$ac_help ac_help="$ac_help --enable-compex-rl2000-fix specify this if you have a Compex RL2000 PCI" +ac_help="$ac_help + --enable-ns8390-force-16bit + specify this if falsely 8 bit is detected" ac_help="$ac_help --enable-smc9000-scan=LIST probe for SMC9000 I/O addresses using LIST" @@ -652,7 +655,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:656: checking for a BSD compatible install" >&5 +echo "configure:659: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -705,7 +708,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:709: checking whether build environment is sane" >&5 +echo "configure:712: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -777,7 +780,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:781: checking for $ac_word" >&5 +echo "configure:784: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -807,7 +810,7 @@ test -n "$AWK" && break done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:811: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:814: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -933,7 +936,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:937: checking host system type" >&5 +echo "configure:940: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -967,7 +970,7 @@ esac # echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:971: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:974: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -993,7 +996,7 @@ if test "x$enable_maintainer_mode" = xyes; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:997: checking for $ac_word" >&5 +echo "configure:1000: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1040,7 +1043,7 @@ fi # echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1044: checking build system type" >&5 +echo "configure:1047: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1066,7 +1069,7 @@ fi # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1070: checking for $ac_word" >&5 +echo "configure:1073: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1098,7 +1101,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1102: checking for $ac_word" >&5 +echo "configure:1105: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1128,7 +1131,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1132: checking for $ac_word" >&5 +echo "configure:1135: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1179,7 +1182,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1183: checking for $ac_word" >&5 +echo "configure:1186: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1211,7 +1214,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1215: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1218: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1222,12 +1225,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1226 "configure" +#line 1229 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1253,12 +1256,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1257: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1262: checking whether we are using GNU C" >&5 +echo "configure:1265: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1267,7 +1270,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1286,7 +1289,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1290: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1293: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1319,7 +1322,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1323: checking how to run the C preprocessor" >&5 +echo "configure:1326: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1334,13 +1337,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1351,13 +1354,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1368,13 +1371,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1381: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1407,7 +1410,7 @@ echo "$ac_t""$CPP" 1>&6 depcc="$CC" depcpp="$CPP" echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 -echo "configure:1411: checking dependency style of $depcc" >&5 +echo "configure:1414: checking dependency style of $depcc" >&5 if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1463,7 +1466,7 @@ if test "x$with_binutils" != x; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1467: checking for $ac_word" >&5 +echo "configure:1470: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1500,7 +1503,7 @@ else # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1504: checking for $ac_word" >&5 +echo "configure:1507: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1540,7 +1543,7 @@ if test "x$ac_cv_prog_gcc" = xyes; then STAGE1_CFLAGS="-O2" GRUB_CFLAGS="-O2" echo $ac_n "checking whether optimization for size works""... $ac_c" 1>&6 -echo "configure:1544: checking whether optimization for size works" >&5 +echo "configure:1547: checking whether optimization for size works" >&5 if eval "test \"`echo '$''{'size_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1548,14 +1551,14 @@ else saved_CFLAGS=$CFLAGS CFLAGS="-Os -g" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* size_flag=yes else @@ -1590,7 +1593,7 @@ if test "x$with_binutils" != x; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1594: checking for $ac_word" >&5 +echo "configure:1597: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1626,7 +1629,7 @@ else # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1630: checking for $ac_word" >&5 +echo "configure:1633: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1660,7 +1663,7 @@ fi # Defined in acinclude.m4. echo $ac_n "checking if C symbols get an underscore after compilation""... $ac_c" 1>&6 -echo "configure:1664: checking if C symbols get an underscore after compilation" >&5 +echo "configure:1667: checking if C symbols get an underscore after compilation" >&5 if eval "test \"`echo '$''{'grub_cv_asm_uscore'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1673,7 +1676,7 @@ func (int *list) } EOF -if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'; { (eval echo configure:1677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.s; then +if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'; { (eval echo configure:1680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.s; then true else { echo "configure: error: ${CC-cc} failed to produce assembly code" 1>&2; exit 1; } @@ -1699,7 +1702,7 @@ fi echo "$ac_t""$grub_cv_asm_uscore" 1>&6 echo $ac_n "checking whether ${OBJCOPY} works for absolute addresses""... $ac_c" 1>&6 -echo "configure:1703: checking whether ${OBJCOPY} works for absolute addresses" >&5 +echo "configure:1706: checking whether ${OBJCOPY} works for absolute addresses" >&5 if eval "test \"`echo '$''{'grub_cv_prog_objcopy_absolute'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1711,21 +1714,21 @@ cmain (void) } EOF -if { (eval echo configure:1715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then : +if { (eval echo configure:1718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then : else { echo "configure: error: ${CC-cc} cannot compile C source code" 1>&2; exit 1; } fi grub_cv_prog_objcopy_absolute=yes for link_addr in 2000 8000 7C00; do - if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'; { (eval echo configure:1721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : + if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'; { (eval echo configure:1724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : else { echo "configure: error: ${CC-cc} cannot link at address $link_addr" 1>&2; exit 1; } fi - if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'; { (eval echo configure:1725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : + if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'; { (eval echo configure:1728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : else { echo "configure: error: ${OBJCOPY-objcopy} cannot create binary files" 1>&2; exit 1; } fi - if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'; { (eval echo configure:1729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'; { (eval echo configure:1732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then mv -f conftest conftest.old else grub_cv_prog_objcopy_absolute=no @@ -1742,7 +1745,7 @@ fi echo $ac_n "checking whether addr32 must be in the same line as the instruction""... $ac_c" 1>&6 -echo "configure:1746: checking whether addr32 must be in the same line as the instruction" >&5 +echo "configure:1749: checking whether addr32 must be in the same line as the instruction" >&5 if eval "test \"`echo '$''{'grub_cv_asm_prefix_requirement'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1751,7 +1754,7 @@ else l1: addr32 movb %al, l1 EOF -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then +if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then grub_cv_asm_prefix_requirement=yes else grub_cv_asm_prefix_requirement=no @@ -1783,7 +1786,7 @@ echo "$ac_t""$grub_cv_asm_prefix_requirement" 1>&6 echo $ac_n "checking for .code16 addr32 assembler support""... $ac_c" 1>&6 -echo "configure:1787: checking for .code16 addr32 assembler support" >&5 +echo "configure:1790: checking for .code16 addr32 assembler support" >&5 if eval "test \"`echo '$''{'grub_cv_asm_addr32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1798,7 +1801,7 @@ else sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s fi -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then +if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then grub_cv_asm_addr32=yes else grub_cv_asm_addr32=no @@ -1815,7 +1818,7 @@ fi echo $ac_n "checking whether an absolute indirect call/jump must not be prefixed with an asterisk""... $ac_c" 1>&6 -echo "configure:1819: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +echo "configure:1822: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 if eval "test \"`echo '$''{'grub_cv_asm_absolute_without_asterisk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1826,7 +1829,7 @@ offset: .word 0 EOF -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then +if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then grub_cv_asm_absolute_without_asterisk=no else grub_cv_asm_absolute_without_asterisk=yes @@ -1847,19 +1850,19 @@ echo "$ac_t""$grub_cv_asm_absolute_without_asterisk" 1>&6 echo $ac_n "checking if start is defined by the compiler""... $ac_c" 1>&6 -echo "configure:1851: checking if start is defined by the compiler" >&5 +echo "configure:1854: checking if start is defined by the compiler" >&5 if eval "test \"`echo '$''{'grub_cv_check_start_symbol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_start_symbol=yes else @@ -1883,19 +1886,19 @@ echo "$ac_t""$grub_cv_check_start_symbol" 1>&6 echo $ac_n "checking if _start is defined by the compiler""... $ac_c" 1>&6 -echo "configure:1887: checking if _start is defined by the compiler" >&5 +echo "configure:1890: checking if _start is defined by the compiler" >&5 if eval "test \"`echo '$''{'grub_cv_check_uscore_start_symbol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_start_symbol=yes else @@ -1924,19 +1927,19 @@ fi echo $ac_n "checking if __bss_start is defined by the compiler""... $ac_c" 1>&6 -echo "configure:1928: checking if __bss_start is defined by the compiler" >&5 +echo "configure:1931: checking if __bss_start is defined by the compiler" >&5 if eval "test \"`echo '$''{'grub_cv_check_uscore_uscore_bss_start_symbol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_uscore_bss_start_symbol=yes else @@ -1960,19 +1963,19 @@ echo "$ac_t""$grub_cv_check_uscore_uscore_bss_start_symbol" 1>&6 echo $ac_n "checking if _edata is defined by the compiler""... $ac_c" 1>&6 -echo "configure:1964: checking if _edata is defined by the compiler" >&5 +echo "configure:1967: checking if _edata is defined by the compiler" >&5 if eval "test \"`echo '$''{'grub_cv_check_uscore_edata_symbol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_edata_symbol=yes else @@ -1996,19 +1999,19 @@ echo "$ac_t""$grub_cv_check_uscore_edata_symbol" 1>&6 echo $ac_n "checking if edata is defined by the compiler""... $ac_c" 1>&6 -echo "configure:2000: checking if edata is defined by the compiler" >&5 +echo "configure:2003: checking if edata is defined by the compiler" >&5 if eval "test \"`echo '$''{'grub_cv_check_edata_symbol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_edata_symbol=yes else @@ -2038,19 +2041,19 @@ fi echo $ac_n "checking if end is defined by the compiler""... $ac_c" 1>&6 -echo "configure:2042: checking if end is defined by the compiler" >&5 +echo "configure:2045: checking if end is defined by the compiler" >&5 if eval "test \"`echo '$''{'grub_cv_check_end_symbol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_end_symbol=yes else @@ -2074,19 +2077,19 @@ echo "$ac_t""$grub_cv_check_end_symbol" 1>&6 echo $ac_n "checking if _end is defined by the compiler""... $ac_c" 1>&6 -echo "configure:2078: checking if _end is defined by the compiler" >&5 +echo "configure:2081: checking if _end is defined by the compiler" >&5 if eval "test \"`echo '$''{'grub_cv_check_uscore_end_symbol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_end_symbol=yes else @@ -2124,7 +2127,7 @@ fi # Get the filename or the whole disk and open it. # Known to work on NetBSD. echo $ac_n "checking for opendisk in -lutil""... $ac_c" 1>&6 -echo "configure:2128: checking for opendisk in -lutil" >&5 +echo "configure:2131: checking for opendisk in -lutil" >&5 ac_lib_var=`echo util'_'opendisk | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2132,7 +2135,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2171,7 +2174,7 @@ fi # Unless the user specify --without-curses, check for curses. if test "x$with_curses" != "xno"; then echo $ac_n "checking for wgetch in -lncurses""... $ac_c" 1>&6 -echo "configure:2175: checking for wgetch in -lncurses" >&5 +echo "configure:2178: checking for wgetch in -lncurses" >&5 ac_lib_var=`echo ncurses'_'wgetch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2179,7 +2182,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2213,7 +2216,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wgetch in -lcurses""... $ac_c" 1>&6 -echo "configure:2217: checking for wgetch in -lcurses" >&5 +echo "configure:2220: checking for wgetch in -lcurses" >&5 ac_lib_var=`echo curses'_'wgetch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2221,7 +2224,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2267,17 +2270,17 @@ for ac_hdr in string.h strings.h ncurses/curses.h ncurses.h curses.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2271: checking for $ac_hdr" >&5 +echo "configure:2274: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2734,6 +2737,16 @@ if test "x$enable_compex_rl2000_fix" = xyes; then NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCOMPEX_RL2000_FIX=1" fi +# Check whether --enable-ns8390-force-16bit or --disable-ns8390-force-16bit was given. +if test "${enable_ns8390_force_16bit+set}" = set; then + enableval="$enable_ns8390_force_16bit" + : +fi + +if test "x$enable_ns8390_force_16bit" = xyes; then + NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNS8390_FORCE_16BIT=1" +fi + # Check whether --enable-smc9000-scan or --disable-smc9000-scan was given. if test "${enable_smc9000_scan+set}" = set; then enableval="$enable_smc9000_scan" diff --git a/configure.in b/configure.in index 428f07119..14400aca6 100644 --- a/configure.in +++ b/configure.in @@ -447,6 +447,13 @@ if test "x$enable_compex_rl2000_fix" = xyes; then NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DCOMPEX_RL2000_FIX=1" fi +AC_ARG_ENABLE(ns8390-force-16bit, + [ --enable-ns8390-force-16bit + specify this if falsely 8 bit is detected]) +if test "x$enable_ns8390_force_16bit" = xyes; then + NET_EXTRAFLAGS="$NET_EXTRAFLAGS -DNS8390_FORCE_16BIT=1" +fi + AC_ARG_ENABLE(smc9000-scan, [ --enable-smc9000-scan=LIST probe for SMC9000 I/O addresses using LIST], diff --git a/netboot/3c509.c b/netboot/3c509.c index ed6988bf2..e135f9a41 100644 --- a/netboot/3c509.c +++ b/netboot/3c509.c @@ -26,13 +26,14 @@ $Id$ #include "etherboot.h" #include "nic.h" +#include "cards.h" #include "3c509.h" static unsigned char eth_vendor, eth_flags, eth_laar; static unsigned short eth_nic_base, eth_asic_base; static char bnc=0, utp=0; /* for 3C509 */ -#ifdef INCLUDE_3C529 +#ifdef INCLUDE_3C529 /* * This table and several other pieces of the MCA support * code were shamelessly borrowed from the Linux kernel source. @@ -41,10 +42,10 @@ static char bnc=0, utp=0; /* for 3C509 */ * */ struct el3_mca_adapters_struct { - char* name; + const char *name; int id; }; -struct el3_mca_adapters_struct el3_mca_adapters[] = { +static struct el3_mca_adapters_struct el3_mca_adapters[] = { { "3Com 3c529 EtherLink III (10base2)", 0x627c }, { "3Com 3c529 EtherLink III (10baseT)", 0x627d }, { "3Com 3c529 EtherLink III (test mode)", 0x62db }, @@ -54,15 +55,6 @@ struct el3_mca_adapters_struct el3_mca_adapters[] = { }; #endif -static void safetwiddle() -{ - static int count=0; - static int count2=0; - static char tiddles[]="-\\|/"; - putchar(tiddles[(count2++)&0xfff?count&3:(count++)&3]); - putchar('\b'); -} - /* a surrogate */ static void DELAY(int val) @@ -74,15 +66,6 @@ static void DELAY(int val) } } -static void SAFEDELAY(int val) -{ - int c; - - for (c=0; cpacket, rx_fifo / 2); @@ -297,7 +279,7 @@ static int t509_poll(struct nic *nic) while(1) { status = inw(BASE + EP_W1_RX_STATUS); -#ifdef EDEBUG +#ifdef EDEBUG printf("*%x*",status); #endif rx_fifo = status & RX_BYTES_MASK; @@ -307,13 +289,13 @@ static int t509_poll(struct nic *nic) if(rx_fifo & 1) nic->packet[nic->packetlen+rx_fifo-1]=inb(BASE + EP_W1_RX_PIO_RD_1); nic->packetlen+=rx_fifo; -#ifdef EDEBUG +#ifdef EDEBUG printf("+%d",rx_fifo); #endif } if(( status & RX_INCOMPLETE )==0) { -#ifdef EDEBUG +#ifdef EDEBUG printf("=%d",nic->packetlen); #endif break; @@ -325,7 +307,7 @@ static int t509_poll(struct nic *nic) /* acknowledge reception of packet */ outw(RX_DISCARD_TOP_PACK, BASE + EP_COMMAND); while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS); -#ifdef EDEBUG +#ifdef EDEBUG type = (nic->packet[12]<<8) | nic->packet[13]; if(nic->packet[0]+nic->packet[1]+nic->packet[2]+nic->packet[3]+nic->packet[4]+ nic->packet[5] == 0xFF*ETHER_ADDR_SIZE) @@ -342,14 +324,14 @@ static int t509_poll(struct nic *nic) **************************************************************************/ static int -eeprom_rdy() +eeprom_rdy(void) { int i; for (i = 0; is_eeprom_busy(IS_BASE) && i < MAX_EEPROMBUSY; i++); if (i >= MAX_EEPROMBUSY) { - /* printf("3c509: eeprom failed to come ready.\n"); */ - printf("3c509: eeprom is busy.\n"); /* memory in EPROM is tight */ + /* printf("3c509: eeprom failed to come ready.\n"); */ + printf("3c509: eeprom busy.\n"); /* memory in EPROM is tight */ return (0); } return (1); @@ -360,8 +342,7 @@ eeprom_rdy() * before */ static int -get_e(offset) -int offset; +get_e(int offset) { if (!eeprom_rdy()) return (0xffff); @@ -372,8 +353,7 @@ int offset; } static int -send_ID_sequence(port) -int port; +send_ID_sequence(int port) { int cx, al; @@ -400,9 +380,7 @@ int port; * read 16 times getting one bit of data with each read. */ static int -get_eeprom_data(id_port, offset) -int id_port; -int offset; +get_eeprom_data(int id_port, int offset) { int i, data = 0; outb(0x80 + offset, id_port); @@ -430,7 +408,7 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) int i; int failcount; -#ifdef INCLUDE_3C529 +#ifdef INCLUDE_3C529 struct el3_mca_adapters_struct *mcafound = NULL; int mca_pos4 = 0, mca_pos5 = 0, mca_irq = 0; #endif @@ -443,7 +421,7 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) unsigned short k; int ep_current_tag = EP_LAST_TAG + 1; short *p; -#ifdef INCLUDE_3C529 +#ifdef INCLUDE_3C529 int curboard; #endif @@ -454,9 +432,9 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) /********************************************************* Search for 3Com 509 card ***********************************************************/ -#ifdef INCLUDE_3C529 - /* - * XXX: We should really check to make sure we have an MCA +#ifdef INCLUDE_3C529 + /* + * XXX: We should really check to make sure we have an MCA * bus controller before going ahead with this... * * For now, we avoid any hassle by making it a compile @@ -496,7 +474,7 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) donewithdetect: /* Kill all setup modes */ outb_p(0, MCA_ADAPTER_SETUP_REG); - + if (mcafound) { eth_vendor = VENDOR_3C509; @@ -520,13 +498,13 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) /* Reset and Enable the card */ outb(W0_P4_CMD_RESET_ADAPTER, io_base + EP_W0_CONFIG_CTRL); - SAFEDELAY(10000); /* we must wait at least 10 ms */ + DELAY(10000); /* we must wait at least 10 ms */ outb(W0_P4_CMD_ENABLE_ADAPTER, io_base + EP_W0_CONFIG_CTRL); /* - * Once activated, all the registers are mapped in the range - * x000 - x00F, where x is the slot number. - */ + * Once activated, all the registers are mapped in the range + * x000 - x00F, where x is the slot number. + */ eth_nic_base = j * EP_EISA_START; eth_vendor = VENDOR_3C509; } @@ -535,7 +513,7 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) /* Look for the ISA boards. Init and leave them actived */ /* search for the first card, ignore all others */ outb(0xc0, id_port); /* Global reset */ - SAFEDELAY(10000); + DELAY(10000); for (i = 0; i < EP_MAX_BOARDS && eth_vendor==VENDOR_NONE; i++) { outb(0, id_port); outb(0, id_port); @@ -566,7 +544,7 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) */ GO_WINDOW(0); k = get_e(EEPROM_PROD_ID); -#ifdef INCLUDE_3C529 +#ifdef INCLUDE_3C529 /* * On MCA, the PROD_ID matches the MCA card ID (POS0+POS1) */ @@ -577,16 +555,16 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) } } else { /* for ISA/EISA */ if ((k & 0xf0ff) != (PROD_ID & 0xf0ff)) - goto no3c509; + goto no3c509; } #else if ((k & 0xf0ff) != (PROD_ID & 0xf0ff)) goto no3c509; #endif -#ifdef INCLUDE_3C529 +#ifdef INCLUDE_3C529 if (mcafound) { - printf("%s board found on MCA at 0x%x IRQ %d -", + printf("%s board found on MCA at 0x%x IRQ %d -", mcafound->name, eth_nic_base, mca_irq); } else { #endif @@ -595,7 +573,7 @@ struct nic *t509_probe(struct nic *nic, unsigned short *probe_addrs) } else { printf("3C5x9 board on ISA at 0x%x - ",eth_nic_base); } -#ifdef INCLUDE_3C529 +#ifdef INCLUDE_3C529 } #endif diff --git a/netboot/3c509.h b/netboot/3c509.h index 1c882e7b6..46ec7ac60 100644 --- a/netboot/3c509.h +++ b/netboot/3c509.h @@ -38,33 +38,33 @@ * Some global constants */ -#define TX_INIT_RATE 16 -#define TX_INIT_MAX_RATE 64 -#define RX_INIT_LATENCY 64 -#define RX_INIT_EARLY_THRESH 64 -#define MIN_RX_EARLY_THRESHF 16 /* not less than ether_header */ -#define MIN_RX_EARLY_THRESHL 4 +#define TX_INIT_RATE 16 +#define TX_INIT_MAX_RATE 64 +#define RX_INIT_LATENCY 64 +#define RX_INIT_EARLY_THRESH 64 +#define MIN_RX_EARLY_THRESHF 16 /* not less than ether_header */ +#define MIN_RX_EARLY_THRESHL 4 -#define EEPROMSIZE 0x40 -#define MAX_EEPROMBUSY 1000 -#define EP_LAST_TAG 0xd7 -#define EP_MAX_BOARDS 16 -#define EP_ID_PORT 0x100 +#define EEPROMSIZE 0x40 +#define MAX_EEPROMBUSY 1000 +#define EP_LAST_TAG 0xd7 +#define EP_MAX_BOARDS 16 +#define EP_ID_PORT 0x100 /* * some macros to acces long named fields */ #define IS_BASE (eth_nic_base) -#define BASE (eth_nic_base) +#define BASE (eth_nic_base) /* * Commands to read/write EEPROM trough EEPROM command register (Window 0, * Offset 0xa) */ -#define EEPROM_CMD_RD 0x0080 /* Read: Address required (5 bits) */ -#define EEPROM_CMD_WR 0x0040 /* Write: Address required (5 bits) */ +#define EEPROM_CMD_RD 0x0080 /* Read: Address required (5 bits) */ +#define EEPROM_CMD_WR 0x0040 /* Write: Address required (5 bits) */ #define EEPROM_CMD_ERASE 0x00c0 /* Erase: Address required (5 bits) */ -#define EEPROM_CMD_EWEN 0x0030 /* Erase/Write Enable: No data required */ +#define EEPROM_CMD_EWEN 0x0030 /* Erase/Write Enable: No data required */ #define EEPROM_BUSY (1<<15) #define EEPROM_TST_MODE (1<<14) @@ -73,10 +73,10 @@ * Some short functions, worth to let them be a macro */ #define is_eeprom_busy(b) (inw((b)+EP_W0_EEPROM_COMMAND)&EEPROM_BUSY) -#define GO_WINDOW(x) outw(WINDOW_SELECT|(x), BASE+EP_COMMAND) +#define GO_WINDOW(x) outw(WINDOW_SELECT|(x), BASE+EP_COMMAND) /************************************************************************** - * * + * * These define the EEPROM data structure. They are used in the probe * function to verify the existance of the adapter after having sent * the ID_Sequence. @@ -94,12 +94,12 @@ #define EEPROM_RESOURCE_CFG 0x9 /* IRQ. Bits 12-15 */ /************************************************************************** - * * - * These are the registers for the 3Com 3c509 and their bit patterns when * - * applicable. They have been taken out the the "EtherLink III Parallel * - * Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual * - * from 3com. * - * * + * + * These are the registers for the 3Com 3c509 and their bit patterns when + * applicable. They have been taken out the the "EtherLink III Parallel + * Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual + * from 3com. + * **************************************************************************/ #define EP_COMMAND 0x0e /* Write. BASE+0x0e is always a @@ -276,7 +276,7 @@ #define S_RX_EARLY (unsigned short) (0x20) #define S_INT_RQD (unsigned short) (0x40) #define S_UPD_STATS (unsigned short) (0x80) -#define S_5_INTS (S_CARD_FAILURE|S_TX_COMPLETE|\ +#define S_5_INTS (S_CARD_FAILURE|S_TX_COMPLETE|\ S_TX_AVAIL|S_RX_COMPLETE|S_RX_EARLY) #define S_COMMAND_IN_PROGRESS (unsigned short) (0x1000) @@ -297,14 +297,14 @@ * * 10-0: RX Bytes (0-1514) */ -#define ERR_RX_INCOMPLETE (unsigned short) (0x1<<15) -#define ERR_RX (unsigned short) (0x1<<14) -#define ERR_RX_OVERRUN (unsigned short) (0x8<<11) -#define ERR_RX_RUN_PKT (unsigned short) (0xb<<11) -#define ERR_RX_ALIGN (unsigned short) (0xc<<11) -#define ERR_RX_CRC (unsigned short) (0xd<<11) -#define ERR_RX_OVERSIZE (unsigned short) (0x9<<11) -#define ERR_RX_DRIBBLE (unsigned short) (0x2<<11) +#define ERR_RX_INCOMPLETE (unsigned short) (0x1<<15) +#define ERR_RX (unsigned short) (0x1<<14) +#define ERR_RX_OVERRUN (unsigned short) (0x8<<11) +#define ERR_RX_RUN_PKT (unsigned short) (0xb<<11) +#define ERR_RX_ALIGN (unsigned short) (0xc<<11) +#define ERR_RX_CRC (unsigned short) (0xd<<11) +#define ERR_RX_OVERSIZE (unsigned short) (0x9<<11) +#define ERR_RX_DRIBBLE (unsigned short) (0x2<<11) /* * FIFO Registers. @@ -336,13 +336,13 @@ * Window 0/Port 04 */ /* Read */ -#define IS_AUI (1<<13) -#define IS_BNC (1<<12) -#define IS_UTP (1<<9) +#define IS_AUI (1<<13) +#define IS_BNC (1<<12) +#define IS_UTP (1<<9) /* Write */ #define ENABLE_DRQ_IRQ 0x0001 -#define W0_P4_CMD_RESET_ADAPTER 0x4 -#define W0_P4_CMD_ENABLE_ADAPTER 0x1 +#define W0_P4_CMD_RESET_ADAPTER 0x4 +#define W0_P4_CMD_ENABLE_ADAPTER 0x1 /* * Media type and status. * Window 4/Port 0A @@ -368,26 +368,26 @@ /* * Misc defines for various things. */ -#define ACTIVATE_ADAPTER_TO_CONFIG 0xff /* to the id_port */ -#define MFG_ID 0x6d50 /* in EEPROM and W0 ADDR_CONFIG */ -#define PROD_ID 0x9150 +#define ACTIVATE_ADAPTER_TO_CONFIG 0xff /* to the id_port */ +#define MFG_ID 0x6d50 /* in EEPROM and W0 ADDR_CONFIG */ +#define PROD_ID 0x9150 -#define AUI 0x1 -#define BNC 0x2 -#define UTP 0x4 +#define AUI 0x1 +#define BNC 0x2 +#define UTP 0x4 #define RX_BYTES_MASK (unsigned short) (0x07ff) /* EISA support */ -#define EP_EISA_START 0x1000 -#define EP_EISA_W0 0x0c80 +#define EP_EISA_START 0x1000 +#define EP_EISA_W0 0x0c80 -#ifdef INCLUDE_3C529 +#ifdef INCLUDE_3C529 /* MCA support */ -#define MCA_MOTHERBOARD_SETUP_REG 0x94 -#define MCA_ADAPTER_SETUP_REG 0x96 -#define MCA_MAX_SLOT_NR 8 -#define MCA_POS_REG(n) (0x100+(n)) +#define MCA_MOTHERBOARD_SETUP_REG 0x94 +#define MCA_ADAPTER_SETUP_REG 0x96 +#define MCA_MAX_SLOT_NR 8 +#define MCA_POS_REG(n) (0x100+(n)) #endif /* diff --git a/netboot/README.netboot b/netboot/README.netboot index 81cc973ed..380696b94 100644 --- a/netboot/README.netboot +++ b/netboot/README.netboot @@ -84,6 +84,7 @@ Lance PCI PCNet/32 Linksys LNE100TX and other NICs using this Tulip clone chip Netgear FA310TX and other NICs using this Tulip clone chip +Tulip clones based on the ADMtek Centaur-P Tulip clones based on the Macronix 987x5 Tulip-Fast Tulip+ @@ -109,6 +110,11 @@ NetVin 5000SC If you have a Compex RL2000 PCI 32-bit (11F6:1401), and the probe hangs in "Probing...[NE*000/PCI]", try enabling this fix... it worked for me :). + --enable-ns8390-force-16bit + It seems that forcing 16 bit bus width for NEPCI causes + Etherboot/GRUB to fail on the RTL8029. Therefore + --enable-ns8390-force-16bit should only be turned on for those NEPCI + NICs that falsely detect 8 bit bus width when it should be 16. Racal-Interlan NI5210 --enable-ni5210 diff --git a/netboot/cards.h b/netboot/cards.h index e94b6a7d6..ae7116971 100644 --- a/netboot/cards.h +++ b/netboot/cards.h @@ -55,6 +55,11 @@ extern struct nic *t529_probe(struct nic *, unsigned short * PCI_ARG(struct pci_device *)); #endif +#ifdef INCLUDE_3C595 +extern struct nic *t595_probe(struct nic *, unsigned short * + PCI_ARG(struct pci_device *)); +#endif + #ifdef INCLUDE_3C90X extern struct nic *a3c90x_probe(struct nic *, unsigned short * PCI_ARG(struct pci_device *)); diff --git a/netboot/config.c b/netboot/config.c index e6f0df1a8..09f881b5e 100644 --- a/netboot/config.c +++ b/netboot/config.c @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Based on "src/config.c" in etherboot-4.5.8. */ +/* Based on "src/config.c" in etherboot-4.6.4. */ /* * This program is free software; you can redistribute it and/or @@ -30,7 +30,7 @@ #include "nic.h" #undef INCLUDE_PCI -#if defined(INCLUDE_NS8390) || defined(INCLUDE_EEPRO100) || defined(INCLUDE_LANCE) || defined(INCLUDE_EPIC100) || defined(INCLUDE_TULIP) || defined(INCLUDE_OTULIP) || defined(INCLUDE_3C90X) || defined(INCLUDE_RTL8139) || defined(INCLUDE_VIA_RHINE) +#if defined(INCLUDE_NS8390) || defined(INCLUDE_EEPRO100) || defined(INCLUDE_LANCE) || defined(INCLUDE_EPIC100) || defined(INCLUDE_TULIP) || defined(INCLUDE_OTULIP) || defined(INCLUDE_3C90X) || defined(INCLUDE_3C595) || defined(INCLUDE_RTL8139) || defined(INCLUDE_VIA_RHINE) /* || others later */ #if defined(ETHERBOOT32) /* only for 32 bit machines */ #define INCLUDE_PCI @@ -78,6 +78,16 @@ static struct pci_device pci_nic_list[] = { "3Com905C-TXM", 0, 0, 0}, #endif +#ifdef INCLUDE_3C595 + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C590, + "3Com590", 0, 0, 0}, + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C595, + "3Com595", 0, 0, 0}, + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C595_1, + "3Com595", 0, 0, 0}, + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C595_2, + "3Com595", 0, 0, 0}, +#endif #ifdef INCLUDE_EEPRO100 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82557, "Intel EtherExpressPro100", 0, 0, 0}, @@ -123,6 +133,8 @@ static struct pci_device pci_nic_list[] = { "Netgear FA310TX", 0, 0, 0}, { PCI_VENDOR_ID_DAVICOM, PCI_DEVICE_ID_DM9102, "Davicom 9102", 0, 0, 0}, + { PCI_VENDOR_ID_ADMTEK, PCI_DEVICE_ID_ADMTEK_0985, + "ADMtek Centaur-P", 0, 0, 0}, #endif #ifdef INCLUDE_VIA_RHINE { PCI_VENDOR_ID_VIATEC, PCI_DEVICE_ID_VIA_RHINE_I, @@ -176,6 +188,9 @@ static struct dispatch_table NIC[] = #ifdef INCLUDE_3C529 { "3C5x9", t529_probe, 0 }, #endif +#ifdef INCLUDE_3C595 + { "3C595", t595_probe, pci_ioaddrs }, +#endif #ifdef INCLUDE_3C90X { "3C90X", a3c90x_probe, pci_ioaddrs }, #endif diff --git a/netboot/epic100.c b/netboot/epic100.c index fd66abc47..1eef71051 100644 --- a/netboot/epic100.c +++ b/netboot/epic100.c @@ -10,8 +10,8 @@ #undef virt_to_bus #define virt_to_bus(x) ((unsigned long)x) -#define TX_RING_SIZE 2 /* use at least 2 buffers for TX */ -#define RX_RING_SIZE 2 +#define TX_RING_SIZE 2 /* use at least 2 buffers for TX */ +#define RX_RING_SIZE 2 #define PKT_BUF_SZ 1536 /* Size of each temporary Tx/Rx buffer.*/ diff --git a/netboot/main.c b/netboot/main.c index 69de7fc7e..aaa42a350 100644 --- a/netboot/main.c +++ b/netboot/main.c @@ -17,7 +17,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Based on "src/main.c" in etherboot-4.5.8. */ +/* Based on "src/main.c" in etherboot-4.6.4. */ /************************************************************************** ETHERBOOT - BOOTP/TFTP Bootstrap Program @@ -77,8 +77,9 @@ static char rfc1533_end[] = {RFC1533_END}; static const char dhcpdiscover[] = { - RFC2132_MSG_TYPE, 1, DHCPDISCOVER, - RFC2132_MAX_SIZE, 2, 2, 64, + RFC2132_MSG_TYPE, 1, DHCPDISCOVER, + RFC2132_MAX_SIZE,2, /* request as much as we can */ + sizeof(struct bootpd_t) / 256, sizeof(struct bootpd_t) % 256, RFC2132_PARAM_LIST, 4, RFC1533_NETMASK, RFC1533_GATEWAY, RFC1533_HOSTNAME, RFC1533_EXTENSIONPATH }; @@ -88,7 +89,8 @@ static const char dhcprequest[] = RFC2132_MSG_TYPE, 1, DHCPREQUEST, RFC2132_SRV_ID, 4, 0, 0, 0, 0, RFC2132_REQ_ADDR, 4, 0, 0, 0, 0, - RFC2132_MAX_SIZE, 2, 2, 64, + RFC2132_MAX_SIZE,2, /* request as much as we can */ + sizeof(struct bootpd_t) / 256, sizeof(struct bootpd_t) % 256, /* request parameters */ RFC2132_PARAM_LIST, #ifdef GRUB @@ -585,7 +587,7 @@ bootp (void) * lost immediately. Not very clever. */ await_reply (AWAIT_QDRAIN, 0, NULL, 0); - udp_transmit (IP_BROADCAST, 0, BOOTP_SERVER, + udp_transmit (IP_BROADCAST, BOOTP_CLIENT, BOOTP_SERVER, sizeof (struct bootp_t), &bp); #ifdef T509HACK if (flag) diff --git a/netboot/ns8390.c b/netboot/ns8390.c index d140b913f..41e54764f 100644 --- a/netboot/ns8390.c +++ b/netboot/ns8390.c @@ -879,7 +879,7 @@ struct nic *eth_probe(struct nic *nic, unsigned short *probe_addrs) outb(D8390_DCR_FT1 | D8390_DCR_LS, eth_nic_base + D8390_P0_DCR); outb(MEM_8192, eth_nic_base + D8390_P0_PSTART); outb(MEM_16384, eth_nic_base + D8390_P0_PSTOP); -#ifdef INCLUDE_NS8390 +#ifdef NS8390_FORCE_16BIT eth_flags |= FLAG_16BIT; /* force 16-bit mode */ #endif diff --git a/netboot/pci.h b/netboot/pci.h index 0278c7c61..9f8b52205 100644 --- a/netboot/pci.h +++ b/netboot/pci.h @@ -94,6 +94,8 @@ __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */ :"memory") #define restore_flags(x) \ __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") +#define PCI_VENDOR_ID_ADMTEK 0x1317 +#define PCI_DEVICE_ID_ADMTEK_0985 0x0985 #define PCI_VENDOR_ID_REALTEK 0x10ec #define PCI_DEVICE_ID_REALTEK_8029 0x8029 #define PCI_DEVICE_ID_REALTEK_8139 0x8139 @@ -106,6 +108,10 @@ __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") #define PCI_VENDOR_ID_NETVIN 0x4a14 #define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000 #define PCI_VENDOR_ID_3COM 0x10b7 +#define PCI_DEVICE_ID_3COM_3C590 0x5900 +#define PCI_DEVICE_ID_3COM_3C595 0x5950 +#define PCI_DEVICE_ID_3COM_3C595_1 0x5951 +#define PCI_DEVICE_ID_3COM_3C595_2 0x5952 #define PCI_DEVICE_ID_3COM_3C900TPO 0x9000 #define PCI_DEVICE_ID_3COM_3C900COMBO 0x9001 #define PCI_DEVICE_ID_3COM_3C905TX 0x9050 @@ -134,8 +140,8 @@ __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") #define PCI_VENDOR_ID_VIATEC 0x1106 #define PCI_DEVICE_ID_VIA_RHINE_I 0x3043 #define PCI_DEVICE_ID_VIA_86C100A 0x6100 -#define PCI_VENDOR_ID_DAVICOM 0x1282 -#define PCI_DEVICE_ID_DM9102 0x9102 +#define PCI_VENDOR_ID_DAVICOM 0x1282 +#define PCI_DEVICE_ID_DM9102 0x9102 struct pci_device { unsigned short vendor, dev_id; diff --git a/netboot/sk_g16.h b/netboot/sk_g16.h index 18a18fda3..9f0bb0745 100644 --- a/netboot/sk_g16.h +++ b/netboot/sk_g16.h @@ -16,8 +16,8 @@ * network device driver which uses this chip * * $Log$ - * Revision 1.2 2000-04-22 01:17:09 okuji - * update the network support to etherboot-4.5.8. + * Revision 1.3 2000-07-29 19:22:54 okuji + * update the network support to etherboot-4.6.4. * -*/ diff --git a/netboot/tulip.c b/netboot/tulip.c index 30ecf438c..e1386c6d3 100644 --- a/netboot/tulip.c +++ b/netboot/tulip.c @@ -40,6 +40,14 @@ /*********************************************************************/ /* + 16 Jul 2000 mdc 0.75b11 + Added support for ADMtek 0985 Centaur-P, a "Comet" tulip clone + which is used on the LinkSYS LNE100TX v4.x cards. We already + support LNE100TX v2.0 cards, which use a different controller. + 04 Jul 2000 jam ? + Added test of status after receiving a packet from the card. + Also uncommented the tulip_disable routine. Stray packets + seemed to be causing problems. 27 Apr 2000 njl ? 29 Feb 2000 mdc 0.75b7 Increased reset delay to 3 seconds because Macronix cards seem to @@ -409,6 +417,7 @@ static void tulip_init_ring(struct nic *nic) static void tulip_reset(struct nic *nic) { unsigned long to, csr6; + u32 addr_low, addr_high; whereami("tulip_reset\n"); @@ -443,6 +452,10 @@ static void tulip_reset(struct nic *nic) } else if (vendor == PCI_VENDOR_ID_DEC && dev_id == PCI_DEVICE_ID_DEC_21142) { /* nothing */ + + } else if (vendor == PCI_VENDOR_ID_ADMTEK && dev_id == PCI_DEVICE_ID_ADMTEK_0985) { + /* nothing */ + } else { /* If we don't know what to do with the card, set to 10Mbps half-duplex */ @@ -468,6 +481,18 @@ static void tulip_reset(struct nic *nic) /* set up transmit and receive descriptors */ tulip_init_ring(nic); + /* set up multicast hash address for Comet (ADKTEK 0985) */ + /* possibly not needed for Etherboot, but seems to do no harm -mdc */ + if (vendor == PCI_VENDOR_ID_ADMTEK && dev_id == PCI_DEVICE_ID_ADMTEK_0985) { + addr_low = nic->node_addr[0] + (nic->node_addr[1] << 8) + + (nic->node_addr[2] << 16) + (nic->node_addr[3] << 24); + addr_high = nic->node_addr[4] + (nic->node_addr[5] << 8); + outl(addr_low, ioaddr + 0xA4); + outl(addr_high, ioaddr + 0xA8); + outl(0, ioaddr + 0xAC); + outl(0, ioaddr + 0xB0); + } + /* Point to receive descriptor */ outl((unsigned long)&rxd[0], ioaddr + CSR3); outl((unsigned long)&txd , ioaddr + CSR4); @@ -513,6 +538,10 @@ static void tulip_reset(struct nic *nic) outl(0x180, ioaddr + CSR12); /* Let bit 7 output port */ outl(0x80, ioaddr + CSR12); /* RESET DM9102 phyxcer */ outl(0x0, ioaddr + CSR12); /* Clear RESET signal */ + + } else if (vendor == PCI_VENDOR_ID_ADMTEK && dev_id == PCI_DEVICE_ID_ADMTEK_0985) { + /* nothing */ + } /* set the chip's operating mode */ @@ -604,6 +633,13 @@ static int tulip_poll(struct nic *nic) nic->packetlen = (rxd[rxd_tail].status & 0x3FFF0000) >> 16; + if( rxd[rxd_tail].status & 0x00008000){ + rxd[rxd_tail].status = 0x80000000; + rxd_tail++; + if (rxd_tail == NRXD) rxd_tail = 0; + return 0; + } + /* copy packet to working buffer */ /* XXX - this copy could be avoided with a little more work but for now we are content with it because the optimised @@ -626,9 +662,6 @@ static void tulip_disable(struct nic *nic) { whereami("tulip_disable\n"); - /* The other Etherboot drivers don't seem to do anything here, - so for now, we will not either */ -#if 0 /* disable interrupts */ outl(0x00000000, ioaddr + CSR7); @@ -637,7 +670,6 @@ static void tulip_disable(struct nic *nic) /* Clear the missed-packet counter. */ (volatile unsigned long)inl(ioaddr + CSR8); -#endif } /*********************************************************************/ @@ -647,6 +679,7 @@ struct nic *tulip_probe(struct nic *nic, unsigned short *io_addrs, struct pci_device *pci) { unsigned int i; + u32 l1, l2; whereami("tulip_probe\n"); @@ -679,6 +712,16 @@ struct nic *tulip_probe(struct nic *nic, unsigned short *io_addrs, nic->node_addr[i*2] = (u8)((value >> 8) & 0xFF); nic->node_addr[i*2 + 1] = (u8)( value & 0xFF); } + } else if (vendor == PCI_VENDOR_ID_ADMTEK && + dev_id == PCI_DEVICE_ID_ADMTEK_0985) { + l1 = inl(ioaddr + 0xA4); + l2 = inl(ioaddr + 0xA8); + nic->node_addr[0] = (l1 ) & 0xFF; + nic->node_addr[1] = (l1 >> 8) & 0xFF; + nic->node_addr[2] = (l1 >> 16) & 0xFF; + nic->node_addr[3] = (l1 >> 24) & 0xFF; + nic->node_addr[4] = (l2 ) & 0xFF; + nic->node_addr[5] = (l2 >> 8) & 0xFF; } else { /* read EEPROM data */ for (i = 0; i < sizeof(ee_data)/2; i++)