Thread (36 messages) 36 messages, 7 authors, 2021-09-17

Re: [PATCH 0/3] Implement role-switch notifications from dwc3-drd to dwc3-qcom

From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Date: 2021-09-17 12:33:33
Also in: linux-arm-msm

On Wed, Sep 15, 2021 at 08:53:35AM -0500, Bjorn Andersson wrote:
On Thu 26 Aug 01:15 CDT 2021, Felipe Balbi wrote:
quoted
Hi,

Bjorn Andersson [off-list ref] writes:
quoted
On Wed 25 Aug 10:59 PDT 2021, Bryan O'Donoghue wrote:
quoted
On 25/08/2021 16:53, Bjorn Andersson wrote:
quoted
But in the case of Type-C altmode several of our boards have either an
external gpio-based SBU-pin-swapper or some redriver on I2C with this
functionality, so we need a way to tell both the PHY and this external
contraption about the orientation.
Its a very similar problem to orientation switch

As an example

- redriver may need to fix up signal integrity for
  lane switching

- PHY needs to toggle lanes from one IP block to another
Right, conceptually the problem is similar, but IMHO there's a big
difference in that the redriver and PHY are two physically separate
entities - on different buses. The dwc3 glue and core represent the same
piece of hardware.
no they don't. The glue is a real piece of HW that adapts the "generic"
synopsys IP to a given SoC. OMAP, for example, was adapting Synopsys'
proprietary interface to the Sonics interconnect, while some others may
adapt it to AXI or PCI or whatever.

They are different HW blocks, the glue (in many cases) has its own IRQ,
its own address space, its own register file, and so on. Granted, the
glue also serves as an access port from CPU to the synopsys core, but
that's handled by `ranges' DT property.
So what you're saying is that the "Qualcomm glue" is the hardware, and
the core is just the basis for that design?

Regardless, on the Qualcomm platforms we have need to inform both
devices about role changes, how do we do this? (Without platform_data
and preferably without having to duplicate the typec code in the glue
and core and the two device nodes in DT)
That part can be handled by simply adding the notifiers to the USB
role switch class as said before [1], so I think the actual problem
here is that your glue layer depends on core that your glue creates
(or a resource that the core driver creates).

I think the dependency on dwc3 core, and what ever it creates, issue
you should be able to solve by using the component framework. I'll
attach you a patch showing how it should probable look like (not even
compile tested).

So the dwc3 core is the aggregate driver and the glue is the only
component in that example (that should be enough for your needs), but
it should not be any problem to later register also the child devices
(xHCI, USB role switch, etc.) as components if needed.

[1] https://lore.kernel.org/linux-usb/20191002231617.3670-3-john.stultz@linaro.org/ (local)

thanks,

-- 
heikki

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help