Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BADDC11F66 for ; Thu, 8 Jul 2021 01:08:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8F90761CBE for ; Thu, 8 Jul 2021 01:08:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F90761CBE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0635382E7D; Thu, 8 Jul 2021 03:08:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com 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=sifive.com header.i=@sifive.com header.b="NTWU6WMs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20DCC82E4C; Thu, 8 Jul 2021 03:08:37 +0200 (CEST) Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) (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 2ADBA82E4C for ; Thu, 8 Jul 2021 03:08:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vincent.chen@sifive.com Received: by mail-pf1-x42e.google.com with SMTP id d12so3954859pfj.2 for ; Wed, 07 Jul 2021 18:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=cPp7bkgOfWI9+O3mik8iEybywApGdgsDbGgMSGmITIQ=; b=NTWU6WMsbycGMjWaGJ8mx6aT4Tf3I5Z9IDGqIX8aqd7xTAWsbD6imRYJ8ybJPwWEtY N9A3vIARSiUBkG5O3JtskvKrHHHhRfweDeM5B7ZXTvVFjg6t9qyh0uwuik0J2Favo/ea ywhobinWEBtS6t6QNNTPiNVo2WW2F8NojocmDHb1wlWw+d/YOmDzrl0X+jR+iHi+kNoz 2+AAOEBnyDd2T1mLZiMGDPumHwvJi7/XZj4P6cE99eExMQDjDpopzOR9iH80DH0f8GWx 8V9wovqVNzXXh+Gsy3VCMwgINpfZdfVtF3t2U68B3x9Cjj6YErIcAgt27OZ12X2Fe/RC cVuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cPp7bkgOfWI9+O3mik8iEybywApGdgsDbGgMSGmITIQ=; b=mOpM/Bp2z105lKzWzbtjSX2JuHjiAuOnuA25crfeKROvftWNje/ef86GhhyctMQfcA 8BUlMTKPYvKoH8OOGotoDB6PTRdV1WtYq5o0ZM7ptpsJ+Tl18HBp5GX0Nicvxq1inOA2 bnSsBcGu296zFG7Ii5S4lm11fkWam/aq/orecj8F6u68fBJTPI6GaygCaWSdp+cKPEs9 1s8vmrzqBFi7BE4MFKwbnQuEF3iVPDQsFxnahz3WpbiBvTb8uYRuB+zsZsZGKmLULFeo WjvccerKIe+8KBN/ImdEuwx1ztZPlAHbT4KW15I4bThGZNljToDO4yVPu8AE9mvfwza2 O6Hg== X-Gm-Message-State: AOAM532ie/nJ0PUQPNh/kUuj5jenJBCyTt0HwAylbEltKHX78bD2HWpw 6aA4yS+L7ydjVhT99nh6NRVz1A== X-Google-Smtp-Source: ABdhPJyS6TKcPcPJJwapPtKR2FIRNw7h+cKsZ3vHdYlP18umn5b0q+rcdVVQGNB8zsNtDylazCkFrQ== X-Received: by 2002:a05:6a00:180d:b029:319:c3d8:16e1 with SMTP id y13-20020a056a00180db0290319c3d816e1mr25804721pfa.3.1625706511415; Wed, 07 Jul 2021 18:08:31 -0700 (PDT) Received: from localhost.localdomain (111-243-35-231.dynamic-ip.hinet.net. [111.243.35.231]) by smtp.gmail.com with ESMTPSA id o1sm352321pjf.56.2021.07.07.18.08.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jul 2021 18:08:31 -0700 (PDT) From: Vincent Chen To: green.wan@sifive.com, rick@andestech.com, bmeng.cn@gmail.com, ycliang@andestech.com, u-boot@lists.denx.de Cc: vincent.chen@sifive.com Subject: [PATCH 0/2] board: sifive: unmatched: reset multiple devices in SPL Date: Thu, 8 Jul 2021 09:08:19 +0800 Message-Id: <1625706501-964-1-git-send-email-vincent.chen@sifive.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean In SiFive unmatched board, the reset of the USB hub, PCIe-USB bridge, and ULPI rely on the power-cycling. However, sometimes the rebooting is without power-cycling. To ensure these devices will be reset in each rebooting, here always reset these devices in the spl_board_init_f(). In addition, because the reset pint of these four devices incluing GEMGXL connects to the GPIO, the 1st patch creates a new wrapper, spl_reset_device_by_gpio(), to address the GPIO operation during the reset. Vincent Chen (2): board: sifive: unmatched: refine GEMGXL initialized function in SPL board: sifive: unmatched: reset USB hub, PCIe-USB bridge, and ULPI device in SPL board/sifive/unmatched/spl.c | 90 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 17 deletions(-) -- 2.7.4