From fc6515ef027d94412228875095708b949b801496 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 16 Nov 2010 14:51:59 +0100 Subject: Add basic device handling infrastructure --- jtag_uart.c | 54 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 19 deletions(-) (limited to 'jtag_uart.c') 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 + * 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 -#include +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 -- cgit v1.2.3-54-g00ecf