summaryrefslogtreecommitdiffstats
path: root/arch/openrisc/boards/generic/generic.c
diff options
context:
space:
mode:
authorFranck Jullien <franck.jullien@gmail.com>2011-12-20 23:11:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-01-02 12:50:57 +0100
commit0777a18c0f85369cfe479fe48a0510fe90e26b1f (patch)
tree0b5e2bb2a9cd8b9f4c267cb955b21520d474e513 /arch/openrisc/boards/generic/generic.c
parent6fe9ee8eb4f85ff85b17024e25171d36c3f062ac (diff)
downloadbarebox-0777a18c0f85369cfe479fe48a0510fe90e26b1f.tar.gz
barebox-0777a18c0f85369cfe479fe48a0510fe90e26b1f.tar.xz
Add a generic board
In this generic configuration, the board can be run in the or1ksim simulator with the linux configuration file using the UART to print the console. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/openrisc/boards/generic/generic.c')
-rw-r--r--arch/openrisc/boards/generic/generic.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/openrisc/boards/generic/generic.c b/arch/openrisc/boards/generic/generic.c
new file mode 100644
index 0000000000..6a9ce5b864
--- /dev/null
+++ b/arch/openrisc/boards/generic/generic.c
@@ -0,0 +1,19 @@
+#include <common.h>
+#include <init.h>
+#include <driver.h>
+#include <partition.h>
+#include <ns16550.h>
+
+static struct NS16550_plat serial_plat = {
+ .clock = 50000000, /* 48MHz (APLL96/2) */
+ .shift = 0,
+};
+
+static int openrisc_console_init(void)
+{
+ /* Register the serial port */
+ add_ns16550_device(-1, OPENRISC_SOPC_UART_BASE, 1024, IORESOURCE_MEM_8BIT, &serial_plat);
+ return 0;
+}
+
+console_initcall(openrisc_console_init);