aboutsummaryrefslogtreecommitdiff
path: root/include/hw/misc
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-07-11 14:32:49 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-07-11 14:32:49 +0100
commit9516034d05a8c71ef157a59f525e4c4f7ed79827 (patch)
tree7bffa57da71fec0e63a49691182852633e988145 /include/hw/misc
parent3cfcc329afd99138e654b65f6f49156fca2e8cdd (diff)
parent7649086f455fe44bd076828749a93ab2a5bb0806 (diff)
downloadqemu-9516034d05a8c71ef157a59f525e4c4f7ed79827.zip
qemu-9516034d05a8c71ef157a59f525e4c4f7ed79827.tar.gz
qemu-9516034d05a8c71ef157a59f525e4c4f7ed79827.tar.bz2
Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-6.1-2' into staging
Some qemu updates for IPMI and I2C Move some ADC file to where they belong and move some sensors to a sensor directory, since with new BMCs coming in lots of different sensors should be coming in. Keep from cluttering things up. Add support for I2C PMBus devices. Replace the confusing and error-prone i2c_send_recv and i2c_transfer with specific send and receive functions. Several errors have already been made with these, avoid any new errors. Fix the watchdog_expired field in the IPMI watchdog, it's not a bool, it's a u8. After a vmstate transfer, the new value could be wrong. # gpg: Signature made Fri 09 Jul 2021 17:25:04 BST # gpg: using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81 # gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown] # gpg: aka "Corey Minyard <minyard@acm.org>" [unknown] # gpg: aka "Corey Minyard <corey@minyard.net>" [unknown] # gpg: aka "Corey Minyard <minyard@mvista.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: FD0D 5CE6 7CE0 F59A 6688 2686 61F3 8C90 919B FF81 * remotes/cminyard/tags/for-qemu-6.1-2: (24 commits) tests/qtest: add tests for MAX34451 device model hw/misc: add MAX34451 device tests/qtest: add tests for ADM1272 device model hw/misc: add ADM1272 device hw/i2c: add support for PMBus ipmi/sim: fix watchdog_expired data type error in IPMIBmcSim struct hw/i2c: Introduce i2c_start_recv() and i2c_start_send() hw/i2c: Extract i2c_do_start_transfer() from i2c_start_transfer() hw/i2c: Make i2c_start_transfer() direction argument a boolean hw/i2c: Rename i2c_set_slave_address() -> i2c_slave_set_address() hw/i2c: Remove confusing i2c_send_recv() hw/misc/auxbus: Replace i2c_send_recv() by i2c_recv() & i2c_send() hw/misc/auxbus: Replace 'is_write' boolean by its value hw/misc/auxbus: Explode READ_I2C / WRITE_I2C_MOT cases hw/misc/auxbus: Fix MOT/classic I2C mode hw/i2c/ppc4xx_i2c: Replace i2c_send_recv() by i2c_recv() & i2c_send() hw/i2c/ppc4xx_i2c: Add reference to datasheet hw/display/sm501: Replace i2c_send_recv() by i2c_recv() & i2c_send() hw/display/sm501: Simplify sm501_i2c_write() logic hw/input/lm832x: Define TYPE_LM8323 in public header ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw/misc')
-rw-r--r--include/hw/misc/emc141x_regs.h37
-rw-r--r--include/hw/misc/max111x.h56
-rw-r--r--include/hw/misc/tmp105_regs.h51
-rw-r--r--include/hw/misc/zynq-xadc.h46
4 files changed, 0 insertions, 190 deletions
diff --git a/include/hw/misc/emc141x_regs.h b/include/hw/misc/emc141x_regs.h
deleted file mode 100644
index 0560fb7..0000000
--- a/include/hw/misc/emc141x_regs.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SMSC EMC141X temperature sensor.
- *
- * Browse the data sheet:
- *
- * http://ww1.microchip.com/downloads/en/DeviceDoc/20005274A.pdf
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or
- * later. See the COPYING file in the top-level directory.
- */
-
-#ifndef TMP105_REGS_H
-#define TMP105_REGS_H
-
-#define EMC1413_DEVICE_ID 0x21
-#define EMC1414_DEVICE_ID 0x25
-#define MANUFACTURER_ID 0x5d
-#define REVISION 0x04
-
-/* the EMC141X registers */
-#define EMC141X_TEMP_HIGH0 0x00
-#define EMC141X_TEMP_HIGH1 0x01
-#define EMC141X_TEMP_HIGH2 0x23
-#define EMC141X_TEMP_HIGH3 0x2a
-#define EMC141X_TEMP_MAX_HIGH0 0x05
-#define EMC141X_TEMP_MIN_HIGH0 0x06
-#define EMC141X_TEMP_MAX_HIGH1 0x07
-#define EMC141X_TEMP_MIN_HIGH1 0x08
-#define EMC141X_TEMP_MAX_HIGH2 0x15
-#define EMC141X_TEMP_MIN_HIGH2 0x16
-#define EMC141X_TEMP_MAX_HIGH3 0x2c
-#define EMC141X_TEMP_MIN_HIGH3 0x2d
-#define EMC141X_DEVICE_ID 0xfd
-#define EMC141X_MANUFACTURER_ID 0xfe
-#define EMC141X_REVISION 0xff
-
-#endif
diff --git a/include/hw/misc/max111x.h b/include/hw/misc/max111x.h
deleted file mode 100644
index beff59c..0000000
--- a/include/hw/misc/max111x.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Maxim MAX1110/1111 ADC chip emulation.
- *
- * Copyright (c) 2006 Openedhand Ltd.
- * Written by Andrzej Zaborowski <balrog@zabor.org>
- *
- * This code is licensed under the GNU GPLv2.
- *
- * Contributions after 2012-01-13 are licensed under the terms of the
- * GNU GPL, version 2 or (at your option) any later version.
- */
-
-#ifndef HW_MISC_MAX111X_H
-#define HW_MISC_MAX111X_H
-
-#include "hw/ssi/ssi.h"
-#include "qom/object.h"
-
-/*
- * This is a model of the Maxim MAX1110/1111 ADC chip, which for QEMU
- * is an SSI slave device. It has either 4 (max1110) or 8 (max1111)
- * 8-bit ADC channels.
- *
- * QEMU interface:
- * + GPIO inputs 0..3 (for max1110) or 0..7 (for max1111): set the value
- * of each ADC input, as an unsigned 8-bit value
- * + GPIO output 0: interrupt line
- * + Properties "input0" to "input3" (max1110) or "input0" to "input7"
- * (max1111): initial reset values for ADC inputs.
- *
- * Known bugs:
- * + the interrupt line is not correctly implemented, and will never
- * be lowered once it has been asserted.
- */
-struct MAX111xState {
- SSIPeripheral parent_obj;
-
- qemu_irq interrupt;
- /* Values of inputs at system reset (settable by QOM property) */
- uint8_t reset_input[8];
-
- uint8_t tb1, rb2, rb3;
- int cycle;
-
- uint8_t input[8];
- int inputs, com;
-};
-
-#define TYPE_MAX_111X "max111x"
-
-OBJECT_DECLARE_SIMPLE_TYPE(MAX111xState, MAX_111X)
-
-#define TYPE_MAX_1110 "max1110"
-#define TYPE_MAX_1111 "max1111"
-
-#endif
diff --git a/include/hw/misc/tmp105_regs.h b/include/hw/misc/tmp105_regs.h
deleted file mode 100644
index ef015ee..0000000
--- a/include/hw/misc/tmp105_regs.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Texas Instruments TMP105 Temperature Sensor I2C messages
- *
- * Browse the data sheet:
- *
- * http://www.ti.com/lit/gpn/tmp105
- *
- * Copyright (C) 2012 Alex Horn <alex.horn@cs.ox.ac.uk>
- * Copyright (C) 2008-2012 Andrzej Zaborowski <balrogg@gmail.com>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or
- * later. See the COPYING file in the top-level directory.
- */
-
-#ifndef TMP105_REGS_H
-#define TMP105_REGS_H
-
-/**
- * TMP105Reg:
- * @TMP105_REG_TEMPERATURE: Temperature register
- * @TMP105_REG_CONFIG: Configuration register
- * @TMP105_REG_T_LOW: Low temperature register (also known as T_hyst)
- * @TMP105_REG_T_HIGH: High temperature register (also known as T_OS)
- *
- * The following temperature sensors are
- * compatible with the TMP105 registers:
- * - adt75
- * - ds1775
- * - ds75
- * - lm75
- * - lm75a
- * - max6625
- * - max6626
- * - mcp980x
- * - stds75
- * - tcn75
- * - tmp100
- * - tmp101
- * - tmp105
- * - tmp175
- * - tmp275
- * - tmp75
- **/
-typedef enum TMP105Reg {
- TMP105_REG_TEMPERATURE = 0,
- TMP105_REG_CONFIG,
- TMP105_REG_T_LOW,
- TMP105_REG_T_HIGH,
-} TMP105Reg;
-
-#endif
diff --git a/include/hw/misc/zynq-xadc.h b/include/hw/misc/zynq-xadc.h
deleted file mode 100644
index 2017b7a..0000000
--- a/include/hw/misc/zynq-xadc.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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"
-#include "qom/object.h"
-
-#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
-
-#define TYPE_ZYNQ_XADC "xlnx-zynq-xadc"
-OBJECT_DECLARE_SIMPLE_TYPE(ZynqXADCState, ZYNQ_XADC)
-
-struct ZynqXADCState {
- /*< 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;
-
- struct IRQState *qemu_irq;
-
-};
-
-#endif /* ZYNQ_XADC_H */