From patchwork Fri Feb 9 13:01:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrejs Cainikovs X-Patchwork-Id: 198851 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp832311dyd; Fri, 9 Feb 2024 05:01:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgQaujUmoHyFUcMmoza4N0ySy/7RX5tLpkwuBpM1g9wqgxY5xQn9/EU5Evf3QYsjxllUA3 X-Received: by 2002:a17:902:e74d:b0:1d9:4d3f:cbf8 with SMTP id p13-20020a170902e74d00b001d94d3fcbf8mr1478461plf.22.1707483706113; Fri, 09 Feb 2024 05:01:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707483706; cv=pass; d=google.com; s=arc-20160816; b=wKmyqs5JWGXs9xFrN+Dvuzty+dfkDCNvEJ38T7kXUginZ+u8s5QYRIzq3ARhbmVeT8 zz462vVc8TH5URORFQLoXQcGKpLN4cTmTt5MSO5ZVMXR708J/dAAUqFJAs8Gp/knCmbQ dCOmJ8HLViPncpMFutMlCliPVel6Il9VGvuOJW3qdt+vscNdgFTnOo7Y7jYauOWx+V68 4x7AgoVnJ+KguoXALCOgKBH52ZnOlBDcenmFmjsDi0wivwMdKmWp5dgs/fg2Y3agThNw 3hGmCurw7KP4hG5/ehzOXPSHzsTril2kvQMqWfQWq33PRw1BmdPFlGYrvgOb7O21maaT Qa6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=+YxIlgX7MIBkIsXwFEBQ3cAM8/Vkesj2iwEzVJ+cQz8=; fh=dXQFUKLdwzNElP6P4lpw34AJoLcyj4FuW8QfwtkEeCE=; b=y4mlumqFGW9oEvMoOtQgh3r69AqezXUoqmc56T3QyXSwMX6OxnsxlwfFfRA+HNnIB/ sUcQU5s5j3loO4rWIyYozHhoYI8UfqXx/wCUzyLkh3ulHrNH6NeTmcSN5v3sHN7K0yVV Jq0IsDAk8xmEDFztJbHUUOhlk3QY2Pna5kdVU2k8VEQSi1i9uzQVw0QU9Y/inuHA+guQ udU1068/oegadKSoI79+AeexRFrIctIaNH3T5WN3ltJMJGg7lm+FoRjKH4QJGp0i8979 26ZxKNIkw/SCJW/MmYy5ryUy+SrWvGiCnN3pisYKkm5ErMaXI2pN2Kkxh2xYaCUdwhA+ EXvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=d6yUl0uX; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59329-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59329-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXG2qHF5LJmf6T/4h4LxJJSDRnqilUSIe6XsGgT3LcRm46xxUw06tOpkuqDOiL/iE7qt4y0McYZiEzAqGfv4WnMTDXNtg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i9-20020a17090332c900b001da17808d86si256805plr.142.2024.02.09.05.01.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 05:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59329-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=d6yUl0uX; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59329-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59329-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D8D742878CB for ; Fri, 9 Feb 2024 13:01:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5596837718; Fri, 9 Feb 2024 13:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d6yUl0uX" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D89C2031E; Fri, 9 Feb 2024 13:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707483688; cv=none; b=R7DNRu493FGUe4BFZT8mG97Rifjm5xPrhmMHaY0h+Ghis+MC9GFBvpMjc1EwN6iW9XvUFgVeLvB+3npQCsPDa0YaTbWTyNOuRVq/WWkBCNMFCLbUOW3OHZ1GKtjguE3nhUoCwfwWRvWIDYVaC2LzpidlOStc7KD0vFADSkFqGnM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707483688; c=relaxed/simple; bh=AdnfAMS7dtM1+VGdSOASt/rIq0mXghN2Y1xkeAMn750=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=cHZamyq1XqDvryDVJ/3dpx7SRj7UHryf/Tac1pPtDR1LFBKLhY4BIlgoTW1Thz3vVvL3Bidak9wTZTStBLbyhgL+86t8JkO5seJjtqtJJKlddwoMxn9Ug+Zs1A4557QHSOdKa/w2LWqbr26zrhpi7uJtULp4yWizivx6Yic7nFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d6yUl0uX; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5600c43caddso1135040a12.2; Fri, 09 Feb 2024 05:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707483685; x=1708088485; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+YxIlgX7MIBkIsXwFEBQ3cAM8/Vkesj2iwEzVJ+cQz8=; b=d6yUl0uXbn2FwodfC1nMax+fqvBGpiKmJN8HU1wT0DWle6m+0ylq3N5ZUG5/vnJQuU W64EAeucqDSPtYo21kx0YimSDvCbVGN0PmJmskvns+Hy54+GgZrt7BLxM+kHfKJmpbvM 1nUhMr1yCRavIO3t5V2Zu7AeEQV5H9ADqgM/5XjLNm7fHhQMETQw5gkNo4iC4rWLJqQA 9cmp5zTpmHYWBy1HbVRiDVIRld6ti/8YaGQrzTJyGpskZ2s5XjMI6ugS4X7IAlzBIwaU cqP3NPMMSvz2lgpTGRffyXFF88Ai4LIJ/KRz4o2z5U+XzLE4EPtJ0H9kS+ag8fjgiYQI KFbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707483685; x=1708088485; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+YxIlgX7MIBkIsXwFEBQ3cAM8/Vkesj2iwEzVJ+cQz8=; b=piWn3WXl4YcjZLCUgiUWh7CDexTbvcTeJnisFpJy4d+0XfZe59GFM241K/NAeOBT0F D+8PpbCGdmSY1RZvmTJqR48+xjq13erTenR5ZF2cqrNDcWFzLFSkrsm2CjjPj79FyRMx TzYPYrZzEAZE5PCdAtk2nE3ETT8Xvs9sCANiSPY1OIM8BeOnci/Jid9XMStqtemV0mWk c5a2Qd+1q4kJEotztsb0DmmMM3jUD29zPsQXqm9fjyC4GyHl2QHDmfEIu/26RbOpdlNB EhBNgmEhOw1/8d5C1ZbhDt5beCp6XWLlVy4mgZ9h0oTua6xjOyufGf2AUP/RCN//BgtK n3KQ== X-Gm-Message-State: AOJu0Yy9c+jFhJ3UwAsYxLKYuj5NQfpcMwuY4Bgm904VpGVZ7q75iSBu EEDalgQlvHq7U7dp0l8z8WYgS9BmvIT7jcUUmH63OqaUoO6Pd/44xeFoddQ6pRM= X-Received: by 2002:a17:906:3650:b0:a38:8b64:c8ef with SMTP id r16-20020a170906365000b00a388b64c8efmr1078126ejb.74.1707483684602; Fri, 09 Feb 2024 05:01:24 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXVufDQMr8/+3ia87L8TOJiU5fLNRJSmugCcDcTAH16AQjsNZzvdfBHSYbYRSU//tCqRvzbsklBRzUzbDyaVUNt8cXyW/wto/9YeljLexszAGcsWBOoPpi4cIRIl8nOhocSG53iy11HoWVclJo3o8lH48tBxzyV8H/K42w68f2xaX2/D26sdJ3tHLiP8BUS/dDj0Ac2vENtMuzy/HxIiLPaDsOODFASdOBRPHOhGlWtfmtlJ+3hr+vREc4iqSetpV2Q4T9SFDmRWHo01meYHRrxNhwD/7/pB03xXdI0F9VqmZWEKq5ltIW9cgVdjTtR/SXdKqqAOWCEiERqS9zNLNYjCq7KCtmGSOB/1uRTbGUv5c/5D6i81ct8pPXMU80= Received: from andrejs-nb.int.toradex.com (77-59-154-235.dclient.hispeed.ch. [77.59.154.235]) by smtp.gmail.com with ESMTPSA id cu2-20020a170906ba8200b00a37295502c0sm739495ejd.138.2024.02.09.05.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 05:01:24 -0800 (PST) From: Andrejs Cainikovs To: Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andrejs Cainikovs , Francesco Dolcini , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] arm64: dts: ti: verdin-am62: add support for Verdin USB1 interface Date: Fri, 9 Feb 2024 14:01:06 +0100 Message-Id: <20240209130106.38739-1-andrejs.cainikovs@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790426434519036598 X-GMAIL-MSGID: 1790426434519036598 From: Andrejs Cainikovs Add support for Verdin USB1 interface, implements role switch functionality using "gpio-usb-b-connector", VBUS is also now controlled with "regulator-fixed" using a standard GPIO. Signed-off-by: Andrejs Cainikovs Reviewed-by: Francesco Dolcini --- v1: - https://lore.kernel.org/all/20240209110500.22193-1-andrejs.cainikovs@gmail.com/ v2: - fix GPIO naming as per rest of the file --- arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 55 +++++++++++++++++----- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi index 6a06724b6d16..7e9bdba438b1 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi @@ -42,6 +42,22 @@ aliases { usb1 = &usb1; }; + connector { + compatible = "gpio-usb-b-connector", "usb-b-connector"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb0_id>; + id-gpios = <&main_gpio1 19 GPIO_ACTIVE_HIGH>; + label = "USB_1"; + self-powered; + vbus-supply = <®_usb0_vbus>; + + port { + usb_dr_connector: endpoint { + remote-endpoint = <&usb0_ep>; + }; + }; + }; + verdin_gpio_keys: gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -151,6 +167,18 @@ reg_sdhc1_vqmmc: regulator-sdhci1-vqmmc { vin-supply = <®_sd_3v3_1v8>; }; + reg_usb0_vbus: regulator-usb0-vbus { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb0_en>; + enable-active-high; + /* Verdin USB_1_EN (SODIMM 155) */ + gpio = <&main_gpio1 50 GPIO_ACTIVE_HIGH>; + regulator-max-microvolt = <5000000>; + regulator-min-microvolt = <5000000>; + regulator-name = "USB_1_EN"; + }; + reserved-memory { #address-cells = <2>; #size-cells = <2>; @@ -436,6 +464,13 @@ AM62X_IOPAD(0x0244, PIN_INPUT_PULLUP, 7) /* (C17) MMC1_SDWP.GPIO1_49 */ /* SODIM >; }; + /* Verdin USB_1_EN */ + pinctrl_usb0_en: main-gpio1-50-default-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x0254, PIN_INPUT, 7) /* (C20) USB0_DRVVBUS.GPIO1_50 */ /* SODIMM 155 */ + >; + }; + /* On-module I2C - PMIC_I2C */ pinctrl_i2c0: main-i2c0-default-pins { pinctrl-single,pins = < @@ -660,13 +695,6 @@ AM62X_IOPAD(0x0038, PIN_OUTPUT, 5) /* (E24) OSPI0_CSn3.UART5_TXD */ /* >; }; - /* Verdin USB_1 */ - pinctrl_usb0: main-usb0-default-pins { - pinctrl-single,pins = < - AM62X_IOPAD(0x0254, PIN_OUTPUT, 0) /* (C20) USB0_DRVVBUS */ /* SODIMM 155 */ - >; - }; - /* Verdin USB_2 */ pinctrl_usb1: main-usb1-default-pins { pinctrl-single,pins = < @@ -1013,7 +1041,7 @@ &main_gpio1 { "", "", "SODIMM_17", - "", /* 50 */ + "SODIMM_155", /* 50 */ "", "", "", @@ -1428,11 +1456,16 @@ &usbss0 { status = "disabled"; }; -/* TODO: role swich using ID pin */ &usb0 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_usb0>, <&pinctrl_usb0_id>; + adp-disable; + usb-role-switch; status = "disabled"; + + port { + usb0_ep: endpoint { + remote-endpoint = <&usb_dr_connector>; + }; + }; }; /* Verdin USB_2 */