From patchwork Thu Jul 8 01:08:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Chen X-Patchwork-Id: 1502063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=NTWU6WMs; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GKyq95w1zz9sXV for ; Thu, 8 Jul 2021 11:08:51 +1000 (AEST) 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 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(-)