summaryrefslogtreecommitdiff
path: root/jtag_uart.c
diff options
context:
space:
mode:
authorTobias Klauser <klto@zhaw.ch>2010-11-16 14:51:59 +0100
committerTobias Klauser <klto@zhaw.ch>2010-11-16 14:52:20 +0100
commitfc6515ef027d94412228875095708b949b801496 (patch)
tree2640edc09346a4d97cf09bb39d2ea8b21feceb86 /jtag_uart.c
parent6f8db3bda1c2644adfc25b83b73285df9a80585d (diff)
Add basic device handling infrastructure
Diffstat (limited to 'jtag_uart.c')
-rw-r--r--jtag_uart.c54
1 files changed, 35 insertions, 19 deletions
diff --git a/jtag_uart.c b/jtag_uart.c
index 052c42c..ba0bf5f 100644
--- a/jtag_uart.c
+++ b/jtag_uart.c
@@ -1,28 +1,44 @@
/*
- Nios-sim - one simple NIOSII simulator only for personal interest and fun.
- Copyright (C) 2010 chysun2000@gmail.com
+ * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
+ * Copyright (C) 2010 chysun2000@gmail.com
+ *
+ * This file is part of nios2sim-ng.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include "nios2sim-ng.h"
+#include "device.h"
+#include "jtag_uart.h"
- 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.
+static int jtag_uart_init(struct device *dev)
+{
+ return 0;
+}
- 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.
+static bool jtag_uart_is_dev_addr(struct device *dev, uint32_t addr)
+{
+ return false;
+}
- 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
+static void jtag_uart_simulate(struct device *dev)
+{
+}
-#include <stdio.h>
-#include <string.h>
+struct device jtag_uart_core = {
+ .name = "JTAG UART Core",
+ .base = JTAG_UART_BASE,
+ .size = JTAG_UART_SIZE,
-#include "public.h"
-#include "jtag_uart.h"
+ .init = jtag_uart_init,
+ .is_dev_addr = jtag_uart_is_dev_addr,
+ .simulate = jtag_uart_simulate,
+};
+
+#if 0
static struct jtag_uart_priv priv;
static void uart_init(struct io_device * self)
{
@@ -166,4 +182,4 @@ struct io_device jtag_uart_io_device = {
.irq_enable_mask = JTAG_IRQ_MASK
};
-
+#endif