root / include / hw / cris / etraxfs.h @ 0d09e41a
History | View | Annotate | Download (1.9 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 | cb9c377f | Paolo Bonzini | #ifndef HW_EXTRAXFS_H
|
26 | cb9c377f | Paolo Bonzini | #define HW_EXTRAXFS_H 1 |
27 | cb9c377f | Paolo Bonzini | |
28 | 1422e32d | Paolo Bonzini | #include "net/net.h" |
29 | 0d09e41a | Paolo Bonzini | #include "hw/cris/etraxfs_dma.h" |
30 | 5ef98b47 | edgar_igl | |
31 | fc9bb176 | Andreas Färber | qemu_irq *cris_pic_init_cpu(CPUCRISState *env); |
32 | d949396e | Edgar E. Iglesias | |
33 | d949396e | Edgar E. Iglesias | /* Instantiate an ETRAXFS Ethernet MAC. */
|
34 | d949396e | Edgar E. Iglesias | static inline DeviceState * |
35 | a8170e5e | Avi Kivity | etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr,
|
36 | d949396e | Edgar E. Iglesias | void *dma_out, void *dma_in) |
37 | d949396e | Edgar E. Iglesias | { |
38 | d949396e | Edgar E. Iglesias | DeviceState *dev; |
39 | d949396e | Edgar E. Iglesias | qemu_check_nic_model(nd, "fseth");
|
40 | d949396e | Edgar E. Iglesias | |
41 | d949396e | Edgar E. Iglesias | dev = qdev_create(NULL, "etraxfs-eth"); |
42 | d949396e | Edgar E. Iglesias | qdev_set_nic_properties(dev, nd); |
43 | d949396e | Edgar E. Iglesias | qdev_prop_set_uint32(dev, "phyaddr", phyaddr);
|
44 | d949396e | Edgar E. Iglesias | qdev_prop_set_ptr(dev, "dma_out", dma_out);
|
45 | d949396e | Edgar E. Iglesias | qdev_prop_set_ptr(dev, "dma_in", dma_in);
|
46 | d949396e | Edgar E. Iglesias | qdev_init_nofail(dev); |
47 | 1356b98d | Andreas Färber | sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
|
48 | d949396e | Edgar E. Iglesias | return dev;
|
49 | d949396e | Edgar E. Iglesias | } |
50 | cb9c377f | Paolo Bonzini | |
51 | cb9c377f | Paolo Bonzini | #endif |