From patchwork Wed Jul 10 22:16:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13729759 X-Patchwork-Delegate: kw@linux.com Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 D399B142E67 for ; Wed, 10 Jul 2024 22:16:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720649805; cv=none; b=LXMpsNqKftiVtGuMydK+tVd0/llJmZd81InD1Kw/8MaTYKM1FRUrp1FtvX+DW7DkHb5cVHIvwok23zG6tgnsXO8zcwF1CZvO49Dpsk8ivHy3POiToqaReG8a8NtHejMPnjOpaLPJs/uASPwZFkdT9qDSk45nQZN+4f0kpVBp3F8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720649805; c=relaxed/simple; bh=Dq9GOQpAPrDAG0qsQLg/mJWjNex2SKN/Iw3ys6E/3Eg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=nNDzRah3L9rggIokbvkWi/DZ6JkWCQ97iQWTU/Sc6RNWPZQqJUhT/aDSkw8WDTCvCUR7g3HWzIhDv4KvXK+TJRefqf2ofGwB/O2uXd66Mk5dKrvSkCzcXuN73fjtVPM0Betc8S2OCQpuyKat3S0fmLHGRFTcAq1RNHWyxsZW0sk= 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=UQQ3BOu3; arc=none smtp.client-ip=209.85.219.54 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="UQQ3BOu3" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6b5f128b199so1925676d6.0 for ; Wed, 10 Jul 2024 15:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1720649802; x=1721254602; 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=mEoArsvRDEBEBIRrEglQTyUvZkKcZfTjZczzIiu7Oak=; b=UQQ3BOu3JEeVGrI8SQck5OgmIhZtaPP1FU58R3wQcTNKyTjWfDLvgIr9ovlMoJSsKW Cu26R1FB1ekGWJlepPLkwbYN9BBPPNgfeqh1wY1yH0BYAyAoUuFAhsKkfKMdQeeXmKNk I8DojH3eTsionYcnzxttFTrty5bzmZ1EPxEkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720649802; x=1721254602; 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=mEoArsvRDEBEBIRrEglQTyUvZkKcZfTjZczzIiu7Oak=; b=WadZFiUo7ol7eG3JAzpnzGr+lDj5OrAp1KIyjpkU3PHz8w0gd84K++51Oqbc7ixi4R pzd4OV3X4QP8Pbo+XkM2snsT8/qIfuEE7ix1HunoS3XxCOtALz2QciA6s2VTcQvIUNya 2T+l0nq4wtq2aiXo+uWEDiWpHw6tegCqMZtkWYSnTqpxzXb2DWGIpFKvajt36bKI8Ze1 +E7eysi242Yob+ZBwUHZoHN1CQSFlgGCKyrsVK0bjGc/dundGINkWhFNK/NMAK5YIfQn ZznIWZc98xkgmMfBGH/pf27uFGYO+EUOH/dNV8Jlp4gPj+yNF1Ti4KgyH7QrIvleKQ0b xk/g== X-Gm-Message-State: AOJu0YwYkuOFa+08MgbeCQWMTLLypoC19TyJ2Wb2LyxlaN5eHfP9AyTq YnnYUmz4xhAIk7v6p6vuMSzxun9X0TCldhRZBG7G+H4kw+48LvGxhjJlDpIy2s9Ck8luOcIluTM KH6ir2ILuR8L5ZmmWaEtgtoQ+/KbvI+96WbJ1uXGyTqwV4cl/hi0QlldbRqdS8tmHy+bG9OsQ1q qqHRqP4aVOWG4FPuevoYUOX7YWN3Oh9ArfwCTcmKvnkLGLRnO7 X-Google-Smtp-Source: AGHT+IEeVUPlnNidAa9SALkkKZQJNT6/gbAlf1iNlCDge62/953JXBjPRy9yUAZ9n3SwyY9QXW6cSg== X-Received: by 2002:a05:6214:194c:b0:6b5:e190:437 with SMTP id 6a1803df08f44-6b61bc83574mr70828616d6.12.1720649802322; Wed, 10 Jul 2024 15:16:42 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b61ba04c16sm20182326d6.60.2024.07.10.15.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jul 2024 15:16:41 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Stanimir Varbanov , Krzysztof Kozlowski , 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 v3 05/12] PCI: brcmstb: Use swinit reset if available Date: Wed, 10 Jul 2024 18:16:19 -0400 Message-Id: <20240710221630.29561-6-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240710221630.29561-1-james.quinlan@broadcom.com> References: <20240710221630.29561-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 Reviewed-by: Stanimir Varbanov Reviewed-by: Florian Fainelli --- drivers/pci/controller/pcie-brcmstb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 92816d8d215a..4dc2ff7f3167 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; @@ -1633,12 +1634,27 @@ static int brcm_pcie_probe(struct platform_device *pdev) if (IS_ERR(pcie->bridge)) return PTR_ERR(pcie->bridge); + pcie->swinit = devm_reset_control_get_optional_exclusive(&pdev->dev, "swinit"); + if (IS_ERR(pcie->swinit)) + return PTR_ERR(pcie->swinit); + ret = clk_prepare_enable(pcie->clk); if (ret) { dev_err(&pdev->dev, "could not enable clock\n"); return ret; } + 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");