On Mon, 27 Apr 2015 13:32:32 +0530
Nikunj A Dadhania <nik...@linux.vnet.ibm.com> wrote:

> With the addition of 64-bit bar ranges (commit: 9fbfed08 - pci: use
> 64bit bar ranges), the usb-setup-hcidev needs to handle 64-bit
> addresses.
> 
> For example, QEMU provided NEC USB XHCI device requests 64-bit memory
> address. Added code to check the memory type before address
> translation.
> 
> Signed-off-by: Nikunj A Dadhania <nik...@linux.vnet.ibm.com>
> ---
>  slof/fs/devices/pci-class_0c.fs | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/slof/fs/devices/pci-class_0c.fs b/slof/fs/devices/pci-class_0c.fs
> index 9c47325..39453fb 100644
> --- a/slof/fs/devices/pci-class_0c.fs
> +++ b/slof/fs/devices/pci-class_0c.fs
> @@ -25,8 +25,14 @@ CONSTANT /hci-dev
>  
>  : usb-setup-hcidev ( num hci-dev -- )
>      >r
> -    10 config-l@ translate-my-address
> -    3 not AND
> +    10 config-l@ F AND case
> +     0 OF 10 config-l@ translate-my-address ENDOF       \ 32-bit memory space
> +     4 OF                                               \ 64-bit memory space
> +         14 config-l@ 20 lshift                         \ Read two bars
> +         10 config-l@ OR translate-my-address
> +     ENDOF
> +    ENDCASE
> +    F not AND
>      ( io-base ) r@ hcd>base !
>      08 config-l@ 8 rshift  0000000F0 AND 4 rshift
>      ( usb-type ) r@ hcd>type !

Looks good to me.

Reviewed-by: Thomas Huth <th...@redhat.com>
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to