From patchwork Thu Aug 15 22:57:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13765271 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 A55DAC531DE for ; Thu, 15 Aug 2024 23:07:22 +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:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iEyfkuyjidIDKVD0EgGnVsHdeDp6cB5THGfAbkbJ5pQ=; b=Hq6ko3qAKNqySxqR6td2vbduuP hucSwiBuEdegGA6XvaKNPPjTVQGArHWsUjO/Z9fGbIJgCGfyRWr7zXSIck9YAO/5acn4GiAsZk5mu 38JOW5ruaODY5abg8ABJdjL88YCQe1YEM7WxQsMcm5zI51b7sefvcTtqE7nb74dZgx+F2HbYEscx3 iwV3F60D9dFziDgUp4/yiySa9ngymymhuQD0rHmcLV/FMErgrQTjeLaY0f6/HYbYHuE7I1dUVyKYy ibnZCLmLchcpK0VzKLyWytwDPx3YpiNfN8Ohg2KCSdLhIL6X+Kf+VcRudh+Uf5Q49lHf7Gx2XNkTn LmODj6iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sejYk-0000000BGNu-21xw; Thu, 15 Aug 2024 23:07:10 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sejQJ-0000000BEGd-43C1 for linux-arm-kernel@lists.infradead.org; Thu, 15 Aug 2024 22:58:29 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2d3bae081efso1043870a91.1 for ; Thu, 15 Aug 2024 15:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1723762707; x=1724367507; 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=iEyfkuyjidIDKVD0EgGnVsHdeDp6cB5THGfAbkbJ5pQ=; b=I//rt+rpvtre4ecMdXPgZOYkCiTcdzmTqQLdHymtC/QjxLH4T1YdmL+/zLBlaTz91P p6HowAFfguBeu/lSTvQMSiKzzK10ktyZDshIYSNCXZ5NguZJmm4Cf7PWRSy7qS0jTAoS ojqKwOKDN2ZLUVmKy99wG2wH8xjxCQS8JLfos= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723762707; x=1724367507; 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=iEyfkuyjidIDKVD0EgGnVsHdeDp6cB5THGfAbkbJ5pQ=; b=Uecsh/u0rRmotkxKm5ftVeEPaS+VSp9FDyp85US3gumyVXiyJYxn3f4ETBXnOvRM0W eBHaU6UB4Yy0h41MELXnlLz8MGhA3zOzaW0d/gLjhxbaCq2RYhLMMSk2CcQgOlxN15HM oHLnRzHzeAGHIK0S6p6XhALbxlCvrLJuKFSBQi408vvbA39m+zp5oTobjAWE8ahePu7B iFWV9roBBTmCBVPzbPwcfGfw9c2Ex/9Zm9j49pm3Np3HeeKE49gP2Aw6h0R4vCMoWL+I 3KImGGe/k+NhWVM3PkXJGFGqLOMaOtQCSaYueOp5d97YbhpW6LOEMZy9q7eDhtLT0ZwJ GOYg== X-Forwarded-Encrypted: i=1; AJvYcCWpQTVUfmbUclE9E/RmajahF1CU0l32svqenRGqFxhXh4Z+5CcRcYssnM+DtZ6kDc4oEIK7xTSi0jrHYGNid3PPhUwsX1YGCETJzDP5nIoO81Xip8U= X-Gm-Message-State: AOJu0Yy0P0X20N+X1qoPWT9Bv/Zd80QNf8paby/OIkczs6S9xqQojNM4 /EJ2WU47zMMagjVpx0UQwupZTz39SUt5oOi0Dr43lEIsGMlFKDFsUSDO6uZm6w== X-Google-Smtp-Source: AGHT+IGXdJjw0jDnc/rZ+TElPH5EDfkpxHpnAawNeGz/KmJkADzTu0pSSxdB5tMFhph2VdZ64qjpwA== X-Received: by 2002:a17:90a:8a81:b0:2d3:d0b7:da4 with SMTP id 98e67ed59e1d1-2d3dfc7a8f2mr1274469a91.19.1723762706894; Thu, 15 Aug 2024 15:58:26 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d3e2e6b2d1sm373997a91.18.2024.08.15.15.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 15:58:26 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Stanimir Varbanov , Manivannan Sadhasivam , 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 , 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 13/13] PCI: brcmstb: Enable 7712 SOCs Date: Thu, 15 Aug 2024 18:57:26 -0400 Message-Id: <20240815225731.40276-14-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240815225731.40276-1-james.quinlan@broadcom.com> References: <20240815225731.40276-1-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240815_155828_067759_091EABB0 X-CRM114-Status: GOOD ( 14.42 ) 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 Broadcom STB 7712 is the sibling chip of the RPi 5 (2712). It has one PCIe controller with a single port, supports gen2 and one lane only. The current revision of the chip is "C0" or "C1". Signed-off-by: Jim Quinlan Reviewed-by: Stanimir Varbanov Reviewed-by: Florian Fainelli Reviewed-by: Manivannan Sadhasivam --- 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 26e8f544da4c..21e692a57882 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1203,6 +1203,10 @@ static void brcm_extend_rbus_timeout(struct brcm_pcie *pcie) const unsigned int REG_OFFSET = PCIE_RGR1_SW_INIT_1(pcie) - 8; u32 timeout_us = 4000000; /* 4 seconds, our setting for L1SS */ + /* 7712 does not have this (RGR1) timer */ + if (pcie->soc_base == BCM7712) + return; + /* Each unit in timeout register is 1/216,000,000 seconds */ writel(216 * timeout_us, pcie->base + REG_OFFSET); } @@ -1674,6 +1678,13 @@ static const int pcie_offsets_bmips_7425[] = { [PCIE_INTR2_CPU_BASE] = 0x4300, }; +static const int pcie_offset_bcm7712[] = { + [EXT_CFG_INDEX] = 0x9000, + [EXT_CFG_DATA] = 0x9004, + [PCIE_HARD_DEBUG] = 0x4304, + [PCIE_INTR2_CPU_BASE] = 0x4400, +}; + static const struct pcie_cfg_data generic_cfg = { .offsets = pcie_offsets, .soc_base = GENERIC, @@ -1739,6 +1750,14 @@ static const struct pcie_cfg_data bcm7216_cfg = { .num_inbound_wins = 3, }; +static const struct pcie_cfg_data bcm7712_cfg = { + .offsets = pcie_offset_bcm7712, + .perst_set = brcm_pcie_perst_set_7278, + .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic, + .soc_base = BCM7712, + .num_inbound_wins = 10, +}; + static const struct of_device_id brcm_pcie_match[] = { { .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg }, { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, @@ -1748,6 +1767,7 @@ static const struct of_device_id brcm_pcie_match[] = { { .compatible = "brcm,bcm7445-pcie", .data = &generic_cfg }, { .compatible = "brcm,bcm7435-pcie", .data = &bcm7435_cfg }, { .compatible = "brcm,bcm7425-pcie", .data = &bcm7425_cfg }, + { .compatible = "brcm,bcm7712-pcie", .data = &bcm7712_cfg }, {}, };