svn commit: r215320 - in projects/binutils-2.17: . bin/sh
bin/sh/bltin contrib/top crypto/openssl/ssl gnu/lib/libgcc
gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/gdb
gnu/usr.bin/gdb/libgdb lib/l...
Dimitry Andric
dim at FreeBSD.org
Sun Nov 14 20:47:31 UTC 2010
Author: dim
Date: Sun Nov 14 20:47:30 2010
New Revision: 215320
URL: http://svn.freebsd.org/changeset/base/215320
Log:
Sync: merge r215273 through r215318 from ^/head.
Modified:
projects/binutils-2.17/Makefile.inc1
projects/binutils-2.17/ObsoleteFiles.inc
projects/binutils-2.17/README
projects/binutils-2.17/UPDATING
projects/binutils-2.17/bin/sh/bltin/bltin.h
projects/binutils-2.17/bin/sh/output.c
projects/binutils-2.17/bin/sh/output.h
projects/binutils-2.17/crypto/openssl/ssl/s3_clnt.c
projects/binutils-2.17/gnu/lib/libgcc/Makefile
projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0
projects/binutils-2.17/gnu/usr.bin/cc/Makefile.tgt
projects/binutils-2.17/gnu/usr.bin/gdb/Makefile.inc
projects/binutils-2.17/gnu/usr.bin/gdb/libgdb/Makefile
projects/binutils-2.17/lib/libc/gen/pututxline.c
projects/binutils-2.17/lib/libkvm/kvm.c
projects/binutils-2.17/lib/libkvm/kvm_pcpu.c
projects/binutils-2.17/share/mk/bsd.cpu.mk
projects/binutils-2.17/sys/amd64/amd64/trap.c
projects/binutils-2.17/sys/boot/i386/boot2/boot1.S
projects/binutils-2.17/sys/dev/arcmsr/arcmsr.c
projects/binutils-2.17/sys/dev/bce/if_bce.c
projects/binutils-2.17/sys/dev/bge/if_bge.c
projects/binutils-2.17/sys/dev/mii/atphy.c
projects/binutils-2.17/sys/dev/mii/brgphy.c
projects/binutils-2.17/sys/dev/mii/ciphy.c
projects/binutils-2.17/sys/dev/mii/e1000phy.c
projects/binutils-2.17/sys/dev/mii/gentbi.c
projects/binutils-2.17/sys/dev/mii/ip1000phy.c
projects/binutils-2.17/sys/dev/mii/jmphy.c
projects/binutils-2.17/sys/dev/mii/mii.h
projects/binutils-2.17/sys/dev/mii/mii_physubr.c
projects/binutils-2.17/sys/dev/mii/miivar.h
projects/binutils-2.17/sys/dev/mii/nsgphy.c
projects/binutils-2.17/sys/dev/mii/rgephy.c
projects/binutils-2.17/sys/dev/mii/smcphy.c
projects/binutils-2.17/sys/dev/mii/ukphy_subr.c
projects/binutils-2.17/sys/dev/mii/xmphy.c
projects/binutils-2.17/sys/dev/msk/if_msk.c
projects/binutils-2.17/sys/dev/nfe/if_nfe.c
projects/binutils-2.17/sys/dev/stge/if_stge.c
projects/binutils-2.17/sys/geom/eli/g_eli.c
projects/binutils-2.17/sys/i386/i386/trap.c
projects/binutils-2.17/sys/kern/kern_clock.c
projects/binutils-2.17/sys/kern/kern_clocksource.c
projects/binutils-2.17/sys/kern/kern_proc.c
projects/binutils-2.17/sys/kern/kern_tc.c
projects/binutils-2.17/sys/kern/link_elf_obj.c
projects/binutils-2.17/sys/kern/sched_4bsd.c
projects/binutils-2.17/sys/kern/subr_clock.c
projects/binutils-2.17/sys/kern/subr_pcpu.c
projects/binutils-2.17/sys/kern/sysv_sem.c
projects/binutils-2.17/sys/kern/vfs_cache.c
projects/binutils-2.17/sys/kern/vfs_mountroot.c
projects/binutils-2.17/sys/kern/vfs_subr.c
projects/binutils-2.17/sys/libkern/gets.c
projects/binutils-2.17/sys/mips/mips/tick.c
projects/binutils-2.17/sys/mips/rmi/tick.c
projects/binutils-2.17/sys/net/flowtable.c
projects/binutils-2.17/sys/net/if.c
projects/binutils-2.17/sys/net/if_clone.c
projects/binutils-2.17/sys/net/if_ethersubr.c
projects/binutils-2.17/sys/net/if_gif.c
projects/binutils-2.17/sys/net/if_llatbl.c
projects/binutils-2.17/sys/net/if_loop.c
projects/binutils-2.17/sys/net/if_media.h
projects/binutils-2.17/sys/net/route.c
projects/binutils-2.17/sys/net/vnet.c
projects/binutils-2.17/sys/net/vnet.h
projects/binutils-2.17/sys/net80211/ieee80211_ratectl.h
projects/binutils-2.17/sys/netgraph/ng_base.c
projects/binutils-2.17/sys/netgraph/ng_eiface.c
projects/binutils-2.17/sys/netgraph/ng_iface.c
projects/binutils-2.17/sys/netinet/if_ether.c
projects/binutils-2.17/sys/netinet/igmp.c
projects/binutils-2.17/sys/netinet/in.c
projects/binutils-2.17/sys/netinet/in_pcb.c
projects/binutils-2.17/sys/netinet/in_rmx.c
projects/binutils-2.17/sys/netinet/ip_divert.c
projects/binutils-2.17/sys/netinet/ip_fastfwd.c
projects/binutils-2.17/sys/netinet/ip_icmp.c
projects/binutils-2.17/sys/netinet/ip_input.c
projects/binutils-2.17/sys/netinet/ip_ipsec.c
projects/binutils-2.17/sys/netinet/ip_mroute.c
projects/binutils-2.17/sys/netinet/ipfw/ip_fw2.c
projects/binutils-2.17/sys/netinet/ipfw/ip_fw_dynamic.c
projects/binutils-2.17/sys/netinet/ipfw/ip_fw_nat.c
projects/binutils-2.17/sys/netinet/ipfw/ip_fw_pfil.c
projects/binutils-2.17/sys/netinet/sctp_crc32.c
projects/binutils-2.17/sys/netinet/sctp_output.c
projects/binutils-2.17/sys/netinet/siftr.c
projects/binutils-2.17/sys/netinet/tcp_hostcache.c
projects/binutils-2.17/sys/netinet/tcp_reass.c
projects/binutils-2.17/sys/netinet/tcp_subr.c
projects/binutils-2.17/sys/netinet/tcp_syncache.c
projects/binutils-2.17/sys/netinet/tcp_timewait.c
projects/binutils-2.17/sys/netinet/udp_usrreq.c
projects/binutils-2.17/sys/netinet6/frag6.c
projects/binutils-2.17/sys/netinet6/icmp6.c
projects/binutils-2.17/sys/netinet6/in6_rmx.c
projects/binutils-2.17/sys/netinet6/in6_src.c
projects/binutils-2.17/sys/netinet6/ip6_ipsec.c
projects/binutils-2.17/sys/netinet6/ip6_mroute.c
projects/binutils-2.17/sys/netinet6/mld6.c
projects/binutils-2.17/sys/netinet6/nd6.c
projects/binutils-2.17/sys/netinet6/nd6_nbr.c
projects/binutils-2.17/sys/netinet6/nd6_rtr.c
projects/binutils-2.17/sys/netinet6/scope6.c
projects/binutils-2.17/sys/netinet6/send.c
projects/binutils-2.17/sys/netipsec/key.c
projects/binutils-2.17/sys/netipsec/keysock.c
projects/binutils-2.17/sys/netipsec/xform_esp.c
projects/binutils-2.17/sys/opencrypto/cryptosoft.c
projects/binutils-2.17/sys/powerpc/aim/clock.c
projects/binutils-2.17/sys/powerpc/booke/clock.c
projects/binutils-2.17/sys/sys/cdefs.h
projects/binutils-2.17/sys/sys/libkern.h
projects/binutils-2.17/sys/sys/linker_set.h
projects/binutils-2.17/sys/sys/param.h
projects/binutils-2.17/sys/sys/pcpu.h
projects/binutils-2.17/sys/vm/vm_map.c
projects/binutils-2.17/sys/vm/vm_mmap.c
projects/binutils-2.17/tools/build/mk/OptionalObsoleteFiles.inc
projects/binutils-2.17/usr.sbin/sysinstall/cdrom.c
projects/binutils-2.17/usr.sbin/sysinstall/config.c
projects/binutils-2.17/usr.sbin/sysinstall/help/shortcuts.hlp
projects/binutils-2.17/usr.sbin/sysinstall/install.c
projects/binutils-2.17/usr.sbin/sysinstall/media.c
projects/binutils-2.17/usr.sbin/sysinstall/menus.c
projects/binutils-2.17/usr.sbin/sysinstall/sysinstall.8
projects/binutils-2.17/usr.sbin/sysinstall/sysinstall.h
Directory Properties:
projects/binutils-2.17/ (props changed)
projects/binutils-2.17/cddl/contrib/opensolaris/ (props changed)
projects/binutils-2.17/contrib/bind9/ (props changed)
projects/binutils-2.17/contrib/binutils/ (props changed)
projects/binutils-2.17/contrib/bzip2/ (props changed)
projects/binutils-2.17/contrib/ee/ (props changed)
projects/binutils-2.17/contrib/expat/ (props changed)
projects/binutils-2.17/contrib/file/ (props changed)
projects/binutils-2.17/contrib/gdb/ (props changed)
projects/binutils-2.17/contrib/gdtoa/ (props changed)
projects/binutils-2.17/contrib/gnu-sort/ (props changed)
projects/binutils-2.17/contrib/groff/ (props changed)
projects/binutils-2.17/contrib/less/ (props changed)
projects/binutils-2.17/contrib/libpcap/ (props changed)
projects/binutils-2.17/contrib/llvm/ (props changed)
projects/binutils-2.17/contrib/llvm/tools/clang/ (props changed)
projects/binutils-2.17/contrib/ncurses/ (props changed)
projects/binutils-2.17/contrib/netcat/ (props changed)
projects/binutils-2.17/contrib/ntp/ (props changed)
projects/binutils-2.17/contrib/one-true-awk/ (props changed)
projects/binutils-2.17/contrib/openbsm/ (props changed)
projects/binutils-2.17/contrib/openpam/ (props changed)
projects/binutils-2.17/contrib/pf/ (props changed)
projects/binutils-2.17/contrib/sendmail/ (props changed)
projects/binutils-2.17/contrib/tcpdump/ (props changed)
projects/binutils-2.17/contrib/tcsh/ (props changed)
projects/binutils-2.17/contrib/top/ (props changed)
projects/binutils-2.17/contrib/top/install-sh (props changed)
projects/binutils-2.17/contrib/tzcode/stdtime/ (props changed)
projects/binutils-2.17/contrib/tzcode/zic/ (props changed)
projects/binutils-2.17/contrib/tzdata/ (props changed)
projects/binutils-2.17/contrib/wpa/ (props changed)
projects/binutils-2.17/contrib/xz/ (props changed)
projects/binutils-2.17/crypto/openssh/ (props changed)
projects/binutils-2.17/crypto/openssl/ (props changed)
projects/binutils-2.17/lib/libc/ (props changed)
projects/binutils-2.17/lib/libc/stdtime/ (props changed)
projects/binutils-2.17/lib/libutil/ (props changed)
projects/binutils-2.17/lib/libz/ (props changed)
projects/binutils-2.17/sbin/ (props changed)
projects/binutils-2.17/sbin/ipfw/ (props changed)
projects/binutils-2.17/share/mk/bsd.arch.inc.mk (props changed)
projects/binutils-2.17/share/zoneinfo/ (props changed)
projects/binutils-2.17/sys/ (props changed)
projects/binutils-2.17/sys/amd64/include/xen/ (props changed)
projects/binutils-2.17/sys/cddl/contrib/opensolaris/ (props changed)
projects/binutils-2.17/sys/contrib/dev/acpica/ (props changed)
projects/binutils-2.17/sys/contrib/pf/ (props changed)
projects/binutils-2.17/sys/contrib/x86emu/ (props changed)
projects/binutils-2.17/sys/dev/xen/xenpci/ (props changed)
projects/binutils-2.17/usr.bin/calendar/ (props changed)
projects/binutils-2.17/usr.bin/csup/ (props changed)
projects/binutils-2.17/usr.bin/procstat/ (props changed)
projects/binutils-2.17/usr.sbin/zic/ (props changed)
Modified: projects/binutils-2.17/Makefile.inc1
==============================================================================
--- projects/binutils-2.17/Makefile.inc1 Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/Makefile.inc1 Sun Nov 14 20:47:30 2010 (r215320)
@@ -121,7 +121,7 @@ VERSION+= ${OSRELDATE}
TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/}
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
${TARGET_ARCH} != ${MACHINE_ARCH}
-TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm}
+TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm/}
.endif
# Legacy names, for a transition period mips:mips -> mipsel:mips
.if defined(TARGET) && defined(TARGET_ARCH) && \
Modified: projects/binutils-2.17/ObsoleteFiles.inc
==============================================================================
--- projects/binutils-2.17/ObsoleteFiles.inc Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/ObsoleteFiles.inc Sun Nov 14 20:47:30 2010 (r215320)
@@ -5086,7 +5086,7 @@ OLD_LIBS+=usr/lib/libthr.so.2
.endif
# 20060127: revert libdisk to static-only
OLD_LIBS+=usr/lib/libdisk.so.3
-# 20051027: libc_r discontinued
+# 20051027: libc_r discontinued (removed 20101113)
OLD_LIBS+=usr/lib/libc_r.a
OLD_LIBS+=usr/lib/libc_r.so
OLD_LIBS+=usr/lib/libc_r.so.7
Modified: projects/binutils-2.17/README
==============================================================================
--- projects/binutils-2.17/README Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/README Sun Nov 14 20:47:30 2010 (r215320)
@@ -43,6 +43,9 @@ Source Roadmap:
---------------
bin System/user commands.
+cddl Various commands and libraries under the Common Development
+ and Distribution License.
+
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
Modified: projects/binutils-2.17/UPDATING
==============================================================================
--- projects/binutils-2.17/UPDATING Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/UPDATING Sun Nov 14 20:47:30 2010 (r215320)
@@ -22,6 +22,32 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
machines to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
+20101114:
+ Generic IEEE 802.3 annex 31B full duplex flow control support has been
+ added to mii(4) and bge(4), bce(4), msk(4), nfe(4) and stge(4) along
+ with brgphy(4), e1000phy(4) as well as ip1000phy() have been converted
+ to take advantage of it instead of using custom implementations. This
+ means that these drivers now no longer unconditionally advertise
+ support for flow control but only do so if flow control is a selected
+ media option. This was implemented in the generic support that way in
+ order to allow flow control to be switched on and off via ifconfig(8)
+ with the PHY specific default to typically off in order to protect
+ from unwanted effects. Consequently, if you used flow control with
+ one of the above mentioned drivers you now need to explicitly enable
+ it, for example via:
+ ifconfig bge0 media auto mediaopt flowcontrol
+
+ Along with the above mentioned changes generic support for setting
+ 1000baseT master mode also has been added and brgphy(4), ciphy(4),
+ e1000phy(4) as well as ip1000phy(4) have been converted to take
+ advantage of it. This means that these drivers now no longer take the
+ link0 parameter for selecting master mode but the master media option
+ has to be used instead, for example like in the following:
+ ifconfig bge0 media 1000baseT mediaopt full-duplex,master
+
+ Selection of master mode now is also available with all other PHY
+ drivers supporting 1000baseT.
+
20101111:
The TCP stack has received a significant update to add support for
modularised congestion control and generally improve the clarity of
Modified: projects/binutils-2.17/bin/sh/bltin/bltin.h
==============================================================================
--- projects/binutils-2.17/bin/sh/bltin/bltin.h Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/bin/sh/bltin/bltin.h Sun Nov 14 20:47:30 2010 (r215320)
@@ -54,6 +54,7 @@
#define putchar(c) out1c(c)
#define fprintf outfmt
#define fputs outstr
+#define fwrite(ptr, size, nmemb, file) outbin(ptr, (size) * (nmemb), file)
#define fflush flushout
#define INITARGS(argv)
#define warnx1(a, b, c) { \
Modified: projects/binutils-2.17/bin/sh/output.c
==============================================================================
--- projects/binutils-2.17/bin/sh/output.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/bin/sh/output.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -122,8 +122,7 @@ out2qstr(const char *p)
void
outstr(const char *p, struct output *file)
{
- while (*p)
- outc(*p++, file);
+ outbin(p, strlen(p), file);
}
/* Like outstr(), but quote for re-input into the shell. */
@@ -165,6 +164,16 @@ outqstr(const char *p, struct output *fi
outc('\'', file);
}
+void
+outbin(const void *data, size_t len, struct output *file)
+{
+ const char *p;
+
+ p = data;
+ while (len-- > 0)
+ outc(*p++, file);
+}
+
static char out_junk[16];
void
@@ -285,17 +294,11 @@ static int
doformat_wr(void *cookie, const char *buf, int len)
{
struct output *o;
- int origlen;
- unsigned char c;
o = (struct output *)cookie;
- origlen = len;
- while (len-- != 0) {
- c = (unsigned char)*buf++;
- outc(c, o);
- }
+ outbin(buf, len, o);
- return (origlen);
+ return (len);
}
void
Modified: projects/binutils-2.17/bin/sh/output.h
==============================================================================
--- projects/binutils-2.17/bin/sh/output.h Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/bin/sh/output.h Sun Nov 14 20:47:30 2010 (r215320)
@@ -36,6 +36,7 @@
#ifndef OUTPUT_INCL
#include <stdarg.h>
+#include <stddef.h>
struct output {
char *nextc;
@@ -59,6 +60,7 @@ void out2str(const char *);
void out2qstr(const char *);
void outstr(const char *, struct output *);
void outqstr(const char *, struct output *);
+void outbin(const void *, size_t, struct output *);
void emptyoutbuf(struct output *);
void flushall(void);
void flushout(struct output *);
Modified: projects/binutils-2.17/crypto/openssl/ssl/s3_clnt.c
==============================================================================
--- projects/binutils-2.17/crypto/openssl/ssl/s3_clnt.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/crypto/openssl/ssl/s3_clnt.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -1377,6 +1377,7 @@ int ssl3_get_key_exchange(SSL *s)
s->session->sess_cert->peer_ecdh_tmp=ecdh;
ecdh=NULL;
BN_CTX_free(bn_ctx);
+ bn_ctx = NULL;
EC_POINT_free(srvr_ecpoint);
srvr_ecpoint = NULL;
}
Modified: projects/binutils-2.17/gnu/lib/libgcc/Makefile
==============================================================================
--- projects/binutils-2.17/gnu/lib/libgcc/Makefile Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/gnu/lib/libgcc/Makefile Sun Nov 14 20:47:30 2010 (r215320)
@@ -140,13 +140,13 @@ LIB1ASMFUNCS = __divxf3 __divdf3 __divsf
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c
.endif
-.if ${TARGET_CPUARCH} == "powerpc"
+.if ${TARGET_ARCH} == "powerpc"
# from config/rs6000/t-ppccomm
LIB2FUNCS_EXTRA = tramp.asm
LIB2FUNCS_STATIC_EXTRA = eabi.asm
.endif
-.if ${TARGET_CPUARCH} == "powerpc64"
+.if ${TARGET_ARCH} == "powerpc64"
# from config/rs6000/t-ppccomm
LIB2FUNCS_EXTRA = tramp.asm
.endif
Modified: projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0
==============================================================================
--- projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0 Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/gnu/usr.bin/binutils/Makefile.inc0 Sun Nov 14 20:47:30 2010 (r215320)
@@ -7,7 +7,7 @@
VERSION= "2.17.50 [FreeBSD] 2007-07-03"
.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else
TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif
@@ -29,7 +29,7 @@ RELSRC= ${RELTOP}/../../../contrib/binut
SRCDIR= ${.CURDIR}/${RELSRC}
.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
- ${TARGET_CPUARCH} == "powerpc" || \
+ ${TARGET_ARCH} == "powerpc" || \
(${TARGET_CPUARCH} == "mips" && \
(!defined(TARGET_ABI) || ${TARGET_ABI} != "n64"))
CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
Modified: projects/binutils-2.17/gnu/usr.bin/cc/Makefile.tgt
==============================================================================
--- projects/binutils-2.17/gnu/usr.bin/cc/Makefile.tgt Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/gnu/usr.bin/cc/Makefile.tgt Sun Nov 14 20:47:30 2010 (r215320)
@@ -4,7 +4,7 @@
# MACHINE_CPUARCH, but there's no easy way to export make functions...
.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else
TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif
Modified: projects/binutils-2.17/gnu/usr.bin/gdb/Makefile.inc
==============================================================================
--- projects/binutils-2.17/gnu/usr.bin/gdb/Makefile.inc Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/gnu/usr.bin/gdb/Makefile.inc Sun Nov 14 20:47:30 2010 (r215320)
@@ -20,7 +20,7 @@ OBJ_GDB= ${OBJ_ROOT}/gdb
# MACHINE_CPUARCH, but there's no easy way to export make functions...
.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else
TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif
Modified: projects/binutils-2.17/gnu/usr.bin/gdb/libgdb/Makefile
==============================================================================
--- projects/binutils-2.17/gnu/usr.bin/gdb/libgdb/Makefile Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/gnu/usr.bin/gdb/libgdb/Makefile Sun Nov 14 20:47:30 2010 (r215320)
@@ -4,7 +4,7 @@
# MACHINE_CPUARCH, but there's no easy way to export make functions...
.if defined(TARGET_ARCH)
-TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/}
.else
TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif
Modified: projects/binutils-2.17/lib/libc/gen/pututxline.c
==============================================================================
--- projects/binutils-2.17/lib/libc/gen/pututxline.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/lib/libc/gen/pututxline.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <sys/endian.h>
#include <sys/stat.h>
#include <sys/uio.h>
+#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
@@ -53,6 +54,7 @@ futx_open(const char *file)
/* Safety check: never use broken files. */
if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0) {
_close(fd);
+ errno = EINVAL;
return (NULL);
}
@@ -142,6 +144,7 @@ utx_active_remove(struct futx *fu)
}
fclose(fp);
+ errno = ESRCH;
return (1);
}
Modified: projects/binutils-2.17/lib/libkvm/kvm.c
==============================================================================
--- projects/binutils-2.17/lib/libkvm/kvm.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/lib/libkvm/kvm.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/linker.h>
+#include <sys/pcpu.h>
#include <net/vnet.h>
@@ -433,7 +434,7 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl,
if (error > 0 && _kvm_dpcpu_initialized(kd, initialize))
error = kvm_fdnlist_prefix(kd, nl, error,
- "pcpu_entry_", _kvm_dpcpu_validaddr);
+ DPCPU_SYMPREFIX, _kvm_dpcpu_validaddr);
return (error);
}
@@ -473,7 +474,7 @@ again:
p->n_value =
_kvm_vnet_validaddr(kd, lookup.symvalue);
else if (_kvm_dpcpu_initialized(kd, initialize) &&
- !strcmp(prefix, "pcpu_entry_"))
+ !strcmp(prefix, DPCPU_SYMPREFIX))
p->n_value =
_kvm_dpcpu_validaddr(kd, lookup.symvalue);
else
@@ -495,7 +496,7 @@ again:
}
if (error && _kvm_dpcpu_initialized(kd, initialize) && !tried_dpcpu) {
tried_dpcpu = 1;
- prefix = "pcpu_entry_";
+ prefix = DPCPU_SYMPREFIX;
goto again;
}
Modified: projects/binutils-2.17/lib/libkvm/kvm_pcpu.c
==============================================================================
--- projects/binutils-2.17/lib/libkvm/kvm_pcpu.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/lib/libkvm/kvm_pcpu.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -197,9 +197,9 @@ _kvm_dpcpu_init(kvm_t *kd)
{
struct nlist nl[] = {
#define NLIST_START_SET_PCPU 0
- { "___start_set_pcpu" },
+ { "___start_" DPCPU_SETNAME },
#define NLIST_STOP_SET_PCPU 1
- { "___stop_set_pcpu" },
+ { "___stop_" DPCPU_SETNAME },
#define NLIST_DPCPU_OFF 2
{ "_dpcpu_off" },
#define NLIST_MP_MAXCPUS 3
Modified: projects/binutils-2.17/share/mk/bsd.cpu.mk
==============================================================================
--- projects/binutils-2.17/share/mk/bsd.cpu.mk Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/share/mk/bsd.cpu.mk Sun Nov 14 20:47:30 2010 (r215320)
@@ -114,7 +114,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__
. else
_CPUCFLAGS = -mcpu=${CPUTYPE}
. endif
-. elif ${MACHINE_CPUARCH} == "powerpc"
+. elif ${MACHINE_ARCH} == "powerpc"
. if ${CPUTYPE} == "e500"
MACHINE_CPU = booke
_CPUCFLAGS = -Wa,-me500 -msoft-float
Modified: projects/binutils-2.17/sys/amd64/amd64/trap.c
==============================================================================
--- projects/binutils-2.17/sys/amd64/amd64/trap.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/sys/amd64/amd64/trap.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -415,9 +415,9 @@ trap(struct trapframe *frame)
* This check also covers the images
* without the ABI-tag ELF note.
*/
- if (SV_CURPROC_ABI() ==
- SV_ABI_FREEBSD &&
- p->p_osrel >= 700004) {
+ if (SV_CURPROC_ABI() == SV_ABI_FREEBSD
+ && p->p_osrel >=
+ __FreeBSD_version_SIGSEGV) {
i = SIGSEGV;
ucode = SEGV_ACCERR;
} else {
Modified: projects/binutils-2.17/sys/boot/i386/boot2/boot1.S
==============================================================================
--- projects/binutils-2.17/sys/boot/i386/boot2/boot1.S Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/sys/boot/i386/boot2/boot1.S Sun Nov 14 20:47:30 2010 (r215320)
@@ -239,7 +239,7 @@ error: callw putstr # Display message
xorb %ah,%ah # BIOS: Get
int $0x16 # keypress
movw $0x1234, BDA_BOOT # Do a warm boot
- ljmp $0xffff,$0x0 # reboot the machine
+ ljmp $0xf000,$0xfff0 # reboot the machine
/*
* Display a null-terminated string using the BIOS output.
*/
Modified: projects/binutils-2.17/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- projects/binutils-2.17/sys/dev/arcmsr/arcmsr.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/sys/dev/arcmsr/arcmsr.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -2470,11 +2470,15 @@ static void arcmsr_action(struct cam_sim
splx(s);
}
else { /* Buffer is physical */
+#ifdef PAE
+ panic("arcmsr: CAM_DATA_PHYS not supported");
+#else
struct bus_dma_segment seg;
seg.ds_addr = (bus_addr_t)pccb->csio.data_ptr;
seg.ds_len = pccb->csio.dxfer_len;
arcmsr_execute_srb(srb, &seg, 1, 0);
+#endif
}
} else {
/* Scatter/gather list */
Modified: projects/binutils-2.17/sys/dev/bce/if_bce.c
==============================================================================
--- projects/binutils-2.17/sys/dev/bce/if_bce.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/sys/dev/bce/if_bce.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -1143,7 +1143,7 @@ bce_attach(device_t dev)
/* MII child bus by attaching the PHY. */
rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd,
bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr,
- MII_OFFSET_ANY, 0);
+ MII_OFFSET_ANY, MIIF_DOPAUSE);
if (rc != 0) {
BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__,
__LINE__);
@@ -1769,8 +1769,7 @@ bce_miibus_statchg(device_t dev)
REG_WR(sc, BCE_EMAC_MODE, val);
- /* FLAG0 is set if RX is enabled and FLAG1 if TX is enabled */
- if (mii->mii_media_active & IFM_FLAG0) {
+ if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) {
DBPRINT(sc, BCE_INFO_PHY,
"%s(): Enabling RX flow control.\n", __FUNCTION__);
BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
@@ -1780,7 +1779,7 @@ bce_miibus_statchg(device_t dev)
BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
}
- if (mii->mii_media_active & IFM_FLAG1) {
+ if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) {
DBPRINT(sc, BCE_INFO_PHY,
"%s(): Enabling TX flow control.\n", __FUNCTION__);
BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN);
Modified: projects/binutils-2.17/sys/dev/bge/if_bge.c
==============================================================================
--- projects/binutils-2.17/sys/dev/bge/if_bge.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/sys/dev/bge/if_bge.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -914,11 +914,13 @@ bge_miibus_statchg(device_t dev)
if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) {
BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX);
- if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG1)
+ if ((IFM_OPTIONS(mii->mii_media_active) &
+ IFM_ETH_TXPAUSE) != 0)
BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
else
BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE);
- if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0)
+ if ((IFM_OPTIONS(mii->mii_media_active) &
+ IFM_ETH_RXPAUSE) != 0)
BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
else
BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE);
@@ -2638,7 +2640,7 @@ bge_attach(device_t dev)
struct bge_softc *sc;
uint32_t hwcfg = 0, misccfg;
u_char eaddr[ETHER_ADDR_LEN];
- int error, f, msicount, phy_addr, reg, rid, trys;
+ int capmask, error, f, msicount, phy_addr, reg, rid, trys;
sc = device_get_softc(dev);
sc->bge_dev = dev;
@@ -2822,13 +2824,31 @@ bge_attach(device_t dev)
if (BGE_IS_5755_PLUS(sc) == 0)
sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG;
+ misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID;
if (sc->bge_asicrev == BGE_ASICREV_BCM5705) {
- misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID;
if (misccfg == BGE_MISCCFG_BOARD_ID_5788 ||
misccfg == BGE_MISCCFG_BOARD_ID_5788M)
sc->bge_flags |= BGE_FLAG_5788;
}
+ capmask = BMSR_DEFCAPMASK;
+ if ((sc->bge_asicrev == BGE_ASICREV_BCM5703 &&
+ (misccfg == 0x4000 || misccfg == 0x8000)) ||
+ (sc->bge_asicrev == BGE_ASICREV_BCM5705 &&
+ pci_get_vendor(dev) == BCOM_VENDORID &&
+ (pci_get_device(dev) == BCOM_DEVICEID_BCM5901 ||
+ pci_get_device(dev) == BCOM_DEVICEID_BCM5901A2 ||
+ pci_get_device(dev) == BCOM_DEVICEID_BCM5705F)) ||
+ (pci_get_vendor(dev) == BCOM_VENDORID &&
+ (pci_get_device(dev) == BCOM_DEVICEID_BCM5751F ||
+ pci_get_device(dev) == BCOM_DEVICEID_BCM5753F ||
+ pci_get_device(dev) == BCOM_DEVICEID_BCM5787F)) ||
+ pci_get_device(dev) == BCOM_DEVICEID_BCM57790 ||
+ sc->bge_asicrev == BGE_ASICREV_BCM5906) {
+ /* These chips are 10/100 only. */
+ capmask &= ~BMSR_EXTSTAT;
+ }
+
/*
* Some controllers seem to require a special firmware to use
* TSO. But the firmware is not available to FreeBSD and Linux
@@ -3102,9 +3122,9 @@ bge_attach(device_t dev)
again:
bge_asf_driver_up(sc);
- error = (mii_attach(dev, &sc->bge_miibus, ifp,
- bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK,
- phy_addr, MII_OFFSET_ANY, 0));
+ error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd,
+ bge_ifmedia_sts, capmask, phy_addr, MII_OFFSET_ANY,
+ MIIF_DOPAUSE);
if (error != 0) {
if (trys++ < 4) {
device_printf(sc->bge_dev, "Try again\n");
Modified: projects/binutils-2.17/sys/dev/mii/atphy.c
==============================================================================
--- projects/binutils-2.17/sys/dev/mii/atphy.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/sys/dev/mii/atphy.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -82,7 +82,7 @@ static int atphy_service(struct mii_soft
static void atphy_status(struct mii_softc *);
static void atphy_reset(struct mii_softc *);
static uint16_t atphy_anar(struct ifmedia_entry *);
-static int atphy_auto(struct mii_softc *);
+static int atphy_setmedia(struct mii_softc *, int);
static const struct mii_phydesc atphys[] = {
MII_PHY_DESC(ATHEROS, F1),
@@ -158,7 +158,7 @@ atphy_service(struct mii_softc *sc, stru
if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO ||
IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) {
- atphy_auto(sc);
+ atphy_setmedia(sc, ife->ifm_media);
break;
}
@@ -175,7 +175,7 @@ atphy_service(struct mii_softc *sc, stru
/*
* XXX
* Due to an unknown reason powering down PHY resulted
- * in unexpected results such as inaccessbility of
+ * in unexpected results such as inaccessibility of
* hardware of freshly rebooted system. Disable
* powering down PHY until I got more information for
* Attansic/Atheros PHY hardwares.
@@ -189,8 +189,9 @@ atphy_service(struct mii_softc *sc, stru
anar = atphy_anar(ife);
if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
bmcr |= BMCR_FDX;
- /* Enable pause. */
- anar |= (3 << 10);
+ if (((ife->ifm_media & IFM_GMASK) & IFM_FLOW) != 0 ||
+ (sc->mii_flags & MIIF_FORCEPAUSE) != 0)
+ anar |= ANAR_PAUSE_TOWARDS;
}
if ((sc->mii_extcapabilities & (EXTSR_1000TFDX |
@@ -222,7 +223,7 @@ done:
}
/*
- * check for link.
+ * Check for link.
* Read the status register twice; BMSR_LINK is latch-low.
*/
bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR);
@@ -238,7 +239,7 @@ done:
return (0);
sc->mii_ticks = 0;
- atphy_auto(sc);
+ atphy_setmedia(sc, ife->ifm_media);
break;
}
@@ -284,7 +285,7 @@ atphy_status(struct mii_softc *sc)
case ATPHY_SSR_1000MBS:
mii->mii_media_active |= IFM_1000_T;
/*
- * atphy(4) got a valid link so reset mii_ticks.
+ * atphy(4) has a valid link so reset mii_ticks.
* Resetting mii_ticks is needed in order to
* detect link loss after auto-negotiation.
*/
@@ -304,11 +305,13 @@ atphy_status(struct mii_softc *sc)
}
if ((ssr & ATPHY_SSR_DUPLEX) != 0)
- mii->mii_media_active |= IFM_FDX;
+ mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
else
mii->mii_media_active |= IFM_HDX;
- /* XXX Master/Slave, Flow-control */
+ if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) &&
+ (PHY_READ(sc, MII_100T2SR) & GTSR_MS_RES) != 0)
+ mii->mii_media_active |= IFM_ETH_MASTER;
}
static void
@@ -336,7 +339,7 @@ atphy_reset(struct mii_softc *sc)
PHY_WRITE(sc, ATPHY_SCR, reg);
/* Workaround F1 bug to reset phy. */
- atphy_auto(sc);
+ atphy_setmedia(sc, sc->mii_pdata->mii_media.ifm_cur->ifm_media);
for (i = 0; i < 1000; i++) {
DELAY(1);
@@ -378,12 +381,17 @@ atphy_anar(struct ifmedia_entry *ife)
}
static int
-atphy_auto(struct mii_softc *sc)
+atphy_setmedia(struct mii_softc *sc, int media)
{
uint16_t anar;
- anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities);
- PHY_WRITE(sc, MII_ANAR, anar | (3 << 10) | ANAR_CSMA);
+ anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA;
+ if (((IFM_SUBTYPE(media) == IFM_AUTO ||
+ ((media & IFM_GMASK) & IFM_FDX) != 0) &&
+ ((media & IFM_GMASK) & IFM_FLOW) != 0) ||
+ (sc->mii_flags & MIIF_FORCEPAUSE) != 0)
+ anar |= ANAR_PAUSE_TOWARDS;
+ PHY_WRITE(sc, MII_ANAR, anar);
if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0)
PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX |
GTCR_ADV_1000THDX);
Modified: projects/binutils-2.17/sys/dev/mii/brgphy.c
==============================================================================
--- projects/binutils-2.17/sys/dev/mii/brgphy.c Sun Nov 14 20:41:22 2010 (r215319)
+++ projects/binutils-2.17/sys/dev/mii/brgphy.c Sun Nov 14 20:47:30 2010 (r215320)
@@ -99,9 +99,9 @@ static driver_t brgphy_driver = {
DRIVER_MODULE(brgphy, miibus, brgphy_driver, brgphy_devclass, 0, 0);
static int brgphy_service(struct mii_softc *, struct mii_data *, int);
-static void brgphy_setmedia(struct mii_softc *, int, int);
+static void brgphy_setmedia(struct mii_softc *, int);
static void brgphy_status(struct mii_softc *);
-static void brgphy_mii_phy_auto(struct mii_softc *);
+static void brgphy_mii_phy_auto(struct mii_softc *, int);
static void brgphy_reset(struct mii_softc *);
static void brgphy_enable_loopback(struct mii_softc *);
static void bcm5401_load_dspcode(struct mii_softc *);
@@ -169,6 +169,7 @@ detect_hs21(struct bce_softc *bce_sc)
static int
brgphy_probe(device_t dev)
{
+
return (mii_phy_dev_probe(dev, brgphys, BUS_PROBE_DEFAULT));
}
@@ -183,7 +184,6 @@ brgphy_attach(device_t dev)
struct mii_attach_args *ma;
struct mii_data *mii;
struct ifnet *ifp;
- int fast_ether;
bsc = device_get_softc(dev);
sc = &bsc->mii_sc;
@@ -203,8 +203,7 @@ brgphy_attach(device_t dev)
* At least some variants wedge when isolating, at least some also
* don't support loopback.
*/
- sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP;
- sc->mii_anegticks = MII_ANEGTICKS_GIGE;
+ sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP | MIIF_NOMANPAUSE;
/* Initialize brgphy_softc structure */
bsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2);
@@ -212,8 +211,6 @@ brgphy_attach(device_t dev)
bsc->mii_rev = MII_REV(ma->mii_id2);
bsc->serdes_flags = 0;
- fast_ether = 0;
-
if (bootverbose)
device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n",
bsc->mii_oui, bsc->mii_model, bsc->mii_rev);
@@ -271,18 +268,6 @@ brgphy_attach(device_t dev)
bce_sc = ifp->if_softc;
}
- /* Todo: Need to add additional controllers such as 5906 & 5787F */
- /* The 590x chips are 10/100 only. */
- if (bge_sc &&
- pci_get_vendor(bge_sc->bge_dev) == BCOM_VENDORID &&
- (pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901 ||
- pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901A2 ||
- pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5906 ||
- pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5906M)) {
- fast_ether = 1;
- sc->mii_anegticks = MII_ANEGTICKS;
- }
-
brgphy_reset(sc);
/* Read the PHY's capabilities. */
@@ -295,27 +280,10 @@ brgphy_attach(device_t dev)
/* Add the supported media types */
if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) {
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst),
- BRGPHY_S10);
- printf("10baseT, ");
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst),
- BRGPHY_S10 | BRGPHY_BMCR_FDX);
- printf("10baseT-FDX, ");
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst),
- BRGPHY_S100);
- printf("100baseTX, ");
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst),
- BRGPHY_S100 | BRGPHY_BMCR_FDX);
- printf("100baseTX-FDX, ");
- if (fast_ether == 0) {
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst),
- BRGPHY_S1000);
- printf("1000baseT, ");
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst),
- BRGPHY_S1000 | BRGPHY_BMCR_FDX);
- printf("1000baseT-FDX, ");
- }
+ mii_phy_add_media(sc);
+ printf("\n");
} else {
+ sc->mii_anegticks = MII_ANEGTICKS_GIGE;
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, sc->mii_inst),
BRGPHY_S1000 | BRGPHY_BMCR_FDX);
printf("1000baseSX-FDX, ");
@@ -337,11 +305,10 @@ brgphy_attach(device_t dev)
printf("auto-neg workaround, ");
bsc->serdes_flags |= BRGPHY_NOANWAIT;
}
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0);
+ printf("auto\n");
}
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0);
- printf("auto\n");
-
#undef ADD
MIIBUS_MEDIAINIT(sc->mii_dev);
return (0);
@@ -367,15 +334,14 @@ brgphy_service(struct mii_softc *sc, str
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
- brgphy_mii_phy_auto(sc);
+ brgphy_mii_phy_auto(sc, ife->ifm_media);
break;
case IFM_2500_SX:
case IFM_1000_SX:
case IFM_1000_T:
case IFM_100_TX:
case IFM_10_T:
- brgphy_setmedia(sc, ife->ifm_media,
- mii->mii_ifp->if_flags & IFF_LINK0);
+ brgphy_setmedia(sc, ife->ifm_media);
break;
default:
return (EINVAL);
@@ -397,7 +363,7 @@ brgphy_service(struct mii_softc *sc, str
* Check to see if we have link. If we do, we don't
* need to restart the autonegotiation process.
*/
- val = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR);
+ val = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR);
if (val & BMSR_LINK) {
sc->mii_ticks = 0; /* Reset autoneg timer. */
break;
@@ -414,7 +380,7 @@ brgphy_service(struct mii_softc *sc, str
/* Retry autonegotiation */
sc->mii_ticks = 0;
- brgphy_mii_phy_auto(sc);
+ brgphy_mii_phy_auto(sc, ife->ifm_media);
break;
}
@@ -456,7 +422,6 @@ brgphy_service(struct mii_softc *sc, str
return (0);
}
-
/****************************************************************************/
/* Sets the PHY link speed. */
/* */
@@ -464,12 +429,10 @@ brgphy_service(struct mii_softc *sc, str
/* None */
/****************************************************************************/
static void
-brgphy_setmedia(struct mii_softc *sc, int media, int master)
+brgphy_setmedia(struct mii_softc *sc, int media)
{
- struct brgphy_softc *bsc = (struct brgphy_softc *)sc;
int bmcr = 0, gig;
- /* Calculate the value for the BMCR register. */
switch (IFM_SUBTYPE(media)) {
case IFM_2500_SX:
break;
@@ -486,7 +449,6 @@ brgphy_setmedia(struct mii_softc *sc, in
break;
}
- /* Calculate duplex settings for 1000BasetT/1000BaseX. */
if ((media & IFM_GMASK) == IFM_FDX) {
bmcr |= BRGPHY_BMCR_FDX;
gig = BRGPHY_1000CTL_AFD;
@@ -494,53 +456,30 @@ brgphy_setmedia(struct mii_softc *sc, in
gig = BRGPHY_1000CTL_AHD;
}
- /* Force loopback to disconnect PHY for Ethernet medium. */
+ /* Force loopback to disconnect PHY from Ethernet medium. */
brgphy_enable_loopback(sc);
- /* Disable 1000BaseT advertisements. */
PHY_WRITE(sc, BRGPHY_MII_1000CTL, 0);
- /* Disable 10/100 advertisements. */
PHY_WRITE(sc, BRGPHY_MII_ANAR, BRGPHY_SEL_TYPE);
- /* Write forced link speed. */
- PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr);
- /* If 10/100 only then configuration is complete. */
- if ((IFM_SUBTYPE(media) != IFM_1000_T) && (IFM_SUBTYPE(media) != IFM_1000_SX))
- goto brgphy_setmedia_exit;
+ if (IFM_SUBTYPE(media) != IFM_1000_T &&
+ IFM_SUBTYPE(media) != IFM_1000_SX) {
+ PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr);
+ return;
+ }
- /* Set duplex speed advertisement for 1000BaseT/1000BaseX. */
+ if (IFM_SUBTYPE(media) == IFM_1000_T) {
+ gig |= BRGPHY_1000CTL_MSE;
+ if ((media & IFM_ETH_MASTER) != 0)
+ gig |= BRGPHY_1000CTL_MSC;
+ }
PHY_WRITE(sc, BRGPHY_MII_1000CTL, gig);
- /* Restart auto-negotiation for 1000BaseT/1000BaseX. */
PHY_WRITE(sc, BRGPHY_MII_BMCR,
bmcr | BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG);
-
- /* If not 5701 PHY then configuration is complete. */
- if (bsc->mii_model != MII_MODEL_xxBROADCOM_BCM5701)
- goto brgphy_setmedia_exit;
-
- /*
- * When setting the link manually, one side must be the master and
- * the other the slave. However ifmedia doesn't give us a good way
- * to specify this, so we fake it by using one of the LINK flags.
- * If LINK0 is set, we program the PHY to be a master, otherwise
- * it's a slave.
- */
- if (master) {
- PHY_WRITE(sc, BRGPHY_MII_1000CTL,
- gig | BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC);
- } else {
- PHY_WRITE(sc, BRGPHY_MII_1000CTL,
- gig | BRGPHY_1000CTL_MSE);
- }
-
-brgphy_setmedia_exit:
- return;
}
/****************************************************************************/
/* Set the media status based on the PHY settings. */
-/* IFM_FLAG0 = 0 (RX flow control disabled) | 1 (enabled) */
-/* IFM_FLAG1 = 0 (TX flow control disabled) | 1 (enabled) */
/* */
/* Returns: */
/* None */
@@ -550,34 +489,34 @@ brgphy_status(struct mii_softc *sc)
{
struct brgphy_softc *bsc = (struct brgphy_softc *)sc;
struct mii_data *mii = sc->mii_pdata;
- int aux, bmcr, bmsr, anar, anlpar, xstat, val;
-
+ int aux, bmcr, bmsr, val, xstat;
+ u_int flowstat;
mii->mii_media_status = IFM_AVALID;
mii->mii_media_active = IFM_ETHER;
bmsr = PHY_READ(sc, BRGPHY_MII_BMSR) | PHY_READ(sc, BRGPHY_MII_BMSR);
bmcr = PHY_READ(sc, BRGPHY_MII_BMCR);
- anar = PHY_READ(sc, BRGPHY_MII_ANAR);
- anlpar = PHY_READ(sc, BRGPHY_MII_ANLPAR);
- /* Loopback is enabled. */
if (bmcr & BRGPHY_BMCR_LOOP) {
-
mii->mii_media_active |= IFM_LOOP;
}
- /* Autoneg is still in progress. */
if ((bmcr & BRGPHY_BMCR_AUTOEN) &&
(bmsr & BRGPHY_BMSR_ACOMP) == 0 &&
(bsc->serdes_flags & BRGPHY_NOANWAIT) == 0) {
/* Erg, still trying, I guess... */
mii->mii_media_active |= IFM_NONE;
- goto brgphy_status_exit;
+ return;
}
- /* Autoneg is enabled and complete, link should be up. */
if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) {
+ /*
+ * NB: reading the ANAR, ANLPAR or 1000STS after the AUXSTS
+ * wedges at least the PHY of BCM5704 (but not others).
+ */
+ flowstat = mii_phy_flowstatus(sc);
+ xstat = PHY_READ(sc, BRGPHY_MII_1000STS);
aux = PHY_READ(sc, BRGPHY_MII_AUXSTS);
/* If copper link is up, get the negotiated speed/duplex. */
@@ -601,8 +540,16 @@ brgphy_status(struct mii_softc *sc)
default:
mii->mii_media_active |= IFM_NONE; break;
}
+
+ if ((mii->mii_media_active & IFM_FDX) != 0)
+ mii->mii_media_active |= flowstat;
+
+ if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T &&
+ (xstat & BRGPHY_1000STS_MSR) != 0)
+ mii->mii_media_active |= IFM_ETH_MASTER;
}
} else {
+ /* Todo: Add support for flow control. */
/* If serdes link is up, get the negotiated speed/duplex. */
if (bmsr & BRGPHY_BMSR_LINK) {
mii->mii_media_status |= IFM_ACTIVE;
@@ -620,7 +567,6 @@ brgphy_status(struct mii_softc *sc)
else
mii->mii_media_active |= IFM_HDX;
}
-
} else if (bsc->serdes_flags & BRGPHY_5708S) {
PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0);
xstat = PHY_READ(sc, BRGPHY_5708S_PG0_1000X_STAT1);
@@ -642,9 +588,7 @@ brgphy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_FDX;
else
mii->mii_media_active |= IFM_HDX;
-
} else if (bsc->serdes_flags & BRGPHY_5709S) {
-
/* Select GP Status Block of the AN MMD, get autoneg results. */
PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS);
xstat = PHY_READ(sc, BRGPHY_GP_STATUS_TOP_ANEG_STATUS);
@@ -670,65 +614,42 @@ brgphy_status(struct mii_softc *sc)
else
mii->mii_media_active |= IFM_HDX;
}
-
}
-
- /* Todo: Change bge to use these settings. */
-
- /* Fetch flow control settings from the copper PHY. */
- if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) {
- /* Set FLAG0 if RX is enabled and FLAG1 if TX is enabled */
- if ((anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANLPAR_PC)) {
- mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1;
- } else if (!(anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANAR_ASP) &&
- (anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) {
- mii->mii_media_active |= IFM_FLAG1;
- } else if ((anar & BRGPHY_ANAR_PC) && (anar & BRGPHY_ANAR_ASP) &&
- !(anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) {
- mii->mii_media_active |= IFM_FLAG0;
- }
- }
-
- /* Todo: Add support for fiber settings too. */
-
-
-brgphy_status_exit:
- return;
}
static void
-brgphy_mii_phy_auto(struct mii_softc *sc)
+brgphy_mii_phy_auto(struct mii_softc *sc, int media)
{
struct brgphy_softc *bsc = (struct brgphy_softc *)sc;
- int ktcr = 0;
+ int anar, ktcr = 0;
brgphy_reset(sc);
- /* Enable flow control in the advertisement register. */
if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) {
- /* Pause capability advertisement (pause capable & asymmetric) */
- PHY_WRITE(sc, BRGPHY_MII_ANAR,
- BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA |
- BRGPHY_ANAR_ASP | BRGPHY_ANAR_PC);
+ anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA;
+ if ((media & IFM_FLOW) != 0 ||
+ (sc->mii_flags & MIIF_FORCEPAUSE) != 0)
+ anar |= BRGPHY_ANAR_PC | BRGPHY_ANAR_ASP;
+ PHY_WRITE(sc, BRGPHY_MII_ANAR, anar);
} else {
- PHY_WRITE(sc, BRGPHY_SERDES_ANAR, BRGPHY_SERDES_ANAR_FDX |
- BRGPHY_SERDES_ANAR_HDX | BRGPHY_SERDES_ANAR_BOTH_PAUSE);
+ anar = BRGPHY_SERDES_ANAR_FDX | BRGPHY_SERDES_ANAR_HDX;
+ if ((media & IFM_FLOW) != 0 ||
+ (sc->mii_flags & MIIF_FORCEPAUSE) != 0)
+ anar |= BRGPHY_SERDES_ANAR_BOTH_PAUSE;
+ PHY_WRITE(sc, BRGPHY_SERDES_ANAR, anar);
}
- /* Enable speed in the 1000baseT control register */
ktcr = BRGPHY_1000CTL_AFD | BRGPHY_1000CTL_AHD;
if (bsc->mii_model == MII_MODEL_xxBROADCOM_BCM5701)
ktcr |= BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC;
PHY_WRITE(sc, BRGPHY_MII_1000CTL, ktcr);
ktcr = PHY_READ(sc, BRGPHY_MII_1000CTL);
- /* Start autonegotiation */
- PHY_WRITE(sc, BRGPHY_MII_BMCR,BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG);
+ PHY_WRITE(sc, BRGPHY_MII_BMCR, BRGPHY_BMCR_AUTOEN |
+ BRGPHY_BMCR_STARTNEG);
PHY_WRITE(sc, BRGPHY_MII_IMR, 0xFF00);
-
}
-
/* Enable loopback to force the link down. */
static void
brgphy_enable_loopback(struct mii_softc *sc)
@@ -923,7 +844,6 @@ brgphy_fixup_jitter_bug(struct mii_softc
PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val);
}
-
static void
brgphy_fixup_disable_early_dac(struct mii_softc *sc)
{
@@ -936,7 +856,6 @@ brgphy_fixup_disable_early_dac(struct mi
}
-
static void
brgphy_ethernet_wirespeed(struct mii_softc *sc)
{
@@ -948,7 +867,6 @@ brgphy_ethernet_wirespeed(struct mii_sof
PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4));
}
-
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list