From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5D3CC19F2D for ; Thu, 4 Aug 2022 14:30:22 +0000 (UTC) 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) 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-Google-Smtp-Source: AA6agR7ZmM8ozDzwVn70U8QIP+w9IOdDwYoAo/iATn668P+5Fwnoy7xq7FY4v9DJP8q38GF/YL6iqA== 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 Content-Transfer-Encoding: 8bit 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; } -- 2.25.1