From: Nick Thompson <nick.thompson@gefanuc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] DA8xx: Add MUSB host support
Date: Thu, 12 Nov 2009 16:26:26 +0000 [thread overview]
Message-ID: <4AFC3732.40000@gefanuc.com> (raw)
In-Reply-To: <1258040357-15800-2-git-send-email-ajay.gupta@ti.com>
On 12/11/09 15:39, Ajay Kumar Gupta wrote:
> Tested USB host functionality on DA830 EVM.
>
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> Signed-off-by: Swaminathan S <swami.iyer@ti.com>
> ---
> drivers/usb/musb/Makefile | 1 +
> drivers/usb/musb/da8xx.c | 143 +++++++++++++++++++++++++++++++++++++++++++++
> drivers/usb/musb/da8xx.h | 83 ++++++++++++++++++++++++++
> include/usb.h | 3 +-
> 4 files changed, 229 insertions(+), 1 deletions(-)
> create mode 100644 drivers/usb/musb/da8xx.c
> create mode 100644 drivers/usb/musb/da8xx.h
> +static void enable_vbus(void)
> +{
> + u32 value;
> +
> + /* configure GPIO bank4 pin 15 in output direction */
> + value = readl(DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR);
> + writel((value & (~USB_VBUS_GPIO)),
> + (DAVINCI_GPIO_BASE + BANK4_REG_DIR_ADDR));
In general you should be using C structure pointers for all readl/writel
accessors in new code. #defines are no longer considered acceptable, but occur
through this patch. In case there is a compatibility issue with existing code,
I think the legacy form is acceptable.
Indentation is also wrong here (and elsewhere) I believe. Using underscores to
illustrate spaces, this should be:
writel((value | USB_VBUS_GPIO),
_______(DAVINCI_GPIO_BASE + BANK4_REG_SET_ADDR));
This is a mix of tabs (8) and spaces (<= 7). Indentation should use tabs only,
alignment uses spaces as required.
> +static u8 phy_on(void)
> +{
> + u32 timeout;
> + u32 cfgchip2;
> +
> + cfgchip2 = readl(DAVINCI_BOOTCFG_BASE + CFGCHIP2);
C structures again, but in this case the initial da8xx patches provide the C
structure and pointer already, so you can already replace this with:
cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
Please take a look at hardware.h after the initial da8xx patches are in.
Thanks,
Nick.
next prev parent reply other threads:[~2009-11-12 16:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 15:39 [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS Ajay Kumar Gupta
2009-11-12 15:39 ` [U-Boot] [PATCH 2/3] DA8xx: Add MUSB host support Ajay Kumar Gupta
2009-11-12 15:39 ` [U-Boot] [PATCH 3/3] DA830: Add usb config Ajay Kumar Gupta
2009-11-12 16:55 ` Nick Thompson
2009-11-13 3:25 ` Gupta, Ajay Kumar
2009-11-12 16:26 ` Nick Thompson [this message]
2009-11-12 16:41 ` [U-Boot] [PATCH 2/3] DA8xx: Add MUSB host support Paulraj, Sandeep
2009-11-12 15:47 ` [U-Boot] [PATCH 1/3] DA830: Add pinmux for USB0_DRVVBUS Tom
2009-11-12 15:58 ` Paulraj, Sandeep
2009-11-12 16:10 ` Tom
2009-11-12 16:29 ` Paulraj, Sandeep
2009-11-13 4:19 ` Gupta, Ajay Kumar
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=4AFC3732.40000@gefanuc.com \
--to=nick.thompson@gefanuc.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.