From patchwork Fri Jun 28 20:54:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13716591 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 4C9C2C2BD09 for ; Fri, 28 Jun 2024 20:56:00 +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=RSJ/7YV7RfugDDy/Fc3McZqvsJoao6Gc7nt5PCdXSN4=; b=OOXXpsAdly5TFDfD2nSqA7Cubz GlvLHzejwrJQ3vO5uYs6ZTrf82Y3G/8IvhFQBCWrwbYKuNb8uP+UJ8BUg4XdfOuy1JVOPj4lp1S9N LbPPM0aRq11+NtOd+hWRfJPUYptxwLp9atV7tu+YISGCWZ6MofNYm/wC10wdNuWXlmq9qHlwGhOda shPXLqTX7MIpstIIKuu9+F53pXQP/hmTvQ8JvYnN4IDrRLqnYi6jf1grgjfoM7RCmoXSQe+OCc24w 1iwAAgCDWmSzEgESGPMy+4diwtCc2DnGIHol8WoRicSQll/EEdTCkSZ6mT15mwU+lGPnVhBuCU1QY GgimMJXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNIdK-0000000EvYB-0OuH; Fri, 28 Jun 2024 20:55:50 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNIcM-0000000Euzq-1IOk for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2024 20:54:52 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1f9b364faddso7393785ad.3 for ; Fri, 28 Jun 2024 13:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608089; x=1720212889; 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=RSJ/7YV7RfugDDy/Fc3McZqvsJoao6Gc7nt5PCdXSN4=; b=N7GnsFn7Ws97ZfmqZS5+cuuJ9Awb7cC1fEtk+t4xKqFKDDy6kL2ATf4gWeJPKc69LY O7WqmIEu1Y0RFL+6d+w9FbS67YIxmxu6EvicItA/ssLKCeTZd/FpTwU39U7vyXfXvuao fXXxYMLF6+aIqisMFpZqpmPs3v4END8MFnFfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608089; x=1720212889; 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=RSJ/7YV7RfugDDy/Fc3McZqvsJoao6Gc7nt5PCdXSN4=; b=JYhCBTgftZPAMVXUH/He20joS9mcwvDZRcvDOp1vFF6rLDHrk6dy/zH0JuL3EJO/c4 sj/HRzt+v8mVxZ1+aGpYjaArkaRRtvfg2bcb2spTQCWxzrWhPrB3DJFfKzyGHMCnwSTQ /YhRlRACPgd58MMGNkvueAOAC2RahvqtItCF8Kt7rqmfKytvyzcqBg/323Wp/Yy0JuB/ HiBAR3ORj+KHkeSTXcVBAeQSNthY1/+6vKT86suEaYR9mAMLQGrqwd/rpbDu7XX1U6nY 4iX6KGEHPjyc0hYOz/xZBE/aPzC6fJZG2j9SCT1rF8HmCM+lqHJ97WV+yQEfUu4uToTL +Ijw== X-Forwarded-Encrypted: i=1; AJvYcCW1RllAFq03p4aMldp2buybd9/Sgq3f3s8Sr88f3e74+FGd51XZYjlZodO1F9G+rZRiizQcSabOYsd7OWJiGKiUAdrNnqjfp7vDFemJRk70lC2cSHE= X-Gm-Message-State: AOJu0YzSzWtdlzKvVtN4IT2GfxAgyqndi0URMHfh6HIegzouSv5ZGRm+ AVNDu94vuy17wLu4J3z0dv1VWaERegd49iUBPn6pfIvdKaql/uIt7YdAZ9SfLw== X-Google-Smtp-Source: AGHT+IH53+z3u40ypBPUnp1e3vEo5MfhKqeiN52/BbM9xTHnKLTKgtdLAteEEpEEBJewCFPGreBQ7w== X-Received: by 2002:a17:902:ec8e:b0:1fa:2099:5c18 with SMTP id d9443c01a7336-1fa23f269aemr190937555ad.26.1719608089092; Fri, 28 Jun 2024 13:54:49 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac15393d1sm19695135ad.157.2024.06.28.13.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:48 -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 v1 4/8] PCI: brcmstb: Use swinit reset if available Date: Fri, 28 Jun 2024 16:54:23 -0400 Message-Id: <20240628205430.24775-5-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240628205430.24775-1-james.quinlan@broadcom.com> References: <20240628205430.24775-1-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240628_135450_442512_E97437DF X-CRM114-Status: GOOD ( 12.16 ) 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 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 4104c3668fdb..0f1c3e1effb1 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,25 @@ 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; + } + + ret = reset_control_assert(pcie->swinit); + if (ret) { + dev_err_probe(&pdev->dev, ret, "could not assert reset 'swinit'\n"); + goto clk_out; + } else { + ret = dev_err_probe(&pdev->dev, reset_control_deassert(pcie->swinit), + "could not de-assert reset 'swinit' after asserting\n"); + if (ret) + goto clk_out; + } + pcie->rescal = devm_reset_control_get_optional_shared(&pdev->dev, "rescal"); if (IS_ERR(pcie->rescal)) { ret = PTR_ERR(pcie->rescal);