[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 02/20] arm: add Faraday FUSBH200 EHCI control
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v2 02/20] arm: add Faraday FUSBH200 EHCI controller |
Date: |
Fri, 25 Jan 2013 10:02:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130108 Thunderbird/10.0.12 |
Hi,
>> +static uint64_t
>> +ehci_faraday_read(void *ptr, hwaddr addr, unsigned size)
>> +{
>> + hwaddr off = 0x34 + addr;
>> +
>> + switch (off) {
>> + case 0x34: /* fusbh200: EOF/Async. Sleep Timer Register */
>> + return 0x00000041;
>> + case 0x40: /* fusbh200: Bus Monitor Control/Status Register */
>> + /* High-Speed, VBUS valid, interrupt level-high active */
>> + return (2 << 9) | (1 << 8) | (1 << 3);
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +static void
>> +ehci_faraday_write(void *ptr, hwaddr addr, uint64_t val, unsigned size)
>> +{
>> +}
>> +
>> +static const MemoryRegionOps ehci_mmio_faraday_ops = {
>> + .read = ehci_faraday_read,
>> + .write = ehci_faraday_write,
>> + .valid.min_access_size = 4,
>> + .valid.max_access_size = 4,
>> + .endianness = DEVICE_LITTLE_ENDIAN,
>> +};
This should go to hcd-ehci-sysbus.c
>> + memory_region_init_io(&s->mem_faraday, &ehci_mmio_faraday_ops, s,
>> + "faraday", 0x4c);
>
> I don't think this is good design... Can't you do the Faraday part from
> your own instance_init / initfn / realizefn function?
Yes, please. Just add your own usb_ehci_sysbus_${board}_initfn, call
usb_ehci_sysbus_initfn for the common stuff, then add your
hardware-specific memory region.
> The define -> class/state movements look fine to me as continuation of
> our previous effort. Optionally this patch could be split into two -
> preparing the fields and updating all define users, and then introduce
> your new model.
Agree, splitting would be nice: one patch making portbase + nports
runtime configurable, one patch adding the new ehci controller.
cheers,
Gerd
[Qemu-devel] [PATCH v2 04/20] arm: add Faraday FTDMAC020 AHB DMA support, Kuo-Jung Su, 2013/01/25
[Qemu-devel] [PATCH v2 05/20] arm: add Faraday FTGMAC100 1Gbps ethernet support, Kuo-Jung Su, 2013/01/25
[Qemu-devel] [PATCH v2 06/20] arm: add Faraday FTMAC110 10/100Mbps ethernet support, Kuo-Jung Su, 2013/01/25
[Qemu-devel] [PATCH v2 07/20] arm: add Faraday FTI2C010 I2C controller support, Kuo-Jung Su, 2013/01/25
[Qemu-devel] [PATCH v2 09/20] arm: add Faraday FTNANDC021 nand flash controller support, Kuo-Jung Su, 2013/01/25