From patchwork Tue Jul 16 21:31:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13734975 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 38E2FC3DA59 for ; Tue, 16 Jul 2024 21:34:17 +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=pyhhOODC/8sUUbxWirdXml2txfy4nRmAniqkd0+qhxY=; b=URCjqFLUnip2CvdeuQDEa0jNfe La6K1LGeH87P56JwTKYU8uWEwlm7aJd7WGnwrUR640Fn0yhZQHOLfYuH9QlGh23uDqNn1XXNRojkq R1GP/YhNoADcfsj5jbVw43HplJzyxsX8rXz7DFVKBXRjnnGFx7GRo26MEbMoC0Om7KnjTrP9PgSTa //I3rVoXdwJ/ReMhTiW4KifJbpF0W3kasBueZPtEIJ64rxkdtg0P2BitIMIiDOG4xlz/Bs9vGLfdO 5ARav5dhwo2u585tTaJopbCPXL0d91PaB7N7ibjwOxSsrf85cl3K/6P10aoKhT+O53oHGY/fRmVu4 bUFqpOxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTpoE-0000000BqEh-28pe; Tue, 16 Jul 2024 21:34:06 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTpmA-0000000BpFf-16Io for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2024 21:31:59 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-70362cb061aso3305990a34.1 for ; Tue, 16 Jul 2024 14:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1721165517; x=1721770317; 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=pyhhOODC/8sUUbxWirdXml2txfy4nRmAniqkd0+qhxY=; b=QgFOnLyRmOuX+OUi9IOnbgOOnemOLY57EXrGyljPgKoqJJf0pxJbVZe/7ULhRWZJvo Lctyv4cKoZphFz0AuqcbsleVOG6P3tmP0K0DWsbSS0zppFi1X5aATrX2skK/6hLrjp3o ZCOhI3Mm6ucGd5RSn7cVycmPtDfr6ou8WpcD8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721165517; x=1721770317; 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=pyhhOODC/8sUUbxWirdXml2txfy4nRmAniqkd0+qhxY=; b=hID7mz5ce7lOziQ8/sWABztg5IONC14LIzaU0I3dAoJKF734Oh1sJhdULsb0RTRk9+ FgY5l9PgL1+julCgY9Gzk56rptBPAGlZvZaBm049NXvLzPsR1/bxsOvFSocWo6+l9ADz 3O9BziwuoTGNh5KSg4Vc5kMsPEom9bSh1kKBUhXeIK8JFOW3hhTRYZivqiYp4iPnI72l HszFPurYhyhhBC0gUMKI+bZss0SsfF/NTjYYJgeud1GKOFyLb2vK03yzprYe2IuRGH/B GS4Ut8ZsUqcylhzBgxENCIuM68bkhWvVge1iNXooFgrbR9T9qqj07CZyVbtr+4j7UfQE AEbw== X-Forwarded-Encrypted: i=1; AJvYcCW+alE3WVQjhKuvyHgDZib67dJiMBSJP58c8+m2rF8Py4m0cpseRwJLT9iAz5ZIrm9zdJ+xaJAAIzRhBVJ4Lcxz2VzQFmkZ09jbRLy18tu8/s0g+Hw= X-Gm-Message-State: AOJu0YzCSvpeRGstUPjPgacC/M2QoXxAfWQ2Q2q19rgdDB7PqNlb698s 92JeDKcnTmAVVCwFKtdSfufsuxj4qCRPj6l6JjF+/sElnGskZBvjQVQJusxKKQ== X-Google-Smtp-Source: AGHT+IGyvYI3DfDEeXUXLaFD+3RzhfvFtKKmjP11NVlZDdaMFKZ7eqxSsGXCqSDwk+jvWaZ5X+QkeQ== X-Received: by 2002:a05:6870:c1d2:b0:25d:f8bb:c0b1 with SMTP id 586e51a60fabf-260bdd0b0b7mr2808568fac.2.1721165516721; Tue, 16 Jul 2024 14:31:56 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b7eb9e20fsm6812828b3a.31.2024.07.16.14.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 14:31:56 -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 v4 05/12] PCI: brcmstb: Use swinit reset if available Date: Tue, 16 Jul 2024 17:31:20 -0400 Message-Id: <20240716213131.6036-6-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240716213131.6036-1-james.quinlan@broadcom.com> References: <20240716213131.6036-1-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240716_143158_316718_405F33A8 X-CRM114-Status: GOOD ( 12.56 ) 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 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");