Statistics
| Branch: | Revision:

root / hw / etraxfs.h @ a8170e5e

History | View | Annotate | Download (1.8 kB)

1 5ef98b47 edgar_igl
/*
2 5ef98b47 edgar_igl
 * QEMU ETRAX System Emulator
3 5ef98b47 edgar_igl
 *
4 5ef98b47 edgar_igl
 * Copyright (c) 2008 Edgar E. Iglesias, Axis Communications AB.
5 5ef98b47 edgar_igl
 *
6 5ef98b47 edgar_igl
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 5ef98b47 edgar_igl
 * of this software and associated documentation files (the "Software"), to deal
8 5ef98b47 edgar_igl
 * in the Software without restriction, including without limitation the rights
9 5ef98b47 edgar_igl
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 5ef98b47 edgar_igl
 * copies of the Software, and to permit persons to whom the Software is
11 5ef98b47 edgar_igl
 * furnished to do so, subject to the following conditions:
12 5ef98b47 edgar_igl
 *
13 5ef98b47 edgar_igl
 * The above copyright notice and this permission notice shall be included in
14 5ef98b47 edgar_igl
 * all copies or substantial portions of the Software.
15 5ef98b47 edgar_igl
 *
16 5ef98b47 edgar_igl
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 5ef98b47 edgar_igl
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 5ef98b47 edgar_igl
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 5ef98b47 edgar_igl
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 5ef98b47 edgar_igl
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 5ef98b47 edgar_igl
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 5ef98b47 edgar_igl
 * THE SOFTWARE.
23 5ef98b47 edgar_igl
 */
24 5ef98b47 edgar_igl
25 661f1929 Jan Kiszka
#include "net.h"
26 5ef98b47 edgar_igl
#include "etraxfs_dma.h"
27 5ef98b47 edgar_igl
28 fc9bb176 Andreas Färber
qemu_irq *cris_pic_init_cpu(CPUCRISState *env);
29 d949396e Edgar E. Iglesias
30 d949396e Edgar E. Iglesias
/* Instantiate an ETRAXFS Ethernet MAC.  */
31 d949396e Edgar E. Iglesias
static inline DeviceState *
32 a8170e5e Avi Kivity
etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr,
33 d949396e Edgar E. Iglesias
                 void *dma_out, void *dma_in)
34 d949396e Edgar E. Iglesias
{
35 d949396e Edgar E. Iglesias
    DeviceState *dev;
36 d949396e Edgar E. Iglesias
    qemu_check_nic_model(nd, "fseth");
37 d949396e Edgar E. Iglesias
38 d949396e Edgar E. Iglesias
    dev = qdev_create(NULL, "etraxfs-eth");
39 d949396e Edgar E. Iglesias
    qdev_set_nic_properties(dev, nd);
40 d949396e Edgar E. Iglesias
    qdev_prop_set_uint32(dev, "phyaddr", phyaddr);
41 d949396e Edgar E. Iglesias
    qdev_prop_set_ptr(dev, "dma_out", dma_out);
42 d949396e Edgar E. Iglesias
    qdev_prop_set_ptr(dev, "dma_in", dma_in);
43 d949396e Edgar E. Iglesias
    qdev_init_nofail(dev);
44 d949396e Edgar E. Iglesias
    sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
45 d949396e Edgar E. Iglesias
    return dev;
46 d949396e Edgar E. Iglesias
}