From patchwork Wed Jul 3 18:02:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13722661 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95EC1C2BD09 for ; Wed, 3 Jul 2024 18:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gmOF3C/tJRdC6RQ/w0/bkN//R/qMRJQWlkFWQpdmfOs=; b=wAyKG3cbXwP9+SmXngulhv9VPx YVWzWjon2fRutHY3qh8PWm1wlD2q5m0vAKVX2snwOrsno2kSAR6ZNg53uvXghX/BQ7W8IV8S7Vf3x Ml2boJLdL1xQuo5FlaHTeyzNRR20Wr62ZqY97YdtkEtjtidC+8BqtH+xibGifbObgrWq33Vda0PPN 7WGndmD6DMc9Zk5K7hreundZXMqIc5UOkX1o5Io0p3z9AC2Zof9LOPh+c/p6BKjZiXPNr5fg+P+3y Z3lB/HfkfJJ6M6HaA7gMbrdZAVnZG6cd2kgwJ2YvixHUdi8fTaGUIsxQ9UDKhij4vE5/iyV87cTdF kHRadlPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP4L4-0000000B5bU-2ZJx; Wed, 03 Jul 2024 18:04:18 +0000 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP4K1-0000000B4zU-0jD5 for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 18:03:16 +0000 Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-6ad86f3cc34so25460806d6.1 for ; Wed, 03 Jul 2024 11:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1720029791; x=1720634591; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=gmOF3C/tJRdC6RQ/w0/bkN//R/qMRJQWlkFWQpdmfOs=; b=E/xFivcEcIrSPKCzUlfLzunv2DPBzrr2PCL8q+uWE0zy40qrDL7QlA5rPjyBp+9QBr PeiP3Od1SwdD+rsqZK7PqfAGGArcsc51ZTXPkYQF5GRJRbt6q/QRy2oSQjD6wvI7BxQQ 7Eq95X3C1Vr2FhJNMxLes0u7/gRNSiXYI3bxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720029791; x=1720634591; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gmOF3C/tJRdC6RQ/w0/bkN//R/qMRJQWlkFWQpdmfOs=; b=QYGVy8KDXRm7OXsF5x/DLJHcpSWx9p0xuI7Wx9JOhJNqtV8cFDSy5Z9z/FD0pn6JIB JA4TOHfe+c3FmDqLhafZtR71IGUOEFLXcNYxdfNx0OZUmsTWdq4r7QcD4Gpd+ryu5Yfl HTQekRxT9qKLlyAkvYLXVAhYBIqJUZnSkQmse/8uWYMt+fZMgqgohws6VriLJKjyrK0n m3nXK/CP70KpSh8d6okhWJyHGeTMGGnSvTo6AJEcRNNRIpMk2NyXHf5l81BT9UhIFWyv UEaK3H7tQZly98lwRNo/mOYQWegFDpQ8vJ94M86vZWH3SOFRVKlTpP/1yrqt/kk1S4Tq uFOA== X-Forwarded-Encrypted: i=1; AJvYcCXGkdYl87H6dvFXKugN1A/Yxf28tqGBs2S41YxaHtySrE67YnTuDt2AhZgzTGcTdbeP2N40ZhBTS0ogI5uyVC+7KAg4mdNyeUgoZdKj/nShB6zExRM= X-Gm-Message-State: AOJu0Yw+r1RpFEh1dVuzpdKpufHvPDzIepFxEImUSSY+VIP5vRorg6Dt vlyaJV/yONIkbyG6Eluy17QtYG6e7WdNb23awKOA/IztqEsCT4iOE1mMnOUoUw== X-Google-Smtp-Source: AGHT+IGDIenXr4YjMW4GwoxRbUQJpTRRQmg2sDYstsvk38qnq4s2NTVKbFtCbvE+st+pQmHWAmeV/Q== X-Received: by 2002:a05:6214:2521:b0:6b5:238:2e42 with SMTP id 6a1803df08f44-6b5b719d2bbmr155619166d6.40.1720029791001; Wed, 03 Jul 2024 11:03:11 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b59e5f1a6dsm55589626d6.83.2024.07.03.11.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 11:03:10 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Stanimir Varbanov , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, james.quinlan@broadcom.com Cc: Florian Fainelli , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Philipp Zabel , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 04/12] PCI: brcmstb: Use swinit reset if available Date: Wed, 3 Jul 2024 14:02:48 -0400 Message-Id: <20240703180300.42959-5-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240703180300.42959-1-james.quinlan@broadcom.com> References: <20240703180300.42959-1-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_110313_281786_C8779398 X-CRM114-Status: GOOD ( 13.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The 7712 SOC adds a software init reset device for the PCIe HW. If found in the DT node, use it. Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 4104c3668fdb..69926ee5c961 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -266,6 +266,7 @@ struct brcm_pcie { struct reset_control *rescal; struct reset_control *perst_reset; struct reset_control *bridge; + struct reset_control *swinit; int num_memc; u64 memc_size[PCIE_BRCM_MAX_MEMC]; u32 hw_rev; @@ -1626,6 +1627,13 @@ static int brcm_pcie_probe(struct platform_device *pdev) dev_err(&pdev->dev, "could not enable clock\n"); return ret; } + + pcie->swinit = devm_reset_control_get_optional_exclusive(&pdev->dev, "swinit"); + if (IS_ERR(pcie->swinit)) { + ret = dev_err_probe(&pdev->dev, PTR_ERR(pcie->swinit), + "failed to get 'swinit' reset\n"); + goto clk_out; + } pcie->rescal = devm_reset_control_get_optional_shared(&pdev->dev, "rescal"); if (IS_ERR(pcie->rescal)) { ret = PTR_ERR(pcie->rescal); @@ -1637,6 +1645,17 @@ static int brcm_pcie_probe(struct platform_device *pdev) goto clk_out; } + ret = reset_control_assert(pcie->swinit); + if (ret) { + dev_err_probe(&pdev->dev, ret, "could not assert reset 'swinit'\n"); + goto clk_out; + } + ret = reset_control_deassert(pcie->swinit); + if (ret) { + dev_err(&pdev->dev, "could not de-assert reset 'swinit' after asserting\n"); + goto clk_out; + } + ret = reset_control_reset(pcie->rescal); if (ret) { dev_err(&pdev->dev, "failed to deassert 'rescal'\n");