aboutsummaryrefslogtreecommitdiff
path: root/src/console
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2010-07-16 20:02:09 +0000
committerRudolf Marek <r.marek@assembler.cz>2010-07-16 20:02:09 +0000
commit4aa93ccd3302d7db0eef00f5963bc991f3f233ff (patch)
tree20c2eafd1c6178df70682a6565e357314236d082 /src/console
parent7fc9e291d7581845461efbdd74b56a8e0360f1e0 (diff)
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
Diffstat (limited to 'src/console')
-rw-r--r--src/console/Kconfig44
-rw-r--r--src/console/Makefile.inc1
-rw-r--r--src/console/console.c9
-rw-r--r--src/console/ne2k_console.c37
4 files changed, 89 insertions, 2 deletions
diff --git a/src/console/Kconfig b/src/console/Kconfig
index a2e3cdddbf..080b37f390 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -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
diff --git a/src/console/Makefile.inc b/src/console/Makefile.inc
index 4af63819e7..a2e576f327 100644
--- a/src/console/Makefile.inc
+++ b/src/console/Makefile.inc
@@ -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
diff --git a/src/console/console.c b/src/console/console.c
index ee7fffe6df..833d287c6c 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -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
diff --git a/src/console/ne2k_console.c b/src/console/ne2k_console.c
new file mode 100644
index 0000000000..c435f073d7
--- /dev/null
+++ b/src/console/ne2k_console.c
@@ -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,
+};