]>
Commit | Line | Data |
---|---|---|
74fcbd22 GR |
1 | /* |
2 | * Device model for Zynq ADC controller | |
3 | * | |
4 | * Copyright (c) 2015 Guenter Roeck <linux@roeck-us.net> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public License | |
8 | * as published by the Free Software Foundation; either version | |
9 | * 2 of the License, or (at your option) any later version. | |
10 | * | |
11 | * You should have received a copy of the GNU General Public License along | |
12 | * with this program; if not, see <http://www.gnu.org/licenses/>. | |
13 | */ | |
14 | ||
15 | #ifndef ZYNQ_XADC_H | |
16 | #define ZYNQ_XADC_H | |
17 | ||
18 | #include "hw/sysbus.h" | |
db1015e9 | 19 | #include "qom/object.h" |
74fcbd22 GR |
20 | |
21 | #define ZYNQ_XADC_MMIO_SIZE 0x0020 | |
22 | #define ZYNQ_XADC_NUM_IO_REGS (ZYNQ_XADC_MMIO_SIZE / 4) | |
23 | #define ZYNQ_XADC_NUM_ADC_REGS 128 | |
24 | #define ZYNQ_XADC_FIFO_DEPTH 15 | |
25 | ||
e178113f | 26 | #define TYPE_ZYNQ_XADC "xlnx-zynq-xadc" |
8063396b | 27 | OBJECT_DECLARE_SIMPLE_TYPE(ZynqXADCState, ZYNQ_XADC) |
74fcbd22 | 28 | |
db1015e9 | 29 | struct ZynqXADCState { |
74fcbd22 GR |
30 | /*< private >*/ |
31 | SysBusDevice parent_obj; | |
32 | ||
33 | /*< public >*/ | |
34 | MemoryRegion iomem; | |
35 | ||
36 | uint32_t regs[ZYNQ_XADC_NUM_IO_REGS]; | |
37 | uint16_t xadc_regs[ZYNQ_XADC_NUM_ADC_REGS]; | |
38 | uint16_t xadc_read_reg_previous; | |
39 | uint16_t xadc_dfifo[ZYNQ_XADC_FIFO_DEPTH]; | |
40 | uint16_t xadc_dfifo_entries; | |
41 | ||
42 | struct IRQState *qemu_irq; | |
43 | ||
db1015e9 | 44 | }; |
74fcbd22 GR |
45 | |
46 | #endif /* ZYNQ_XADC_H */ |