public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] usb: ci_udc: Fix set address to work with older controllers
Date: Tue, 24 Feb 2015 10:00:43 -0700	[thread overview]
Message-ID: <54ECAE3B.8080208@wwwdotorg.org> (raw)
In-Reply-To: <1424796293-22746-1-git-send-email-alban.bedel@avionic-design.de>

On 02/24/2015 09:44 AM, Alban Bedel wrote:
> Older controllers don't implement "Device Address Advance" which allow
> to pass the device address to the controller when it is received.
> To support such controller we need to store the requested address and
> only apply it after the next IN transfer completed on EP0.

> diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c

>   	case SETUP(USB_RECIP_DEVICE, USB_REQ_SET_ADDRESS):
> -		/*
> -		 * write address delayed (will take effect
> -		 * after the next IN txn)
> -		 */
> -		writel((r.wValue << 25) | (1 << 24), &udc->devaddr);
> +		/* The device address must be updated after the next IN
> +		 * request completed */
> +		controller.set_address = r.wValue;

Presumably, bit 24 is the "device address advance" feature?

I'd prefer it if new controllers used the existing code, but we deferred 
the write only for older controllers that don't support "device address 
advance". That reduces the possibility of regressions on controller HW 
that's already working. Presumably, there is some advantage using the 
new feature, rather than deferring the address change manually, e.g. it 
solves some race condition?

  parent reply	other threads:[~2015-02-24 17:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 16:44 [U-Boot] [PATCH 1/3] usb: ci_udc: Fix set address to work with older controllers Alban Bedel
2015-02-24 16:44 ` [U-Boot] [PATCH 2/3] ARM: tegra: Fix the USB gadget configuration for T20 Alban Bedel
2015-02-24 16:54   ` Stephen Warren
2015-02-24 17:39     ` Alban Bedel
2015-02-24 16:44 ` [U-Boot] [PATCH 3/3] ARM: tegra: usb gadgets: Allow accessing the NAND via DFU Alban Bedel
2015-02-24 16:56   ` Stephen Warren
2015-02-24 17:37     ` Alban Bedel
2015-02-24 18:49       ` Stephen Warren
2015-02-24 17:00 ` Stephen Warren [this message]
2015-02-24 17:41   ` [U-Boot] [PATCH 1/3] usb: ci_udc: Fix set address to work with older controllers Alban Bedel
2015-02-24 19:25     ` Stephen Warren
2015-02-26 17:03       ` Alban Bedel
2015-02-26 17:24         ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54ECAE3B.8080208@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox