From: Kever Yang <kever.yang@rock-chips.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/7] usb: xhci-rockchip: add rockchip dwc3 controller driver
Date: Wed, 24 Aug 2016 11:06:45 +0800 [thread overview]
Message-ID: <57BD0F45.1010906@rock-chips.com> (raw)
In-Reply-To: <46132467-7a85-fb68-7b67-48699ae4d2d8@denx.de>
Hi Marek,
On 08/19/2016 06:52 PM, Marek Vasut wrote:
> On 08/19/2016 09:19 AM, Kever Yang wrote:
>> From: MengDongyang <daniel.meng@rock-chips.com>
>>
>> This patch add support for rockchip dwc3 controller, which corresponding
>> to the two type-C port on rk3399 evb.
>> Only support usb2.0 currently for we have not enable the usb3.0 phy
>> driver and PD(fusb302) driver.
>>
>> Signed-off-by: MengDongyang <daniel.meng@rock-chips.com>
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Hi,
>
> [...]
>
>> +static void rockchip_dwc3_phy_setup(struct dwc3 *dwc3_reg,
>> + struct rockchip_xhci *rockchip)
>> +{
>> + u32 reg;
>> + const void *blob = gd->fdt_blob;
>> + struct udevice *dev = rockchip->dev;
>> + const struct fdt_property *prop;
>> + const u32 *data;
>> +
>> + reg = readl(&dwc3_reg->g_usb3pipectl[0]);
>> +
>> + /* To do set dwc3 usb3 pipe control */
>> +
>> + writel(reg, &dwc3_reg->g_usb3pipectl[0]);
> This read - do nothing - write looks suspicious. Is this needed ?
This is for usb3.0 phy, will remove in next version for we not enable
usb3.0 phy now.
>
> Also, drop the newline after the comment, it's useless, both above and
> below here.
Will fix in next version.
Thanks,
- Kever
>
>> + /* Set dwc3 usb2 phy config */
>> +
>> + reg = readl(&dwc3_reg->g_usb2phycfg[0]);
>> +
>> + prop = fdt_get_property(blob, dev->of_offset,
>> + "snps,dis-enblslpm-quirk", NULL);
>> + if (prop)
>> + reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM;
>> +
>> + prop = fdt_get_property(blob, dev->of_offset,
>> + "snps,phyif-utmi-bits", NULL);
>> + data = (u32 *)prop->data;
>> + if (fdt32_to_cpu(*data) == 16) {
>> + reg |= DWC3_GUSB2PHYCFG_PHYIF;
>> + reg &= ~DWC3_GUSB2PHYCFG_USBTRDTIM_MASK;
>> + reg |= 5 << DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET;
>> + } else if (fdt32_to_cpu(*data) == 8) {
>> + reg &= ~DWC3_GUSB2PHYCFG_PHYIF;
>> + reg &= ~DWC3_GUSB2PHYCFG_USBTRDTIM_MASK;
>> + reg |= 9 << DWC3_GUSB2PHYCFG_USBTRDTIM_OFFSET;
>> + }
>> +
>> + prop = fdt_get_property(blob, dev->of_offset,
>> + "snps,dis-u2-freeclk-exists-quirk", NULL);
>> + if (prop)
>> + reg &= ~DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS;
>> +
>> + prop = fdt_get_property(blob, dev->of_offset,
>> + "snps,dis-u2-susphy-quirk", NULL);
>> + if (prop)
>> + reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
>> +
>> + writel(reg, &dwc3_reg->g_usb2phycfg[0]);
>> +}
> [...]
>
next prev parent reply other threads:[~2016-08-24 3:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 7:19 [U-Boot] [PATCH v2 0/7] rk3399: enable host controllers Kever Yang
2016-08-19 7:19 ` [U-Boot] [PATCH v2 1/7] usb: xhci-rockchip: add rockchip dwc3 controller driver Kever Yang
2016-08-19 10:52 ` Marek Vasut
2016-08-24 3:06 ` Kever Yang [this message]
2016-08-22 4:20 ` Simon Glass
2016-08-24 3:34 ` Kever Yang
2016-08-19 7:19 ` [U-Boot] [PATCH v2 2/7] rockchip: select DM_USB for rockchip SoC Kever Yang
2016-08-19 7:19 ` [U-Boot] [PATCH v2 3/7] config: rk3399: add usb related configs Kever Yang
2016-08-19 7:19 ` [U-Boot] [PATCH v2 4/7] dts: rk3399: add dwc3_typec node for rk3399 Kever Yang
2016-08-19 7:19 ` [U-Boot] [PATCH v2 5/7] dts: rk3399-evb: add regulator-fixed for usb host vbus Kever Yang
2016-08-19 7:19 ` [U-Boot] [PATCH v2 6/7] board: evb-rk3399: enable usb 2.0 host vbus power on board_init Kever Yang
2016-08-22 4:20 ` Simon Glass
2016-08-19 7:19 ` [U-Boot] [PATCH v2 7/7] config: evb-rk3399: enable fixed regulator Kever Yang
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=57BD0F45.1010906@rock-chips.com \
--to=kever.yang@rock-chips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox