From patchwork Mon Apr 29 10:35:48 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: 13646592 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 A8294C4345F for ; Mon, 29 Apr 2024 10:36:20 +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=WzOhbmyJYpHOC6xXZWMx4QtdNUEyhzOcmuiF5U7SQ/I=; b=2KMfk5vp+8cQ2Z GrrCYAa6y1Gic5K84aF+rNcPYfDqP4e+wvvT165RCoCW8Gj9w4OfVVa/0VxC79v/p/9wkSvBANIao lXy1T/rTTaHm1aZ8DFHq6onH4KQ7EyClulOIrhD3KS7CkOEykeAwaPkEOFCekT8jfv5kq8pT+AIHP A3eE3YUGQ+uYBE9hzrCTC/rDpY/+R14aetQeu/uJfjQcAf5qwk5UsVz0l5X+9q4FbQ+uic6+TXS81 yc+OWidjo+9pZ6WrMih/qurpmMJeRQS6dzxzsI3Nte+tb3TCKuq3jFQ5kgDL+jpFcCVg9rYf32bd5 PhQJwnQfYmBWGthVc8Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1OMf-00000002IOd-2OxW; Mon, 29 Apr 2024 10:36:05 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1OMY-00000002IKl-2IZc for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 10:36:02 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a56d7d457a1so506463466b.1 for ; Mon, 29 Apr 2024 03:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714386951; x=1714991751; 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=D0dFudsAqmrLZH4yacrFdeMowSooBD8BjjmtuCZ0i58=; b=KG2HMRl30OroE9MJlGItFEVeIL0RbAvT8M+sx8xJoGIMDnqSta3TiWircMh8ne3Y2Q oLs6MnodlNd86OFJUwlECNBs0AjJmR8fMJve9oVegDXrJGYe2LIJtO5EjOGNxkU7afrB zdKFvXHAXF9+BgHe+EG5Cod9Ds94/wkvf7Vdc+11QH+oa7ycXRhzI4CNftItnAAxboyI MJ8LB+U3Ssh+5Z2JuPdzXFT5TZpkVdnMZ2fsIoyujO7GyDNHhxIofjB8d6CngkfilPro cbmJ61b4M39Lf82PV0y3xrfcZ9rHP7f6+bEUykwAQnGahHyGyrKmw/XQn4ALjya1GGaJ Vvtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714386951; x=1714991751; 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=D0dFudsAqmrLZH4yacrFdeMowSooBD8BjjmtuCZ0i58=; b=VZW4dg9dnTztLwpBW7VQ9OilbrqCkkczCPSBqCOlDo8GOK6GRnkEDcdJ8fiZW06J+t wucUvxJ3foFtfz0Jb1aCRuopoegRLya0mB0Dq25pDYSF+Y1CsxzEEmUp1xmNIQihQmpW bhQ/ZFuLTLWUsGoAphb6aUdJIPSy8wRff68YdE7my/Mrzq3P/yeqLehbRHUOD1kyUMHn 0ioXJatDrNlXv9qGdNd80THyZ87wH3E3Fby/tz75S9RRXJmSPrMUrLK8swo2kofrpu47 z5E4MmHWqGo//zUl0Yl0rkA/UrBU+QDi1+NIqLaiJBC6fHK0TFn/lECgAxRY59lAWJxr ZV6w== X-Forwarded-Encrypted: i=1; AJvYcCUCcNDfw8nMjVH7BnFu2yqpC44TR6d2+6S5jd9eNn9eDeuMHa4XnmPpAHGHO9W8GWRpEAKiO/WDdqVuFmKHJw41USXyLanJJd7nqOX5wwsN5BvdQG0= X-Gm-Message-State: AOJu0Yy9szbQOHQnJh2en5cdG9tOZRh3qSSh5ZX/5rBmDcnNx5DBcTN9 rU6pDChrVDyDiY2hd1PlWJkqE2ZKHQV7b3WDxjgs2CmVBFzDno/2518k9q2fiGE= X-Google-Smtp-Source: AGHT+IHX5e2PjT6Zi7stQ95VQoSVfBeNDqewVXxb9OK/UqHotHHp8TPzAVv7FQ+J+dvjMqI50M/e1A== X-Received: by 2002:a17:906:e2c3:b0:a55:b520:766 with SMTP id gr3-20020a170906e2c300b00a55b5200766mr6201811ejb.0.1714386951265; Mon, 29 Apr 2024 03:35:51 -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 a7-20020a170906670700b00a522bef9f06sm13717707ejp.181.2024.04.29.03.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 03:35:50 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Subject: [PATCH v2 0/2] enable USB on Pixel 6 (Oriole) Date: Mon, 29 Apr 2024 11:35:48 +0100 Message-Id: <20240429-usb-dts-gs101-v2-0-7c1797c9db80@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAV4L2YC/3XMyw6CQAyF4VchXVvTlomIK97DsOAyQBPDmCkSD eHdHdm7/E9yvg3MR/UGt2yD6Fc1DXMKOWXQTc08etQ+NQiJIyc5vqzFfjEcjYnRyaX0xEXR0QD p84x+0Pfh3evUk9oS4ufgV/6t/6SVkTB3wi3lBUt5rR46NzGcQxyh3vf9C/tOfk2rAAAA 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-20240429_033558_805139_6DC1490B X-CRM114-Status: GOOD ( 12.60 ) 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 and DTS phandle references, this series depends on the bindings and DTS patches "dt-bindings: clock: google,gs101-clock: add HSI0 clock management unit" "arm64: dts: exynos: gs101: enable cmu-hsi0 clock controller" of the series in https://lore.kernel.org/r/20240423-hsi0-gs101-v1-0-2c3ddb50c720@linaro.org (which have been merged to linux-next already) Furthermore, it also depends on the bindings for USB and USB-phy which 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 and haven't been merged yet. Signed-off-by: André Draszik --- Changes in v2: - fix commit messages - rebase against 20240429 linux-next - Link to v1: https://lore.kernel.org/r/20240423-usb-dts-gs101-v1-0-3421b0371298@linaro.org --- 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: b0a2c79c6f3590b74742cbbc76687014d47972d8 change-id: 20240423-usb-dts-gs101-4269e0177c0f Best regards,