168ceb29eSwdenk 268ceb29eSwdenkIn U-Boot, we implemented the networked console via the standard 368ceb29eSwdenk"devices" mechanism, which means that you can switch between the 468ceb29eSwdenkserial and network input/output devices by adjusting the 'stdin' and 568ceb29eSwdenk'stdout' environment variables. To switch to the networked console, 668ceb29eSwdenkset either of these variables to "nc". Input and output can be 768ceb29eSwdenkswitched independently. 868ceb29eSwdenk 9eedcd078SwdenkWe use an environment variable 'ncip' to set the IP address and the 10eedcd078Swdenkport of the destination. The format is <ip_addr>:<port>. If <port> is 11eedcd078Swdenkomitted, the value of 6666 is used. If the env var doesn't exist, the 12eedcd078Swdenkbroadcast address and port 6666 are used. If it is set to an IP 13eedcd078Swdenkaddress of 0 (or 0.0.0.0) then no messages are sent to the network. 14eedcd078Swdenk 1568ceb29eSwdenkOn the host side, please use this script to access the console: 1668ceb29eSwdenk 1768ceb29eSwdenk+++++++++++++++++++++++++++++++++++++++++++ 1868ceb29eSwdenk#! /bin/bash 1968ceb29eSwdenk 2068ceb29eSwdenkTARGET_IP=$1 2168ceb29eSwdenk 2268ceb29eSwdenkstty -icanon -echo intr ^T 2368ceb29eSwdenknc -u -l -p 6666 < /dev/null & 2468ceb29eSwdenknc -u ${TARGET_IP} 6666 2568ceb29eSwdenkstty icanon echo intr ^C 2668ceb29eSwdenk+++++++++++++++++++++++++++++++++++++++++++ 2768ceb29eSwdenk 28*25d6712aSwdenkIt turns out that 'netcat' cannot be used to listen to broadcast 29eedcd078Swdenkpackets. We developed our own tool 'ncb' (see tools directory) that 30eedcd078Swdenklistens to broadcast packets on a given port and dumps them to the 31eedcd078Swdenkstandard output. use it as follows: 32eedcd078Swdenk 33eedcd078Swdenk+++++++++++++++++++++++++++++++++++++++++++ 34eedcd078Swdenk#! /bin/bash 35eedcd078Swdenk 36eedcd078Swdenkstty icanon echo intr ^T 37eedcd078Swdenk./ncb & 38eedcd078Swdenknc -u mpc5200 6666 39eedcd078Swdenkstty icanon echo intr ^C 40eedcd078Swdenkkill 0 41eedcd078Swdenk+++++++++++++++++++++++++++++++++++++++++++ 42eedcd078Swdenk 4368ceb29eSwdenkFor Linux, the network-based console needs special configuration. 4468ceb29eSwdenkMinimally, the host IP address needs to be specified. This can be 4568ceb29eSwdenkdone either via the kernel command line, or by passing parameters 4668ceb29eSwdenkwhile loading the netconsole.o module (when used in a loadable module 4768ceb29eSwdenkconfiguration). Please refer to Documentation/networking/logging.txt 4868ceb29eSwdenkfile for the original Ingo Molnar's documentation on how to pass 4968ceb29eSwdenkparameters to the loadable module. 5068ceb29eSwdenk 5168ceb29eSwdenkThe format of the kernel command line parameter (for the static 5268ceb29eSwdenkconfiguration) is as follows: 5368ceb29eSwdenk 5468ceb29eSwdenk netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr] 5568ceb29eSwdenk 5668ceb29eSwdenkwhere 5768ceb29eSwdenk 5868ceb29eSwdenk src-port source for UDP packets 5968ceb29eSwdenk (defaults to 6665) 6068ceb29eSwdenk src-ip source IP to use 6168ceb29eSwdenk (defaults to the interface's address) 6268ceb29eSwdenk dev network interface 6368ceb29eSwdenk (defaults to eth0) 6468ceb29eSwdenk tgt-port port for logging agent 6568ceb29eSwdenk (defaults to 6666) 6668ceb29eSwdenk tgt-ip IP address for logging agent 6768ceb29eSwdenk (this is the required parameter) 6868ceb29eSwdenk tgt-macaddr ethernet MAC address for logging agent 6968ceb29eSwdenk (defaults to broadcast) 7068ceb29eSwdenk 7168ceb29eSwdenkExamples: 7268ceb29eSwdenk 7368ceb29eSwdenk netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc 7468ceb29eSwdenk 7568ceb29eSwdenkor 7668ceb29eSwdenk 7768ceb29eSwdenk netconsole=@/,@192.168.3.1/ 7868ceb29eSwdenk 7968ceb29eSwdenkPlease note that for the Linux networked console to work, the 8068ceb29eSwdenkethernet interface has to be up by the time the netconsole driver is 8168ceb29eSwdenkinitialized. This means that in case of static kernel configuration, 8268ceb29eSwdenkthe respective Ethernet interface has to be brought up using the "IP 8368ceb29eSwdenkAutoconfiguration" kernel feature, which is usually done by defaults 8468ceb29eSwdenkin the ELDK-NFS-based environment. 8568ceb29eSwdenk 8668ceb29eSwdenkTo browse the Linux network console output, use the 'netcat' tool invoked 8768ceb29eSwdenkas follows: 8868ceb29eSwdenk 8968ceb29eSwdenk nc -u -l -p 6666 90*25d6712aSwdenk 91*25d6712aSwdenkNote that unlike the U-Boot implementation the Linux netconsole is 92*25d6712aSwdenkunidirectional, i. e. you have console output only in Linux. 93