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: 13722647 X-Patchwork-Delegate: kw@linux.com Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4092C18E74F for ; Wed, 3 Jul 2024 18:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720029795; cv=none; b=VerN6KfQnEhdrtrLpFDPzeWB97asiD+rWhVJNUI0ktuYZOYo+TSxsQOSWwcEltTSbtFZ5csVaEZnsIQpjVOlBG8c8q1k1F1VmkEyQ9xyBvKQk3By1NyOa166ieA+dx2BTZfDwi9TVfJwewNFByHiMXWIcZ283anvjbjp4jlZx04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720029795; c=relaxed/simple; bh=EOBPDqQqQDFulKiEDsOnfn0KPzEZSlf9FosuyHy70c4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=q/Gex97A6rMIhYxCRYvJJKYLGB/Vsbt3pGvKku5dlbMzeO69TspJfv6Ad//AxKJcSU98gNe3JJJoy5B9m4ISsJOKQm8ALe2Vj+wMNjSFfeCxzQMFY3kVMJiLflFE7Exu+aJSvZokn+/7uFqxyccIRlMfU50FNc3GdKfRK2+76Ec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=O7E+qaDT; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="O7E+qaDT" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6b4fec3a1a7so29245676d6.2 for ; Wed, 03 Jul 2024 11:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1720029791; x=1720634591; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=1VgxPgTdcfjix69wlc3tPzvP/XhSowoH2KTpY8LIcCI=; b=O7E+qaDTb5gavIVMSPF0lsUUZAByRiC6Wd8b5mX/mUt+rtDIdglG0JV2fMJaXVYkok VS2FDBh8tgwmy1EanuaLbmqVheqCPtqWxP2o0DwHoMgfzIYh5wYnj6ZcS2jaJyrodbO8 ULza5SX7ajAaVouhlgzxvmEYsr41/nhACvRvE= 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=1VgxPgTdcfjix69wlc3tPzvP/XhSowoH2KTpY8LIcCI=; b=WmE4rtwhPE6EnTQvJ2ItyA8W937f/U0XpE6e7iaUdq/B+8NZ0Q3RrZw69Bpb9cTR1b y2pdmBrnkqOnwFh2pU3k061wznOQMcn1i7qzkPAghxfGjdLr7z1axffpA72jyw3IuzzW lgQ94ny3DOzc7Z9U+OQ2BJ27E5aRH1ActWV0KxReMiUgbiENsVkjS3KLdSicHOfqGH8d C96IzafkM03NJh4u2O1D3WU3kMwTONCXDejh6daJSc7hx0sXFxZdyIIGjvINXiaziVMs TKoq09uaTrYoZ7y6xeKO4lSJ4Tqc0t4vP95pLk4MEiCFS7lxbQdzP4d4/lhhT9zpMfKm xYfQ== X-Gm-Message-State: AOJu0Ywu0J7QEN+NbRt8KqpuXKHYWqhZYZfrU0phhiSU4e2myiLpsvwc elTMZJlVwjuMAfrzObwQguBLKPJ/VqRNBRgKjv5Bb4ObeyUbbLAG8UPsq0g7p3h9Hmtk21909iP YTULPbd6uZ5+Z00r6upYOdM9pCe9wlY4rj5G/kX2eFDdDka/JMt4WvltjT4Oo6A9IbHvhCBs37S WxKBgv974LMQBcbku1mP0ZT4IINGtfiLfnHKsx1i3Qnla0vvmr 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> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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");