From patchwork Mon Mar 22 09:18:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1456428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=WoWPx0Ky; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F3pnw5DWgz9sWF for ; Mon, 22 Mar 2021 20:18:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 61C5380A4C; Mon, 22 Mar 2021 10:18:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="WoWPx0Ky"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 10F3580A4C; Mon, 22 Mar 2021 10:18:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE23D80200 for ; Mon, 22 Mar 2021 10:18:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=narmstrong@baylibre.com Received: by mail-wm1-x32c.google.com with SMTP id w203-20020a1c49d40000b029010c706d0642so10822368wma.0 for ; Mon, 22 Mar 2021 02:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=h7cHnNeVuxm99mWC9y6v/9uTO8W2TCbz/evep+udaiw=; b=WoWPx0KyYeYFTbiDgMI6yaKvOqVnhN/3bcGLJQH6/Z/zM995oj/NwMwYqo1WpImfbB GMuaFR2QpyxGmF+4rBjQLin6daqklL++HG48Rl8A1UBVQs4KXyiRIEKej90MvakH7HBj B0YVauSKbLoDZ9gSUV27sX3WPwi6YxTYhDBPqeGIO0C02CZe1GGCtMUSdr7wbm6YTSiU qF2nWYyy8CsS8B+lK0A6lGBioEm1MUtYvW4b1BaDwUg3apQC37Vi09cbGns4muIud01u LVYcXiWL19aNqy3W0MBSE42paeAn2uVQGchbVd4ThvFwPkMB9jHSiV8ChbHNv7wcTD4C 7/Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=h7cHnNeVuxm99mWC9y6v/9uTO8W2TCbz/evep+udaiw=; b=MCDW7oSdFa2x4D07RnGZZGWv2nebbGKxYrBhfmtPpIfjaveIM5HkCEAwPQ0/94CdGj Akxg9As1Y6Sq+TfWtaX81mw3jR9SACtQSrD6TliYlP7feiPnIwh0z1lJzrIONhSKwqIA N6H7Ogo6AcqjLyCavqIgj6ZBCzKq0qTPXGaD/I3OMrwE2/5OpDyKMVjYmY/2XaOoAIgH SrCWpKmHQtCr3IpowCd+8uh3AHWUoLamToXuBSyCsmRF8EtEUCn/wIlz0+V0Ji0fjNz/ DPAIBxVyG0srjTQpvXTTj799Cmxl79uvaajHpqP6nlw4V1EnLvSNCN+/qL8xPCWNGEN1 YVsw== X-Gm-Message-State: AOAM532LebVKU5V1O33naDvtSJCAokP9wxNu39DkC3dvc8kjEybgnlVF eGeEfK3TKLt/DSUHeoF9/gBv3w== X-Google-Smtp-Source: ABdhPJzO4+dTmU1cBl+TzZckgeZSzTfTkTLF0HCTSRoO42Kdx6WyGyWIZp13tfJrbzMyZA7qe0LxBg== X-Received: by 2002:a1c:b0c4:: with SMTP id z187mr14678016wme.81.1616404696156; Mon, 22 Mar 2021 02:18:16 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:ad09:d3a7:e7fe:de22]) by smtp.gmail.com with ESMTPSA id n4sm15560723wmq.40.2021.03.22.02.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 02:18:15 -0700 (PDT) From: Neil Armstrong To: lokeshvutla@ti.com, nsekhar@ti.com, shawn.lin@rock-chips.com Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io, Neil Armstrong Subject: [PATCH RFT 0/4] pci: add common Designware PCIe functions and support Amlogic Meson PCIe controller Date: Mon, 22 Mar 2021 10:18:08 +0100 Message-Id: <20210322091812.2511462-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean With the introduction of pcie_dw_rockchip, and need to support the DW PCIe in the Amlogic AXG & G12 SoCs, most of the DW PCIe helpers would be duplicated. This introduce a "common" DW PCIe helpers file with common code merged from the dw_ti and dw_rockchip drivers and adapted to fit with the upcoming dw_meson. The following changes will switch the dw_ti and dw_rockchip, and introduce a new driver to support the Amlogic AXG & G12 SoCs using these new common helpers. The dw_meson has been validated, but the dw_ti and dw_rockchip would need testing on hardware to validate nothing has been broken. Neil Armstrong (4): pci: add common Designware PCIe functions pci: pcie_dw_ti: migrate to common Designware PCIe functions pci: pcie_dw_rockchip: migrate to common Designware PCIe functions pci: add Amlogic Meson Designware PCIe controller drivers/pci/Kconfig | 15 +- drivers/pci/Makefile | 2 + drivers/pci/pcie_dw_common.c | 352 ++++++++++++++++++++++++ drivers/pci/pcie_dw_common.h | 153 +++++++++++ drivers/pci/pcie_dw_meson.c | 459 ++++++++++++++++++++++++++++++++ drivers/pci/pcie_dw_rockchip.c | 472 ++------------------------------- drivers/pci/pcie_dw_ti.c | 444 +++---------------------------- 7 files changed, 1046 insertions(+), 851 deletions(-) create mode 100644 drivers/pci/pcie_dw_common.c create mode 100644 drivers/pci/pcie_dw_common.h create mode 100644 drivers/pci/pcie_dw_meson.c