summaryrefslogtreecommitdiff
path: root/uart.c
blob: f49c1cb07e77e6263f7776ad583df901de55a564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * 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 "uart.h"

static int uart_init(struct device *dev)
{
	return 0;
}

static bool uart_is_dev_addr(struct device *dev, uint32_t addr)
{
	if (addr >= dev->base && addr < dev->base + dev->size)
		return true;

	return false;
}

static void uart_simulate(struct device *dev)
{
}

struct device uart_core = {
	.name		= "UART Core",
	.base		= UART_BASE,
	.size		= UART_SIZE,

	.init		= uart_init,
	.is_dev_addr	= uart_is_dev_addr,
	.simulate	= uart_simulate,
};