From patchwork Thu Mar 25 14:49:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1458384 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=ayW0AiFx; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F5p0m1mL2z9sVm for ; Fri, 26 Mar 2021 01:49:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E06FA8276D; Thu, 25 Mar 2021 15:49:38 +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="ayW0AiFx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6944B82838; Thu, 25 Mar 2021 15:49:37 +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-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 9C4C88006D for ; Thu, 25 Mar 2021 15:49:34 +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-wr1-x432.google.com with SMTP id k8so2581154wrc.3 for ; Thu, 25 Mar 2021 07:49:34 -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=zTFJYQW1c3YdCCh30wj2urANPakC0tY8Q3lX/mMpBOs=; b=ayW0AiFxnJHq7L1a3aeIZroc7HFJ/iV18eepNxkGgFHRlMWnkOmDp+y+IDs0mdJCEm yE694NFRbLFcFTiV50jALAP4n90vnPwWLpZN9Ea8H6ZJKxjCtUL48N7zlhV8Nqn8fjgY FZlEhFStNh/pe42WpSPrEE8uGWafWDY+jLG97GZUgsR6snHKOQzPnNmK+Z2M8n2woRC1 DGJA9fl9UifeMdMh8CHpVLHGov+xVbcw2pQ5u/r1WVE40RCHu8ZImogSXuGlfJa+oHs5 kD9JP1FLh3suYXpYR1DRb5xlLdRsBqYBrPa54Cs34b0dalScSV1VL0FgoThl+mmTxrsF +MZw== 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=zTFJYQW1c3YdCCh30wj2urANPakC0tY8Q3lX/mMpBOs=; b=Zoq1jaN20s2rRBB6MrzxoH7CHwAlSEMtSg3baI/7dc0+qfjAhLfcKFY3eLF24tS51x XZMZ+B5T+TOZcWhxeHGpMEJ83ovFNtBCw0k5RCCiZQ4W63PCg9nW2uAmLlzH+f+pv/V0 QVdjFYEoFEFT3XNvVW2Y4sitCXFpkaNy2ZY/xAKOg0cnxyzVr98c6E6hSweaBkhBtYC6 FBNJDvzPeJugHzKGsZB638SRH9d4x5wEgBxK1DnvbpFftyGNKlBw5mUQu1D5ATHpGkdx 0wduvYbBA+p8f383cyUQufvllJT05Q8ilO0qJkx5QUoEibMahmCO3wXRe8goVmfG6mMx 4ITg== X-Gm-Message-State: AOAM532YaVzubIJKMEWyCPwtiV1czR3+LO8EdM9WZemzipSWTnj70w13 l34rh0TISqf0wEQE+Uh9HU0dqQ== X-Google-Smtp-Source: ABdhPJxSl1f9K/Iy96jEhPM5l3lm4fYwjL92Sw79Femk4Mo967HJpCxx9O8Zu0TBXDG3vEMmlpuiNg== X-Received: by 2002:adf:ecc8:: with SMTP id s8mr9277578wro.11.1616683774113; Thu, 25 Mar 2021 07:49:34 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:b105:9672:b0a:5820]) by smtp.gmail.com with ESMTPSA id w6sm7787727wrl.49.2021.03.25.07.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:49:33 -0700 (PDT) From: Neil Armstrong To: lokeshvutla@ti.com, nsekhar@ti.com, shawn.lin@rock-chips.com, bmeng.cn@gmail.com, green.wan@sifive.com Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io, Neil Armstrong Subject: [PATCH RFT v2 0/4] pci: add common Designware PCIe functions and support Amlogic Meson PCIe controller Date: Thu, 25 Mar 2021 15:49:17 +0100 Message-Id: <20210325144921.1791892-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. Changes since v1: - added prefetch memory region support - switched to __iomem - fixed circular dependency for PCI_KEYSTONE 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 | 16 +- drivers/pci/Makefile | 2 + drivers/pci/pcie_dw_common.c | 366 +++++++++++++++++++++++++ drivers/pci/pcie_dw_common.h | 155 +++++++++++ drivers/pci/pcie_dw_meson.c | 459 ++++++++++++++++++++++++++++++++ drivers/pci/pcie_dw_rockchip.c | 472 ++------------------------------- drivers/pci/pcie_dw_ti.c | 444 +++---------------------------- 7 files changed, 1062 insertions(+), 852 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