Convert CONFIG_USB_XHCI_OMAP to Kconfig
[platform/kernel/u-boot.git] / doc / usage / netconsole.rst
1 Network console
2 ===============
3
4 In U-Boot, we implemented the networked console via the standard
5 "devices" mechanism, which means that you can switch between the
6 serial and network input/output devices by adjusting the 'stdin' and
7 'stdout' environment variables. To switch to the networked console,
8 set either of these variables to "nc". Input and output can be
9 switched independently.
10
11 The default buffer size can be overridden by setting
12 CONFIG_NETCONSOLE_BUFFER_SIZE.
13
14 We use an environment variable 'ncip' to set the IP address and the
15 port of the destination. The format is <ip_addr>:<port>. If <port> is
16 omitted, the value of 6666 is used. If the env var doesn't exist, the
17 broadcast address and port 6666 are used. If it is set to an IP
18 address of 0 (or 0.0.0.0) then no messages are sent to the network.
19 The source / listening port can be configured separately by setting
20 the 'ncinport' environment variable and the destination port can be
21 configured by setting the 'ncoutport' environment variable.
22
23 For example, if your server IP is 192.168.1.1, you could use::
24
25         => setenv nc 'setenv stdout nc;setenv stdin nc'
26         => setenv ncip 192.168.1.1
27         => saveenv
28         => run nc
29
30 On the host side, please use this script to access the console
31
32 .. code-block:: bash
33
34         tools/netconsole <ip> [port]
35
36 The script uses netcat to talk to the board over UDP.  It requires you to
37 specify the target IP address (or host name, assuming DNS is working). The
38 script can be interrupted by pressing ^T (CTRL-T).
39
40 Be aware that in some distributives (Fedora Core 5 at least)
41 usage of nc has been changed and -l and -p options are considered
42 as mutually exclusive. If nc complains about options provided,
43 you can just remove the -p option from the script.
44
45 It turns out that 'netcat' cannot be used to listen to broadcast
46 packets. We developed our own tool 'ncb' (see tools directory) that
47 listens to broadcast packets on a given port and dumps them to the
48 standard output.  It will be built when compiling for a board which
49 has CONFIG_NETCONSOLE defined.  If the netconsole script can find it
50 in PATH or in the same directory, it will be used instead.
51
52 For Linux, the network-based console needs special configuration.
53 Minimally, the host IP address needs to be specified. This can be
54 done either via the kernel command line, or by passing parameters
55 while loading the netconsole.o module (when used in a loadable module
56 configuration). Please refer to Documentation/networking/logging.txt
57 file for the original Ingo Molnar's documentation on how to pass
58 parameters to the loadable module.
59
60 The format of the kernel command line parameter (for the static
61 configuration) is as follows
62
63 .. code-block:: bash
64
65     netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]
66
67 where
68
69 src-port
70     source for UDP packets (defaults to 6665)
71
72 src-ip
73     source IP to use (defaults to the interface's address)
74
75 dev
76     network interface (defaults to eth0)
77
78 tgt-port
79   port for logging agent (defaults to 6666)
80
81 tgt-ip
82   IP address for logging agent (this is the required parameter)
83
84 tgt-macaddr
85     ethernet MAC address for logging agent (defaults to broadcast)
86
87 Examples
88
89 .. code-block:: bash
90
91   netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
92   netconsole=@/,@192.168.3.1/
93
94 Please note that for the Linux networked console to work, the
95 ethernet interface has to be up by the time the netconsole driver is
96 initialized. This means that in case of static kernel configuration,
97 the respective Ethernet interface has to be brought up using the "IP
98 Autoconfiguration" kernel feature, which is usually done by defaults
99 in the ELDK-NFS-based environment.
100
101 To browse the Linux network console output, use the 'netcat' tool invoked
102 as follows:
103
104 .. code-block:: bash
105
106         nc -u -l -p 6666
107
108 Note that unlike the U-Boot implementation the Linux netconsole is
109 unidirectional, i. e. you have console output only in Linux.