summaryrefslogtreecommitdiffstats
path: root/hw/pci-host/piix.c
diff options
context:
space:
mode:
authorEduardo Habkost2015-08-07 21:15:31 +0200
committerMichael S. Tsirkin2015-08-13 13:08:25 +0200
commite33d22fab3ad64bedc1c9addb0a0fa437995c12a (patch)
tree01afe4144118e2761e51ee7aea96a2dd54d6c7cc /hw/pci-host/piix.c
parentmake: load only required dependency files. (diff)
downloadqemu-e33d22fab3ad64bedc1c9addb0a0fa437995c12a.tar.gz
qemu-e33d22fab3ad64bedc1c9addb0a0fa437995c12a.tar.xz
qemu-e33d22fab3ad64bedc1c9addb0a0fa437995c12a.zip
piix: Document coreboot-specific RAM size config register
The existing i440fx initialization code sets a PCI config register that isn't documented anywhere in the Intel 440FX datasheet. Register 0x57 is DRAMC (DRAM Control) and has nothing to do with the RAM size. This was implemented in commit ec5f92ce6ac8ec09056be77e03c941be188648fa because old coreboot code tried to read registers 0x5a-0x5f,0x56,0x57 to get the RAM size from QEMU, but I couldn't find out why coreboot did that. I assume it was a mistake, and the original code was supposed to be reading the DRB[0-7] registers (offsets 0x60-0x67). Document that coreboot-specific register offset in a macro and a comment, for future reference. Cc: Ed Swierk <eswierk@skyportsystems.com> Cc: Richard Smith <smithbone@gmail.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci-host/piix.c')
-rw-r--r--hw/pci-host/piix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index ad55f99663..1cb25f3fa6 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -117,6 +117,11 @@ struct PCII440FXState {
#define I440FX_PAM_SIZE 7
#define I440FX_SMRAM 0x72
+/* Older coreboot versions (4.0 and older) read a config register that doesn't
+ * exist in real hardware, to get the RAM size from QEMU.
+ */
+#define I440FX_COREBOOT_RAM_SIZE 0x57
+
static void piix3_set_irq(void *opaque, int pirq, int level);
static PCIINTxRoute piix3_route_intx_pin_to_irq(void *opaque, int pci_intx);
static void piix3_write_config_xen(PCIDevice *dev,
@@ -394,7 +399,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state,
if (ram_size > 255) {
ram_size = 255;
}
- d->config[0x57] = ram_size;
+ d->config[I440FX_COREBOOT_RAM_SIZE] = ram_size;
i440fx_update_memory_mappings(f);