2015-11-12 20:54:55 +03:00
|
|
|
/*
|
|
|
|
* Device model for Zynq ADC controller
|
|
|
|
*
|
|
|
|
* Copyright (c) 2015 Guenter Roeck <linux@roeck-us.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version
|
|
|
|
* 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZYNQ_XADC_H
|
|
|
|
#define ZYNQ_XADC_H
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2015-11-12 20:54:55 +03:00
|
|
|
|
|
|
|
#define ZYNQ_XADC_MMIO_SIZE 0x0020
|
|
|
|
#define ZYNQ_XADC_NUM_IO_REGS (ZYNQ_XADC_MMIO_SIZE / 4)
|
|
|
|
#define ZYNQ_XADC_NUM_ADC_REGS 128
|
|
|
|
#define ZYNQ_XADC_FIFO_DEPTH 15
|
|
|
|
|
hw: Replace anti-social QOM type names
Several QOM type names contain ',':
ARM,bitband-memory
etraxfs,pic
etraxfs,serial
etraxfs,timer
fsl,imx25
fsl,imx31
fsl,imx6
fsl,imx6ul
fsl,imx7
grlib,ahbpnp
grlib,apbpnp
grlib,apbuart
grlib,gptimer
grlib,irqmp
qemu,register
SUNW,bpp
SUNW,CS4231
SUNW,DBRI
SUNW,DBRI.prom
SUNW,fdtwo
SUNW,sx
SUNW,tcx
xilinx,zynq_slcr
xlnx,zynqmp
xlnx,zynqmp-pmu-soc
xlnx,zynq-xadc
These are all device types. They can't be plugged with -device /
device_add, except for xlnx,zynqmp-pmu-soc, and I doubt that one
actually works.
They *can* be used with -device / device_add to request help.
Usability is poor, though: you have to double the comma, like this:
$ qemu-system-x86_64 -device SUNW,,fdtwo,help
Trap for the unwary. The fact that this was broken in
device-introspect-test for more than six years until commit e27bd49876
fixed it demonstrates that "the unwary" includes seasoned developers.
One QOM type name contains ' ': "ICH9 SMB". Because having to
remember just one way to quote would be too easy.
Rename the "SUNW,FOO types to "sun-FOO". Summarily replace ',' and '
' by '-' in the other type names.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210304140229.575481-2-armbru@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
2021-03-04 17:02:28 +03:00
|
|
|
#define TYPE_ZYNQ_XADC "xlnx-zynq-xadc"
|
2020-09-16 21:25:19 +03:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(ZynqXADCState, ZYNQ_XADC)
|
2015-11-12 20:54:55 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct ZynqXADCState {
|
2015-11-12 20:54:55 +03:00
|
|
|
/*< private >*/
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
/*< public >*/
|
|
|
|
MemoryRegion iomem;
|
|
|
|
|
|
|
|
uint32_t regs[ZYNQ_XADC_NUM_IO_REGS];
|
|
|
|
uint16_t xadc_regs[ZYNQ_XADC_NUM_ADC_REGS];
|
|
|
|
uint16_t xadc_read_reg_previous;
|
|
|
|
uint16_t xadc_dfifo[ZYNQ_XADC_FIFO_DEPTH];
|
|
|
|
uint16_t xadc_dfifo_entries;
|
|
|
|
|
2022-05-09 23:20:35 +03:00
|
|
|
qemu_irq irq;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2015-11-12 20:54:55 +03:00
|
|
|
|
|
|
|
#endif /* ZYNQ_XADC_H */
|