From patchwork Fri Jun 28 20:54: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: 13716579 X-Patchwork-Delegate: kw@linux.com Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 0DE327E575 for ; Fri, 28 Jun 2024 20:54:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608082; cv=none; b=K0hh3tMuSeTBArZ+p5wxiXCm7ErJf04QiACizkLMq1S3lVub9/9j1UawKrHtxW+zuApfKdaVLffsXDmTte5Jts/Jz1Obtw2MCTKFeP0UO2mzBILCji30QwFB/WluvrcFfTKF7xtO2OZXeR1OafahOX0t1K5T/8rLh6RVvQkraKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608082; c=relaxed/simple; bh=NpKNPAK9SFpgREBnScc6c+zCnjj6qTmN1JrfSND8fKY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=X2NY7sCzw/9ypnODj+GRfDXle4DyWgmsSXkVSCTIo9LNNbiS78jMXQn5MFTLu/GOuADEMW0EI9VR2E6JvN1EWyfkLnRd5G8d8Ssiqb9L3+d5XPLIXB0D8gOz0HLCJcC/afDnWxVqK9wQ7di5iSQFoA8yiE+S941mUJrCa2nxzXE= 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=aH/r3Zed; arc=none smtp.client-ip=209.85.210.182 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="aH/r3Zed" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-706738c209bso737972b3a.3 for ; Fri, 28 Jun 2024 13:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608079; x=1720212879; 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=9ATakf0/bXioqD2/+MWIhrZIrGn8Z1N41QP03O3hKD0=; b=aH/r3ZedRwA457MKrbUHV6oSNksW5Kntj438OTgI2p2GPNlaVnc2XXFtNnLUqFsmN0 1pTfy8ribXAQbA3ENw6UtP50zewZFz7XuqxY7gYCrsYv2ejGnGETAxZuORg/cgFuKSVn e72yGVPbD+cVEeiEAoDpJCiQEfamAj828RDQE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608079; x=1720212879; 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=9ATakf0/bXioqD2/+MWIhrZIrGn8Z1N41QP03O3hKD0=; b=G0wd6/6b9sm4fyiTHjespzgEhFc2g4w1aam2jmRok3XR1wyP/sDROjnq7dGkhbdswS LAyZwMwpWJRWAhMeTw2HvMgf4b+5GcsDqaOuUvvIjN2M9agW5mGcCwRFozOeDp5OzWSu NyazBHOKPXpEDIDJ4jv4B8XOEUbDO63Kl5GjWcwv05Jp7XDwfNyR8U07owk0DQsWcH6u XYs/rsgBJPQAmfGxMOx8Q8+3yH99utQkfgbJsihNWi/0eVTvANY2maq9guTYjd2dOfOq zbfqK7QcSpZeJfJvRuAgmd8iMClM6ZAjoxdWIKrW221S80Kd3CEdHIb9f4Vm/SmNx4G1 Z4AA== X-Gm-Message-State: AOJu0Yw1B/Mr2wpCABb+Z1l67Eo7uEp8uYvolo/QSkqMlUT4Ku8hhv8l mZgl6PDQ62UPPoQTKH/A2zs/efqfhE6iAKYiFo/wDDnmB53KQLf20i4erHQnGxZ/4DOhke+n4Pf D/hC0X99f2paoRpEk9Tgxq8Sy/B3pY04HSHpMq7K7Y2JOVMQ+wp/UFkCiSLSHdRWTpIvcMjQMCS a34M2KRrecOOzoM9usLxrtw/GG8984SwpilPxIMAcLO8gESw/g X-Google-Smtp-Source: AGHT+IHJTcY6xTX84sUUetr3pzucd4fpSz0k01OozAgZGD+D7jjywHWfurr6UZ013/P9Y2VjKMtzLQ== X-Received: by 2002:a05:6a21:6d9f:b0:1be:d161:47ee with SMTP id adf61e73a8af0-1bed1614c55mr7756687637.30.1719608079265; Fri, 28 Jun 2024 13:54:39 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:38 -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 , Krzysztof Kozlowski , Conor Dooley , 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), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 1/8] dt-bindings: PCI: Add Broadcom STB 7712 SOC, update maintainter Date: Fri, 28 Jun 2024 16:54:20 -0400 Message-Id: <20240628205430.24775-2-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: - Update maintainer. - Adds a driver compatible string for the new STB SOC 7712 - Adds two new resets for the 7712: "bridge", for the the bridge between the PCIe core and the memory bus; and "swinit", the PCIe core reset. Signed-off-by: Jim Quinlan --- .../bindings/pci/brcm,stb-pcie.yaml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml b/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml index 11f8ea33240c..f594fef343a1 100644 --- a/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml @@ -7,12 +7,13 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Brcmstb PCIe Host Controller maintainers: - - Nicolas Saenz Julienne + - Jim Quinlan properties: compatible: items: - enum: + - brcm,bcm7712-pcie # STB sibling SOC of Raspberry Pi 5 - brcm,bcm2711-pcie # The Raspberry Pi 4 - brcm,bcm4908-pcie - brcm,bcm7211-pcie # Broadcom STB version of RPi4 @@ -146,6 +147,27 @@ allOf: required: - resets - reset-names + - if: + properties: + compatible: + contains: + const: brcm,bcm7712-pcie + then: + properties: + resets: + items: + - description: phandle pointing to the RESCAL reset controller + - description: phandle pointing to the BRIDGE reset controller + - description: phandle pointing to the core SWINIT reset controller + + reset-names: + items: + - const: rescal + - const: bridge + + required: + - resets + - reset-names unevaluatedProperties: false From patchwork Fri Jun 28 20:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13716580 X-Patchwork-Delegate: kw@linux.com Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 E8E407FBA8 for ; Fri, 28 Jun 2024 20:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608085; cv=none; b=NVtz2vT1m9TQ5DyWKSIvzUWLKDA5wT5NoBMFx5jo6OGwPmPdaZpifrqn4XZzUwfIdLgu+vGq1gzu1r3ySsn8mPARpwJIlwaD0QPmeOyZIigxP0DZ5LQNZ6Pn7cy+AU9Qq6zQQEc/Tl6b1in6r4W5dBd6K7gGYmb4/tfzUPcvc0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608085; c=relaxed/simple; bh=rC++sZ1RZfxUIcMgS1w64RKH29YFR4Pde3aMM5NpvsU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=GN6oGeDlR1jR/7ivYgPbO6XTtDGzFtMoQs2yoIRT3x5w/knOQMHo3wk07B26i9kfsza1mDL+6lL6bvSYwadmZ+SmuebwKdPrJkBwiTfZ/EB6/6WT0cC6o9DtcqdrTt+2Dn4vPjYibqeZnZnc02JQlvgAZLYfJp4L3b2mO2ADBko= 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=Y33ERjkH; arc=none smtp.client-ip=209.85.210.175 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="Y33ERjkH" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-70670fb3860so803681b3a.1 for ; Fri, 28 Jun 2024 13:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608083; x=1720212883; 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=7ylex07+kfE9xuykW9odNeRYshlqzTBnx28DddXYqQw=; b=Y33ERjkH9iJ5+AsE30y0Zzx7GaIHkfo5H+S9ypIm8T5xT5YuAMF0ImgCOF5wQ3eaLy NgUER0dNxTVgY8+Tjmivjc7RkiCmQhJhJGcESym47v2axKRyzSlDDMw82ewdrfUUmcq5 RNz/07UwheVBJilf6LZsG3IkDRxqGORHlSjR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608083; x=1720212883; 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=7ylex07+kfE9xuykW9odNeRYshlqzTBnx28DddXYqQw=; b=PJF8AaNZhEnwVCS3t2WsufVEjhwgl8yip1VyKxx3YcAMqTwAk31WFQuW1Jj/BwKc17 jil8nMjb7QMQWmDZm3p0LLQP6yTCknZsu9q7mzROq2W6GqcZTVmAU+Y2tnHi0laamDLI rDtcNfIkCCeRKCN5YAInm+rgfyQA3RGj8zBPSTkS9N1mB0kTs6Uzu+kVC/VR9p//0j0e 4pben6JXufzrkDnVJNeux0s+7LErmwCHkWAsHk4AGhD9LYckushjIXsMpBsHe1XAa34o l/HGZa8mwLmcTZ5IRe9XTyZLGaclchm+hgsPgXr5s4d2nO+xf2mDexKSpogNAY43ff9R vFNw== X-Gm-Message-State: AOJu0YxQ6v4MpnD6zFKNtGH60iYPQvvrhlnqrweHBntQOxCAy8Svcf9R PEeWm4g9eciGC693Qu5SSivgcPkd3HJQqgTkIZVgVsiOkK59YSEmYXeQEOcpJxbaJy0a5yBT1O8 gGyDTyV4PSnnHXdjrTDWszBJ5iOisejh2huKQIyubRd1CaVXTJVIFRUCvadj1/d/CtEJzk8vgg7 jWNVRTn3KkijIjfDhctW6lSP++10eDHo7oAvLRLk4jp9FMW/XR X-Google-Smtp-Source: AGHT+IEjEyzsDfVcrmM1ByRve/0wh2Kf3Gn6sPZupq9P8Kzpcsawn6x/9OP/l3k9kT5VC/EiWbN/+w== X-Received: by 2002:a05:6a20:734f:b0:1bd:2b58:c62c with SMTP id adf61e73a8af0-1bd2b59f156mr12722475637.53.1719608082554; Fri, 28 Jun 2024 13:54:42 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:41 -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 , 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 2/8] PCI: brcmstb: Use "clk_out" error path label Date: Fri, 28 Jun 2024 16:54:21 -0400 Message-Id: <20240628205430.24775-3-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: Instead of invoking "clk_disable_unprepare(pcie->clk)" in a number of error paths. Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index c08683febdd4..c2eb29b886f7 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1620,24 +1620,25 @@ static int brcm_pcie_probe(struct platform_device *pdev) } pcie->rescal = devm_reset_control_get_optional_shared(&pdev->dev, "rescal"); if (IS_ERR(pcie->rescal)) { - clk_disable_unprepare(pcie->clk); - return PTR_ERR(pcie->rescal); + ret = PTR_ERR(pcie->rescal); + goto clk_out; } pcie->perst_reset = devm_reset_control_get_optional_exclusive(&pdev->dev, "perst"); if (IS_ERR(pcie->perst_reset)) { - clk_disable_unprepare(pcie->clk); - return PTR_ERR(pcie->perst_reset); + ret = PTR_ERR(pcie->perst_reset); + goto clk_out; } ret = reset_control_reset(pcie->rescal); - if (ret) + if (ret) { dev_err(&pdev->dev, "failed to deassert 'rescal'\n"); + goto clk_out; + } ret = brcm_phy_start(pcie); if (ret) { reset_control_rearm(pcie->rescal); - clk_disable_unprepare(pcie->clk); - return ret; + goto clk_out; } ret = brcm_pcie_setup(pcie); @@ -1676,6 +1677,9 @@ static int brcm_pcie_probe(struct platform_device *pdev) return 0; +clk_out: + clk_disable_unprepare(pcie->clk); + return ret; fail: __brcm_pcie_remove(pcie); return ret; From patchwork Fri Jun 28 20:54:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13716581 X-Patchwork-Delegate: kw@linux.com Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 0FCC37D40B for ; Fri, 28 Jun 2024 20:54:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608088; cv=none; b=X35vupryjZZgqZ2hAwYF2RZxtHYpRQHNGkRBGHmDf460K/9HDBR0IPpQtIQCG5n6219avcw+1nq4PebL2xbSHZCun5uvc84efNmhUWaqkdpaLfttUkv37Y7SAOu9JrtHk5Uyg7LA/fwmEALocyYgh/Pr7vxmNDSEujE2U0CNE4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608088; c=relaxed/simple; bh=hKKExbWisgi/aMJOt2lKBQxO7Kd6nYG6/xcPYIFpj0U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=nx8I4bGqOyjDyMcjEpuTrAJi0Ct+RDM/1tPrCzBWQNZHQ9xMakNRSulVpAEtqq+ka6/oHoYkzEVKB+OqALZy2RthVNA7a/dOvbJHsLpJTOZ5tJ6F9ThtkD9WsKp9H2q4cGudnQ5agWaY/c90yyuKJnEWy9tfA1pfbHNgs5ucbo4= 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=A3ml/CyW; arc=none smtp.client-ip=209.85.214.177 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="A3ml/CyW" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1f6fabe9da3so7176465ad.0 for ; Fri, 28 Jun 2024 13:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608086; x=1720212886; 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=ZYixtrPd4pJWRf7OwRCYyQM7NcR8Ph3fCcl4TTdIcHA=; b=A3ml/CyWaAIsMrXuTJzCEoj1FKGStwLXmU5qoeGVa0Su7di3P0Ba5icxARDpm+Cm+T TmHSbKZcHn803x5gXec+Vx+J3h6ZmdsRYbo90kNu2WSVqR36natZxijNCvz9Iy1JwlmR QsRZOkYK9qT1QIHuJ1Qr0e6+yJ0TnSKjQtNwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608086; x=1720212886; 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=ZYixtrPd4pJWRf7OwRCYyQM7NcR8Ph3fCcl4TTdIcHA=; b=Cyh92ngL6nYipCUw4zMDfyfByDoOplzCykwhk+npnQCqAMNymVgg25iaJCVnQX9C5A N3uaF8ugVggS9zyRS762p/1qLlkTV+dmhWLdjsh9K58SNsod0W7ETKM6nwyxHNDolhl3 rgXzzSRIjoDE706YTRrVwoerCJmtixiNW6Dau4TGq1ekP+r1orxRqrFQumMyfJIgoel6 xZ21t7QNG6rjseol8v6zvKBVPLkR6cXq+qXgk6w2OHWo5ec8bRFnuMJeBnnP7hnictE7 6hSRnWhVVf/qUrTIbFaioMdNclOiE8tKCvCkKkYJbkfVoZtXsoKR/sxiGS0EhTlZ+D0m TiOw== X-Gm-Message-State: AOJu0YzpxBXzpDUeRVFvp62k4HWLf4B2CxllkUawIeQ/60Gx1Mpb48TU CEVY50pOX2+kh6bM7+uH/UvK2n4bpmeWCLKL+HhtqTk3axXeVAGoLDxpjXQdWAsYL0B6jG4fKQz Lh3mw54g6FLYiPavuYX+2yk6psMi54z4jZcUH7GeDagvs+0VSq95/H2Fcg5qot7HKgmlMVXEL8V Vk6ydTax6ibFO+4TwWfEl6qsZoN7xn/6mAVFXh+vnDuj7jS7Zk X-Google-Smtp-Source: AGHT+IH/L+b6uQbJFoZXayOD8y14oJ/r7oa8wxPA2GIhVQOwDkQLMKI+EZwDN8QDCgoLaXZnM2uLgQ== X-Received: by 2002:a17:902:e846:b0:1f6:502d:ca88 with SMTP id d9443c01a7336-1fa23f15aa5mr171432915ad.49.1719608085820; Fri, 28 Jun 2024 13:54:45 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:45 -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 3/8] PCI: brcmstb: Use bridge reset if available Date: Fri, 28 Jun 2024 16:54:22 -0400 Message-Id: <20240628205430.24775-4-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 has a bridge reset which can be described in the device tree. If it is present, use it. Otherwise, continue to use the legacy method to reset the bridge. Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index c2eb29b886f7..4104c3668fdb 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -265,6 +265,7 @@ struct brcm_pcie { enum pcie_type type; struct reset_control *rescal; struct reset_control *perst_reset; + struct reset_control *bridge; int num_memc; u64 memc_size[PCIE_BRCM_MAX_MEMC]; u32 hw_rev; @@ -732,12 +733,19 @@ static void __iomem *brcm7425_pcie_map_bus(struct pci_bus *bus, static void brcm_pcie_bridge_sw_init_set_generic(struct brcm_pcie *pcie, u32 val) { - u32 tmp, mask = RGR1_SW_INIT_1_INIT_GENERIC_MASK; - u32 shift = RGR1_SW_INIT_1_INIT_GENERIC_SHIFT; + if (pcie->bridge) { + if (val) + reset_control_assert(pcie->bridge); + else + reset_control_deassert(pcie->bridge); + } else { + u32 tmp, mask = RGR1_SW_INIT_1_INIT_GENERIC_MASK; + u32 shift = RGR1_SW_INIT_1_INIT_GENERIC_SHIFT; - tmp = readl(pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); - tmp = (tmp & ~mask) | ((val << shift) & mask); - writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); + tmp = readl(pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); + tmp = (tmp & ~mask) | ((val << shift) & mask); + writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); + } } static void brcm_pcie_bridge_sw_init_set_7278(struct brcm_pcie *pcie, u32 val) @@ -1635,6 +1643,12 @@ static int brcm_pcie_probe(struct platform_device *pdev) goto clk_out; } + pcie->bridge = devm_reset_control_get_optional_exclusive(&pdev->dev, "bridge"); + if (IS_ERR(pcie->bridge)) { + ret = PTR_ERR(pcie->bridge); + goto clk_out; + } + ret = brcm_phy_start(pcie); if (ret) { reset_control_rearm(pcie->rescal); 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: 13716582 X-Patchwork-Delegate: kw@linux.com 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="dJ4OhtjP" 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); From patchwork Fri Jun 28 20:54:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13716583 X-Patchwork-Delegate: kw@linux.com Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 F1F0B811EB for ; Fri, 28 Jun 2024 20:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608095; cv=none; b=TboBG9ssWkFjPZiI5aWASk7ZzgUIN5hokbzgq1b8GHpRWeSwrLh21IyPS2svvUBxU+zA9bq3HSwxqo/FvWO2PICDpbMzdYH5GFAHO4NsxvfmRjqK+SZyH1CWVGfsIRI7NrUc3brkBm9K25VSEj12Nld4NcZpfOu1CKvngdndtfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608095; c=relaxed/simple; bh=vuqevtC1Sm1c/Q3NdbtfRMeSnWwQsXIlzzYKTu5oVI0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=oYi/fuqCkbovwUMVLCP6peZJVnWrGiArDraVEdPVe5MnfEVA+qrbqXZ/2hOOLiJOg5FmlAtQI5JfoIV/fK4MHJMHMig+CTrAzp1O+s6Nsnij04SHg/et+SzDlkXHE69/o9qxQiXM/GTsFdoQAp87t3I8koWgjdMTjDOJDBcndTA= 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=afEjoD5q; arc=none smtp.client-ip=209.85.214.174 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="afEjoD5q" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1f8395a530dso5831905ad.0 for ; Fri, 28 Jun 2024 13:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608092; x=1720212892; 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=KdPwI8jOrYkH+pQYwsdlLml7UI+rF2ui/uFq4bFYfsE=; b=afEjoD5qdXXpV0lRhdfx4Vd/AXjvTvRzXCdcrGd1vLiHiUSBrcqXjMcgltCxiNvJnJ pKeMjZVAAvkUZ4oVi4BTSnM8L2ZYqwxSCQlPzDUSqOUpEJsmnV05pavQ4BrbjDoWshSY gwfQVPgLKc4sW5wjCth2hB1ofCI+BtoawfEF8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608092; x=1720212892; 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=KdPwI8jOrYkH+pQYwsdlLml7UI+rF2ui/uFq4bFYfsE=; b=vyh2B/TaXfiMhrhMxUNgOcdkOgeX1Q+jFw3zszmC++kiapfd6OAiB44wUs3G+O8D+W S/tc1QhYW9ia0lGC1z3BRCGhpU3myjHVKW5cYsNNeOjsE+kaXR97Ra47mssaRfiG0Q5P 6v1OaxKB4i2q2PffkAlZmbxrbOBY1VQNZ64PAT9LYHn8LsGuvlW+ePw2FKYG0mVcJ+33 8UuuPROR1YXyHpLDUI8eNKuInf3l0w2k2hI/7A+ntvfM7Hk02gqdAgnwFUgBcMAZIJsp jriGzcbdH+bljEdW2ZWvsbmgXT+5CxUTcNcSSwgs2U30OXhw1IZR8mRlLl9ONFWVx7OX r8oQ== X-Gm-Message-State: AOJu0Yz7ebvZdsaFf9e9MXYweEW6QXia7rY6++R3JFzf9jfDR+cTECJ7 9+1RPODafUOcKnqXHLREIpZvb6svfk6zYVL8QpMc11aBsAjmrLMR9Bwj+KIeuEDTkeBwwAhlfpo FmdssQFEGdcB+LKnW5N0CKKA/G+EqVHB5alNprpNb0axEZAFCjt5qX0JMvDRAZ0Pqph76EkV3x3 hElAfRKnusVwKxtoF3uY7/xuVemoSyHqbck1k058o7kWbZzYS1 X-Google-Smtp-Source: AGHT+IG7tsVk/yVPnQptFwZqBnGlbe0A/PpWj+6T68da+89lbFTZ9RttfgJKtbZSQ9AdeugDWVZ6fw== X-Received: by 2002:a17:902:ec91:b0:1fa:aa62:8b5f with SMTP id d9443c01a7336-1faaa628dadmr53626075ad.37.1719608092261; Fri, 28 Jun 2024 13:54:52 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:51 -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 , 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 5/8] PCI: brcmstb: Two more register offsets vary by SOC Date: Fri, 28 Jun 2024 16:54:24 -0400 Message-Id: <20240628205430.24775-6-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: Our HW design has again changed a register offset which used to be standard for all Broadcom SOCs with PCIe cores. This difference is now reconciled. Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 33 +++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 0f1c3e1effb1..4e0848e1311f 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -122,7 +122,6 @@ #define PCIE_MEM_WIN0_LIMIT_HI(win) \ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LIMIT_HI + ((win) * 8) -#define PCIE_MISC_HARD_PCIE_HARD_DEBUG 0x4204 #define PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK 0x2 #define PCIE_MISC_HARD_PCIE_HARD_DEBUG_L1SS_ENABLE_MASK 0x200000 #define PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK 0x08000000 @@ -131,9 +130,9 @@ (PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK | \ PCIE_MISC_HARD_PCIE_HARD_DEBUG_L1SS_ENABLE_MASK) -#define PCIE_INTR2_CPU_BASE 0x4300 #define PCIE_MSI_INTR2_BASE 0x4500 -/* Offsets from PCIE_INTR2_CPU_BASE and PCIE_MSI_INTR2_BASE */ + +/* Offsets from INTR2_CPU and MSI_INTR2 BASE offsets */ #define MSI_INT_STATUS 0x0 #define MSI_INT_CLR 0x8 #define MSI_INT_MASK_SET 0x10 @@ -187,6 +186,8 @@ #define IDX_ADDR(pcie) (pcie->reg_offsets[EXT_CFG_INDEX]) #define DATA_ADDR(pcie) (pcie->reg_offsets[EXT_CFG_DATA]) #define PCIE_RGR1_SW_INIT_1(pcie) (pcie->reg_offsets[RGR1_SW_INIT_1]) +#define HARD_DEBUG(pcie) (pcie->reg_offsets[PCIE_HARD_DEBUG]) +#define INTR2_CPU_BASE(pcie) (pcie->reg_offsets[PCIE_INTR2_CPU_BASE]) /* Rescal registers */ #define PCIE_DVT_PMU_PCIE_PHY_CTRL 0xc700 @@ -210,6 +211,8 @@ enum { enum { RGR1_SW_INIT_1_INIT_MASK, RGR1_SW_INIT_1_INIT_SHIFT, + PCIE_HARD_DEBUG, + PCIE_INTR2_CPU_BASE, }; enum pcie_type { @@ -651,7 +654,7 @@ static int brcm_pcie_enable_msi(struct brcm_pcie *pcie) BUILD_BUG_ON(BRCM_INT_PCI_MSI_LEGACY_NR > BRCM_INT_PCI_MSI_NR); if (msi->legacy) { - msi->intr_base = msi->base + PCIE_INTR2_CPU_BASE; + msi->intr_base = msi->base + INTR2_CPU_BASE(pcie); msi->nr = BRCM_INT_PCI_MSI_LEGACY_NR; msi->legacy_shift = 24; } else { @@ -898,12 +901,12 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie) /* Take the bridge out of reset */ pcie->bridge_sw_init_set(pcie, 0); - tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + tmp = readl(base + HARD_DEBUG(pcie)); if (is_bmips(pcie)) tmp &= ~PCIE_BMIPS_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK; else tmp &= ~PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK; - writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + writel(tmp, base + HARD_DEBUG(pcie)); /* Wait for SerDes to be stable */ usleep_range(100, 200); @@ -1072,7 +1075,7 @@ static void brcm_config_clkreq(struct brcm_pcie *pcie) } /* Start out assuming safe mode (both mode bits cleared) */ - clkreq_cntl = readl(pcie->base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + clkreq_cntl = readl(pcie->base + HARD_DEBUG(pcie)); clkreq_cntl &= ~PCIE_CLKREQ_MASK; if (strcmp(mode, "no-l1ss") == 0) { @@ -1115,7 +1118,7 @@ static void brcm_config_clkreq(struct brcm_pcie *pcie) dev_err(pcie->dev, err_msg); mode = "safe"; } - writel(clkreq_cntl, pcie->base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + writel(clkreq_cntl, pcie->base + HARD_DEBUG(pcie)); dev_info(pcie->dev, "clkreq-mode set to %s\n", mode); } @@ -1337,9 +1340,9 @@ static void brcm_pcie_turn_off(struct brcm_pcie *pcie) writel(tmp, base + PCIE_MISC_PCIE_CTRL); /* Turn off SerDes */ - tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + tmp = readl(base + HARD_DEBUG(pcie)); u32p_replace_bits(&tmp, 1, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK); - writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + writel(tmp, base + HARD_DEBUG(pcie)); /* Shutdown PCIe bridge */ pcie->bridge_sw_init_set(pcie, 1); @@ -1425,9 +1428,9 @@ static int brcm_pcie_resume_noirq(struct device *dev) pcie->bridge_sw_init_set(pcie, 0); /* SERDES_IDDQ = 0 */ - tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + tmp = readl(base + HARD_DEBUG(pcie)); u32p_replace_bits(&tmp, 0, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK); - writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG); + writel(tmp, base + HARD_DEBUG(pcie)); /* wait for serdes to be stable */ udelay(100); @@ -1499,12 +1502,16 @@ static const int pcie_offsets[] = { [RGR1_SW_INIT_1] = 0x9210, [EXT_CFG_INDEX] = 0x9000, [EXT_CFG_DATA] = 0x9004, + [PCIE_HARD_DEBUG] = 0x4204, + [PCIE_INTR2_CPU_BASE] = 0x4300, }; static const int pcie_offsets_bmips_7425[] = { [RGR1_SW_INIT_1] = 0x8010, [EXT_CFG_INDEX] = 0x8300, [EXT_CFG_DATA] = 0x8304, + [PCIE_HARD_DEBUG] = 0x4204, + [PCIE_INTR2_CPU_BASE] = 0x4300, }; static const struct pcie_cfg_data generic_cfg = { @@ -1539,6 +1546,8 @@ static const int pcie_offset_bcm7278[] = { [RGR1_SW_INIT_1] = 0xc010, [EXT_CFG_INDEX] = 0x9000, [EXT_CFG_DATA] = 0x9004, + [PCIE_HARD_DEBUG] = 0x4204, + [PCIE_INTR2_CPU_BASE] = 0x4300, }; static const struct pcie_cfg_data bcm7278_cfg = { From patchwork Fri Jun 28 20:54:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13716584 X-Patchwork-Delegate: kw@linux.com Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 4B06C7710F for ; Fri, 28 Jun 2024 20:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608098; cv=none; b=TwfZWWW8/Tn4d7DDJG/uK9A3NyndpeY7Axq2NWjg+ZKK9qnO1Dm4MYy+QGE9vI8IGNzxaEtgo+VeZkEX/Rrg0jWdpPlHW6JM2kOAL2SbpLCxcVvWFU8vblo15/Ufp7RDuqnKWnlZMabY+DwYe9xZjS8Zd8i01Yr143isb3ZEIzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608098; c=relaxed/simple; bh=uSH1eL1EapnWE6fgqnLXSC6QbhygKVFjt8TTNhuJQNQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=EdVP5pvD+nG4sUzrANSEBMVW19sBFEgpGLj5eFH8QKLe4qYxOBp/AQ9D7gwZNZCjjS7z8aN9BGGspiTVdeUOPl0oSd1WrC5AnkTsogdkD6Ky4fD8Oe33H0FandGlCwvwtx15Aaptn3Efjd2Bq1gR3eiDmTTZJqeUJTfn7FTCa3k= 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=Ohxvr+LB; arc=none smtp.client-ip=209.85.214.170 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="Ohxvr+LB" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1f9d9b57b90so7881115ad.0 for ; Fri, 28 Jun 2024 13:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608095; x=1720212895; 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=HEILCN2d8OFzc+BpFvHyMnm0M/etrOVUmbrRQ25WYNI=; b=Ohxvr+LB526pJUfX0fBR0mp/om9azNWejg1tfvS104t4UbrwWfuxyeuuBUZIbj8qOT pABzWiXB38Pq29565IOEksXYd8LfeylrcdYutNCVj1W/syBIeu1aLuV0C+GlWxysiVBI DZ1gldCjq6w8llDsJEW1prdYpm3xak4uo6LNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608095; x=1720212895; 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=HEILCN2d8OFzc+BpFvHyMnm0M/etrOVUmbrRQ25WYNI=; b=hbAu42DuwxCmzPZzk4ng52mEE4p7phNl7MHULwRlQx3EL4Ga9os2Y8hVnm5LbsSFEy UscJnhAq/ucXlpRIvl2LAqRS7wKLllkowa327fpjFUgRjlnIs6gHrR/e7tYd6ZMax329 3hB0MsQ5hFbQ6RvVRY+b+jBIdRGq+VN4muJwybWA1PUc1bEQyeSbtuhh0hvhAubMboac DqSIndURGeulEkOl9z42J2X3GB67qiYQj+ZSbVHwLdPl9y5I4OtH7aipQP+4nPga9Bcd 77RDrHldBZIX0us4CmIRK+/5IicZlL43bmOi76xrvmV0jZkVrz5QJEEyvs19OGT7WGk0 8hTA== X-Gm-Message-State: AOJu0YxFKplWyTl8gn0NLIXQhlgQT9yNO5B9sTJXzvZVZgggGATQxiwS hBzQFqnY0IXp2zzjOLSYuzNswWo8DwAp/waxGGhEJp9ftGIpjvP2H6fo3EKve5l4edHLhd+/FPg BPS1P18dJVysGRWaFqqCyf55zUthWItGNZjLLikjZ6/XqX6RH9DpSUlDuqbX+sZ1Z3Zmnh+8rGM gwmYi+MMF5DA6LN7sj2jj9dH0ZZzORKFQsDVW1buncHbUqNriM X-Google-Smtp-Source: AGHT+IGbMb5fPkyqtOTwQu7ckhQWO7NdTPqcoiDVq14unC7YAkorNf1fubhprv/ElzDDmlQhzPMIRg== X-Received: by 2002:a17:902:ce90:b0:1f7:1706:2596 with SMTP id d9443c01a7336-1fa23f4a1d7mr215721575ad.67.1719608095425; Fri, 28 Jun 2024 13:54:55 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:54 -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 , 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 6/8] PCI: brcmstb: Don't conflate the reset rescal with phy ctrl Date: Fri, 28 Jun 2024 16:54:25 -0400 Message-Id: <20240628205430.24775-7-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: We've been assuming that if an SOC has a "rescal" reset controller that we should automatically invoke brcm_phy_cntl(...). This will not be true in future SOCs, so we create a bool "has_phy" and adjust the cfg_data appropriately (we need to give 7216 its own cfg_data structure instead of sharing one). Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 4e0848e1311f..e740e2966a5c 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -227,6 +227,7 @@ enum pcie_type { struct pcie_cfg_data { const int *offsets; const enum pcie_type type; + const bool has_phy; void (*perst_set)(struct brcm_pcie *pcie, u32 val); void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); }; @@ -277,6 +278,7 @@ struct brcm_pcie { void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); struct subdev_regulators *sr; bool ep_wakeup_capable; + bool has_phy; }; static inline bool is_bmips(const struct brcm_pcie *pcie) @@ -1316,12 +1318,12 @@ static int brcm_phy_cntl(struct brcm_pcie *pcie, const int start) static inline int brcm_phy_start(struct brcm_pcie *pcie) { - return pcie->rescal ? brcm_phy_cntl(pcie, 1) : 0; + return pcie->has_phy ? brcm_phy_cntl(pcie, 1) : 0; } static inline int brcm_phy_stop(struct brcm_pcie *pcie) { - return pcie->rescal ? brcm_phy_cntl(pcie, 0) : 0; + return pcie->has_phy ? brcm_phy_cntl(pcie, 0) : 0; } static void brcm_pcie_turn_off(struct brcm_pcie *pcie) @@ -1564,12 +1566,20 @@ static const struct pcie_cfg_data bcm2711_cfg = { .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic, }; +static const struct pcie_cfg_data bcm7216_cfg = { + .offsets = pcie_offset_bcm7278, + .type = BCM7278, + .perst_set = brcm_pcie_perst_set_7278, + .bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278, + .has_phy = true, +}; + static const struct of_device_id brcm_pcie_match[] = { { .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg }, { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, { .compatible = "brcm,bcm7211-pcie", .data = &generic_cfg }, { .compatible = "brcm,bcm7278-pcie", .data = &bcm7278_cfg }, - { .compatible = "brcm,bcm7216-pcie", .data = &bcm7278_cfg }, + { .compatible = "brcm,bcm7216-pcie", .data = &bcm7216_cfg }, { .compatible = "brcm,bcm7445-pcie", .data = &generic_cfg }, { .compatible = "brcm,bcm7435-pcie", .data = &bcm7435_cfg }, { .compatible = "brcm,bcm7425-pcie", .data = &bcm7425_cfg }, @@ -1617,6 +1627,7 @@ static int brcm_pcie_probe(struct platform_device *pdev) pcie->type = data->type; pcie->perst_set = data->perst_set; pcie->bridge_sw_init_set = data->bridge_sw_init_set; + pcie->has_phy = data->has_phy; pcie->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pcie->base)) From patchwork Fri Jun 28 20:54: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: 13716585 X-Patchwork-Delegate: kw@linux.com Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.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 C130E82869 for ; Fri, 28 Jun 2024 20:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608102; cv=none; b=SkG0SFP904JiRgvNlWLMDTrWsq5E3udJaDfmzh0d1VEi+A2bkdnOde7l4KaEOQrq1cs1YVNthAVz/52pdTIzkylrwgYTxOXPXNXBXkctgqOu3FnfCEeHyqwXBR9DVCxR4s4PAp2HR8JAlfi6H9XAjJ1RyKHcJCjH1F/dhnETpuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608102; c=relaxed/simple; bh=Pap42k/z2I3l7R422Y40FHSdPbw7ujHFZE7L10FktM4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=MYQducTNjKNeZJFf5AtvxqFHZbXn8HWHDj0S2tul62nHzKAWPPo7/uaycSsfEvc0vfjal2+D5m+lzjZs6/bpzLkQVr4tJkhKIT0dnGA7dLyp1k0Qp95CYu5jYi7SHtKX5o3Kq1EtPpbL/kyRDMpzSfWHzzhmhuERzsrbt8YNBJo= 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=H7Avxn17; arc=none smtp.client-ip=209.85.215.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="H7Avxn17" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-7180308e90bso743960a12.1 for ; Fri, 28 Jun 2024 13:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608099; x=1720212899; 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=WXAW9MOh9WcKBKWajR/s5O/lkTA2QPjcMZdOE9Kb6G4=; b=H7Avxn17g35wEBDHva2DLLhyp/u5wq2mptgDKPH1BiANB7KXiLeEwA6IWKLR8mB78c 1qOoyXJ8LDdXtPqYXfZr7TaZQ5ehJIxHSVI+7x8C5vQ1O2K29HpqA7RQRnVO40KwHvnC j6CsWmPBKT8nNW4OxknyeaFQRY9CQLLIfZikU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608099; x=1720212899; 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=WXAW9MOh9WcKBKWajR/s5O/lkTA2QPjcMZdOE9Kb6G4=; b=fAv6FlMt8ZV97ezhnn2wpc5h4y7M3O7dXt+qR+j6MIa2Cr75qsI0+vxCYHW9Vc1EuE yyvlhhN8oNJS98GCpwcTFwiR56fHtywoYdHbIJA0w3MNILUZJq5D4DIuW6KoGDKrI53u gnIpG8oU2O2ixPCznT8QwXGkXK1oE/CntKn9UTxvH291RlZXgTJXaHQfB1+z5i97is9d YLbNtn2w9tiNtNRn03RlFMu202M8pqRlTE34dxkmNDFrAea80F8e38p9UgOx1Hoeyaia 5Q68dfU+Am/KD/FLMAjrExEI3MnsZM/0JzZ0UCvzRQ6aGQ/aoqHa8Fi6rZot9/n96Zlj /WbQ== X-Gm-Message-State: AOJu0YwfXRRHQ8GuZrEI7K6VY8yVfAun8uEkbZx9CduhzHwLukoX2A7y GtP9UGZq4cuz38dUbpS7YAuESLHhOAwAKFxKzjiiQSBgmz2rLfQyp7kELP+NaS2LkB3acN8WG65 n3xiqHRObvCLYnNu7JFNBKG3Yx9y+e/XD8PgkJBWMEMfm0XsygZYdVkEOCtHWlBb785KQH6y4s4 SLgbrFySj0C6J/0iYdznKMx69eV6B2daU4uzgqrWdhF5wJjt6n X-Google-Smtp-Source: AGHT+IE5G8pDHGxPgc4xEfwuRigSmXXdvVvVO19gxkRojRpIcplJS7bV38dCvgv/yuQInjLOuYlq6w== X-Received: by 2002:a05:6a20:2446:b0:1be:e1e1:d5e4 with SMTP id adf61e73a8af0-1bee1e1d6a5mr4080263637.12.1719608098740; Fri, 28 Jun 2024 13:54:58 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:58 -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 , 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 7/8] PCI: brcmstb: Refactor for chips with many regular inbound BARs Date: Fri, 28 Jun 2024 16:54:26 -0400 Message-Id: <20240628205430.24775-8-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: Previously, our chips provided three inbound "BARS" with fixed purposes: the first was for mapping SOC registers, the second was for memory, and the third was for memory but with the endian swapped. We typically only used one of these BARs. Complicating that BARs usage was the fact that the PCIe HW would do a baroque internal mapping of system memory, and concatenate the regions of multiple memory controllers. Newer chips such as the 7712 and Cable Modem SOCs have taken a step forward and now provide multiple inbound BARs. This works in concert with the dma-ranges property, where each provided range becomes an inbound BAR. This commit provides support for these new chips and their multiple inbound BARs but also keeps the legacy support for the older system. Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 199 +++++++++++++++++++------- 1 file changed, 150 insertions(+), 49 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index e740e2966a5c..9dab577dc1b4 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -75,15 +75,12 @@ #define PCIE_MEM_WIN0_HI(win) \ PCIE_MISC_CPU_2_PCIE_MEM_WIN0_HI + ((win) * 8) +#define PCIE_BRCM_MAX_RC_BARS 16 #define PCIE_MISC_RC_BAR1_CONFIG_LO 0x402c #define PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK 0x1f -#define PCIE_MISC_RC_BAR2_CONFIG_LO 0x4034 -#define PCIE_MISC_RC_BAR2_CONFIG_LO_SIZE_MASK 0x1f -#define PCIE_MISC_RC_BAR2_CONFIG_HI 0x4038 +#define PCIE_MISC_RC_BAR4_CONFIG_LO 0x40d4 -#define PCIE_MISC_RC_BAR3_CONFIG_LO 0x403c -#define PCIE_MISC_RC_BAR3_CONFIG_LO_SIZE_MASK 0x1f #define PCIE_MISC_MSI_BAR_CONFIG_LO 0x4044 #define PCIE_MISC_MSI_BAR_CONFIG_HI 0x4048 @@ -130,6 +127,10 @@ (PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK | \ PCIE_MISC_HARD_PCIE_HARD_DEBUG_L1SS_ENABLE_MASK) +#define PCIE_MISC_UBUS_BAR1_CONFIG_REMAP 0x40ac +#define PCIE_MISC_UBUS_BAR1_CONFIG_REMAP_ACCESS_EN_MASK 0x1 +#define PCIE_MISC_UBUS_BAR4_CONFIG_REMAP 0x410c + #define PCIE_MSI_INTR2_BASE 0x4500 /* Offsets from INTR2_CPU and MSI_INTR2 BASE offsets */ @@ -222,6 +223,13 @@ enum pcie_type { BCM4908, BCM7278, BCM2711, + BCM7712, +}; + +struct rc_bar { + u64 size; + u64 pci_offset; + u64 cpu_addr; }; struct pcie_cfg_data { @@ -279,6 +287,7 @@ struct brcm_pcie { struct subdev_regulators *sr; bool ep_wakeup_capable; bool has_phy; + int num_inbound; }; static inline bool is_bmips(const struct brcm_pcie *pcie) @@ -794,23 +803,60 @@ static void brcm_pcie_perst_set_generic(struct brcm_pcie *pcie, u32 val) writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1(pcie)); } -static int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie, - u64 *rc_bar2_size, - u64 *rc_bar2_offset) +static inline void set_bar(struct rc_bar *b, int *count, u64 size, + u64 cpu_addr, u64 pci_offset) +{ + b->size = size; + b->cpu_addr = cpu_addr; + b->pci_offset = pci_offset; + (*count)++; +} + +static int brcm_pcie_get_rc_bar_sizes_and_offsets(struct brcm_pcie *pcie, + struct rc_bar rc_bars[]) { struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); + u64 pci_offset, cpu_addr, size = 0, tot_size = 0; struct resource_entry *entry; struct device *dev = pcie->dev; u64 lowest_pcie_addr = ~(u64)0; - int ret, i = 0; - u64 size = 0; + + int ret, i = 0, n = 0; + + /* + * The HW registers (and PCIe) use order-1 numbering for BARs. As + * such, we have rc_bars[0] unused and BAR1 starts at rc_bars[1]. + */ + struct rc_bar *b_begin = &rc_bars[1]; + struct rc_bar *b = b_begin; + + /* + * STB chips beside 7712 disable BAR1 by default. It is mapped not + * to system memory but to a regiion all of the SOC registers. No + * one uses this anymore. + */ + if (pcie->type != BCM7712) + set_bar(b++, &n, 0, 0, 0); resource_list_for_each_entry(entry, &bridge->dma_ranges) { u64 pcie_beg = entry->res->start - entry->offset; + u64 cpu_beg = entry->res->start; - size += entry->res->end - entry->res->start + 1; + size = entry->res->end - entry->res->start + 1; + tot_size += size; if (pcie_beg < lowest_pcie_addr) lowest_pcie_addr = pcie_beg; + /* + * 7712 and newer chips may have many BARs, with each + * offering a non-overlapping viewport to system memory. + * That being said, each BARs size must still be a power of + * two. + */ + if (pcie->type == BCM7712) + set_bar(b++, &n, size, cpu_beg, pcie_beg); + + if (n > pcie->num_inbound) + break; } if (lowest_pcie_addr == ~(u64)0) { @@ -818,13 +864,20 @@ static int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie, return -EINVAL; } + /* + * 7712 and newer chips do not have an internal memory mapping system + * that enables multiple memory controllers. As such, it can return + * now w/o doing special configuration. + */ + if (pcie->type == BCM7712) + return n; + ret = of_property_read_variable_u64_array(pcie->np, "brcm,scb-sizes", pcie->memc_size, 1, PCIE_BRCM_MAX_MEMC); - if (ret <= 0) { /* Make an educated guess */ pcie->num_memc = 1; - pcie->memc_size[0] = 1ULL << fls64(size - 1); + pcie->memc_size[0] = 1ULL << fls64(tot_size - 1); } else { pcie->num_memc = ret; } @@ -833,10 +886,15 @@ static int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie, for (i = 0, size = 0; i < pcie->num_memc; i++) size += pcie->memc_size[i]; - /* System memory starts at this address in PCIe-space */ - *rc_bar2_offset = lowest_pcie_addr; - /* The sum of all memc views must also be a power of 2 */ - *rc_bar2_size = 1ULL << fls64(size - 1); + /* Our HW mandates that the window size must be a power of 2 */ + size = 1ULL << fls64(size - 1); + + /* + * For STB chips, the BAR2 cpu_addr is hardwired to the start + * of system memory, so we set it to 0. + */ + cpu_addr = 0; + pci_offset = lowest_pcie_addr; /* * We validate the inbound memory view even though we should trust @@ -871,25 +929,50 @@ static int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie, * outbound memory @ 3GB). So instead it will start at the 1x * multiple of its size */ - if (!*rc_bar2_size || (*rc_bar2_offset & (*rc_bar2_size - 1)) || - (*rc_bar2_offset < SZ_4G && *rc_bar2_offset > SZ_2G)) { + if (!size || (pci_offset & (size - 1)) || + (pci_offset < SZ_4G && pci_offset > SZ_2G)) { dev_err(dev, "Invalid rc_bar2_offset/size: size 0x%llx, off 0x%llx\n", - *rc_bar2_size, *rc_bar2_offset); + size, pci_offset); return -EINVAL; } - return 0; + /* Enable BAR2, the inbound window for STB chips */ + set_bar(b++, &n, size, cpu_addr, pci_offset); + + /* + * Disable BAR3. On some chips presents the same window as BAR2 + * but the data appears in a settable endianness. + */ + set_bar(b++, &n, 0, 0, 0); + + return n; +} + +static unsigned int brcm_calc_bar_reg_offset(int bar) +{ + if (bar <= 3) + return PCIE_MISC_RC_BAR1_CONFIG_LO + 8 * (bar - 1); + else + return PCIE_MISC_RC_BAR4_CONFIG_LO + 8 * (bar - 4); +} + +static unsigned int brcm_calc_ubus_reg_offset(int bar) +{ + if (bar <= 3) + return PCIE_MISC_UBUS_BAR1_CONFIG_REMAP + 8 * (bar - 1); + else + return PCIE_MISC_UBUS_BAR4_CONFIG_REMAP + 8 * (bar - 4); } static int brcm_pcie_setup(struct brcm_pcie *pcie) { - u64 rc_bar2_offset, rc_bar2_size; + struct rc_bar rc_bars[PCIE_BRCM_MAX_RC_BARS]; void __iomem *base = pcie->base; struct pci_host_bridge *bridge; struct resource_entry *entry; u32 tmp, burst, aspm_support; - int num_out_wins = 0; - int ret, memc; + int num_out_wins = 0, num_rc_bars = 0; + int i, memc; /* Reset the bridge */ pcie->bridge_sw_init_set(pcie, 1); @@ -938,17 +1021,47 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie) u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_PCIE_RCB_64B_MODE_MASK); writel(tmp, base + PCIE_MISC_MISC_CTRL); - ret = brcm_pcie_get_rc_bar2_size_and_offset(pcie, &rc_bar2_size, - &rc_bar2_offset); - if (ret) - return ret; + num_rc_bars = brcm_pcie_get_rc_bar_sizes_and_offsets(pcie, rc_bars); + if (num_rc_bars < 0) + return num_rc_bars; + + for (i = 1; i <= num_rc_bars; i++) { + u64 pci_offset = rc_bars[i].pci_offset; + u64 cpu_addr = rc_bars[i].cpu_addr; + u64 size = rc_bars[i].size; + u32 reg_offset = brcm_calc_bar_reg_offset(i); + + tmp = lower_32_bits(pci_offset); + u32p_replace_bits(&tmp, brcm_pcie_encode_ibar_size(size), + PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK); + + /* Write low */ + writel(tmp, base + reg_offset); + /* Write high */ + writel(upper_32_bits(pci_offset), + base + reg_offset + 4); + + /* + * Most STB chips: + * Do nothing. + * 7712: + * All of their BARs need to be set. + */ + if (pcie->type == BCM7712) { + /* BUS remap register settings */ + reg_offset = brcm_calc_ubus_reg_offset(i); + tmp = lower_32_bits(cpu_addr) & ~0xfff; + tmp |= PCIE_MISC_UBUS_BAR1_CONFIG_REMAP_ACCESS_EN_MASK; + writel(tmp, base + reg_offset); + tmp = upper_32_bits(cpu_addr); + writel(tmp, base + reg_offset + 4); + } + } - tmp = lower_32_bits(rc_bar2_offset); - u32p_replace_bits(&tmp, brcm_pcie_encode_ibar_size(rc_bar2_size), - PCIE_MISC_RC_BAR2_CONFIG_LO_SIZE_MASK); - writel(tmp, base + PCIE_MISC_RC_BAR2_CONFIG_LO); - writel(upper_32_bits(rc_bar2_offset), - base + PCIE_MISC_RC_BAR2_CONFIG_HI); + if (!brcm_pcie_rc_mode(pcie)) { + dev_err(pcie->dev, "PCIe RC controller misconfigured as Endpoint\n"); + return -EINVAL; + } tmp = readl(base + PCIE_MISC_MISC_CTRL); for (memc = 0; memc < pcie->num_memc; memc++) { @@ -970,25 +1083,12 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie) * 4GB or when the inbound area is smaller than 4GB (taking into * account the rounding-up we're forced to perform). */ - if (rc_bar2_offset >= SZ_4G || (rc_bar2_size + rc_bar2_offset) < SZ_4G) + if (rc_bars[2].pci_offset >= SZ_4G || + (rc_bars[2].size + rc_bars[2].pci_offset) < SZ_4G) pcie->msi_target_addr = BRCM_MSI_TARGET_ADDR_LT_4GB; else pcie->msi_target_addr = BRCM_MSI_TARGET_ADDR_GT_4GB; - if (!brcm_pcie_rc_mode(pcie)) { - dev_err(pcie->dev, "PCIe RC controller misconfigured as Endpoint\n"); - return -EINVAL; - } - - /* disable the PCIe->GISB memory window (RC_BAR1) */ - tmp = readl(base + PCIE_MISC_RC_BAR1_CONFIG_LO); - tmp &= ~PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK; - writel(tmp, base + PCIE_MISC_RC_BAR1_CONFIG_LO); - - /* disable the PCIe->SCB memory window (RC_BAR3) */ - tmp = readl(base + PCIE_MISC_RC_BAR3_CONFIG_LO); - tmp &= ~PCIE_MISC_RC_BAR3_CONFIG_LO_SIZE_MASK; - writel(tmp, base + PCIE_MISC_RC_BAR3_CONFIG_LO); /* Don't advertise L0s capability if 'aspm-no-l0s' */ aspm_support = PCIE_LINK_STATE_L1; @@ -1628,6 +1728,7 @@ static int brcm_pcie_probe(struct platform_device *pdev) pcie->perst_set = data->perst_set; pcie->bridge_sw_init_set = data->bridge_sw_init_set; pcie->has_phy = data->has_phy; + pcie->num_inbound = (pcie->type == BCM7712) ? 10 : 3; pcie->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pcie->base)) From patchwork Fri Jun 28 20:54:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13716586 X-Patchwork-Delegate: kw@linux.com Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 DBD6B8288C for ; Fri, 28 Jun 2024 20:55:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608105; cv=none; b=o0mAPtOsZdDbQ+aGcMqxkBLwj5J429XGG5EOcv1PHK1L06nY3rrAMcJC9goHZQ1J1qAOFD0r2meQUpxyHeb5NA48sSNBGqkEcJrdGEzkPK9/r3TBMTnUYJSGxtwQfiElJDZEPxFdyNJdwT32zR68q5X5HUAcBHDrk8tZ7CAsSs4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719608105; c=relaxed/simple; bh=p59QM8Hg0ie7gXelgYuLgogyTalqq6n3jY3L/sRfcOw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type; b=jv4fPS7lbWEUFob6JBdYpqYHJybM7Q5gTuDOgHAgHab42qfLInp/aMj9J+ErNS0i+uqEZ/tY/OZ0ChmmZdQfrGog55vSHnqVRS2lV4jR34jgQUL5KtGsIwqPTnX4VJH/obcMLn2n4hFvNGvjsop0DTn2ilFVRWEKav8VRyQGXf0= 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=eXhQNkP6; arc=none smtp.client-ip=209.85.214.178 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="eXhQNkP6" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1fab03d2eecso7424965ad.0 for ; Fri, 28 Jun 2024 13:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608102; x=1720212902; 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=S++DXg3zWBKe6V++76XrrZXrEx1yet5qEN042s+Axdc=; b=eXhQNkP6X/QMPXcLsLIXkeC+pD6PmR1t6heweCJLrssBNv8SG5C/yEwKQwLZyzjcWk a6vSsnErX0GmWvhz1Y2lLsAWjZ6ZfZd6rO+wiSWvvfR+hcEOR1xjSubI7GhuvGw5/zIE IJEn7rkj5vAdMQc22BXCUuaTAJ7us28x53mCs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608102; x=1720212902; 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=S++DXg3zWBKe6V++76XrrZXrEx1yet5qEN042s+Axdc=; b=QECB9WRrfoQZ0NZEuvq/Q8NUc3F0vI+MV02ETUH3XRSjwjPdJAn+Sw1h9MwMZTGfj/ dFIfqfU1eW4CmMKv9no2iZyHHfeNIvJ/cG7yXMOzPc7/whE9wZuJEHqfXP4OLWlZh2DC 5DmdZ4b2UmP6gt+CaOhmTPCMA9m3aEsBCq6GkKYbABKFtNftcgijxHqLN2L65XCuC1+T zvPmaMLKCKkbH4Z29f219ATPyg1GXbSkUeZkIphq++JJhsyZZLCVBJ13vciYN9JQn8gm eVZIFS7sLondEx27wh0NSisaUM9QwFmbiwQfaf13B5v+ccdIeuGd7mtQeyt+30oFyxyW //QQ== X-Gm-Message-State: AOJu0YwA8ePGVa7ysyQTvxTzYoCOtrHspCvGv9Z92oUW72CmyZqM/jfG JPEada1bwedsxzHU4oL0OjfPs9RfI+bxc7tINO3yxpA6SbAR/ez0965Fb85LkOmZXDvlUxCX24l qo5Lav0O87pLQIjNtGGOcZZlhjc4DyQi0mfDc9Vcrzb4XzDYRJwSNWjEG2yjW67EBTB93eb/ola dkNFrc5zk1s/2ObwqIkGBPATg54ubscKDjtMs9qt8A7TARNycr X-Google-Smtp-Source: AGHT+IELxM8/f9oyyzic3Bqjj/l2RVlhs/69Q6AI9NPehfUpL0FZUx9C2EZ28TvHfLH4QsvhI16FWA== X-Received: by 2002:a17:902:ce82:b0:1fa:1ebb:eb79 with SMTP id d9443c01a7336-1fa1ebbeee9mr218666275ad.58.1719608101995; Fri, 28 Jun 2024 13:55:01 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:55:01 -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 , 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 8/8] PCI: brcmstb: Enable 7712 SOCs Date: Fri, 28 Jun 2024 16:54:27 -0400 Message-Id: <20240628205430.24775-9-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 Broadcom STB 7712 is the sibling chip of the RPi 5 (2712). Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 9dab577dc1b4..418525c9d249 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1209,7 +1209,9 @@ static void brcm_config_clkreq(struct brcm_pcie *pcie) * atypical and should happen only with older devices. */ clkreq_cntl |= PCIE_MISC_HARD_PCIE_HARD_DEBUG_L1SS_ENABLE_MASK; - brcm_extend_rbus_timeout(pcie); + /* 7712 does not have this (RGR1) timer */ + if (pcie->type != BCM7712) + brcm_extend_rbus_timeout(pcie); } else { /* @@ -1616,6 +1618,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, .type = GENERIC, @@ -1674,6 +1683,13 @@ static const struct pcie_cfg_data bcm7216_cfg = { .has_phy = true, }; +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, + .type = BCM7712, +}; + static const struct of_device_id brcm_pcie_match[] = { { .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg }, { .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg }, @@ -1683,6 +1699,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 }, {}, };