public inbox for linux-sunxi@lists.linux.dev
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Chris Morgan <macromorgan@hotmail.com>,
	Chris Morgan <macroalpha82@gmail.com>,
	linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org,
	uwu@icenowy.me, samuel@sholland.org, jernej.skrabec@gmail.com,
	wens@csie.org, conor+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org
Subject: Re: [PATCH 3/3] ARM: dts: sunxi: add support for Anbernic RG-Nano
Date: Sat, 1 Jul 2023 01:37:07 +0100	[thread overview]
Message-ID: <20230701013707.54c6d37a@slackpad.lan> (raw)
In-Reply-To: <ytgchgmhgegjdqe44yamcgh6ovk6yxbpj2oxgrtslqle5tskvl@np2oxx4l6a5w>

On Fri, 30 Jun 2023 10:16:35 +0200
Maxime Ripard <mripard@kernel.org> wrote:

Hi,

> On Thu, Jun 29, 2023 at 08:34:10PM +0100, Andre Przywara wrote:
> > > > > +&usbphy {
> > > > > +	usb0_id_det-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;  
> > 
> > Where is this pin connected to, in the USB-C connector? One of the CC
> > pins?
> >   
> > > > > +	status = "okay";    
> > > > 
> > > > So in the commit message you say "USB-C for power", but this here
> > > > describes a full featured USB port. So does that work? Can you use it as a
> > > > gadget, but also as a host?    
> > > 
> > > Yes, it's an OTG port with the ID pin pulled to ground.  
> > 
> > Do you mean both CC pins? IIRC this means it's hardwired as a
> > peripheral (UFP).
> > 
> > If I ignore the ID pin above, this looks like on the OrangePi Zero2 or
> > the MangoPi MQ-R. In those cases we put peripheral in the DT, as this
> > is what this connection seems to indicate. That *can* be used a host as
> > well, with the "right" cable, but it's not really a well supported
> > configuration, so we leave this up to people to change this locally,
> > should they really desire so.  
> 
> The ID pin above is exactly what makes "the right cable" works:
> depending on the state of the ID pin the controller will act either as a
> peripheral or a host. Dual-mode works just fine, so if the hardware
> supports it there's no reason not to enable it.

Mmmh, I think that's correct for an USB micro-B socket, but this is a
USB type C one. I don't think USB type C role switching can be easily
implemented with just a single GPIO, probably not even with two purely
digital GPIOs, as you would need some more clever voltage detection
circuitry.
For a simple connection via a USB-2.0 A<->C cable this probably doesn't
matter (as nothing happens to the CC pins?), and a USB-C thumb drive
probably would work as well, but I doubt those boards can properly
detect that automatically.

Chris, can you check how many pins from the type C connector are
actually used on the board? Can you follow the traces? Does it just
pull CC1 and CC2 to GND, via a resistor? Or are those pins somehow
connected to the SoC, or even a separate USB-C controller chip? Maybe
also worth checking if the stock OS can detect hosts or devices attached
automatically.

I am not really familiar with the USB type C situation in those
simplified USB-2.0-only setups, so if anyone can shed some light on
this, I'd be grateful.

Cheers,
Andre

      parent reply	other threads:[~2023-07-01  0:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 20:00 [PATCH 0/3] Add Anbernic RG-Nano Chris Morgan
2023-06-20 20:00 ` [PATCH 1/3] arm: dts: sun8i: V3s: Add pinctrl for pwm Chris Morgan
2023-06-20 23:50   ` Andre Przywara
2023-06-24  4:57     ` Icenowy Zheng
2023-06-26  8:50       ` Andre Przywara
2023-06-27 17:49         ` Chris Morgan
2023-06-20 20:00 ` [PATCH 2/3] dt-binding: arm: sunxi: add Anbernic RG-Nano Chris Morgan
2023-06-21  6:15   ` Krzysztof Kozlowski
2023-06-21  9:55   ` Andre Przywara
2023-06-20 20:00 ` [PATCH 3/3] ARM: dts: sunxi: add support for " Chris Morgan
2023-06-21  9:52   ` Andre Przywara
2023-06-27 17:49     ` Chris Morgan
2023-06-29 19:34       ` Andre Przywara
2023-06-29 22:21         ` Chris Morgan
2023-06-30  8:16         ` Maxime Ripard
2023-06-30 13:34           ` Chris Morgan
2023-07-01  0:37           ` Andre Przywara [this message]

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=20230701013707.54c6d37a@slackpad.lan \
    --to=andre.przywara@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=macroalpha82@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=mripard@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=uwu@icenowy.me \
    --cc=wens@csie.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