1 |
dpavlin |
7 |
/* |
2 |
|
|
* Cisco Router Simulation platform. |
3 |
|
|
* Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr) |
4 |
|
|
*/ |
5 |
|
|
|
6 |
|
|
#ifndef __DEV_MPC860_H__ |
7 |
|
|
#define __DEV_MPC860_H__ |
8 |
|
|
|
9 |
|
|
#include <sys/types.h> |
10 |
|
|
#include "utils.h" |
11 |
|
|
#include "mips64.h" |
12 |
|
|
#include "cpu.h" |
13 |
|
|
#include "device.h" |
14 |
|
|
#include "net_io.h" |
15 |
|
|
#include "vm.h" |
16 |
|
|
|
17 |
|
|
/* Forward declaration for MPC860 private data */ |
18 |
|
|
struct mpc860_data; |
19 |
|
|
|
20 |
dpavlin |
11 |
/* SPI callback for TX data */ |
21 |
|
|
typedef void (*mpc860_spi_tx_callback_t)(struct mpc860_data *d, |
22 |
|
|
u_char *buffer,u_int len, |
23 |
|
|
void *user_arg); |
24 |
|
|
|
25 |
dpavlin |
7 |
/* Set IRQ pending status */ |
26 |
|
|
void mpc860_set_pending_irq(struct mpc860_data *d,m_uint32_t val); |
27 |
|
|
|
28 |
|
|
/* Clear a pending IRQ */ |
29 |
|
|
void mpc860_clear_pending_irq(struct mpc860_data *d,m_uint32_t val); |
30 |
|
|
|
31 |
dpavlin |
11 |
/* Put a buffer into SPI receive buffers */ |
32 |
|
|
int mpc860_spi_receive(struct mpc860_data *d,u_char *buffer,u_int len); |
33 |
|
|
|
34 |
|
|
/* Set SPI TX callback */ |
35 |
|
|
void mpc860_spi_set_tx_callback(struct mpc860_data *d, |
36 |
|
|
mpc860_spi_tx_callback_t cbk, |
37 |
|
|
void *user_arg); |
38 |
|
|
|
39 |
|
|
/* Set NIO for the specified SCC channel */ |
40 |
|
|
int mpc860_scc_set_nio(struct mpc860_data *d,u_int scc_chan,netio_desc_t *nio); |
41 |
|
|
|
42 |
|
|
/* Unset NIO of the specified SCC channel */ |
43 |
|
|
int mpc860_scc_unset_nio(struct mpc860_data *d,u_int scc_chan); |
44 |
|
|
|
45 |
|
|
/* Set NIO for the Fast Ethernet Controller */ |
46 |
|
|
int mpc860_fec_set_nio(struct mpc860_data *d,netio_desc_t *nio); |
47 |
|
|
|
48 |
|
|
/* Unset NIO of the Fast Ethernet Controller */ |
49 |
|
|
int mpc860_fec_unset_nio(struct mpc860_data *d); |
50 |
|
|
|
51 |
dpavlin |
7 |
/* Create the MPC860 device */ |
52 |
|
|
int dev_mpc860_init(vm_instance_t *vm,char *name, |
53 |
|
|
m_uint64_t paddr,m_uint32_t len); |
54 |
|
|
|
55 |
|
|
#endif |