summaryrefslogtreecommitdiffstats
path: root/arch/x86/boards/x86_generic/serial_ns16550.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-05 11:05:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-05 11:05:51 +0200
commitf8327af20c1c2988b0d9909f403780e31cc6b59e (patch)
tree80eb52cc1160e577646e136ad9e3e4638aac5559 /arch/x86/boards/x86_generic/serial_ns16550.c
parentb568687bc3c48edd814c4b4546d049d859c8cc3f (diff)
parent9f556d4b6fc71d548e5c984c416f4f1b7d599d2f (diff)
downloadbarebox-f8327af20c1c2988b0d9909f403780e31cc6b59e.tar.gz
barebox-f8327af20c1c2988b0d9909f403780e31cc6b59e.tar.xz
Merge branch 'for-next/ioresource'
Diffstat (limited to 'arch/x86/boards/x86_generic/serial_ns16550.c')
-rw-r--r--arch/x86/boards/x86_generic/serial_ns16550.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/x86/boards/x86_generic/serial_ns16550.c b/arch/x86/boards/x86_generic/serial_ns16550.c
new file mode 100644
index 0000000000..3b284f3d3d
--- /dev/null
+++ b/arch/x86/boards/x86_generic/serial_ns16550.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2009 Juergen Beisert, Pengutronix, Michel Stam,
+ * Fugro Intersite
+ *
+ * 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; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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.
+ *
+ *
+ */
+
+/**
+ * @file
+ * @brief Generic PC support to let barebox acting as a boot loader
+ */
+
+#include <common.h>
+#include <types.h>
+#include <driver.h>
+#include <init.h>
+#include <asm/syslib.h>
+#include <ns16550.h>
+#include <linux/err.h>
+
+static struct NS16550_plat serial_plat = {
+ .clock = 1843200,
+};
+
+static int pc_console_init(void)
+{
+ barebox_set_model("X86 generic barebox");
+ barebox_set_hostname("x86");
+
+ /* Register the serial port */
+ add_ns16550_device(DEVICE_ID_DYNAMIC, 0x3f8, 8, IORESOURCE_IO,
+ &serial_plat);
+ add_ns16550_device(DEVICE_ID_DYNAMIC, 0x2f8, 8, IORESOURCE_IO,
+ &serial_plat);
+
+ return 0;
+}
+console_initcall(pc_console_init);