From patchwork Thu Aug 4 14:27:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 595333 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp484709maz; Thu, 4 Aug 2022 07:30:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TOvJ2dllSPyZJ/xuY6h0eGR62to6WqrSq3/8Rn7JIrJp8DPN8hAsiahybNEzunYV7Z4Cs X-Received: by 2002:a6b:c3c3:0:b0:67f:f487:987e with SMTP id t186-20020a6bc3c3000000b0067ff487987emr894550iof.0.1659623423531; Thu, 04 Aug 2022 07:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623423; cv=none; d=google.com; s=arc-20160816; b=Q8IVaEnm+rYp7bWeceI6f1HRzcR/PHtUGBzJrP0K/2kJ5wN4pvlKZBbE//a0g4+M2X PoKEMGclEzIwpC4iCP5/KSYzcGwVM1Mq3wG40BSIjCkhfSfJXs5rC/Y6eOzARQVXqfS3 ZOIKNKCsgdnd1sEflbjXh3YSEHr5Jn24/mGoyB5xfjBBaWA+jvtiCVwdzs67ztsoEJQg eA+iopcau2eNK/2BOKpBamcSi+ie3OPiE7QooprDXaffMzJf9oqW8qDazwsYAIDOILgE JWRpflLRMGmxz3jO8MpRklGXwqsVv4L5MDnhY0ic2RxDwwfu7r7y54oPl3A4RhqnaYby wFxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ww/ChQlSZtm4GQEIVVvjedI8VyEY7u19rBa29ITtpgk=; b=VGOBW0bNbIb9p8vsc0prUyia8l85dgYv91GuW5t6Rbe8eAov/+rz+CwbiJJBurdUcg Sir4OSFvYNkSr4dcboI+UJfUxAy+ZfoufWR7tULUrgjMr1KsbGrjFEpsAdkEhbpB/PQu bVmeEwNxuaAUhZ46KnbHF1R3uFpFxuSudv7XUYa516PBUj4Tcv3NrKDUGp0WWe+d+3Cr KuXQ9fbKYdydUbbJSQ+YfcfdpDwcQGwJggO6nRASEMpEOoJStfj6zzALH3Jxc78y+ols Hr5bdAKUhFNVomKx8pgNnVUXfwzUDbHlnBf/WVgSPZVf1AbpHJ9o8weUgQ1LA/z+VgAj 7Hvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FdTPhqnp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id i5-20020a92df05000000b002df0ad8e54esi1227505ilp.168.2022.08.04.07.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:30:23 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FdTPhqnp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E9A784878; Thu, 4 Aug 2022 16:29:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="FdTPhqnp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DCF1B84871; Thu, 4 Aug 2022 16:29:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7AEC384886 for ; Thu, 4 Aug 2022 16:29:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pj1-x102f.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so5857896pjl.0 for ; Thu, 04 Aug 2022 07:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ww/ChQlSZtm4GQEIVVvjedI8VyEY7u19rBa29ITtpgk=; b=FdTPhqnpiKUds1Kgni0fhHozTrH/EVZVsjgb8vK6HgRWlhWSpodgSYeNGZdEERWylS Y4Wwpu845WlXqz4o9s+TGYZAJCZ1dev8OOl8h/acjoLYEk9tbamqIyHb5J2u0zOp2SZL 9LkDDe+nxdrZZnCknPu3jYhsPF6f3VO+5kMyIW7EqWE1rxk7dCrrdLhAA/w0yZlvn1uF 2b8OnH3h1nc9u4iibOeolUcr1g+169IK9QWV9HYCRA2CIwtMRQ7daJHry+yCEQFBXPLj 5fDXFskP35mncSvQWYOMwVOy/UoF4IlkwjzpmlCldBQU2lK7Rf5in/9SF4sSg0RxcLIo x7bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ww/ChQlSZtm4GQEIVVvjedI8VyEY7u19rBa29ITtpgk=; b=nFRJa1l+nfeBJfwwiBy3l5tyE03lmAerxj0TLiJGbtQnQpXY+VcCtOcSnb+e6M41TX k+pTXjJGOvsEych1RuX8kQ082Iu/41d8jUmpNLc/EnAam28L7V2TDyaBG+ZP1KpcxPC3 uHhl4JANY8hCyUn3QQpmWBVsGKxAyUgfhFIILwyF9tAUtQrJHs6Mv6+Za9RcFyBY9FKj IcwaqXVfW7rqfjUpwDe1ZQjkqF9fzrBYZEGPbs+GIWe15WbCrkGxTceckElz2Tf2qu1T sDVUhY4Wg8TCqHZXW/VQyMevgOsE8I8srMFbG1KJFAbbDsVXKisyvrnYLDi2AuBwPOSD bmOA== X-Gm-Message-State: ACgBeo39Kjn7j02rc+BTCwg/NHNXolgAxF3P9xTNHcmUlHIOz6BvSMsh 0js39mRctOp/Kmgp6jArH+T70qwJ8bUKzQ== X-Received: by 2002:a17:902:b58a:b0:16e:f91a:486b with SMTP id a10-20020a170902b58a00b0016ef91a486bmr2229631pls.119.1659623352680; Thu, 04 Aug 2022 07:29:12 -0700 (PDT) Received: from localhost.localdomain ([122.162.196.218]) by smtp.gmail.com with ESMTPSA id h185-20020a6253c2000000b0052cdb06c125sm1013549pfb.159.2022.08.04.07.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:29:12 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, jorge.ramirez.ortiz@gmail.com, sjg@chromium.org, trini@konsulko.com, stephan@gerhold.net, mario.six@gdsys.cc, dsankouski@gmail.com, robert.marko@sartura.hr, luka.kovacic@sartura.hr, luka.perkov@sartura.hr, jh80.chung@samsung.com, nicolas.dechesne@linaro.org, vinod.koul@linaro.org, mworsfold@impinj.com, lgillham@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH 12/13] board: qcs404-evb: Enable USB3 specific PMIC GPIO Date: Thu, 4 Aug 2022 19:57:20 +0530 Message-Id: <20220804142721.536556-13-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804142721.536556-1-sumit.garg@linaro.org> References: <20220804142721.536556-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean For USB3 host controller to detect devices on the bus it is required to enable a PMIC GPIO: usb_vbus_boost_pin. So enable that during board specific initialization. And since this PMIC GPIO parsing is quite u-boot specific, so add a DT override to qcs404-evb-uboot.dtsi to represent usb_vbus_boost_pin. Signed-off-by: Sumit Garg --- arch/arm/dts/qcs404-evb-uboot.dtsi | 6 ++++++ board/qualcomm/qcs404-evb/qcs404-evb.c | 29 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/arch/arm/dts/qcs404-evb-uboot.dtsi b/arch/arm/dts/qcs404-evb-uboot.dtsi index c18080a483..c73d71e8c7 100644 --- a/arch/arm/dts/qcs404-evb-uboot.dtsi +++ b/arch/arm/dts/qcs404-evb-uboot.dtsi @@ -22,3 +22,9 @@ }; }; }; + +&pms405_gpios { + usb_vbus_boost_pin { + gpios = <&pms405_gpios 2 0>; + }; +}; diff --git a/board/qualcomm/qcs404-evb/qcs404-evb.c b/board/qualcomm/qcs404-evb/qcs404-evb.c index f1e6e7f7eb..249dca7e72 100644 --- a/board/qualcomm/qcs404-evb/qcs404-evb.c +++ b/board/qualcomm/qcs404-evb/qcs404-evb.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,34 @@ int dram_init(void) int board_init(void) { + struct udevice *pmic_gpio; + struct gpio_desc usb_vbus_boost_pin; + int ret, node; + + ret = uclass_get_device_by_name(UCLASS_GPIO, + "pms405_gpios@c000", + &pmic_gpio); + if (ret < 0) { + printf("Failed to find pms405_gpios@c000 node.\n"); + return ret; + } + + node = fdt_subnode_offset(gd->fdt_blob, dev_of_offset(pmic_gpio), + "usb_vbus_boost_pin"); + if (node < 0) { + printf("Failed to find usb_hub_reset_pm dt node.\n"); + return node; + } + ret = gpio_request_by_name_nodev(offset_to_ofnode(node), "gpios", 0, + &usb_vbus_boost_pin, 0); + if (ret < 0) { + printf("Failed to request usb_hub_reset_pm gpio.\n"); + return ret; + } + + dm_gpio_set_dir_flags(&usb_vbus_boost_pin, + GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); + return 0; }