Suppose you have two network controllers.
The first one is ENC28J60 (it is in low power mode
after start) the second one is always-enabled eth1.
As ENC28J60 is in low power mode before enc28j60_eth_open()
is called. ENC28J60's mii traceiver is in low power mode too
so the mii traceiver's register are inaccessable.
Here is a sample log just after barebox start:
barebox:/ miitool
miibus0: registered phy as /dev/phy0
No MII transceiver present!.
miibus1: registered phy as /dev/phy1
phy1: eth1: negotiated 100baseTx-FD, link ok
barebox:/ miitool
No MII transceiver present!.
phy1: eth1: negotiated 100baseTx-FD, link ok
The 'No MII transceiver present!.' message is confusing here.
This patch fixes the problem so the miitool output
looks like this:
barebox:/ miitool
phy0: spieth0: No MII transceiver present!.
phy1: eth1: negotiated 100baseTx-FD, link ok
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The doxygen documentation is long outdated. Remove it. It will
be replaced with sphinx based documentation later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
bmcr2 contains the gigabit advertise bits and lpa2 contains the gigabit
link partner ability bits, not the other way round.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
media_list tests for gigabit phys like this:
if (mask & BMCR_SPEED1000)
mask does not contain the value of the BMCR register though, so the
test is completely bogus. Test for mask2 instead which is only
nonzero when the phy has gigabit capabilities.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
media_list writes into a static string. Worst case length of this string
is 125 bytes, but the function only allocates 100 bytes. Use 256 bytes which
is long enough for some extensions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.
The old output format (plus grouping) is now available with 'help -v'.
Example:
Information commands:
?, devinfo, help, iomem, meminfo, version
Boot commands:
boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
...
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The GbE support based on the patch for generic 'mii-tool', see
http://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz
We need to note Jean-Christophe PLAGNIOL-VILLARD for his
initial GbE support patch:
http://lists.infradead.org/pipermail/barebox/2013-February/012634.html
Generic 'mii-tool' GbE support patch has some disadvantages:
1. 1000baseT-HD is prefered to 1000baseT-FD;
2. show GbE-features for 10/100 only phys (e.g. Level One LXT971).
This patch fixes this disadvantages.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
miitool without arguments will try to show status for all phys.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With the -s option all mii buses can be scanned for devices so
that they are available without doing network operations. Also,
now *all* phy devices on a mii bus can be examined, not only
the one attached to an ethernet device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This command is based on the 'mii-diag' and 'mii-tool'
Unix utilities, but it lacks routines to manipulate
MII state (e.g. reset MII, restart autonegotiation
or force MII mode).
This version of the 'miitool' command has no GbE support,
but we can upgrade it in the future. The GbE support
patch for generic 'mii-tool' is here
http://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz
EXAMPLE:
barebox:/ miitool -vv /dev/phy0
negotiated 100baseTx-FD, link ok
registers for MII PHY:
3100 782d 0013 78e2 01e1 45e1 0007 2001
0000 ffff ffff ffff ffff ffff ffff ffff
0084 4780 0000 0000 0422 0000 0000 0000
0000 0000 0080 0000 ffff 0000 0000 3660
product info: Level One LXT971A rev 2
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>