xref: /openbmc/u-boot/doc/README.NetConsole (revision 68ceb29e7133a0f972f53d3d61fd61207374baec)
1*68ceb29eSwdenk
2*68ceb29eSwdenkIn U-Boot, we implemented the networked console via the standard
3*68ceb29eSwdenk"devices" mechanism, which means that you can switch between the
4*68ceb29eSwdenkserial and network input/output devices by adjusting the 'stdin' and
5*68ceb29eSwdenk'stdout' environment variables. To switch to the networked console,
6*68ceb29eSwdenkset either of these variables to "nc". Input and output can be
7*68ceb29eSwdenkswitched independently.
8*68ceb29eSwdenk
9*68ceb29eSwdenkOn the host side, please use this script to access the console:
10*68ceb29eSwdenk
11*68ceb29eSwdenk+++++++++++++++++++++++++++++++++++++++++++
12*68ceb29eSwdenk#! /bin/bash
13*68ceb29eSwdenk
14*68ceb29eSwdenkTARGET_IP=$1
15*68ceb29eSwdenk
16*68ceb29eSwdenkstty -icanon -echo intr ^T
17*68ceb29eSwdenknc -u -l -p 6666 < /dev/null &
18*68ceb29eSwdenknc -u ${TARGET_IP} 6666
19*68ceb29eSwdenkstty icanon echo intr ^C
20*68ceb29eSwdenk+++++++++++++++++++++++++++++++++++++++++++
21*68ceb29eSwdenk
22*68ceb29eSwdenkFor Linux, the network-based console needs special configuration.
23*68ceb29eSwdenkMinimally, the host IP address needs to be specified. This can be
24*68ceb29eSwdenkdone either via the kernel command line, or by passing parameters
25*68ceb29eSwdenkwhile loading the netconsole.o module (when used in a loadable module
26*68ceb29eSwdenkconfiguration). Please refer to Documentation/networking/logging.txt
27*68ceb29eSwdenkfile for the original Ingo Molnar's documentation on how to pass
28*68ceb29eSwdenkparameters to the loadable module.
29*68ceb29eSwdenk
30*68ceb29eSwdenkThe format of the kernel command line parameter (for the static
31*68ceb29eSwdenkconfiguration) is as follows:
32*68ceb29eSwdenk
33*68ceb29eSwdenk  netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]
34*68ceb29eSwdenk
35*68ceb29eSwdenkwhere
36*68ceb29eSwdenk
37*68ceb29eSwdenk  src-port	source for UDP packets
38*68ceb29eSwdenk		(defaults to 6665)
39*68ceb29eSwdenk  src-ip	source IP to use
40*68ceb29eSwdenk		(defaults to the interface's address)
41*68ceb29eSwdenk  dev		network interface
42*68ceb29eSwdenk		(defaults to eth0)
43*68ceb29eSwdenk  tgt-port	port for logging agent
44*68ceb29eSwdenk		(defaults to 6666)
45*68ceb29eSwdenk  tgt-ip	IP address for logging agent
46*68ceb29eSwdenk		(this is the required parameter)
47*68ceb29eSwdenk  tgt-macaddr	ethernet MAC address for logging agent
48*68ceb29eSwdenk		(defaults to broadcast)
49*68ceb29eSwdenk
50*68ceb29eSwdenkExamples:
51*68ceb29eSwdenk
52*68ceb29eSwdenk  netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
53*68ceb29eSwdenk
54*68ceb29eSwdenkor
55*68ceb29eSwdenk
56*68ceb29eSwdenk  netconsole=@/,@192.168.3.1/
57*68ceb29eSwdenk
58*68ceb29eSwdenkPlease note that for the Linux networked console to work, the
59*68ceb29eSwdenkethernet interface has to be up by the time the netconsole driver is
60*68ceb29eSwdenkinitialized. This means that in case of static kernel configuration,
61*68ceb29eSwdenkthe respective Ethernet interface has to be brought up using the "IP
62*68ceb29eSwdenkAutoconfiguration" kernel feature, which is usually done by defaults
63*68ceb29eSwdenkin the ELDK-NFS-based environment.
64*68ceb29eSwdenk
65*68ceb29eSwdenkTo browse the Linux network console output, use the 'netcat' tool invoked
66*68ceb29eSwdenkas follows:
67*68ceb29eSwdenk
68*68ceb29eSwdenk	nc -u -l -p 6666
69