RE: [RFC/PATCH 2/2] usb: dwc3: core: split host address space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Felipe Balbi [mailto:balbi@xxxxxx]
> Sent: Thursday, April 12, 2012 6:08 AM
> 
> This will prevent dwc3.ko from ioremapping
> the entire memory space, thus preventing xHCI
> from requesting its own part of the address.
> 
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> ---
>  drivers/usb/dwc3/core.c |   26 +++++++---
>  drivers/usb/dwc3/core.h |  122 +++++++++++++++++++++++------------------------
>  2 files changed, 80 insertions(+), 68 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index e7c853a..3c69d1a 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -405,6 +405,7 @@ static void dwc3_core_exit(struct dwc3 *dwc)
>  static int __devinit dwc3_probe(struct platform_device *pdev)
>  {
>  	struct device_node	*node = pdev->dev.of_node;
> +	struct resource		host_resource[2];
>  	struct resource		*res;
>  	struct dwc3		*dwc;
>  	struct device		*dev = &pdev->dev;
> @@ -431,7 +432,24 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  	}
> 
> -	dwc->res = res;
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0) {
> +		dev_err(dev, "missing IRQ\n");
> +		return -ENODEV;
> +	}
> +
> +	host_resource[0].start = res->start;
> +	host_resource[0].end = res->start + 0x7fff;
> +	host_resource[0].flags = IORESOURCE_MEM;
> +
> +	host_resource[1].start = irq;
> +	host_resource[1].end = irq;
> +	host_resource[1].flags = IORESOURCE_IRQ;
> +
> +	dwc->res = host_resource;
> +
> +	/* Skip host address space */
> +	res->start += 0xc100;

Maybe it would be a good idea to make the Device address space end
at 0xcbff? And then add another resource for OTG starting at
0xcc00. That would allow the OTG driver to have its own address
space. Not sure if that's necessary, I'm just thinking out loud
here.

-- 
Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux