Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2304088imw; Wed, 6 Jul 2022 03:46:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sxxR7eJtZFpguRtekCCUpe4FtfTP5oisuAlmSyk6UTr9ygUunaVOdaddnW4sOz99bs/qiI X-Received: by 2002:a17:902:efd5:b0:16b:ef4e:d40a with SMTP id ja21-20020a170902efd500b0016bef4ed40amr10416393plb.71.1657104369642; Wed, 06 Jul 2022 03:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657104369; cv=none; d=google.com; s=arc-20160816; b=W9oIWzLHDssoSw4h8hELjuAHeDZyB76nz1QP6Hqs6OZtUq62MWrsfDStRIvfl/Ms0U /ohcZbKdht9mcu2kcKZABv5GwEKHtTlZwc3pjf2mO3g+GO3Z9QpaBjZc9ID2+mr0P7VU m4H4+uB0RcTM13KocDw6ghgDN0tEIaKMGWHtURDyd5QPSLyX0hZ1qUS7GTFrLrzfP0rn D5QcG8FN/zdt8KesqzzoKTF0nTAl2vVnoAwXKyww92VJbgQCUW1L7jADXJsyQkq9+SrH V+JVKNeqL7dztjAIL1V3LJVDfI6hE6XkEESnInF/UWtTlke3oA17uVQfsRyZ2Xlmljyr r1/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=KQpsnBI8WM6vXFb6JUXNFYF3o0fkw8t7cg0kxlUtuLo=; b=kTe2OHlqRlLpsk5ko0kEeoGrOZvbwNZOeQTrVq5fQS1ZM4O3QNUQU790l62PnN/VSi WT0lilNSFAPPzIBH9b5osgAoe/HTeDkBeuwBlc4bWmF6LXFWkIel/Y9i/J6ZUl9bn4R1 ISIMHDI121yOhYvIA/8uhlNgNoeGE0mTBT4/VvlAZvB0FSm0mgys3/PtkW8WbUljaTI8 7trNMcMDXPV+/kTHqZlOjQkRiKkK7CDzkju23o+2S5oy3gGQDVRxPjPh4QhSF0ZvvhvI ecgqzzzOe3Rj6KBYtqyeZp2QZFiw7UIYovBG1LfckeB9uCBmyFkU+x94EkYKFcEVwe2n JeQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nh8cmyXU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i191-20020a6387c8000000b0041169d2d034si20196264pge.682.2022.07.06.03.45.57; Wed, 06 Jul 2022 03:46:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nh8cmyXU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233110AbiGFKnl (ORCPT + 99 others); Wed, 6 Jul 2022 06:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232324AbiGFKn3 (ORCPT ); Wed, 6 Jul 2022 06:43:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EEF1B6F; Wed, 6 Jul 2022 03:43:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 4B838CE1EBC; Wed, 6 Jul 2022 10:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 452CDC3411C; Wed, 6 Jul 2022 10:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657104200; bh=ZJU7+A8sh/C/YCWpWSHDj402O/F82gQIyYiqc8Vq+qE=; h=From:To:Cc:Subject:Date:From; b=nh8cmyXUfOvYI6WT/AqaEO7/btmBNWEvYeHfvCxNxPIErrpWyhHpKR+fhDtiBlvfa kT8ArZVV+1VD/6vlI01haiBNIlM+IlQtrAb/N+NaUp7z93wJLoENFaSD3my3yn0tS4 wMDuaZjjAlgQ5ROrTtALTzAF0Up4SJbomsO3rV4MVqdNQyCAOWd1wD1FYRlvNbTvUw ydBkCWCUX67FXFmcmfwJ/lcrXbeEDhV9s7IxPHyhwMhgdb0IGACmK27xw9oNsNdbMV If7giLMUEZpHlF1AReLsG27w2cYIcAr+1bDlGCJD8k46sn0/tXu5mq3V0+KBw4JBbJ KJyiIeWlt7FYQ== Received: by pali.im (Postfix) id 41DC57BA; Wed, 6 Jul 2022 12:43:17 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Nick Child , Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/5] powerpc/pci: Cleanup unused code and enable 256 PCI buses Date: Wed, 6 Jul 2022 12:43:03 +0200 Message-Id: <20220706104308.5390-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series cleanup unused code by eliminating it at compile time and then enable usage of all 256 PCI buses per every PCI domain as currently PCI bus numbers have to be unique across all PCI domains. So first bus number of each PCI domain would be zero and not the bus number of the previous domain plus one. As such bus assignment changes BDF address of every PCI device on multi-domain system, this new "feature" is configurable by config option to prevent regressions. Tested on Freescale P2020 board. Before this patch lspci reports: 8000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21) 8000:01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02) 9000:02:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21) 9000:03:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network Adapter (rev 01) a000:04:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21) a000:05:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter With these patches and enabled config option it reports: 8000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21) 8000:01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02) 9000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21) 9000:01:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network Adapter (rev 01) a000:00:00.0 PCI bridge: Freescale Semiconductor Inc P2020E (rev 21) a000:01:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter Now every PCIe Root Port is on bus zero and theoretically with enough multiport PCIe switches connected to every PCIe Root Port, it should be possible to have 256 PCI buses on every PCIe controller (as each is in own PCI domain) and therefore connect more PCIe cards as without these patches. Pali Rohár (5): powerpc/pci: Hide pci_device_from_OF_node() for non-powermac code powerpc/pci: Make pcibios_make_OF_bus_map() static powerpc/pci: Hide pci_create_OF_bus_map() for non-chrp code powerpc/pci: Disable filling pci-OF-bus-map for non-chrp/powermac powerpc/pci: Add config option for using all 256 PCI buses arch/powerpc/Kconfig | 11 +++++++++++ arch/powerpc/include/asm/pci-bridge.h | 4 ++++ arch/powerpc/kernel/pci_32.c | 27 +++++++++++++++++++++------ arch/powerpc/kernel/pci_64.c | 2 ++ 4 files changed, 38 insertions(+), 6 deletions(-) -- 2.20.1