222a223,224
> pci_devices = []
>
260,261d261
< self.cf0 = CowIdeDisk(driveID='master')
< self.cf0.childImage(mdesc.disk())
265,266c265,271
< # default to an IDE controller rather than a CF one
< try:
---
>
> self.cf0 = CowIdeDisk(driveID='master')
> self.cf0.childImage(mdesc.disk())
> # Old platforms have a built-in IDE or CF controller. Default to
> # the IDE controller if both exist. New platforms expect the
> # storage controller to be added from the config script.
> if hasattr(self.realview, "ide"):
268c273
< except:
---
> elif hasattr(self.realview, "cf_ctrl"):
269a275,277
> else:
> self.pci_ide = IdeController(disks=[self.cf0])
> pci_devices.append(self.pci_ide)
362a371,372
>
> # Attach off-chip devices
363a374,377
> for dev_id, dev in enumerate(pci_devices):
> dev.pci_bus, dev.pci_dev, dev.pci_func = (0, dev_id + 1, 0)
> self.realview.attachPciDevice(dev, self.iobus)
>