Date: Mon, 18 Sep 2017 13:42:35 -0700 From: Mark Millard <markmi@dsl-only.net> To: Emmanuel Vadot <manu@FreeBSD.org>, freebsd-arm <freebsd-arm@freebsd.org> Subject: Re: allwinner question: New CLR4(sc->phy_ctrl, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG) for phyno !=0 vs. CLR4(sc, 0, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG) before. . . Message-ID: <5830ABC8-6544-4588-BDB6-483C2D1B3D3E@dsl-only.net> In-Reply-To: <BD75F42B-AA93-4BFC-8989-ABA110287673@dsl-only.net> References: <BD75F42B-AA93-4BFC-8989-ABA110287673@dsl-only.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2017-Sep-18, at 1:30 PM, Mark Millard <markmi@dsl-only.net> wrote: > It probably just my ignorance of the code's intent > but for A64 it used to be that phyno ==1 had code > that did CLR4 for phyno==0 (hard coded): > > if (sc->phy_type == AWUSBPHY_TYPE_A64) { > CLR4(sc, phyno, PMU_UNK_H3, PMU_UNK_H3_CLR); > > /* EHCI0 and OTG share a PHY */ > if (phyno == 0) > SET4(sc, 0, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); > else if (phyno == 1) > CLR4(sc, 0, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); > } > > So: that last CLR4 manipulated phyno==0 as far as I can tell, > no matter what the passed-in phyno was. > > In the new code there seems to be no hook for phyno==1 > to manipulate phyno==0 similarly: > > if (sc->phy_conf->phy0_route == true) { > if (phyno == 0) > SET4(sc->phy_ctrl, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); > else > CLR4(sc->phy_ctrl, OTG_PHY_CFG, OTG_PHY_ROUTE_OTG); > } > > That CLR4 seems to be manipulating phyno==1 instead and > seems to have no means of doing otherwise. > > Was the old code wrong? May be I asked the reverse of the right question: that first CLR 4 in the old code varied by phyno but now always uses phy_ctrl: if (sc->phy_conf->pmu_unk1 == true) CLR4(sc->phy_ctrl, PMU_UNK_H3, PMU_UNK_H3_CLR); Overall one part or the other seems to be a mismatch with the old code for A64. === Mark Millard markmi at dsl-only.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5830ABC8-6544-4588-BDB6-483C2D1B3D3E>