Add support for the console over Ethernet (through PCI NE2000).
Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Cristian Magherusan-Stanciu <cristi.magherusan@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5666 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
menu "Console options"
|
||||
|
||||
# TODO: Rename to SERIAL_CONSOLE once Kconfig transition is complete.
|
||||
config CONSOLE_SERIAL8250
|
||||
bool "Serial port console output"
|
||||
@@ -130,6 +129,49 @@ config CONSOLE_VGA_ONBOARD_AT_FIRST
|
||||
help
|
||||
If not selected, the last adapter found will be used.
|
||||
|
||||
config CONSOLE_NE2K
|
||||
bool "Network console over NE2000 compatible Ethernet adapter"
|
||||
default n
|
||||
help
|
||||
Send coreboot debug output to a Ethernet console, it works
|
||||
same way as Linux netconsole, packets are received to UDP
|
||||
port 6666 on IP/MAC specified with options bellow.
|
||||
Use following netcat command: nc -u -l -p 6666
|
||||
|
||||
config CONSOLE_NE2K_DST_MAC
|
||||
depends on CONSOLE_NE2K
|
||||
string "Destination MAC address of remote system"
|
||||
default "00:13:d4:76:a2:ac"
|
||||
help
|
||||
Type in either MAC address of logging system or MAC address
|
||||
of the router.
|
||||
|
||||
config CONSOLE_NE2K_DST_IP
|
||||
depends on CONSOLE_NE2K
|
||||
string "Destination IP of logging system"
|
||||
default "10.0.1.27"
|
||||
help
|
||||
This is IP adress of the system running for example
|
||||
netcat command to dump the packets.
|
||||
|
||||
config CONSOLE_NE2K_SRC_IP
|
||||
depends on CONSOLE_NE2K
|
||||
string "IP adress of Coreboot system"
|
||||
default "10.0.1.253"
|
||||
help
|
||||
This is the IP of the Coreboot system
|
||||
|
||||
config CONSOLE_NE2K_IO_PORT
|
||||
depends on CONSOLE_NE2K
|
||||
hex "NE2000 adapter fixed IO port address"
|
||||
default 0xe00
|
||||
help
|
||||
This is the IO port address for the IO port
|
||||
on the card, please select some non-conflicting region,
|
||||
32 bytes of IO spaces will be used (and align on 32 bytes
|
||||
boundary, qemu needs broader align)
|
||||
|
||||
|
||||
choice
|
||||
prompt "Maximum console log level"
|
||||
default MAXIMUM_CONSOLE_LOGLEVEL_8
|
||||
|
@@ -15,6 +15,7 @@ driver-$(CONFIG_CONSOLE_VGA) += vga_console.o
|
||||
driver-$(CONFIG_CONSOLE_BTEXT) += btext_console.o
|
||||
driver-$(CONFIG_CONSOLE_BTEXT) += font-8x16.o
|
||||
driver-$(CONFIG_CONSOLE_LOGBUF) += logbuf_console.o
|
||||
driver-$(CONFIG_CONSOLE_NE2K) += ne2k_console.o
|
||||
|
||||
$(obj)/console/console.o : $(obj)/build.h
|
||||
$(obj)/console/console.initobj.o : $(obj)/build.h
|
||||
|
@@ -7,11 +7,14 @@
|
||||
#include <arch/hlt.h>
|
||||
#include <arch/io.h>
|
||||
|
||||
#if CONFIG_CONSOLE_NE2K
|
||||
#include <console/ne2k.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PRE_RAM__
|
||||
#include <string.h>
|
||||
#include <pc80/mc146818rtc.h>
|
||||
|
||||
|
||||
/* initialize the console */
|
||||
void console_init(void)
|
||||
{
|
||||
@@ -99,6 +102,10 @@ void __attribute__((noreturn)) die(const char *msg)
|
||||
|
||||
void console_init(void)
|
||||
{
|
||||
|
||||
#if CONFIG_CONSOLE_NE2K
|
||||
ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT);
|
||||
#endif
|
||||
static const char console_test[] =
|
||||
"\n\ncoreboot-"
|
||||
COREBOOT_VERSION
|
||||
|
37
src/console/ne2k_console.c
Normal file
37
src/console/ne2k_console.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2010 Advanced Micro Devices, Inc.
|
||||
* Copyright (C) 2010 Rudolf Marek <r.marek@assembler.cz>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <console/console.h>
|
||||
#include <console/ne2k.h>
|
||||
|
||||
static void ne2k_tx_byte(unsigned char data)
|
||||
{
|
||||
ne2k_append_data(&data, 1, CONFIG_CONSOLE_NE2K_IO_PORT);
|
||||
}
|
||||
|
||||
static void ne2k_tx_flush(void)
|
||||
{
|
||||
ne2k_transmit(CONFIG_CONSOLE_NE2K_IO_PORT);
|
||||
}
|
||||
|
||||
static const struct console_driver ne2k_console __console = {
|
||||
.tx_byte = ne2k_tx_byte,
|
||||
.tx_flush = ne2k_tx_flush,
|
||||
};
|
Reference in New Issue
Block a user