From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
Date: Thu, 22 Jan 2015 08:05:53 +0100 [thread overview]
Message-ID: <201501220805.53148.marex@denx.de> (raw)
In-Reply-To: <1421793730-8179-3-git-send-email-srae@broadcom.com>
On Tuesday, January 20, 2015 at 11:42:08 PM, Steve Rae wrote:
> Implement the UDC support for the USB OTG interface.
>
> Signed-off-by: Steve Rae <srae@broadcom.com>
> ---
General question -- this bcm controller you're adding here isn't by
any chance a DWC2 controller, or is it ? There's already a driver
for DWC2 in drivers/usb/gadget/s3c_udc_otg.c . This driver should really
be properly renamed though ;-/
If this is not DWC2, do you know what controller this is please ?
[...]
> +#define FASTBOOT_INTERFACE_CLASS 0xff
> +#define FASTBOOT_INTERFACE_SUB_CLASS 0x42
> +#define FASTBOOT_INTERFACE_PROTOCOL 0x03
> +
> +#define wfld_set(addr, fld_val, fld_mask) \
> + (writel(((readl(addr) & ~(fld_mask)) | (fld_val)), (addr)))
> +#define wfld_clear(addr, fld_mask) \
> + (writel((readl(addr) & ~(fld_mask)), (addr)))
The same functionality is implemented by clrsetbits32() and friends.
> +#define DEVICE_STRING_LANGUAGE_ID 0x0409 /* English (United States) */
> +
> +/*
> + * In high speed mode rx packets are 512
> + * In full speed mode rx packets are 64
> + */
> +#define RX_ENDPOINT_MAXIMUM_PACKET_SIZE (0x0200)
> +#define TX_ENDPOINT_MAXIMUM_PACKET_SIZE (0x0040)
No need for the brackets here.
> +#ifndef CONFIG_USB_BOARDNAME
> +#define CONFIG_USB_BOARDNAME "Board"
> +#endif
> +
> +#ifndef CONFIG_USB_CONFIGURATION
> +#define CONFIG_USB_CONFIGURATION "Fastboot"
> +#endif
What is all this stuff doing in generic USB UDC driver please ?
Or is this not a generic UDC driver ?
[...]
> +static void usb_turn_off_vdp(void)
> +{
> + /* Check if it is standard host port (SHP) */
> + if (readl(HSOTG_CTRL_BASE_ADDR + HSOTG_CTRL_STATUS_OFFSET) &
> + HSOTG_CTRL_STATUS_SHP_MASK) {
> + udelay(60000); /* 50 ms + 20 % */
mdelay(60), this should be fixed all over the place please.
> + /*
> + * force turn off VDP, enable sw_ovwr_set to take over the
> + * bc11 switches directly
> + */
> + wfld_set(HSOTG_CTRL_BASE_ADDR + HSOTG_CTRL_CFG_OFFSET,
> + BC11_CFG_VDP_OFF,
> + HSOTG_CTRL_CFG_OVWR_KEY_MASK |
> + HSOTG_CTRL_CFG_SW_OVWR_EN_MASK |
> + HSOTG_CTRL_CFG_OVWR_SET_M0_MASK |
> + HSOTG_CTRL_CFG_OVWR_SET_P0_MASK);
> +
> + udelay(160); /* Allow time for switches to disengage */
> + } else {
> + udelay(120000); /* 100 ms + 20 % */
> + }
> +}
[...]
next prev parent reply other threads:[~2015-01-22 7:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-20 22:42 [U-Boot] [PATCH 0/4] This series implements fastboot on the "bcm28155_ap" boards Steve Rae
2015-01-20 22:42 ` [U-Boot] [PATCH 1/4] usb: gadget: fastboot: add CONFIG_FASTBOOT_NO_GADGET support Steve Rae
2015-01-20 22:42 ` [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support Steve Rae
2015-01-22 7:05 ` Marek Vasut [this message]
2015-01-23 23:48 ` Steve Rae
2015-01-24 11:47 ` Marek Vasut
2015-01-26 8:38 ` Lukasz Majewski
2015-01-26 12:12 ` Marek Vasut
2015-01-26 12:31 ` Lukasz Majewski
2015-01-30 22:16 ` Marek Vasut
2015-01-31 13:26 ` Lukasz Majewski
2015-01-31 14:15 ` Marek Vasut
2015-02-01 13:15 ` Lukasz Majewski
2015-02-01 16:21 ` Marek Vasut
2015-01-26 17:44 ` Steve Rae
2015-01-27 23:00 ` Marek Vasut
2015-01-28 19:04 ` Steve Rae
2015-01-30 22:17 ` Marek Vasut
2015-01-20 22:42 ` [U-Boot] [PATCH 3/4] usb: update 'sysmap.h' Steve Rae
2015-01-20 22:42 ` [U-Boot] [PATCH 4/4] usb: fastboot: implement fastboot Steve Rae
2015-01-22 7:00 ` [U-Boot] [PATCH 0/4] This series implements fastboot on the "bcm28155_ap" boards Marek Vasut
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=201501220805.53148.marex@denx.de \
--to=marex@denx.de \
--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.