All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: u-boot@lists.denx.de
Subject: [PATCH 5/8] xhci: mediatek: Add support for MTK xHCI host controller
Date: Wed, 11 Mar 2020 16:17:12 +0800	[thread overview]
Message-ID: <1583914632.25913.1.camel@mhfsdcap03> (raw)
In-Reply-To: <2a096d71-d4a3-a693-8822-791448f64f99@denx.de>

On Wed, 2020-03-11 at 08:11 +0100, Marek Vasut wrote:
> On 3/11/20 7:50 AM, Chunfeng Yun wrote:
> [...]
> > + * @u3_ctrl_p[x]: ip usb3 port x control register, only low 4bytes are used
> > + * @u2_ctrl_p[x]: ip usb2 port x control register, only low 4bytes are used
> > + * @u2_phy_pll: usb2 phy pll control register
> > + */
> > +struct mtk_ippc_regs {
> > +	__le32 ip_pw_ctr0;
> > +	__le32 ip_pw_ctr1;
> > +	__le32 ip_pw_ctr2;
> 
> Please define the registers with #define macros , this struct-based
> approach doesn't scale.
Ok
> 
> [..]
> 
> > +static int xhci_mtk_host_enable(struct mtk_xhci *mtk)
> > +{
> > +	struct mtk_ippc_regs *ippc = mtk->ippc;
> > +	u32 value, check_val;
> > +	int ret;
> > +	int i;
> > +
> > +	/* power on host ip */
> > +	value = readl(&ippc->ip_pw_ctr1);
> > +	value &= ~CTRL1_IP_HOST_PDN;
> > +	writel(value, &ippc->ip_pw_ctr1);
> > +
> > +	/* power on and enable all u3 ports */
> > +	for (i = 0; i < mtk->num_u3_ports; i++) {
> > +		value = readl(&ippc->u3_ctrl_p[i]);
> > +		value &= ~(CTRL_U3_PORT_PDN | CTRL_U3_PORT_DIS);
> > +		value |= CTRL_U3_PORT_HOST_SEL;
> > +		writel(value, &ippc->u3_ctrl_p[i]);
> > +	}
> 
> Use clrsetbits_le32() above and below and where applicable.
Ok
> 
> > +	/* power on and enable all u2 ports */
> > +	for (i = 0; i < mtk->num_u2_ports; i++) {
> > +		value = readl(&ippc->u2_ctrl_p[i]);
> > +		value &= ~(CTRL_U2_PORT_PDN | CTRL_U2_PORT_DIS);
> > +		value |= CTRL_U2_PORT_HOST_SEL;
> > +		writel(value, &ippc->u2_ctrl_p[i]);
> > +	}
> 
> [...]
> 
> > +static int xhci_mtk_clks_enable(struct mtk_xhci *mtk)
> > +{
> > +	int ret;
> > +
> > +	ret = clk_enable(mtk->sys_clk);
> > +	if (ret) {
> > +		dev_err(mtk->dev, "failed to enable sys_clk\n");
> > +		goto sys_clk_err;
> > +	}
> 
> Can you use clk_enable_bulk() and other clk.*bulk functions ?
Will try it, thank you
> [...]
> 

  reply	other threads:[~2020-03-11  8:17 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  6:50 [PATCH 0/8] Add support for MediaTek xHCI host controller Chunfeng Yun
2020-03-11  6:50 ` [PATCH 1/8] phy: phy-mtk-tphy: add support USB phys Chunfeng Yun
2020-03-11  6:50 ` [PATCH 2/8] phy: phy-mtk-tphy: add support new version Chunfeng Yun
2020-03-11  6:50 ` [PATCH 3/8] phy: phy-mtk-tphy: add a new reference clock Chunfeng Yun
2020-03-11  6:50 ` [PATCH 4/8] dm: core: Add function to get child count of ofnode Chunfeng Yun
2020-03-11 12:17   ` Simon Glass
2020-03-12  6:24     ` Chunfeng Yun
2020-03-11  6:50 ` [PATCH 5/8] xhci: mediatek: Add support for MTK xHCI host controller Chunfeng Yun
2020-03-11  7:11   ` Marek Vasut
2020-03-11  8:17     ` Chunfeng Yun [this message]
2020-03-21  8:53     ` Chunfeng Yun
2020-03-21 14:12     ` Simon Glass
2020-03-21 15:08       ` Marek Vasut
2020-03-21 16:42         ` Simon Glass
2020-03-21 16:59           ` Marek Vasut
2020-03-21 18:41             ` Simon Glass
2020-03-21 19:01               ` Marek Vasut
2020-03-21 19:34                 ` Simon Glass
2020-03-21 20:04                   ` Marek Vasut
2020-03-22  2:08                     ` Simon Glass
2020-03-22  2:15                       ` Marek Vasut
2020-03-22 15:17                         ` Simon Glass
2020-03-22 15:34                           ` Marek Vasut
2020-03-24  3:56                             ` Chunfeng Yun
2020-03-30 23:31                             ` Simon Glass
2020-03-31  0:38                               ` Marek Vasut
2020-03-31 13:24                                 ` Simon Glass
2020-03-31 13:29                                   ` Marek Vasut
2020-03-31 14:16                                     ` Simon Glass
2020-03-31 16:05                                       ` Marek Vasut
2020-04-10 18:41                                         ` Marek Vasut
2020-04-10 19:14                                           ` Simon Glass
2020-04-10 19:27                                             ` Marek Vasut
2020-04-19 23:38                                               ` Simon Glass
2020-03-11 12:18   ` Simon Glass
2020-03-12  6:23     ` Chunfeng Yun
2020-03-11  6:50 ` [PATCH 6/8] arm: dts: mt7629: add support usb related nodes Chunfeng Yun
2020-03-11  6:50 ` [PATCH 7/8] dt-bindings: phy-mtk-tphy: add properties of address mapping and clocks Chunfeng Yun
2020-03-11  6:50 ` [PATCH 8/8] dt-bindings: usb: mtk-xhci: Add binding for MediaTek xHCI host controller Chunfeng Yun

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=1583914632.25913.1.camel@mhfsdcap03 \
    --to=chunfeng.yun@mediatek.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.