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: 1954168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=dJ4OhtjP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.80.249; helo=am.mirrors.kernel.org; envelope-from=linux-pci+bounces-9417-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W9nlT2Wpxz20Xg for ; Sat, 29 Jun 2024 06:55:49 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 065AF1F2116A for ; Fri, 28 Jun 2024 20:55:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04AAA80BE5; Fri, 28 Jun 2024 20:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="dJ4OhtjP" X-Original-To: linux-pci@vger.kernel.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 861F780611 for ; Fri, 28 Jun 2024 20:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608091; cv=none; b=SqKFQyn4mzlbfIlhqGtsQkSgYRch52oVaR31AHOeJNohD+LUQwV9U3UyvNWxdDh+MYAG2U3jSDNwJ+lPR6ObvaxUphnIv4z3aCtIy4Q+izFLh49kzC5EoHvCEFU1WVjoiAFZoAKY2dqrEMyo+RcEz2hqXvxX6wCHfI4xi405pU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608091; c=relaxed/simple; bh=fdRkQB72RyDAksj7idY+6O6hOBdVeFQTfoinIU0zTc0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=Tc8tNS9OEXPUOZX3OQJmrsoi3S7Fx5JfhwS1JuD4oJES5wpwuKTvOhzkkyxfDw3Eft5yp3P/gRy0PdvX9ChcBT5fUVqkYS5ZMDh2+f0hN2VJXTQ9ngZi4peWBQowsjS5OGMs/mE1UZRUkI9qXCWpj5RLId36rSi7vQGcHrjYTBA= 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=dJ4OhtjP; arc=none smtp.client-ip=209.85.214.172 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 Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1fa75f53f42so6086195ad.0 for ; Fri, 28 Jun 2024 13:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608089; x=1720212889; 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=N7TGeRCIg7GQt07ZD2y/Y4ICEAWpnB+U2DlH6ElKDCw=; b=dJ4OhtjPQfDZsJbW/JcZaYueh0g1Uc6d+dtuEquOnH2UFVdq9lJQgLRa1QukRQu11N PdBMsjlKyxnKCCmOk4cleM941rDSaVbmD/47G7EOVDqMXIuGpfE8antUam2MYOi7C8Rw 7F1dBaFRQWQo+JYqj8Pq5HiXbpf8iigY/azR0= 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=N7TGeRCIg7GQt07ZD2y/Y4ICEAWpnB+U2DlH6ElKDCw=; b=OqzHFgAgPogl1InJ5X3FkIgGg4j2KQvcf3oE8gi4c1BJ4FRHUztxDOde17V8Zk/36M D6ikg75sHvWK1im1/iMDFpnFjeJvFVLSliHfUUmuNxf+oiE+P9/RBJm2wtHmhvWC9BM+ yCYwhX3aGTpPJ3azCcErsFqorXJMd3UfMgci2sByTmYqBnkjoIM7xu65myUxNGrPw6Wl LkDmFqdJAxaI8gm1e+cvYVIOpwn1vXJ0wrydEk+7O+Uv1lAnd+qDH4dqEnWMJxgDfqQg DiM6v7J5z7goCg74wgoSozLicX0VhpIF1dhussdAVZ/bVp93WC/97kgUoGIrgMY8kCVj L11w== X-Gm-Message-State: AOJu0YzGCGomj5849Zd2ft/Nc9MTFG0DMsV1X7JelwXXyHFbkOlinqws BpJDNwOkuA3/tYBrqWPH6CKlqaTUkCKws3+q8drqA3rTI9sig5by1NUPDxLH+0w6ELTZWKq5Vo9 D12BavnrnCDxP1U+9xm+KISy9GlHEtdJsUQj4KIhNjNVrML9bINibDl/IldzuwCET3gzucOmCxK hAya4FNh3pcYhV3f8wLocQ8xBq5RBUZvoOukLW4cU5SVB6WeDm 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> 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 | 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);