From patchwork Tue Oct 29 21:07:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suneel Garapati X-Patchwork-Id: 1186300 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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="gUGMmA4G"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 472kqC3bCJz9sRN for ; Wed, 30 Oct 2019 08:14:15 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D2170C21C51; Tue, 29 Oct 2019 21:09:39 +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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 51E1FC21D8E; Tue, 29 Oct 2019 21:08:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D7A05C21E13; Tue, 29 Oct 2019 21:08:37 +0000 (UTC) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by lists.denx.de (Postfix) with ESMTPS id 75FBBC21DF8 for ; Tue, 29 Oct 2019 21:08:32 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id l24so10478986pgh.10 for ; Tue, 29 Oct 2019 14:08:32 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=HAtmxz+W7Z+AbcI2CKjop+6/7h5D6Ng7gOGtvBk446Q=; b=gUGMmA4Gsr3FXyFrpztcSqe0imC3jFZ68DD4rjoZXf88IriIRWKxMBO8WNYsqOpiuF J3+w636v86Hw0XI5RE/nXpwTrkz1U3grwfEhGtCr4QqCi9jncIzxqEBUG/iq9t4WakEO BGTDCoHoqrakQeadP+B6sb73lFUtRNyjZpZV983vnTR1JJld+eSq8vKEdRGhFlfTf3s/ Ntmv6+lzVSr3BxXtV1CqUDGRC+VQJb69w4i+OyffUwm8y9i7gZtWzbiHE1mnpwDyEVqH h633iLm+eG38Ufl3GOKhlI5K2pfOnatfUxCqhlKbSAWiGguEYHiErZcqdhctc0f4yuir idng== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HAtmxz+W7Z+AbcI2CKjop+6/7h5D6Ng7gOGtvBk446Q=; b=pNpZaQL7ZLGw0Y8h1pOtSle1R/1u3bAVgN5XBNCjXCAMqnRgrBRMeeiu5Pp8iuoso9 yJ8D8IK9hdt2V6AaMOoVze4TR1WwqzyIzqhZXpzgSTn/Bk8enyq1aUnEinar9encN2iK BjZQUKX98K94Czw1BRUykX1Ygo267jrEDgF8NmCVNQMx/PP3vtWzzn3U1utild0EFota geE6A8p7fNd40Izm6L3BM9xcCbOVvvjrlQZs2SEHshZ22zM634W/Ej0H0qQOcE46jECU cSeatHlAMug5rj5GSDLUwiq3SKYhhgcgPtRl+UT7ly7P4mzDKEZAIY78vHrBMXOqYXBg t4CA== X-Gm-Message-State: APjAAAWuT2EkBPQwHD4zKuYEIbnKxoOPbwBkoQbn7WIEfG68kuQejj9H GhVdQvDXm8ICrPIPoftE2Jx2TtbR X-Google-Smtp-Source: APXvYqz50CSJISu3/idaXwqhq4Pj7TO7tX/gDqPxE9e5Bfk0YVC2ndl65BRH35EimeApC61aooJ0OA== X-Received: by 2002:a63:ff66:: with SMTP id s38mr16259496pgk.84.1572383310892; Tue, 29 Oct 2019 14:08:30 -0700 (PDT) Received: from suneel.hsd1.ca.comcast.net ([2601:641:4000:c9c0:7044:5eef:7096:2413]) by smtp.gmail.com with ESMTPSA id q3sm131160pgj.54.2019.10.29.14.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 14:08:30 -0700 (PDT) From: Suneel Garapati To: u-boot Date: Tue, 29 Oct 2019 14:07:58 -0700 Message-Id: <20191029210821.1954-7-suneelglinux@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191029210821.1954-1-suneelglinux@gmail.com> References: <20191029210821.1954-1-suneelglinux@gmail.com> MIME-Version: 1.0 Cc: Tom Rini , Matthias Brugger , Joe Hershberger , Prasun Kapoor , Maen Suleiman , Chandrakala Chavva , Zi Shen Lim , Stefan Roese , Chris Packham Subject: [U-Boot] [RFC PATCH 06/29] drivers: pci-uclass: add multi entry support for pci regions 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" From: Suneel Garapati Enable PCI memory regions to be of multiple entry. This helps to add support for SoC's like OcteonTX/TX2 where every peripheral is on PCI bus. Signed-off-by: Suneel Garapati --- drivers/pci/Kconfig | 9 +++++++++ drivers/pci/pci-uclass.c | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 19e7b50046..752439afcf 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -43,6 +43,15 @@ config PCI_PNP help Enable PCI memory and I/O space resource allocation and assignment. +config PCI_REGION_MULTI_ENTRY + bool "Enable Multiple entries of MEMORY region for PCI" + depends on PCI || DM_PCI + default n + help + Enable PCI memory regions to be of multiple entry. This helps to + add support for SoC's like OcteonTX/TX2 where every peripheral is + on PCI bus. + config PCIE_ECAM_GENERIC bool "Generic ECAM-based PCI host controller support" default n diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 007b7472c6..f17e83565c 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -902,10 +902,12 @@ static void decode_regions(struct pci_controller *hose, ofnode parent_node, } pos = -1; +#if !CONFIG_IS_ENABLED(PCI_REGION_MULTI_ENTRY) for (i = 0; i < hose->region_count; i++) { if (hose->regions[i].flags == type) pos = i; } +#endif if (pos == -1) pos = hose->region_count++; debug(" - type=%d, pos=%d\n", type, pos);