From: pavel@denx.de (Pavel Machek)
To: cip-dev@lists.cip-project.org
Subject: [cip-dev] [PATCH 4.19.y-cip 08/12] phy: renesas: rcar-gen3-usb2: follow the hardware manual procedure
Date: Tue, 16 Jul 2019 14:18:55 +0200 [thread overview]
Message-ID: <20190716121854.GH24157@amd> (raw)
In-Reply-To: <1563199312-18842-9-git-send-email-biju.das@bp.renesas.com>
Hi!
> From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>
> commit 72c0339c115b31b3c0b22b1809854136cadd49be upstream.
>
> This patch modifies rcar_gen3_init_otg() procedure to follow Figure
> 73.4 of "R-Car Series, 3rd Generation User's Manual: Hardware Rev.1.00".
>
> @@ -310,16 +310,21 @@ static void rcar_gen3_init_otg(struct rcar_gen3_chan *ch)
> void __iomem *usb2_base = ch->base;
> u32 val;
>
> + /* Should not use functions of read-modify-write a register */
> + val = readl(usb2_base + USB2_LINECTRL1);
> + val = (val & ~USB2_LINECTRL1_DP_RPD) | USB2_LINECTRL1_DPRPD_EN |
> + USB2_LINECTRL1_DMRPD_EN | USB2_LINECTRL1_DM_RPD;
> + writel(val, usb2_base + USB2_LINECTRL1);
> +
I don't understand the comment here. Actually having function to
set/clear bits in arbitrary register might be a nice cleanup.
While reviewing that I noticed:
static void rcar_gen3_init_otg(struct rcar_gen3_chan *ch)
...
val = readl(usb2_base + USB2_LINECTRL1);
rcar_gen3_set_linectrl(ch, 0, 0);
writel(val | USB2_LINECTRL1_DPRPD_EN | USB2_LINECTRL1_DMRPD_EN,
usb2_base + USB2_LINECTRL1);
AFAICT it modifies the register only to undo those chanes
immediately. Is it intentional? Is it worth a comment? Can the block
be replaced with
static void rcar_gen3_init_otg(struct rcar_gen3_chan *ch)
...
rcar_gen3_set_linectrl(ch, 0, 0);
rcar_gen3_set_linectrl(ch, 1, 1);
?
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190716/39db3e09/attachment.sig>
next prev parent reply other threads:[~2019-07-16 12:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 14:01 [cip-dev] [PATCH 4.19.y-cip 00/12] Add USB Host support Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 01/12] phy: renesas: rcar-gen3-usb2: fix vbus_ctrl for role sysfs Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 02/12] phy: renesas: rcar-gen3-usb2: Rename has_otg_pins to uses_otg_pins Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 03/12] phy: renesas: rcar-gen3-usb2: Check a property to use otg pins Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 04/12] phy: renesas: rcar-gen3-usb2: unify OBINTEN handling Biju Das
2019-07-16 12:03 ` Pavel Machek
2019-07-16 12:57 ` Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 05/12] phy: renesas: rcar-gen3-usb2: add conditions for uses_otg_pins == false Biju Das
2019-07-16 12:05 ` Pavel Machek
2019-07-16 12:50 ` Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 06/12] phy: renesas: rcar-gen3-usb2: change a condition "dr_mode" Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 07/12] phy: renesas: rcar-gen3-usb2: add is_otg_channel to use "role" sysfs Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 08/12] phy: renesas: rcar-gen3-usb2: follow the hardware manual procedure Biju Das
2019-07-16 12:18 ` Pavel Machek [this message]
2019-07-16 12:49 ` Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 09/12] phy: rcar-gen3-usb2: Add support for r8a77470 Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 10/12] phy: renesas: rcar-gen3-usb2: Use pdev's device pointer on dev_vdbg() Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 11/12] phy: renesas: rcar-gen3-usb2: enable/disable independent irqs Biju Das
2019-07-15 14:01 ` [cip-dev] [PATCH 4.19.y-cip 12/12] arm64: dts: renesas: cat874: Add USB-HOST support Biju Das
2019-07-16 16:46 ` [cip-dev] [PATCH 4.19.y-cip 00/12] Add USB Host support Pavel Machek
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=20190716121854.GH24157@amd \
--to=pavel@denx.de \
--cc=cip-dev@lists.cip-project.org \
/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