summaryrefslogtreecommitdiffstats
path: root/drivers/serial/altera_jtag_uart.c
diff options
context:
space:
mode:
authorThomas Chou <thomas@wytron.com.tw>2014-08-25 16:50:14 +0800
committerThomas Chou <thomas@wytron.com.tw>2014-08-30 17:48:43 +0800
commit8645071006a0b577ae4660f4a271f42c081ef4ab (patch)
tree2fc4bd555b665626099489dc77dd2dadaaa11001 /drivers/serial/altera_jtag_uart.c
parentef3cc8112c7ac58d621246523e8c84bf6035b53b (diff)
downloadu-boot-8645071006a0b577ae4660f4a271f42c081ef4ab.tar.gz
u-boot-8645071006a0b577ae4660f4a271f42c081ef4ab.tar.xz
u-boot-8645071006a0b577ae4660f4a271f42c081ef4ab.zip
nios2: divide nios2-io.h into each specific drivers and remove it
The nios2-io.h defines hardware registers and bits of several FPGA IP cores. It could be divided in to the specific drivers, including altera timer, altera sysid, altera uart and altera jtag uart. The altera pio and altera spi drivers use their own hardware definitions. The removal of nios2-io.h will help modularity and maintenance. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Diffstat (limited to 'drivers/serial/altera_jtag_uart.c')
-rw-r--r--drivers/serial/altera_jtag_uart.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/serial/altera_jtag_uart.c b/drivers/serial/altera_jtag_uart.c
index 0573c7a987..9a81402ffb 100644
--- a/drivers/serial/altera_jtag_uart.c
+++ b/drivers/serial/altera_jtag_uart.c
@@ -8,10 +8,28 @@
#include <common.h>
#include <watchdog.h>
#include <asm/io.h>
-#include <nios2-io.h>
#include <linux/compiler.h>
#include <serial.h>
+typedef volatile struct {
+ unsigned data; /* Data register */
+ unsigned control; /* Control register */
+} nios_jtag_t;
+
+/* data register */
+#define NIOS_JTAG_RVALID (1<<15) /* Read valid */
+#define NIOS_JTAG_DATA(d) ((d)&0x0ff) /* Read data */
+#define NIOS_JTAG_RAVAIL(d) ((d)>>16) /* Read space avail */
+
+/* control register */
+#define NIOS_JTAG_RE (1 << 0) /* read intr enable */
+#define NIOS_JTAG_WE (1 << 1) /* write intr enable */
+#define NIOS_JTAG_RI (1 << 8) /* read intr pending */
+#define NIOS_JTAG_WI (1 << 9) /* write intr pending*/
+#define NIOS_JTAG_AC (1 << 10) /* activity indicator */
+#define NIOS_JTAG_RRDY (1 << 12) /* read available */
+#define NIOS_JTAG_WSPACE(d) ((d)>>16) /* Write space avail */
+
DECLARE_GLOBAL_DATA_PTR;
/*------------------------------------------------------------------