Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp905445rdb; Fri, 9 Feb 2024 05:01:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXAkh0JdSjPQfom5MKWiHAJnGgJu6yerNxxXFoXZn47akty7ZCsgBWb4CVkLh55asJfW/V X-Received: by 2002:a05:620a:12f0:b0:785:b9cf:c757 with SMTP id f16-20020a05620a12f000b00785b9cfc757mr936383qkl.36.1707483697841; Fri, 09 Feb 2024 05:01:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707483697; cv=pass; d=google.com; s=arc-20160816; b=w2qK9vq3FBtQa7CvjrNr/D5cSjGg3r4Idt6VYHcq4KitKtiSuDdkYB4b7xxRrR87sr OHjX9QhLILjxlVZdrB/gr3tJidRNESzaFj8Gm8v096MIB+pTceS84Hgju7fONgPAk4/o As0UphLdmcoF5IRX+1aNoGiWi+B9IZKESeI4H/rkPdmq4tVO3XX4NwkqU+sI23/bhOVk s7clk/zlksXSHA6o0VgoM/gk+lVdATa+C0aC74TuyrO/QmPAtId+U7yK9imsIpMU7guz v5vTAU1sSUlWOcRk+Y6fxu/bTWCuRjK5s++FyicAu7DcHC4ui6ANeoXQnpRlBGzgqSpL 86MQ== 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=UyW8t9ipmQLZnkA/aOQn2Vo8vP1Ru+QSouzRJL2GvBM=; b=qlPkCl7V6uew/lVjbuxLSQtxWEZMgrhyRGmX01Q2ze1X00rIH8rYqGHFcRIlGBLXmQ r5JqaBySG25m/CWxBesFY4mkhrzE0myavxzmYbUB0Uhe5EZYCRdQb6cA/ij/3biA490D Mf/NarU8/qGaj9fXe6YbdtsBBbdVfBvNRomDyhI9ut9yyrQRxXSQ9Qt0GuOlNHOuOoU1 uSoKH2OkzwwxmKNj2RRYFETORX6xBwEiZHYY2kKwsrc+RkfSVKlVYy0MsLUo7RsiIdFq 5oOMzyVpC3velKPnFs4jVc8gLtE8nlkT87W81r6ltjIKAHo9OHdWqPxlkOspetr8cWVT /0NA==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCWsisIvuks3mV/3/VQA/ucPct+gODDRHz1vNGHy1pp66t9yDdv+9lyriWtCKXEnDt6NEVeMZ+cYj7F9Wkr3K3UX31jx60NVxJ9iQGSo1A== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o22-20020a05620a111600b0078328d65c15si1862908qkk.476.2024.02.09.05.01.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 05:01:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59329-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 80E431C21305 for ; Fri, 9 Feb 2024 13:01:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B550376F6; Fri, 9 Feb 2024 13:01:29 +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 Content-Transfer-Encoding: 8bit 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 */ -- 2.34.1