From patchwork Sat Apr 27 08:15:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 1091929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qS056sQb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44rqZV4WdNz9s5c for ; Sat, 27 Apr 2019 22:13:22 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4F721C21DA1; Sat, 27 Apr 2019 12:11:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D077CC21DB5; Sat, 27 Apr 2019 12:10:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C3CFEC21C29; Sat, 27 Apr 2019 08:15:35 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by lists.denx.de (Postfix) with ESMTPS id 723B0C21C27 for ; Sat, 27 Apr 2019 08:15:35 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id k16so7710017wrn.5 for ; Sat, 27 Apr 2019 01:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cXZG/ZqbnDnb2Efs/qljCxLrVZfkTIf2ZSOQkTE+lZw=; b=qS056sQbNpcquQmHbf7tl8HP+hilP9Sgh81IoF6MlJfE+0jUMwhaIdPFJKIuUNVfqE Xgltk2x4mfg94ObTwW6tzome3HvwOFp/9M4ZWCvU56IS8stNlJETx5VfEYLX7JfINpjx C9vKuWMpJoOlcMOVE4Pxpy6A9Za2hAm0HDfO4qWR5EBdrVJtOefnCYkhyfjDUzJze1ff l8EtU0zrj5i/76BHL3XrPNgeZIak37gGSBz0I7wblAIFKtHa4HhUFnHNRyoEkyh6aUwC JLB83JhScyoLQ4dy3wNOiilgB0C7Zw2yxHTfkRIEPZxdBySzpmHlXL9V7wjze+8ueP1j XJZA== 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=cXZG/ZqbnDnb2Efs/qljCxLrVZfkTIf2ZSOQkTE+lZw=; b=js+69TMfhftv60cij7oHPvKbhoL+coHOFUs7OFTXrPw+l8DNLBy0CWNruFk9Q93jNy ZVfe13+bpjJCBV0EQA/ptL5Oiq0UcWm7s2tOjgHc/k27XocC8zU2W6WbBJY1KcULko13 Z5HnFODaTb3yCuw38Gvt/9qUzZo5HsGTv7AnWm+/fCOq65N86cc/G2eR4SqrmMHgEtvB ZNyGxFcr5u7YBWgRGj9pad9FIet3hGIgdUFxKDbVw2qDUpeITKv1YCdJghKwZSX3JLS9 9ptB9ezjqd7TnjvqyzBS/9NoX+emOZApxnDfZHlNOmeL/Gzn8uFBMVhzlSLEBd6KrDXL YMJw== X-Gm-Message-State: APjAAAWFkMzLXE6Qlqo5cPX52F91osdmWcs340XBM5kPNaFmpOfCs26u 8WfmcVvdIUBhKhPGw9EZh/U= X-Google-Smtp-Source: APXvYqz5jtDrSUh0ythJ7o45FoC47p7Lg2F1ia/pfMKATaOBVtqtPYR46CE4HhEvJe+qV1NR+uIsSQ== X-Received: by 2002:adf:dbc1:: with SMTP id e1mr17081070wrj.203.1556352934787; Sat, 27 Apr 2019 01:15:34 -0700 (PDT) Received: from localhost.localdomain ([141.226.31.91]) by smtp.gmail.com with ESMTPSA id u17sm19724163wmj.1.2019.04.27.01.15.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Apr 2019 01:15:33 -0700 (PDT) From: Ramon Fried To: sjg@chromium.org Date: Sat, 27 Apr 2019 11:15:20 +0300 Message-Id: <20190427081524.5759-1-ramon.fried@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 27 Apr 2019 12:10:19 +0000 Cc: u-boot@lists.denx.de, Stefan Roese , Michal Simek , Ryder Lee , Heinrich Schuchardt , Alexander Graf , Krzysztof Kozlowski , Ramon Fried , Eugeniu Rosca , Joe Hershberger , Maxime Ripard Subject: [U-Boot] [PATCH v3 0/4] Add Cadence PCIe endpoint driver with new uclass X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" This patchset adds support for new uclass, UCLASS_PCI_EP allowing new set of PCI endpoint drivers. Included in the patch is also a driver for Cadence PCIe endpoint. Changes in V2: - Removed "pci.h: add missing maskbit" as it was already merged by Simon. - Added PCI endpoint sandbox driver - Added testing for sandbox driver - Addressed issues raised by Simon in UCLASS_PCI_EP class implementation Changes in v3: - Added function to read bar config - Fixed a bug in set MSI implementation (missing -1) - Elaborate a bit more in comments - Added MAINTAINER entry for PCI Endpoint - Added more description to commit message and kmsg - Removed some unused functionality that can't be tested. - Removed entries from sandbox config and added implies and select to arch/Kconfig sandbox entry. - Added more testing of sandbox driver Ramon Fried (4): drivers: pci_ep: Introduce UCLASS_PCI_EP uclass pci_ep: add Cadence PCIe endpoint driver pci_ep: add pci endpoint sandbox driver test: pci_ep: add basic pci_ep tests MAINTAINERS | 6 + arch/Kconfig | 2 + arch/sandbox/dts/test.dts | 4 + arch/sandbox/include/asm/test.h | 8 + .../pci_endpoint/cdns,cdns-pcie-ep.txt | 18 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/pci_endpoint/Kconfig | 34 ++ drivers/pci_endpoint/Makefile | 8 + drivers/pci_endpoint/pci_ep-uclass.c | 211 +++++++++ drivers/pci_endpoint/pcie-cadence-ep.c | 177 ++++++++ drivers/pci_endpoint/pcie-cadence.h | 309 +++++++++++++ drivers/pci_endpoint/sandbox-pci_ep.c | 182 ++++++++ include/dm/uclass-id.h | 1 + include/pci_ep.h | 414 ++++++++++++++++++ test/dm/Makefile | 1 + test/dm/pci_ep.c | 64 +++ 17 files changed, 1442 insertions(+) create mode 100644 doc/device-tree-bindings/pci_endpoint/cdns,cdns-pcie-ep.txt create mode 100644 drivers/pci_endpoint/Kconfig create mode 100644 drivers/pci_endpoint/Makefile create mode 100644 drivers/pci_endpoint/pci_ep-uclass.c create mode 100644 drivers/pci_endpoint/pcie-cadence-ep.c create mode 100644 drivers/pci_endpoint/pcie-cadence.h create mode 100644 drivers/pci_endpoint/sandbox-pci_ep.c create mode 100644 include/pci_ep.h create mode 100644 test/dm/pci_ep.c