From 9df11c9f086e8329cdc06a67314ddce886841a5b Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Mon, 5 May 2014 10:52:50 -0400 Subject: pc: add compat_props placeholder for 2.0 machine type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the "boilerplate" necessary for subsequent patches to simply drop in compat_props for pc machines 2.0 and older. This patch contains no functional changes. Signed-off-by: Gabriel Somlo Acked-by: Alexander Graf Reviewed-by: Andreas Färber Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/pc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 9f26e14bef..0ade0f114e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -242,8 +242,12 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); int e820_get_num_entries(void); bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); +#define PC_Q35_COMPAT_2_0 \ + PC_COMPAT_2_0 + #define PC_Q35_COMPAT_1_7 \ PC_COMPAT_1_7, \ + PC_Q35_COMPAT_2_0, \ {\ .driver = "hpet",\ .property = HPET_INTCAP,\ @@ -262,7 +266,12 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); PC_COMPAT_1_4, \ PC_Q35_COMPAT_1_5 +#define PC_COMPAT_2_0 \ + {\ + } + #define PC_COMPAT_1_7 \ + PC_COMPAT_2_0, \ {\ .driver = TYPE_USB_DEVICE,\ .property = "msos-desc",\ -- cgit v1.2.3 From aa93200b88fb1071eaf21bf766711762ed4630e2 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Mon, 5 May 2014 10:52:51 -0400 Subject: apic: use emulated lapic version 0x14 on pc machines >= 2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add "version" property to local apic, and have it default to 0x14 for pc machines starting at 2.1. For compatibility with previous releases, pc machines up to 2.0 will have their local apic version set to 0x11. Signed-off-by: Gabriel L. Somlo Acked-by: Alexander Graf Reviewed-by: Andreas Färber Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/apic_internal.h | 1 + include/hw/i386/pc.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h index 70542a6f43..83e2a42cc1 100644 --- a/include/hw/i386/apic_internal.h +++ b/include/hw/i386/apic_internal.h @@ -98,6 +98,7 @@ struct APICCommonState { X86CPU *cpu; uint32_t apicbase; uint8_t id; + uint8_t version; uint8_t arb_id; uint8_t tpr; uint32_t spurious_vec; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 0ade0f114e..32a76876c7 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -268,6 +268,9 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); #define PC_COMPAT_2_0 \ {\ + .driver = "apic",\ + .property = "version",\ + .value = stringify(0x11),\ } #define PC_COMPAT_1_7 \ -- cgit v1.2.3 From 285364e96818c1a5f715fe256557b4a718222bc6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 31 Mar 2014 18:26:29 +0200 Subject: smbus: allow returning an error from reads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paolo Bonzini Acked-by: Michael S. Tsirkin Reviewed-by: Andreas Färber Signed-off-by: Michael S. Tsirkin --- include/hw/i2c/smbus.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h index 63f0cc4788..285d3b5de3 100644 --- a/include/hw/i2c/smbus.h +++ b/include/hw/i2c/smbus.h @@ -67,11 +67,11 @@ struct SMBusDevice { /* Master device commands. */ void smbus_quick_command(I2CBus *bus, uint8_t addr, int read); -uint8_t smbus_receive_byte(I2CBus *bus, uint8_t addr); +int smbus_receive_byte(I2CBus *bus, uint8_t addr); void smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t data); -uint8_t smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command); +int smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command); void smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t data); -uint16_t smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command); +int smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command); void smbus_write_word(I2CBus *bus, uint8_t addr, uint8_t command, uint16_t data); int smbus_read_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data); void smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data, -- cgit v1.2.3 From 046a1844142dc9ffa7c95f0761bfa11272480adf Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 31 Mar 2014 18:26:30 +0200 Subject: smbus: return -1 if nothing found at the given address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paolo Bonzini Acked-by: Michael S. Tsirkin Reviewed-by: Andreas Färber Signed-off-by: Michael S. Tsirkin --- include/hw/i2c/smbus.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h index 285d3b5de3..544bbc1957 100644 --- a/include/hw/i2c/smbus.h +++ b/include/hw/i2c/smbus.h @@ -66,16 +66,16 @@ struct SMBusDevice { }; /* Master device commands. */ -void smbus_quick_command(I2CBus *bus, uint8_t addr, int read); +int smbus_quick_command(I2CBus *bus, uint8_t addr, int read); int smbus_receive_byte(I2CBus *bus, uint8_t addr); -void smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t data); +int smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t data); int smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command); -void smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t data); +int smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t data); int smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command); -void smbus_write_word(I2CBus *bus, uint8_t addr, uint8_t command, uint16_t data); +int smbus_write_word(I2CBus *bus, uint8_t addr, uint8_t command, uint16_t data); int smbus_read_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data); -void smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data, - int len); +int smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data, + int len); void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom, const uint8_t *eeprom_spd, int size); -- cgit v1.2.3