From patchwork Fri Jun 23 14:40:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13290750 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD3E2EB64DD for ; Fri, 23 Jun 2023 14:41:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230350AbjFWOlX (ORCPT ); Fri, 23 Jun 2023 10:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjFWOlW (ORCPT ); Fri, 23 Jun 2023 10:41:22 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA4526AE for ; Fri, 23 Jun 2023 07:41:13 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-7624012c0b4so60088185a.1 for ; Fri, 23 Jun 2023 07:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1687531272; x=1690123272; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=NXsIMdLVeqRmJLvAoHxSsCTJKyoULvGWQBxYVILJlHw=; b=KmXxf2GN07ol57yvkZVILQdt7IMRHcOHQ4wgmO+Dm9xQlGfuS4payO/AMWy0bdIQEW f6YcNPzmMDoRfTT8cUY2WgJB2YxmWMDI41WN7mmMAwVYd6xTToF/VnYCiLgzheG+mpKt AiAk3++rxE7MPUm6hJ7GEfrQJMiT19IrvVBDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687531272; x=1690123272; 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=NXsIMdLVeqRmJLvAoHxSsCTJKyoULvGWQBxYVILJlHw=; b=cSSkCSAGsmHw017yI//V0XI2Uk+lX2nUnyDExJHCWMt5+qQ3C0IbfIW6ZWC0EsWYpH eS0NdtdGtUCEZsQm4GjPhG1GgFM2RDpe10ad6xo+DYwyUEDLG3ZBlM9KuLwjAOHH1ETO noD1Y6FkMCviRQKCitNaVbUkhOVFihB2QCC4uOEg8eBKM7hZG1dxqeHfQEUxSIn5DGWY wpOvr3QhzIQlrITm/W2SGJ5fdZO6o5r2PqZ1X9EgaTy8fsBFJOzJTv7KMUHPZeYbIaKV tZlxG0RsUgYa1Yb7d4t+KWF8nYnkSFKx9DnExmUgLfL2jXbSJo7fDQwva4rlzGNL/d9M f5hg== X-Gm-Message-State: AC+VfDw8OXo9/WGhESfB1T5NXEMm90rRoNoDKh8dxOQWV9jdYqI7QFJ2 b1MecXCYBZDFdSQWb4KM3NEpdUFQqoQf5ZFd7aavs9KTqZwFxLVxMx5bweM59zvbPqtWaCAGoLR A67Qr1JvDcVEdslwrFN+H7VSsVf2/WER6hC1GsteJAauFlMEQ+14NuoS3nfq6cNOfyv71x79ulr EUOwYPuFg/VQ== X-Google-Smtp-Source: ACHHUZ7YaKrVqQ8QnvGuhcY3JvOvengIIXyMeQqiinLnw5eZIkQ6quN3qI+0+AoueIHKsYdVThZWIw== X-Received: by 2002:a05:620a:2955:b0:763:a83c:a9e4 with SMTP id n21-20020a05620a295500b00763a83ca9e4mr18146840qkp.31.1687531272243; Fri, 23 Jun 2023 07:41:12 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id i18-20020a05620a145200b007625382f4ccsm4564613qkl.69.2023.06.23.07.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 07:41:11 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com Cc: Florian Fainelli , Jim Quinlan , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , 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 v6 4/5] PCI: brcmstb: Assert PERST# on BCM2711 Date: Fri, 23 Jun 2023 10:40:57 -0400 Message-Id: <20230623144100.34196-5-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230623144100.34196-1-james.quinlan@broadcom.com> References: <20230623144100.34196-1-james.quinlan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The current PCIe driver assumes PERST# is asserted when probe() is invoked. Some older versions of the 2711/RPi bootloader left PERST# unasserted, as the Raspian OS does assert PERST# on probe(). For this reason, we assert PERST# for BCM2711 SOCs (i.e. RPi). Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index fe0415a98c63..7b698a9a851e 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -884,6 +884,11 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie) /* Reset the bridge */ pcie->bridge_sw_init_set(pcie, 1); + + /* Ensure that PERST# is asserted; some bootloaders may deassert it. */ + if (pcie->type == BCM2711) + pcie->perst_set(pcie, 1); + usleep_range(100, 200); /* Take the bridge out of reset */