From patchwork Fri Jun 29 09:22:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 936728 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=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41HB5K4pj6z9ry1 for ; Fri, 29 Jun 2018 19:23:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933551AbeF2JXA (ORCPT ); Fri, 29 Jun 2018 05:23:00 -0400 Received: from mail.bootlin.com ([62.4.15.54]:44610 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbeF2JW7 (ORCPT ); Fri, 29 Jun 2018 05:22:59 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 835FE20DDD; Fri, 29 Jun 2018 11:22:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AAubervilliers-681-1-87-188.w90-88.abo.wanadoo.fr [90.88.29.188]) by mail.bootlin.com (Postfix) with ESMTPSA id 9AD64207F3; Fri, 29 Jun 2018 11:22:37 +0200 (CEST) From: Thomas Petazzoni To: Bjorn Helgaas , Lorenzo Pieralisi , linux-pci@vger.kernel.org Cc: Russell King , linux-arm-kernel@lists.infradead.org, Gregory Clement , =?utf-8?q?Miqu=C3=A8l_Raynal?= , Maxime Chevallier , Antoine Tenart , Nadav Haklai , Victor Gu , Wilson Ding , Zachary Zhang , Thomas Petazzoni Subject: [PATCH 0/3] PCI: emulated PCI bridge common logic Date: Fri, 29 Jun 2018 11:22:28 +0200 Message-Id: <20180629092231.32207-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.14.4 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hello, The pci-mvebu driver already contains some logic to emulate a root port PCI bridge. It turns out that we have a similar need for the pci-aardvark driver. Instead of duplicating the same logic in two drivers, this patch series starts by adding a small common infrastructure that helps emulate a root port PCI bridge, converts pci-mvebu to use it, and finally extends pci-aardvark to use it as well. Thanks to this, Marvell Armada 3720 based systems, which use the Aarkvark PCI controller, will have better PCI support, by having a root port PCI bridge exposed. The emulated PCI bridge common logic is a proposal, I very much welcome comments and suggestions. Also, if you feel that adding a common logic for only two drivers is too early, I'm fine with duplicating a bit of code betwen pci-mvebu and pci-aardvark. Best regards, Thomas Thomas Petazzoni (2): PCI: Introduce PCI software bridge common logic PCI: mvebu: Convert to PCI software bridge Zachary Zhang (1): PCI: aardvark: Implement emulated root PCI bridge drivers/pci/Kconfig | 3 + drivers/pci/Makefile | 1 + drivers/pci/controller/Kconfig | 2 + drivers/pci/controller/pci-aardvark.c | 119 ++++++++++- drivers/pci/controller/pci-mvebu.c | 370 ++++++++++------------------------ drivers/pci/pci-sw-bridge.c | 149 ++++++++++++++ include/linux/pci-sw-bridge.h | 125 ++++++++++++ 7 files changed, 497 insertions(+), 272 deletions(-) create mode 100644 drivers/pci/pci-sw-bridge.c create mode 100644 include/linux/pci-sw-bridge.h