On 10/25/12 11:47, Peter Crosthwaite wrote:
> The capabilities register and operational register offsets can vary from one
> EHCI implementation to the next. Parameterise accordingly.

>  static Property ehci_properties[] = {
>      DEFINE_PROP_UINT32("maxframes", EHCIState, maxframes, 128),
> +    DEFINE_PROP_UINT16("capabase", EHCIState, capabase, 0),
> +    DEFINE_PROP_UINT16("opregbase", EHCIState, opregbase, 0x20),
>      DEFINE_PROP_END_OF_LIST(),
>  };

I don't think we want have this as properties.  Just set them in initfn().

> @@ -2718,8 +2719,10 @@ static int usb_ehci_initfn(PCIDevice *dev)
>      pci_conf[0x6e] = 0x00;
>      pci_conf[0x6f] = 0xc0;  // USBLEFCTLSTS
>  
> +    s->caps = g_malloc0(s->opregbase);

I don't think we need to make that dynamic.

opregbase just happened equal caps_size for pci-ehci due to packing
these regions without space inbetween.

>      memory_region_init_io(&s->mem_caps, &ehci_mmio_caps_ops, s,
> -                          "capabilities", OPREGBASE);
> +                          "capabilities", s->opregbase);

caps_size

cheers,
  Gerd

Reply via email to