summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2014-01-18 19:12:59 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2014-01-30 10:43:55 +0100
commitb496743c611c83c28b8186f91c6c5786d9b891e7 (patch)
tree1e632b621b3a6dafead58330c82e653ece068188 /arch
parentb7f18a40e9fe84d74b1a3ab4ccbd93ffaafe4564 (diff)
downloadbarebox-b496743c611c83c28b8186f91c6c5786d9b891e7.tar.gz
barebox-b496743c611c83c28b8186f91c6c5786d9b891e7.tar.xz
MIPS: loongson-ls1b: add ns16550-based console
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/boards/loongson-ls1b/Makefile1
-rw-r--r--arch/mips/boards/loongson-ls1b/serial.c22
-rw-r--r--arch/mips/mach-loongson/Kconfig1
3 files changed, 24 insertions, 0 deletions
diff --git a/arch/mips/boards/loongson-ls1b/Makefile b/arch/mips/boards/loongson-ls1b/Makefile
index 0899b66c5f..a21952b737 100644
--- a/arch/mips/boards/loongson-ls1b/Makefile
+++ b/arch/mips/boards/loongson-ls1b/Makefile
@@ -1 +1,2 @@
obj-y += ram.o
+obj-y += serial.o
diff --git a/arch/mips/boards/loongson-ls1b/serial.c b/arch/mips/boards/loongson-ls1b/serial.c
new file mode 100644
index 0000000000..d8e0f7c28a
--- /dev/null
+++ b/arch/mips/boards/loongson-ls1b/serial.c
@@ -0,0 +1,22 @@
+#include <common.h>
+#include <init.h>
+#include <ns16550.h>
+
+#include <mach/loongson1.h>
+
+static struct NS16550_plat serial_plat = {
+ .clock = 83000000,
+ .shift = 0,
+};
+
+static int console_init(void)
+{
+ barebox_set_model("Loongson Tech LS1B Demo Board");
+ barebox_set_hostname("ls1b");
+
+ add_ns16550_device(DEVICE_ID_DYNAMIC, KSEG1ADDR(LS1X_UART2_BASE),
+ 8, IORESOURCE_MEM_8BIT, &serial_plat);
+
+ return 0;
+}
+console_initcall(console_init);
diff --git a/arch/mips/mach-loongson/Kconfig b/arch/mips/mach-loongson/Kconfig
index c2cb7744b4..263b67e3fe 100644
--- a/arch/mips/mach-loongson/Kconfig
+++ b/arch/mips/mach-loongson/Kconfig
@@ -14,6 +14,7 @@ config BOARD_LOONGSON_TECH_LS1B
select SYS_SUPPORTS_LITTLE_ENDIAN
select CSRC_R4K_LIB
select HAS_DEBUG_LL
+ select DRIVER_SERIAL_NS16550
endchoice