Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2574461pxb; Mon, 18 Apr 2022 03:51:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHQFxo5AoyVtckWl65PB4RGw0AMiNl+S7TIIMniiF3JRweHblOQuaAEDeBH9DKHRxtbEeW X-Received: by 2002:a05:6402:1f15:b0:41d:8bc2:6f09 with SMTP id b21-20020a0564021f1500b0041d8bc26f09mr11468152edb.143.1650279114379; Mon, 18 Apr 2022 03:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650279114; cv=none; d=google.com; s=arc-20160816; b=fRAymN9kaL2yRv2cErVCMDRhpgo89B/q66t+FfGtMMM972es7aAGgo09MBYi+o2zUc 3kBIB7/22kraHivpV1+mJxofUZqmIbk1TPg3OzPprnAdWCBD1l5U8KBxUSS16gGTAKX7 ulQSATQzZ9WZDu++amlpyNdZpRgn8y5u8sO/ToYLAh2uwOvGDMfia0y1GkummqCISnUW k3jefxH/Naa0QbxfNgkc4fsSMQWI6a1p927HnHyXvchhTkkSVMhqliQagjdSFf/j+7Dm xkTBe40nx/UYAZyQ6kotw9BRSiWK8AIjKLPfXmVcLy8+WQRrQA7/kaOQ2Wypsr3oAaWv 4Cjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5P+kuagV6Z84gNo/RLW8HroxGzgqmpKqpzpblsOEYl4=; b=MgIZsBqfZW+4wp3WMu2/2SEEz3gQ8XdlKkOTZV+wOZzN9KwvTg831ljehOexogndMX TYNFqXHksenw0SWX5ttOP09lhypR/Wjzu30327Ki4HApbreyd4XcU1EbnZ278c0J0WkW hfldwIt5ipJMCPaWk8wTGTiS3+K4+WZ8HIxqVmqzlO8tdDQO1lAe613k83vLYUSEhMnE hqcZpstmM9nvrvj6hiZxQ/p5wmrXuBZ8HrWf5E4dcj9rBPl+kzWG3dkSgRGxkZiWc4CV Mm+syDnJvrGqLjp8JgDSGrd2i40yqvBMy0PoQ671GLBvICyOMJdDs2t80GW7mQHUHGjn 58Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=SAxjKjmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fx15-20020a170906b74f00b006e886d5db42si5496200ejb.420.2022.04.18.03.51.29; Mon, 18 Apr 2022 03:51:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=SAxjKjmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232202AbiDPN6Y (ORCPT + 99 others); Sat, 16 Apr 2022 09:58:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232133AbiDPN6K (ORCPT ); Sat, 16 Apr 2022 09:58:10 -0400 Received: from mxout4.routing.net (mxout4.routing.net [IPv6:2a03:2900:1:a::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61F9941303; Sat, 16 Apr 2022 06:55:38 -0700 (PDT) Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout4.routing.net (Postfix) with ESMTP id AEF821007A0; Sat, 16 Apr 2022 13:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1650117336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5P+kuagV6Z84gNo/RLW8HroxGzgqmpKqpzpblsOEYl4=; b=SAxjKjmrGjaI1uK2U/O/6+N2p68chmV2mmP0kNgXJkUHVP5KL3bknUE0AkqdNT+5e+l2kG XrqOi5Hjk5GehVDEX+/mX7WQqtUy9X+XoZEWVw1Si5Or1yjMXtD9besm0+TK6yIjW63ZJs MQmC1tcWWEXhAI7nih/OVDT1onLdqpg= Received: from localhost.localdomain (fttx-pool-217.61.150.108.bambit.de [217.61.150.108]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 6ADE81006D1; Sat, 16 Apr 2022 13:55:35 +0000 (UTC) From: Frank Wunderlich To: linux-rockchip@lists.infradead.org Cc: Frank Wunderlich , Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Bjorn Helgaas , Philipp Zabel , Johan Jonker , Peter Geis , Michael Riesch , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [RFC/RFT 4/6] PCI: rockchip-dwc: add pcie bifurcation Date: Sat, 16 Apr 2022 15:54:56 +0200 Message-Id: <20220416135458.104048-5-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220416135458.104048-1-linux@fw-web.de> References: <20220416135458.104048-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mail-ID: 81dc4821-c206-4329-8a32-b1fae495dacc X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frank Wunderlich PCIe Lanes can be split to 2 slots with bifurcation. Add support for this in existing pcie driver. Co-developed-by: Peter Geis Signed-off-by: Frank Wunderlich --- drivers/pci/controller/dwc/pcie-dw-rockchip.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c index 863374604fb1..1b0c2115b32e 100644 --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "pcie-designware.h" @@ -59,6 +60,7 @@ struct rockchip_pcie { struct regulator *vpcie3v3; struct irq_domain *irq_domain; raw_spinlock_t irq_lock; + bool bifurcation; }; static int rockchip_pcie_readl_apb(struct rockchip_pcie *rockchip, @@ -273,6 +275,12 @@ static int rockchip_pcie_phy_init(struct rockchip_pcie *rockchip) return dev_err_probe(dev, PTR_ERR(rockchip->phy), "missing PHY\n"); + if (rockchip->bifurcation) { + ret = phy_set_mode_ext(rockchip->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_BIFURCATION); + if (ret) + return ret; + } + ret = phy_init(rockchip->phy); if (ret < 0) return ret; @@ -345,6 +353,9 @@ static int rockchip_pcie_probe(struct platform_device *pdev) } } + if (device_property_read_bool(dev, "rockchip,bifurcation")) + rockchip->bifurcation = true; + ret = rockchip_pcie_phy_init(rockchip); if (ret) goto disable_regulator; -- 2.25.1