From patchwork Tue Apr 23 20:52:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13640721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D0CBC04FFE for ; Tue, 23 Apr 2024 20:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Ogy8Jlglkx205pmkgD/+fcpxWI+Np0U+psuyrswL92E=; b=tQ63s1jx9aP1U0 oO6x+elfJJWiCMrnycvTiSSPtXag4gi21nTj1282OoNe3fvyLi6Pedh9quIeKZyQWb3uVuEtXa8uZ p0HAGurJyX8D0t52zosEuPNHfWCU/NRlArJghS+z493It1V+ppHsuxydXsFgx2J5znEZpOpMWoE3e +IZeMKj7ZW2Se6r6sQeUYckXe9ZlNVsW4qwU5mUGwT8MIuWfHiOO5Ppw9Nu8XU2hoGH47ADOTEbwr SdOUade7toCyfDiPrZ5OPFdD2Jq0pKvlo488eeX7mQG9eJR62nZah9zTvBYzg6M4Ckjj2rC2NGi2t 8l0ZBfEPOhTUcOTIKf4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzN8q-00000001UdN-2wzd; Tue, 23 Apr 2024 20:53:28 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzN8K-00000001UJb-34cx for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2024 20:52:58 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a55b2f49206so44497166b.1 for ; Tue, 23 Apr 2024 13:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713905571; x=1714510371; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=enKb/FePM63duYlRqV9Qk3Sv4AxdpT2UptzUIV9J624=; b=DzJJRy4tkTpP4eNQ47a153/o8w+4ySQZxgE7xcmtcX0j6yrJBYQ/lYTL+QOJ/sGEsc oLsA1UjAMImMc3Vek3SojQK0vP+iBIAJT+4AaOmT8o6oI3cTf5caoFn8e6eXhqq7WEsz rkOiv+n2xe5JA9hZd7446XuO9doAHNi9MHYR/ZDjYLy3ZEuFRYKRHy4SVs4EUpol5Rkn 4pEV5Bg86mazumyeZg9uBdVZ2zKUTINphj4WhpE1TkFfV3GDWQ0lv2MVhGQvBMNYTWx4 BJ4HN7hinD7x1SHI57+uITRaRNx5GCSDvEW9clc4Tt4wrw90l/ytb3kEuYh4LHQlySZc HE+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713905571; x=1714510371; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=enKb/FePM63duYlRqV9Qk3Sv4AxdpT2UptzUIV9J624=; b=FAjLWCtKDbP0fJh+liDbVU5xOD4e1uQS6jh05AzIbmqJb3+tMs4dPyEco8btPuSsnK m5wgWM3dah4Glbvno6KgSDuEkmeJqeXhFxk41VTxIz9/hBheWTV0J5GuE/H6FMkNVBVV y48TBSF/UJcGvbfQuuzagZx8TzjUJ6i7nQ3oGhOFUvQrls9cuyHJr9y48tXblOmxDqKA iPfEyZuh8m+/BTp1dEUgf8dVzdix9gZVGruX9rxLxvyOKFKoGwc+QwuzgXze5/LrdaNo aYrGTCc6S5LoGbkELE4NuCB4neIJaTDv09vVY88mfaoyhl5kYHyXC7+YxpjJc71pQf+H up4A== X-Forwarded-Encrypted: i=1; AJvYcCXEf19ehi2vHKg5/419nPFCUrFmyenHoV4Y4LJNwsQBA0N1JqaHn/UEKSMEDv+ldgenWcOGTzFMaCA2dZ4lKF4SuX0JyA56+MHpzbQHX0CghhxRbzg= X-Gm-Message-State: AOJu0YxGaCSoi2ooXTc7VmDipq7oG5/z3opdg4souw0ExtW1xUnsBR9Q zCXPlfKURFiR/2jpt/Jqx0LFMUrsoVJF4MHZZM+q4i2rqe6OD81bsBFRfzTBTAU= X-Google-Smtp-Source: AGHT+IE5ZEFfPw9z6hVQ6KJ4VDfJlUP0PDE9gbusrIEU5+zuqqJGyyYKlrOwD4UvxqV9eS82lWjsuw== X-Received: by 2002:a17:906:30d0:b0:a55:aded:200d with SMTP id b16-20020a17090630d000b00a55aded200dmr533206ejb.12.1713905570797; Tue, 23 Apr 2024 13:52:50 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id ww4-20020a170907084400b00a51d88e6164sm7443632ejb.203.2024.04.23.13.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 13:52:50 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Subject: [PATCH 0/2] enable USB on Pixel 6 (Oriole) Date: Tue, 23 Apr 2024 21:52:47 +0100 Message-Id: <20240423-usb-dts-gs101-v1-0-3421b0371298@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJ8fKGYC/x3MQQ5AMBBA0avIrE0yrUbDVcSCGjUbpINIxN01l m/x/wPKSVihLR5IfInKtmaYsoCwDGtklCkbLFlHzlZ46ojToRjVkEFn64bJeB9ohtzsiWe5/1/ Xv+8HWsKQDF8AAAA= To: Peter Griffin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar Cc: Tudor Ambarus , Will McVicker , Roy Luo , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240423_135256_962226_B4D251E0 X-CRM114-Status: GOOD ( 10.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These patches enable USB in peripheral mode on Pixel 6. We can only support peripheral mode at this stage, as the MAX77759 TCPCI controller used on Pixel 6 to do the role selection doesn't have a(n upstream) Linux driver. Therefore the role is defaulted to peripheral without any endpoints / ports. For the same reason, we can not detect the orientation of a SS USB-C cable and therefore it will only establish a link in SS mode in one of the possible orientations of the cable. In all other cases, the link will be HS. This series has a dependency on other patches, please see below. I have mainly tested this as CDC ECM Ethernet device using the following: mount -t configfs configfs /sys/kernel/config/ modprobe libcomposite modprobe usb_f_ecm mkdir /sys/kernel/config/usb_gadget/g3 cd /sys/kernel/config/usb_gadget/g3 echo 0xadad > idVendor echo 0xddaa > idProduct mkdir strings/0x409 echo 01234567 > strings/0x409/serialnumber echo ADADAD > strings/0x409/manufacturer cat /proc/device-tree/model > strings/0x409/product # create the function (name must match a usb_f_ module such as 'acm') mkdir functions/ecm.usb0 # stable MAC addresses echo "6e:27:3a:b9:40:87" > functions/ecm.usb0/dev_addr echo "ca:49:84:b0:3b:bc" > functions/ecm.usb0/host_addr mkdir configs/c.1 ln -s functions/ecm.usb0 configs/c.1/ echo $(ls -1 /sys/class/udc/) > UDC ifconfig usb0 192.168.1.2 up at which point the other side should detect it and network communication becomes possible (once the other side also configures its network interface). Due to the clock IDs, this series depends on the bindings patch "dt-bindings: clock: google,gs101-clock: add HSI0 clock management unit" of the series in https://lore.kernel.org/r/20240423-hsi0-gs101-v1-0-2c3ddb50c720@linaro.org The bindings for USB and USB-phy have been proposed as part of: https://lore.kernel.org/r/20240423-usb-dwc3-gs101-v1-0-2f331f88203f@linaro.org and https://lore.kernel.org/r/20240423-usb-phy-gs101-v1-0-ebdcb3ac174d@linaro.org respectively. Signed-off-by: André Draszik --- André Draszik (2): arm64: dts: exynos: gs101: add USB & USB-phy nodes arm64: dts: exynos: gs101-oriole: enable USB on this board arch/arm64/boot/dts/exynos/google/gs101-oriole.dts | 24 +++++++++++++ arch/arm64/boot/dts/exynos/google/gs101.dtsi | 41 ++++++++++++++++++++++ 2 files changed, 65 insertions(+) --- base-commit: a59668a9397e7245b26e9be85d23f242ff757ae8 change-id: 20240423-usb-dts-gs101-4269e0177c0f Best regards,