devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Brugger <matthias.bgg@gmail.com>
To: Macpaul Lin <macpaul.lin@mediatek.com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bear Wang <bear.wang@mediatek.com>,
	Pablo Sun <pablo.sun@mediatek.com>,
	Macpaul Lin <macpaul@gmail.com>,
	Miles Chen <miles.chen@mediatek.com>,
	linux-usb@vger.kernel.org,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Tinghan Shen <tinghan.shen@mediatek.com>,
	Rex-BC Chen <rex-bc.chen@mediatek.com>,
	Chen-Yu Tsai <wenst@chromium.org>,
	yow-shin.liou@mediatek.com, ben.lok@mediatek.com
Subject: Re: [PATCH 1/3] arm64: dts: mediatek: Introduce MT8195 LAPTOP and IOT's USB configurations
Date: Wed, 1 Feb 2023 13:52:38 +0100	[thread overview]
Message-ID: <c834dc47-02f7-d6e0-60c6-ce42b3255c86@gmail.com> (raw)
In-Reply-To: <7851a7a2-a2bc-c460-a53a-52a8f94e3969@mediatek.com>

Hi all,

On 11/01/2023 06:37, Macpaul Lin wrote:
> 
> 
> On 1/9/23 23:13, AngeloGioacchino Del Regno wrote:
>> Il 05/01/23 10:28, Macpaul Lin ha scritto:
>>> Introduce the split MT8195 laptop and iot USB configurations.
>>> The hardware specifications for LAPTOP devices is different from IOT
>>> devices. The major differences include some hardware constrains for
>>> dual-role switch for USB controllers in different configurations,
>>> especially for power management and other control flows as well.
>>>
>>> Here are some hardware specifiction differences listed:
>>>    1. LAPTOP (Cherry Tomato boards) don't support USB gadget (device mode).
>>>    2. IOT devices must support multiple gadget devices and host mode.
>>>    3. Dual-role switch is not fully supported. Only USB PORT0 support
>>>       dual-role switch.
>>>    4. Power management is designed in primary and secondary dominator.
>>>       For a dual-role port, the device controller is the primary controller
>>>       for power management; while the host controller is the secondary.
>>>       LAPTOP devices should remove device nodes for avoiding abnormal
>>>       behavior.
>>>
>>> This modifcation is to add USB configurations "mt8195-laptop-usb.dtsi"
>>> for LAPTOP devices, and add "mt8195-iot-usb.dtsi" for IOT devices.
>>>
>>> To remove common USB configurations for mt8195.dtsi and switch includes
>>> dtsi these new files for the boards will come in next patch.
>>>
>>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>>
>> I'm mostly sure that there's no reason to split the two configurations.
>>
>> I agree in that Tomato doesn't support gadget mode on the Type-A port and I
>> honestly don't currently know (and I'll test that later!) if it would be possible
>> to act as gadget on any of the two Type-C ports.
>> Of course I agree on the fact that a laptop acting as a gadget may not be useful,
>> but that's not something that I want to judge, as someone may find a usecase.
>>
>> In any case, even if Tomato does *not* support gadget mode on *any* port at all,
>> I wonder why we wouldn't be able to probe MTU3 (and correctly describe the SoC)
>> on Chromebooks but only on MT8195-based IoT boards...
>> ...and in case there's any real issue, we can always force host mode (with a
>> generic  devicetree property!) on the MTU3 on Tomato.
> 
> We are sorry it cannot be achieved by even setting "force host mode" to usb 
> device node. At least, it cannot be done on MT8195.
> 
> The basic reason is the power requirements for USB host on a LAPTOP are 
> different from those on an IoT device.
> 
> The main cause is low power management. The hardware of each device port is 
> different on MT8195. Even the bit fields definition in registers were different.
> 
> Some details such as sequence need to be coordinated with the SPM firmware. When 
> a device hardware is involved in runtime PM, function like remote wakeup and 
> other suspend/resume behavior will be abnormal for a LAPTOP device. If we split 
> the dtsi for different devices, people can choose different configuration in SPM 
> firmware in coreboot or in TF-A to meet the requirement. Hence we'd better not 
> to get more messy code in Linux driver.
> 

I'm not sure I understand everything here. If the XHCI device is a child of the 
mtu3 node then we have problems with some SPM firmware that is not coordinated 
with the runtime PM functions of the kernel?

Fixing that in the device tree sounds wrong here. I think the real fix would be, 
to fix the SPM firmware, so that it can deal with that.

Or is there more to it? If so what? In that case can we try to ignore the 
runtime PM in the MTU3 kernel driver?

I'm not an USB expert but to me it looks very strange that we can have the XHCI 
devices nodes as 'standalone' or as children of mtu3. We should try to describe 
the HW as it is in DT.

Regards,
Matthias

>> Finally, if we're able to add MTU3 to Tomato boards, this means that we won't be
>> seeing these two DTSI files and that USB nodes are still going to all lie in the
>> main `mt8195.dtsi` file, without all this duplication that I'm seeing here.
>>
>> What do you think?
>>
>> Regards,
>> Angelo
>>
> 
> Thanks for the suggestion, we hope the next platform in the future could avoid 
> this issue and reduce some duplicate dts.
> 
> Macpaul Lin

  reply	other threads:[~2023-02-01 12:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05  9:28 [PATCH 1/3] arm64: dts: mediatek: Introduce MT8195 LAPTOP and IOT's USB configurations Macpaul Lin
2023-01-05  9:28 ` [PATCH 2/3] arm64: dts: mediatek: switch MT8195 boards into different " Macpaul Lin
2023-01-05  9:28 ` [PATCH 3/3] arm64: dts: mediatek: enable USB device port for mt8195-demo board Macpaul Lin
2023-01-06 12:56   ` Krzysztof Kozlowski
2023-01-11  5:41     ` Macpaul Lin
2023-02-01 12:24   ` Matthias Brugger
2023-02-07  9:36     ` Chunfeng Yun (云春峰)
2023-01-06 12:56 ` [PATCH 1/3] arm64: dts: mediatek: Introduce MT8195 LAPTOP and IOT's USB configurations Krzysztof Kozlowski
2023-01-11  2:19   ` Chunfeng Yun (云春峰)
2023-01-11  3:53     ` Macpaul Lin
2023-01-09 15:13 ` AngeloGioacchino Del Regno
2023-01-11  5:37   ` Macpaul Lin
2023-02-01 12:52     ` Matthias Brugger [this message]
2023-02-09 10:44       ` Macpaul Lin

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=c834dc47-02f7-d6e0-60c6-ce42b3255c86@gmail.com \
    --to=matthias.bgg@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bear.wang@mediatek.com \
    --cc=ben.lok@mediatek.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=macpaul.lin@mediatek.com \
    --cc=macpaul@gmail.com \
    --cc=miles.chen@mediatek.com \
    --cc=pablo.sun@mediatek.com \
    --cc=rex-bc.chen@mediatek.com \
    --cc=robh+dt@kernel.org \
    --cc=tinghan.shen@mediatek.com \
    --cc=wenst@chromium.org \
    --cc=yow-shin.liou@mediatek.com \
    /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;
as well as URLs for NNTP newsgroup(s).