From: Ruslan Bukin Date: Fri, 3 Apr 2015 16:42:10 +0000 (-0500) Subject: dev: Extend access width for IDE control registers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3314673f456a9686559ec95cbee2302c3214921;p=gem5.git dev: Extend access width for IDE control registers Add 32-bit access width for PrimaryTiming register and 16bit for UDMAControl register as FreeBSD required. Committed by: Nilay Vaish --- diff --git a/src/dev/ide_ctrl.cc b/src/dev/ide_ctrl.cc index 27757529a..d931fab2b 100644 --- a/src/dev/ide_ctrl.cc +++ b/src/dev/ide_ctrl.cc @@ -202,6 +202,9 @@ IdeController::readConfig(PacketPtr pkt) break; case sizeof(uint16_t): switch (offset) { + case UDMAControl: + pkt->set(udmaControl); + break; case PrimaryTiming: pkt->set(primaryTiming); break; @@ -222,10 +225,16 @@ IdeController::readConfig(PacketPtr pkt) (uint32_t)pkt->get()); break; case sizeof(uint32_t): - if (offset == IDEConfig) + switch (offset) { + case PrimaryTiming: + pkt->set(primaryTiming); + break; + case IDEConfig: pkt->set(ideConfig); - else + break; + default: panic("No 32bit reads implemented for this device."); + } DPRINTF(IdeCtrl, "PCI read offset: %#x size: 4 data: %#x\n", offset, (uint32_t)pkt->get()); break; @@ -268,6 +277,9 @@ IdeController::writeConfig(PacketPtr pkt) break; case sizeof(uint16_t): switch (offset) { + case UDMAControl: + udmaControl = pkt->get(); + break; case PrimaryTiming: primaryTiming = pkt->get(); break; @@ -289,10 +301,16 @@ IdeController::writeConfig(PacketPtr pkt) offset, (uint32_t)pkt->get()); break; case sizeof(uint32_t): - if (offset == IDEConfig) + switch (offset) { + case PrimaryTiming: + primaryTiming = pkt->get(); + break; + case IDEConfig: ideConfig = pkt->get(); - else + break; + default: panic("Write of unimplemented PCI config. register: %x\n", offset); + } break; default: panic("invalid access size(?) for PCI configspace!\n");