From patchwork Tue Oct 25 06:52:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018527 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0EF7FA373E for ; Tue, 25 Oct 2022 06:53:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230520AbiJYGxK (ORCPT ); Tue, 25 Oct 2022 02:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbiJYGxI (ORCPT ); Tue, 25 Oct 2022 02:53:08 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2088.outbound.protection.outlook.com [40.107.93.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80AFDCD5F9; Mon, 24 Oct 2022 23:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VI60PHmMkysWpm39Wqcklfiyq83cq17iN19WfTIZvCpuc6mYae404THXfontYE0vxtZpndzwQphrutckXEQ3tJlKantkNkBB3zxJCeT1xDh0m3CNEd4cqWSjHZWmzGBCMGXzKDt7GHan6gLw292gdv39UE3JaEfQdyNuajFcwvspe+YNjLcDPFiFQbJuenHJe9zfRof2t8Pht8cmUnrpHIvLlsVeG1dMlWDjNMqgLtYNwvkjmrdD7uGpiP5vDxkB91eCIcKM1J5swsw9xaZfr7JuB9oCXyHD6AhGiF25VzjfQ/7cTdYiP22GlsrGDbNcceHtOHVluN7ReoLIBbN1Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XZPJJahAvYM9GOhoWjDEhyPeof8yzWTmQGoD3VO4gT0=; b=SzH0qbxfi5OE075RebsPeSks2m9Rd5p7qAv6iwgJU9njkBxz7y4gzzAB9+pldkKSHX+BLOa7wUDofVUTZ5oc9RgnRnGynYLPqEqXmYOXz3I1wk6kJiL5JStNsGMjH04VwjytPAsw9JUNzeu/dy/elEG5STvHjAtr+98ThsV5PTcPas6pWoi7f3PplU9mJ/2CzG6OxXhjGkeJRdS5g1WewLnCT0WSrSdNDsnusBDeHqbovEp72DxImWpK74QGkz0NZIjkO4y6frkfcNn9f9fthfv54Q5n0+ScGr4kXOkFRfewgWx84+rkBQjagA4hy+zDhQyarP4lCgIACN+Y7cadbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XZPJJahAvYM9GOhoWjDEhyPeof8yzWTmQGoD3VO4gT0=; b=Kp+oDLCNrQxFWWRCGMzs5JZY/KRRjn9bV14J8odbGPlIU5pz+8pEgHjWiev7Itkr6SUGKWfMWTikgMJnVYur2ZCvQRm58CCwQqioc+6KNi7S031pEr+VEevIS6hImtxNcpxno4z8wwuBBpF+2EUftCOaN5zPvt5n1ZJYcfpdjF4= Received: from DM6PR03CA0090.namprd03.prod.outlook.com (2603:10b6:5:333::23) by SJ0PR12MB5437.namprd12.prod.outlook.com (2603:10b6:a03:302::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Tue, 25 Oct 2022 06:53:03 +0000 Received: from DM6NAM11FT089.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::13) by DM6PR03CA0090.outlook.office365.com (2603:10b6:5:333::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.27 via Frontend Transport; Tue, 25 Oct 2022 06:53:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT089.mail.protection.outlook.com (10.13.173.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:03 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:01 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:52:58 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 01/13] microblaze/PCI: Remove unused early_read_config_byte() et al declarations Date: Tue, 25 Oct 2022 12:22:02 +0530 Message-ID: <20221025065214.4663-2-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT089:EE_|SJ0PR12MB5437:EE_ X-MS-Office365-Filtering-Correlation-Id: 14f3855e-6741-46e9-8afb-08dab6559008 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WCZ+WoypvesvjAKU1Vab+mCx/XZV+mRCXdvz+NoS8ZC6Wnz9Fn6mutkDWjWE/4soNuAxm7V46MVM24KBDCIvlz2rbDfByugMTOxoG1+52jlzYrmI/KRi4/niSXT0WMVXjT6Hpx9bWP5/35/gMptwPWZfXpIv5iE/XAVIowEsNd49ZprMNsQYj+548Ir2cEwGrvwW6EHL6f/OM+qNSqJ7+wukrnv+ij9CLjy/OkmenE9E7RuJEW8IiXF0i7JYS1jhsoz6/5YkKysIjacnjSl44NgnK2hv9AuTeA2pZl8vOoM7P+tF17i32PnqhGVofWAMt7/zh1IIdMHvnFy9sLIbEGr3FyXSWEePJBJjSU8eAAP9CGLiwsS/3DTozBJahD6GZ+E3U4f2s47QDk3zxBNgbW1P7tmAWMeIq13hx1sVCk7RJ5DmE6zydFFQyc9vkTmUQfDLwZ2miLRA66vAxQZWJc173bvQHdHXoukywH7wvRoa8wcWQdCNEUTUYrLrlxec5+j90BYnvs0yOxyFTa2647KAzjrUP/tEl6qyZHrdAJ/om1XAZvyWEncfVn40aTkOOSoL0KX3XECw924vkc7whTVXjs+IuvJ0m0auvPuyMd7TbzKDtMKFtLdoGmKg9/PA8KMGUoUw3beAoQhj6KKSpiCaR4OzNWK9Gz0hdeENJqiZ0ftNopf17cGk3Rd+mvPi5rb0EIdUd4PpQ5ybk7oaS7QW2Q8YHflMSGwm5KJYQrTlvtAn4PntqN4x5tTaGQGnfrMU0i1rWOvuX9Tilq4TvJGqOrMcXBH4YKQfleizf2nP2i+V1+SU/l6oABo4CTnk X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199015)(40470700004)(46966006)(36840700001)(316002)(70206006)(70586007)(40480700001)(82310400005)(36860700001)(336012)(44832011)(82740400003)(356005)(81166007)(2906002)(4326008)(41300700001)(8676002)(26005)(6666004)(36756003)(478600001)(110136005)(54906003)(47076005)(426003)(86362001)(8936002)(5660300002)(83380400001)(1076003)(186003)(2616005)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:03.0519 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14f3855e-6741-46e9-8afb-08dab6559008 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT089.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5437 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org early_read_config_byte() and similar are declared but never defined. Remove the unused declarations. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 18 ------------ arch/microblaze/pci/pci-common.c | 5 ---- arch/microblaze/pci/xilinx_pci.c | 48 -------------------------------- 3 files changed, 71 deletions(-) diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 171b40a..a9d3940 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -103,24 +103,6 @@ static inline int isa_vaddr_is_ioport(void __iomem *address) } #endif /* CONFIG_PCI */ -/* These are used for config access before all the PCI probing - has been done. */ -extern int early_read_config_byte(struct pci_controller *hose, int bus, - int dev_fn, int where, u8 *val); -extern int early_read_config_word(struct pci_controller *hose, int bus, - int dev_fn, int where, u16 *val); -extern int early_read_config_dword(struct pci_controller *hose, int bus, - int dev_fn, int where, u32 *val); -extern int early_write_config_byte(struct pci_controller *hose, int bus, - int dev_fn, int where, u8 val); -extern int early_write_config_word(struct pci_controller *hose, int bus, - int dev_fn, int where, u16 val); -extern int early_write_config_dword(struct pci_controller *hose, int bus, - int dev_fn, int where, u32 val); - -extern int early_find_capability(struct pci_controller *hose, int bus, - int dev_fn, int cap); - extern void setup_indirect_pci(struct pci_controller *hose, resource_size_t cfg_addr, resource_size_t cfg_data, u32 flags); diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 33bab7e..69ce51c 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -1060,8 +1060,3 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn) EARLY_PCI_OP(write, word, u16) EARLY_PCI_OP(write, dword, u32) -int early_find_capability(struct pci_controller *hose, int bus, int devfn, - int cap) -{ - return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap); -} diff --git a/arch/microblaze/pci/xilinx_pci.c b/arch/microblaze/pci/xilinx_pci.c index f4cb86f..7ed6647 100644 --- a/arch/microblaze/pci/xilinx_pci.c +++ b/arch/microblaze/pci/xilinx_pci.c @@ -76,44 +76,6 @@ static void xilinx_pci_fixup_bridge(struct pci_dev *dev) { return (bus != 0); } - -/** - * xilinx_early_pci_scan - List pci config space for available devices - * - * List pci devices in very early phase. - */ -static void __init xilinx_early_pci_scan(struct pci_controller *hose) -{ - u32 bus = 0; - u32 val, dev, func, offset; - - /* Currently we have only 2 device connected - up-to 32 devices */ - for (dev = 0; dev < 2; dev++) { - /* List only first function number - up-to 8 functions */ - for (func = 0; func < 1; func++) { - pr_info("%02x:%02x:%02x", bus, dev, func); - /* read the first 64 standardized bytes */ - /* Up-to 192 bytes can be list of capabilities */ - for (offset = 0; offset < 64; offset += 4) { - early_read_config_dword(hose, bus, - PCI_DEVFN(dev, func), offset, &val); - if (offset == 0 && val == 0xFFFFFFFF) { - pr_cont("\nABSENT"); - break; - } - if (!(offset % 0x10)) - pr_cont("\n%04x: ", offset); - - pr_cont("%08x ", val); - } - pr_info("\n"); - } - } -} -#else -static void __init xilinx_early_pci_scan(struct pci_controller *hose) -{ -} #endif /** @@ -146,15 +108,6 @@ void __init xilinx_pci_init(void) r.start + XPLB_PCI_DATA, INDIRECT_TYPE_SET_CFG_TYPE); - /* According to the xilinx plbv46_pci documentation the soft-core starts - * a self-init when the bus master enable bit is set. Without this bit - * set the pci bus can't be scanned. - */ - early_write_config_word(hose, 0, 0, PCI_COMMAND, PCI_HOST_ENABLE_CMD); - - /* Set the max latency timer to 255 */ - early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0xff); - /* Set the max bus number to 255, and bus/subbus no's to 0 */ pci_reg = of_iomap(pci_node, 0); WARN_ON(!pci_reg); @@ -166,5 +119,4 @@ void __init xilinx_pci_init(void) INDIRECT_TYPE_SET_CFG_TYPE); pr_info("xilinx-pci: Registered PCI host bridge\n"); - xilinx_early_pci_scan(hose); } From patchwork Tue Oct 25 06:52:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018528 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06CA1C38A2D for ; Tue, 25 Oct 2022 06:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231288AbiJYGxO (ORCPT ); Tue, 25 Oct 2022 02:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbiJYGxL (ORCPT ); Tue, 25 Oct 2022 02:53:11 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2052.outbound.protection.outlook.com [40.107.212.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 063BD43323; Mon, 24 Oct 2022 23:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IqHrqWupdgZ/TnxflcZdQMc0WxIaoeO21TwG/ejd6NzxxUYMipx/8AagLhYCdGhRyBdIJoPsKdz+661NhX7YCED9dr0P79j2MgBJOAzfsNgpNdBUXwzhNWgbkfXWF7nD6dScw4dULGE9swmUiDtuGXBstYRMfPOVWLbJZfT2EJkv51YKY+4l90fLHBDeRLITM2Bem75Q/WSu27gRyRPgiCVBSasVpBB+h5sfq5dhdALHnoFWxIMaZr5OcC1d86NxCeIjelY2jtHvXGXaGKETdzpiv5d4vuZfWLVCgWuRrZr30B9bqVJ09cW1/xWSzz6BY64bcyMnnfJqXOH5+WlYEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3W+4MPc5n6RdCbQDePmn1uWM4TgWoEY5+Ukz/RNbSVw=; b=jqSM2naIAskIXlBhAmRDeyYrW0a2EtHbwmNUcFBulliFlz+RdrZq9y5qCdwu0N0/dUNu/UytHZk0KjcQ643Fw5lOStyl0HoE96ZIrODt+UaS24XvJv5qxiGY2ha34etHCD2Z15r86KGOAF9gMMcD4lSX33rxRztYGl43sDhiENz54jiItuKF2qzkd8g3MzAQEMUASzzPTVy0e3wzx968L3wymNxAkYaQrlrAaNx99AkcD7QH5rNJJBYxNzQBIpMHBN8M9Ue/4R9TsQA3kee1Zh24bSecJCWAcsN7Dro4HroVW+orrXItrsKyTgax3y7k9mqlH3M3YgRCo4dKUQtxFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3W+4MPc5n6RdCbQDePmn1uWM4TgWoEY5+Ukz/RNbSVw=; b=ek7ZOX48pcddHFrnWOpGzlVA04ylKn+LGMyDzxzXs7j850FswBSTasfDogj3MiUwNHcQuvIyBeUEvUMeOKsaf31CFaFJrRKYkqioDK9iYOrJd9ZHCv2vwdEH26jRK8JjuxcyKb2LrQW9FQt4V/nHkRPfjPcWEw1b23UQ79cR88k= Received: from DS7PR05CA0075.namprd05.prod.outlook.com (2603:10b6:8:57::16) by PH0PR12MB5606.namprd12.prod.outlook.com (2603:10b6:510:141::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Tue, 25 Oct 2022 06:53:05 +0000 Received: from DM6NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::1e) by DS7PR05CA0075.outlook.office365.com (2603:10b6:8:57::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.8 via Frontend Transport; Tue, 25 Oct 2022 06:53:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT025.mail.protection.outlook.com (10.13.172.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:05 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:04 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:01 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 02/13] microblaze/PCI: Remove Null PCI config access unused functions Date: Tue, 25 Oct 2022 12:22:03 +0530 Message-ID: <20221025065214.4663-3-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT025:EE_|PH0PR12MB5606:EE_ X-MS-Office365-Filtering-Correlation-Id: a064805e-01b9-43d6-1794-08dab6559152 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rHgOq6UuPUvFF5qX6dnpHgZimNvhE7easo+B+o9DPIa7nel4RfMpcnYI4Eo291LT3IVcek3os30rAYFLpd7ZdaBi6IhBUCp1OwVx6YbT69NmYNI6daNPKSslqaJu7OFv420teKmm39selypYJzkugsJdph/0nOdXkhUxgeQxWaIT82VfOJWPxMpHYewassnkwDu4Q5b7819WTyBx1QSF/ychFQeqd8QBARJiIUGO+CbybuXh7m7AC95apOW5+tOcjs3Lipe5lBhAWbAEbi9kd9toFFklMlXT3CSltkTBfPrDllt6J8diDHYM+sacpPrQTgQRuocH7WA12v1ouAZXFidyzkLcWN+0sR9z39G3hyXhp8hdNrIUMIJabpZ2Yx3uLWt9mhuQsPxrAYR0b/iFOdLivJ9DOBEA4p4DLKzhz3Wsrki4WCmzswIDzz4MjN5LxVrcmgbJkKHwZsZWd2co4lJhl0XT7LsjFZWPf2G9S0qUeKsGYFL0wIqwuCtkqBtWUeEdR3c4LQEX/hBdwxBTVQLx9Cxxd4O6WW9wM46KcSfvnG+Ql/5/AduAEYkSA8LgPKCtBMMDnI5Sl24z9HjI8RWz1/7yLUm3sqqeawp/nLISseiTQRYOj9uM++umLbDgoyzzYfD5q8aaKvO429gseFzm4QFUYZH9bikoWTEKthCaxwXLN/2Q36FfZuVx1tvCcVXhIt73lYQh2E9Ws5QUJH2i1Lk6igYG1bf1qf59hmUgWmUNX7kpgiwxe4PaQGeDSm4QLCCahZOOfW3BW4WpH7hfN+FD9mCWpJy9mHR7Y7XcUcy0B9HZOHuoST/E0mYC X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199015)(46966006)(40470700004)(36840700001)(86362001)(70586007)(110136005)(8676002)(70206006)(4326008)(316002)(40460700003)(54906003)(44832011)(36756003)(5660300002)(8936002)(41300700001)(47076005)(81166007)(82740400003)(40480700001)(36860700001)(26005)(356005)(82310400005)(478600001)(426003)(336012)(83380400001)(186003)(2616005)(1076003)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:05.2116 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a064805e-01b9-43d6-1794-08dab6559152 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5606 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unused NULL_PCI_OP config access functions, for the case when we can't find a hose. Remove unused EARLY_PCI_OP and other declarations. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/pci/pci-common.c | 64 ---------------------------------------- 1 file changed, 64 deletions(-) diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 69ce51c..58397cf 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -996,67 +996,3 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn) return result; } - -/* - * Null PCI config access functions, for the case when we can't - * find a hose. - */ -#define NULL_PCI_OP(rw, size, type) \ -static int \ -null_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \ -{ \ - return PCIBIOS_DEVICE_NOT_FOUND; \ -} - -static int -null_read_config(struct pci_bus *bus, unsigned int devfn, int offset, - int len, u32 *val) -{ - return PCIBIOS_DEVICE_NOT_FOUND; -} - -static int -null_write_config(struct pci_bus *bus, unsigned int devfn, int offset, - int len, u32 val) -{ - return PCIBIOS_DEVICE_NOT_FOUND; -} - -static struct pci_ops null_pci_ops = { - .read = null_read_config, - .write = null_write_config, -}; - -/* - * These functions are used early on before PCI scanning is done - * and all of the pci_dev and pci_bus structures have been created. - */ -static struct pci_bus * -fake_pci_bus(struct pci_controller *hose, int busnr) -{ - static struct pci_bus bus; - - if (!hose) - pr_err("Can't find hose for PCI bus %d!\n", busnr); - - bus.number = busnr; - bus.sysdata = hose; - bus.ops = hose ? hose->ops : &null_pci_ops; - return &bus; -} - -#define EARLY_PCI_OP(rw, size, type) \ -int early_##rw##_config_##size(struct pci_controller *hose, int bus, \ - int devfn, int offset, type value) \ -{ \ - return pci_bus_##rw##_config_##size(fake_pci_bus(hose, bus), \ - devfn, offset, value); \ -} - -EARLY_PCI_OP(read, byte, u8 *) -EARLY_PCI_OP(read, word, u16 *) -EARLY_PCI_OP(read, dword, u32 *) -EARLY_PCI_OP(write, byte, u8) -EARLY_PCI_OP(write, word, u16) -EARLY_PCI_OP(write, dword, u32) - From patchwork Tue Oct 25 06:52:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018529 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6053FA3740 for ; Tue, 25 Oct 2022 06:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231408AbiJYGxP (ORCPT ); Tue, 25 Oct 2022 02:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231379AbiJYGxL (ORCPT ); Tue, 25 Oct 2022 02:53:11 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D88D42E4E; Mon, 24 Oct 2022 23:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eHd/lfKBZIC6SnrNJIanSQ3Njxotlx/6WtCXPui5tx+OcdUnqa5Fal0eJx9csZRPDR2XPQRVXJKIuBprJ1sPeyMyR3ZDEJFTyx8whQW4nsqj9S+0ABQ+Zf9RbbN19ZE4Yqvr5So8Hhfhx+ETFObKceziGdqzYf7rvMfgRZyOfqemu29ymMeIKUrWkVMcWGFqrLuHeJ7XPJCQmVRV9Sr7VjFhIsG/JocE1KuNu6kRKJpk4EpuWeLXPu3/N/3Yf/SeeHwY1RQ08Wv+DhXRvTQ2y14e0kiAQPj7eemXp9ecAXvp228YtZLGMdGif5aMeHRy222djZ6JIcPp3AKrQw53Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+Qim3nbKB+i4XowF4RwWsvHZ41O/PxAGFMo24XcwqCc=; b=Mu21/BlmQzkcbil1Si1NlDT6Trtkt8NafeZCpOv+zTC+X65soKNhEU/SHLB7shxa/liMXqsLBUr5tJFoMct9SLgncdtrkZTwG2rh7kmYC0NSFwrb787347B4IfQdmJ/chlXRehIgg5hSSpikx0+jDDRcWRPNIdZml/CpAkuRb4QL33FeIlKzNnN3T27Ul+EiApcaetGD6FOCbwH24m135GUFhmrrD6ztvh/IQRvCCxtq5SQscLONkxRxQPnOkbXYNN+1wpW/2/VGIl0RPCJkJOVUBTKRrRZN9QjvkU1gLGWh43VcWES3d5ZCNrYB3R4t7xg/hBIMrdhEgimAhzSBAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Qim3nbKB+i4XowF4RwWsvHZ41O/PxAGFMo24XcwqCc=; b=k1jXzYMbNWO5R/re9ACEjCpF31OIrBb0vGjGl1Yov6eNAnJQy7aNPymobf7aGD9S3oyLwaSgZ3PTt+KWtMaQ58gcuy51l+wnlyXsUtNY1HMRz6fwYsV1LXx6ud8TCM2Mz7JCJw92nI5GXFYUBQck8/UQjLbeV/Z8KKdiUIkRWnI= Received: from DS7P222CA0025.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::31) by DM4PR12MB5152.namprd12.prod.outlook.com (2603:10b6:5:393::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Tue, 25 Oct 2022 06:53:08 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2e:cafe::13) by DS7P222CA0025.outlook.office365.com (2603:10b6:8:2e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.27 via Frontend Transport; Tue, 25 Oct 2022 06:53:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:08 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:07 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:05 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 03/13] microblaze/PCI: Remove unused PCI bus scan if configured as a host Date: Tue, 25 Oct 2022 12:22:04 +0530 Message-ID: <20221025065214.4663-4-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT029:EE_|DM4PR12MB5152:EE_ X-MS-Office365-Filtering-Correlation-Id: a511c590-84fb-46a7-0505-08dab655932e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Od4pOhVnl3uK97cbtJwnzH91FsnyeYiMUXjcaYDlLdSnuvRiNpiW5Nk2cHoCBXq0sKBDwgiur9dnnVcJwZaY3S8wvrmPnQI5edRILrIjVlmpzxRxTiJSPfysAuJW+Ww86jNr2sUkLH/MFMjUy/WXGQbxgMSARPcdAIAJX+hPfotejdJjmVDYYQaDBfPG4l+XdqiPsfqmaSlMTXfskyPkrV0JvIhGGLbkgkK7Kr/IQeS3frXysJhVa/ReXVu4GzXvkDoOJw/ANsdyn0ep1wQ512+sr5MkFLfxpA7bGes1CvCNHQK1pPvX+DRqjeR8ygZ6gqfvCDaygwokTKYMZJsOD4cchmYAgxt6ocYm24UIhDcchpqrz/NGt3jRxTiXrZdScZNTGgNC2uSxvf+vpEUM8deuTgWyrbKbg0v7Y/od1AFUiF8s2zcYEEFWBarplMnKXTZbe98AC2cZJl5L/CoEKEkZ4IPk9b3rhR3NE//vW5CnKaNJS+XnZBCaJ1mVRmiuPMQl87XlOosQpfRxaLn03AnnzfqeXPTYJEmexckNX/S+ZNmN+lar/R2YtKZJmQCKSGxdEnDOR7DncGdgeXfItDRgvWcYbGb+M5VbgU4fLCoZ2wuLE10HXuUWwJAOOOslRsWdpo6826biuJg98hWFxt9DFfL7bmtGAnQdJDE7AnptuR3yNPlWSpOL98DiLBzVHUbwnS578znW5MYQdr1wI1WiW2/oOtrzfNbMFkgVTrxArgskaRJ+Eo61WUHBJDlVzCwYFeZWAGpKYrUu7RnhoMhd6F90Keg1chhRO3X0iKo= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(2616005)(36756003)(40480700001)(2906002)(54906003)(1076003)(70586007)(36860700001)(110136005)(336012)(41300700001)(316002)(70206006)(8936002)(82740400003)(81166007)(86362001)(5660300002)(8676002)(4326008)(44832011)(426003)(40460700003)(478600001)(26005)(82310400005)(186003)(47076005)(356005)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:08.3307 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a511c590-84fb-46a7-0505-08dab655932e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5152 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This routine is meant to be used early during boot, when the PCI bus numbers have not yet been assigned, and you need to issue PCI config cycles to an OF device. It could also be used to "fix" RTAS config cycles if you want to set pci_assign_all_buses to 1 and still use RTAS for PCI config cycles. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 4 ---- arch/microblaze/pci/pci-common.c | 19 ------------------- 2 files changed, 23 deletions(-) diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index a9d3940..ce74b0c 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -107,10 +107,6 @@ extern void setup_indirect_pci(struct pci_controller *hose, resource_size_t cfg_addr, resource_size_t cfg_data, u32 flags); -/* Get the PCI host controller for an OF device */ -extern struct pci_controller *pci_find_hose_for_OF_device( - struct device_node *node); - /* Fill up host controller resources from the OF node */ extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, struct device_node *dev, int primary); diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 58397cf..6ccaf33 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -122,25 +122,6 @@ unsigned long pci_address_to_pio(phys_addr_t address) } EXPORT_SYMBOL_GPL(pci_address_to_pio); -/* This routine is meant to be used early during boot, when the - * PCI bus numbers have not yet been assigned, and you need to - * issue PCI config cycles to an OF device. - * It could also be used to "fix" RTAS config cycles if you want - * to set pci_assign_all_buses to 1 and still use RTAS for PCI - * config cycles. - */ -struct pci_controller *pci_find_hose_for_OF_device(struct device_node *node) -{ - while (node) { - struct pci_controller *hose, *tmp; - list_for_each_entry_safe(hose, tmp, &hose_list, list_node) - if (hose->dn == node) - return hose; - node = node->parent; - } - return NULL; -} - void pcibios_set_master(struct pci_dev *dev) { /* No special bus mastering setup handling */ From patchwork Tue Oct 25 06:52:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018532 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BFD8FA3740 for ; Tue, 25 Oct 2022 06:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbiJYGx6 (ORCPT ); Tue, 25 Oct 2022 02:53:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231376AbiJYGxy (ORCPT ); Tue, 25 Oct 2022 02:53:54 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2068.outbound.protection.outlook.com [40.107.94.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B896D58507; Mon, 24 Oct 2022 23:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VXawekAEqTzoUq4gje3kqpdRcdSrsv9ms2O/4i7nTAKAp8uInH0c9t6+E0oBZqACrJZGl6nCafTjn9AuS2CdEP2214SSRp5qCr/6ztCNyvQnVGvYMVsgblfP9wWfGi/TDhyaq4SLrWem55t874x0p7o7XGUCfVY3RUqSSslQk89o94+UzH97/nncozNSvgJtQB1alUicugeLtpDfzZBQd0KUJsIK/EP22MKTVpCxHxiF1Wi6hntb2VrEjndPA6fO6UNfkYJjPXNP3Ol/hcOGMOIWYhBW5xa+HVtjMwHv7n+U1F0Z2XrFLxqS9IR1dHbvJBptIQYDytFRBGRSLbMadA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=goNxu6pBKIuoYleAH24z7RYLds0YoEJz6olkIaC6uB4=; b=PMmTgjDmLxwXhcSatUG7lVMyKce9G2XOv99/gWiB4hCcbac6PmWFlDra3kQ8lkAQnWw+f5MbJecUqECzb+TsKBwa0obTwKtlGlaP7wygUnkHu/f7cq7M6Hwr4UhOUt1OPiMgIDtm6td28Ay/tvio0MJWyJzlN03A84oySZmcAEIPiYzLNz+ZN+dBw/GLFy5fcICkuDYwD/GmePIIa7Q9JANFHuoGjL32TBJFNA4JuXasn0iAWAD+BcMU7O6lYFxNLBmEE32bHrYHLSkhurmop06Tt6pIuRvZWnwZX7W2gUHG4dZ9jJr4Cl2sBpoMReiM2wOJoiEqTTAD26dpm9LxvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=goNxu6pBKIuoYleAH24z7RYLds0YoEJz6olkIaC6uB4=; b=IhwpJW3iSptmWA5IGQ/VP6OIjPLbL+YwJIO06sE8aHyuSvgcjNN3IVVj9csu5Oz9FT/FL7kTNHOq4tysUaMdKXywiaKIbBs7dXNKw+BN4E3tzI0VgoY4ZwdBgZuGgo2gXbzlsmcp87a0KF1syW2RRnYhv+0MUdB37vSGkQKg22E= Received: from DS7PR03CA0206.namprd03.prod.outlook.com (2603:10b6:5:3b6::31) by IA1PR12MB6626.namprd12.prod.outlook.com (2603:10b6:208:3a2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Tue, 25 Oct 2022 06:53:48 +0000 Received: from DM6NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::13) by DS7PR03CA0206.outlook.office365.com (2603:10b6:5:3b6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Tue, 25 Oct 2022 06:53:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT014.mail.protection.outlook.com (10.13.173.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:48 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:43 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:08 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 04/13] microblaze/PCI: Remove unused PCI legacy IO's access on a bus Date: Tue, 25 Oct 2022 12:22:05 +0530 Message-ID: <20221025065214.4663-5-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT014:EE_|IA1PR12MB6626:EE_ X-MS-Office365-Filtering-Correlation-Id: f83630a2-5429-4c3c-b347-08dab655ab1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Qs+qBJPEwld0JyuqBDlet/QhSDpBW6TMElngewMZHfUzQcTdAMuRzY5mS9RuyXZM+vGS/PCFjSlUYl+Wej5mnNo8Xr04/7I79ZcDvqJGYZw6lBM61NrUE7op2sGREReQow7LYRiC+TUv01JvYaEHzazJUj+PQzp5oO7K2CeUAh+Snw+QlxS6Ah+jvPTcDKIpItcT6TTnp4uonIFd8e8R3fnrLxiFnWvDrbRLqv/IkwKy4vIGEvj1ANIo7hGhq1v8tsZ5WNZ2BQztwC4EuQE+3EmPtx+Amsrn7GrdWqM5m85HTQkImGo0sSmdx2X6HGbrN3FGteYxxBhVHbkrwxIwxA+0JugW/Qp7joFYDvmkhxMUN143OJz5w+BNb6l4NBwWkAKc4kiLsnd5aY7ghG7zsj2qdncdpDvDav2mQzdCkmvmXfAKilU14IzuRnSgkrQ+e0VtVYddZN7RlXs+GjNMcwiUiSx7cA8d9v4kVFLH3bO2rQVjTbLIpEyPHulGfagg1/NtySYPiUxB8VEGDDxV+aosPz/aYyih+Ovc2oNms+nODCoXGMPUu9O3WesMQOM9AZHVALkDH4MtUVMtn3mbEtvIvytfF4WfqfbLDJ++IbBMuzdA4OdnYZPCFuaS3uiskSF2k6wwRH0t/WWmxUxbP9yElpnK6yP8VFfDpJXfKx4GbbkoEqjw4YC3r2lCty5dMc1fQzfq7wrHCSRlWVggoB+6K1+uwllb80LMAnS9/AFlSm5KtWOM5b5e34/gYUiX5BlFi9amkhUDcySf7UNE/AOWFy00VY68p1+Xb83XyE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(39860400002)(376002)(396003)(451199015)(40470700004)(36840700001)(46966006)(1076003)(2906002)(83380400001)(186003)(47076005)(336012)(40460700003)(4326008)(8676002)(81166007)(26005)(41300700001)(356005)(82310400005)(86362001)(36756003)(110136005)(316002)(82740400003)(54906003)(40480700001)(36860700001)(8936002)(426003)(478600001)(70586007)(44832011)(2616005)(70206006)(5660300002)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:48.4759 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f83630a2-5429-4c3c-b347-08dab655ab1b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6626 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove PCI legacy read,write and mmap access IO's on a bus Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci.h | 10 --- arch/microblaze/pci/pci-common.c | 140 -------------------------------------- 2 files changed, 150 deletions(-) diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index d905280..34337e2 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h @@ -48,16 +48,6 @@ #define ARCH_GENERIC_PCI_MMAP_RESOURCE 1 #define arch_can_pci_mmap_io() 1 -extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val, - size_t count); -extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val, - size_t count); -extern int pci_mmap_legacy_page_range(struct pci_bus *bus, - struct vm_area_struct *vma, - enum pci_mmap_state mmap_state); - -#define HAVE_PCI_LEGACY 1 - extern void pcibios_resource_survey(void); struct file; diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 6ccaf33..ef4a9fc 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -146,146 +146,6 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma) return 0; } -/* This provides legacy IO read access on a bus */ -int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val, size_t size) -{ - unsigned long offset; - struct pci_controller *hose = pci_bus_to_host(bus); - struct resource *rp = &hose->io_resource; - void __iomem *addr; - - /* Check if port can be supported by that bus. We only check - * the ranges of the PHB though, not the bus itself as the rules - * for forwarding legacy cycles down bridges are not our problem - * here. So if the host bridge supports it, we do it. - */ - offset = (unsigned long)hose->io_base_virt - _IO_BASE; - offset += port; - - if (!(rp->flags & IORESOURCE_IO)) - return -ENXIO; - if (offset < rp->start || (offset + size) > rp->end) - return -ENXIO; - addr = hose->io_base_virt + port; - - switch (size) { - case 1: - *((u8 *)val) = in_8(addr); - return 1; - case 2: - if (port & 1) - return -EINVAL; - *((u16 *)val) = in_le16(addr); - return 2; - case 4: - if (port & 3) - return -EINVAL; - *((u32 *)val) = in_le32(addr); - return 4; - } - return -EINVAL; -} - -/* This provides legacy IO write access on a bus */ -int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val, size_t size) -{ - unsigned long offset; - struct pci_controller *hose = pci_bus_to_host(bus); - struct resource *rp = &hose->io_resource; - void __iomem *addr; - - /* Check if port can be supported by that bus. We only check - * the ranges of the PHB though, not the bus itself as the rules - * for forwarding legacy cycles down bridges are not our problem - * here. So if the host bridge supports it, we do it. - */ - offset = (unsigned long)hose->io_base_virt - _IO_BASE; - offset += port; - - if (!(rp->flags & IORESOURCE_IO)) - return -ENXIO; - if (offset < rp->start || (offset + size) > rp->end) - return -ENXIO; - addr = hose->io_base_virt + port; - - /* WARNING: The generic code is idiotic. It gets passed a pointer - * to what can be a 1, 2 or 4 byte quantity and always reads that - * as a u32, which means that we have to correct the location of - * the data read within those 32 bits for size 1 and 2 - */ - switch (size) { - case 1: - out_8(addr, val >> 24); - return 1; - case 2: - if (port & 1) - return -EINVAL; - out_le16(addr, val >> 16); - return 2; - case 4: - if (port & 3) - return -EINVAL; - out_le32(addr, val); - return 4; - } - return -EINVAL; -} - -/* This provides legacy IO or memory mmap access on a bus */ -int pci_mmap_legacy_page_range(struct pci_bus *bus, - struct vm_area_struct *vma, - enum pci_mmap_state mmap_state) -{ - struct pci_controller *hose = pci_bus_to_host(bus); - resource_size_t offset = - ((resource_size_t)vma->vm_pgoff) << PAGE_SHIFT; - resource_size_t size = vma->vm_end - vma->vm_start; - struct resource *rp; - - pr_debug("pci_mmap_legacy_page_range(%04x:%02x, %s @%llx..%llx)\n", - pci_domain_nr(bus), bus->number, - mmap_state == pci_mmap_mem ? "MEM" : "IO", - (unsigned long long)offset, - (unsigned long long)(offset + size - 1)); - - if (mmap_state == pci_mmap_mem) { - /* Hack alert ! - * - * Because X is lame and can fail starting if it gets an error - * trying to mmap legacy_mem (instead of just moving on without - * legacy memory access) we fake it here by giving it anonymous - * memory, effectively behaving just like /dev/zero - */ - if ((offset + size) > hose->isa_mem_size) { - pr_debug("Process %s (pid:%d) mapped non-existing PCI", - current->comm, current->pid); - pr_debug("legacy memory for 0%04x:%02x\n", - pci_domain_nr(bus), bus->number); - if (vma->vm_flags & VM_SHARED) - return shmem_zero_setup(vma); - return 0; - } - offset += hose->isa_mem_phys; - } else { - unsigned long io_offset = (unsigned long)hose->io_base_virt - - _IO_BASE; - unsigned long roffset = offset + io_offset; - rp = &hose->io_resource; - if (!(rp->flags & IORESOURCE_IO)) - return -ENXIO; - if (roffset < rp->start || (roffset + size) > rp->end) - return -ENXIO; - offset += hose->io_base_phys; - } - pr_debug(" -> mapping phys %llx\n", (unsigned long long)offset); - - vma->vm_pgoff = offset >> PAGE_SHIFT; - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, - vma->vm_end - vma->vm_start, - vma->vm_page_prot); -} - void pci_resource_to_user(const struct pci_dev *dev, int bar, const struct resource *rsrc, resource_size_t *start, resource_size_t *end) From patchwork Tue Oct 25 06:52:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018530 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6A34FA373E for ; Tue, 25 Oct 2022 06:53:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbiJYGx4 (ORCPT ); Tue, 25 Oct 2022 02:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbiJYGxv (ORCPT ); Tue, 25 Oct 2022 02:53:51 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85DAB57225; Mon, 24 Oct 2022 23:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a7nmNeANpyECj6UHhLNT5RgfUI3ksdmkQNz6eqJH4ZdOKaLgI2tYfR/c6zW1JxiQi440PCRqgpwB464eer/dlZLWFRwPsXdmiNu3PO5rVrvV2Dqv36EDURwzYdStp2gwl3ODaH2Fvj9lyRH+7PSPGLG5xLWlZVwI2kdhjI07bCGwr1C2p3QrzeeNrf+YscrIp8zps+FdtELyjyN4wjJpy/FPA86TgHVJwghEj3myYCAKKhm7hkUFvib6lgouWkhjI1aBbC8KxvJ+F31l/NKJ4N/7Ngm7DccJpuASLe/TQA42fKpOZhupiFTnMupCQEW7UEMVngCzx+JpGmVT/mEjbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g7Ch1D7H4JfsRTBSbPRLM8rYC0XAUY7OwecvH+SsaXQ=; b=goVIIVk1MWrHoeChqLSygC0b+35FE7IujF03wyA/jr1tSrAnpj50yn3wdcwokf3lcOGROPaj+ZjloNh+IfKppM8nWTUwsMT3pWd/vngaPRcvB41a/H4AbUq1zKObi1Kzj2Wlm7q4br1on8iKxCpRLcsCXjGALdLzhMKW7LbB8E0j/7H6IMg0BZoUHq2f0dPTDL+vwQAVtx0C36UVlSbW4ZaFVB2gg6YxVnBIyH6wv8yqDD1RyCmaqbAPQdOv9pz/EGMzY2nzRGwcX2bmrvfSo7MFpe1wsI0/eiaL0JHxYZwx7CDQDTQye5A/RkgulB0kIFtC3x1tfkXgTSujg0Ku3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g7Ch1D7H4JfsRTBSbPRLM8rYC0XAUY7OwecvH+SsaXQ=; b=eDJLoSnJUSU8bNc3NwwcnJsPJUfse7/YHLjEShZn8Ic1Akk9GxGHVqOXYzOZmttBDPPlfUDzGl3OCdqngYObRy4Y56+tBN0x2mERm1t6P+YQwbuTs6rV27pQ0DaQsUHs55Qu0MCBnShyviicl64vKf043PqHuutHCTZXxLphR5U= Received: from DM6PR02CA0064.namprd02.prod.outlook.com (2603:10b6:5:177::41) by PH7PR12MB6419.namprd12.prod.outlook.com (2603:10b6:510:1fd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Tue, 25 Oct 2022 06:53:47 +0000 Received: from DM6NAM11FT071.eop-nam11.prod.protection.outlook.com (2603:10b6:5:177:cafe::d9) by DM6PR02CA0064.outlook.office365.com (2603:10b6:5:177::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.27 via Frontend Transport; Tue, 25 Oct 2022 06:53:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT071.mail.protection.outlook.com (10.13.173.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:47 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:46 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:46 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:43 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 05/13] microblaze/PCI: Remove unused device tree parsing for a host bridge resources Date: Tue, 25 Oct 2022 12:22:06 +0530 Message-ID: <20221025065214.4663-6-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT071:EE_|PH7PR12MB6419:EE_ X-MS-Office365-Filtering-Correlation-Id: 86879a29-65a0-462e-8025-08dab655aa78 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z/auqdwrSr9w9UNOfKucILuWp51mCqRP0xyw8wj8qz0S6musgX+BhEJyQZz8AswZXWjoUaya0bQLEWiEvlX/XxRjW6NqGE+VFyhb9iN+CGbKhijsVvPaZvtypzv934aHQfk9bQihu7rqgUZH8+ND8n4XhvJaRx43W+QUlJXxIIrixc35ff396tyTseAJ/WYDOWjHZRyJBn/G9BMs+h02AsGm95lm4tef2Iw0mgucYJfru7y73EzlCV4nsMwWpteLsTzvCFEEhi+9rIji9VfSEXxC0senDioPmFf862H3tIGMFAZ7zsI5geBo5moUJtUEaKGzVu6UaaJSlatv5bE6NyhCU54WIWmUBnHR/t97pMEmLQvqV6lxwkKvM1TNO6nXXpIOqxsKVSbgaOvaHN2tEK293H/lcfvlV7QXS26cmRkdlpZFxg0auadFtNOEaeYhyjV3V6a50+P3l+s6qR5LKKrkD8BnCG4fKndw18WYd+LasgB/zlTMd63840ISKE4xzEIT6niMBkIUi1cPVQ1AtihnlbV7lAjU/mnhaEBsqGdj5rKpDozbVGIEOhotAhK3n/xPcdMmmq7MQ9dorHx//1vDJo96aaCq4eweVyTD2dxsZAp+56jRhImMguEg9dp33zx6tyXIH/TikKag8HxYK2HMTTk7BR6BdwNL4EgDXUBDj7Q/XmcrB2hPybrM1PNsaE3Rnh2XBaP+TWWXKQY43LmwtKZ5QQuFeGXgpcxQpfD/KL5IwUdYTlPQTzm1dYuKty7+HmNqwWubO0oyX9jC/hDbEM+ITJ0az6KsAZx1aRa9AMhQMQ8L/W8VQVUYWeAG X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(346002)(136003)(396003)(451199015)(40470700004)(36840700001)(46966006)(82310400005)(6666004)(4326008)(86362001)(70206006)(8676002)(70586007)(36860700001)(336012)(82740400003)(186003)(83380400001)(1076003)(2906002)(40460700003)(41300700001)(426003)(47076005)(26005)(356005)(81166007)(8936002)(2616005)(5660300002)(40480700001)(44832011)(36756003)(478600001)(66899015)(54906003)(316002)(110136005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:47.4064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86879a29-65a0-462e-8025-08dab655aa78 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT071.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6419 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unused pci_process_bridge_OF_ranges function, used to parse the "ranges" property of a PCI host device. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 13 --- arch/microblaze/pci/pci-common.c | 163 ------------------------------- arch/microblaze/pci/xilinx_pci.c | 5 - 3 files changed, 181 deletions(-) diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index ce74b0c..252bcc1 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -38,20 +38,11 @@ struct pci_controller { void __iomem *io_base_virt; resource_size_t io_base_phys; - resource_size_t pci_io_size; - /* Some machines (PReP) have a non 1:1 mapping of * the PCI memory space in the CPU bus space */ resource_size_t pci_mem_offset; - /* Some machines have a special region to forward the ISA - * "memory" cycles such as VGA memory regions. Left to 0 - * if unsupported - */ - resource_size_t isa_mem_phys; - resource_size_t isa_mem_size; - struct pci_ops *ops; unsigned int __iomem *cfg_addr; void __iomem *cfg_data; @@ -107,10 +98,6 @@ extern void setup_indirect_pci(struct pci_controller *hose, resource_size_t cfg_addr, resource_size_t cfg_data, u32 flags); -/* Fill up host controller resources from the OF node */ -extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, - struct device_node *dev, int primary); - /* Allocate & free a PCI host bridge structure */ extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev); extern void pcibios_free_controller(struct pci_controller *phb); diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index ef4a9fc..12764df0 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -171,169 +171,6 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar, *end = rsrc->end; } -/** - * pci_process_bridge_OF_ranges - Parse PCI bridge resources from device tree - * @hose: newly allocated pci_controller to be setup - * @dev: device node of the host bridge - * @primary: set if primary bus (32 bits only, soon to be deprecated) - * - * This function will parse the "ranges" property of a PCI host bridge device - * node and setup the resource mapping of a pci controller based on its - * content. - * - * Life would be boring if it wasn't for a few issues that we have to deal - * with here: - * - * - We can only cope with one IO space range and up to 3 Memory space - * ranges. However, some machines (thanks Apple !) tend to split their - * space into lots of small contiguous ranges. So we have to coalesce. - * - * - We can only cope with all memory ranges having the same offset - * between CPU addresses and PCI addresses. Unfortunately, some bridges - * are setup for a large 1:1 mapping along with a small "window" which - * maps PCI address 0 to some arbitrary high address of the CPU space in - * order to give access to the ISA memory hole. - * The way out of here that I've chosen for now is to always set the - * offset based on the first resource found, then override it if we - * have a different offset and the previous was set by an ISA hole. - * - * - Some busses have IO space not starting at 0, which causes trouble with - * the way we do our IO resource renumbering. The code somewhat deals with - * it for 64 bits but I would expect problems on 32 bits. - * - * - Some 32 bits platforms such as 4xx can have physical space larger than - * 32 bits so we need to use 64 bits values for the parsing - */ -void pci_process_bridge_OF_ranges(struct pci_controller *hose, - struct device_node *dev, int primary) -{ - int memno = 0, isa_hole = -1; - unsigned long long isa_mb = 0; - struct resource *res; - struct of_pci_range range; - struct of_pci_range_parser parser; - - pr_info("PCI host bridge %pOF %s ranges:\n", - dev, primary ? "(primary)" : ""); - - /* Check for ranges property */ - if (of_pci_range_parser_init(&parser, dev)) - return; - - pr_debug("Parsing ranges property...\n"); - for_each_of_pci_range(&parser, &range) { - /* Read next ranges element */ - - /* If we failed translation or got a zero-sized region - * (some FW try to feed us with non sensical zero sized regions - * such as power3 which look like some kind of attempt - * at exposing the VGA memory hole) - */ - if (range.cpu_addr == OF_BAD_ADDR || range.size == 0) - continue; - - /* Act based on address space type */ - res = NULL; - switch (range.flags & IORESOURCE_TYPE_BITS) { - case IORESOURCE_IO: - pr_info(" IO 0x%016llx..0x%016llx -> 0x%016llx\n", - range.cpu_addr, range.cpu_addr + range.size - 1, - range.pci_addr); - - /* We support only one IO range */ - if (hose->pci_io_size) { - pr_info(" \\--> Skipped (too many) !\n"); - continue; - } - /* On 32 bits, limit I/O space to 16MB */ - if (range.size > 0x01000000) - range.size = 0x01000000; - - /* 32 bits needs to map IOs here */ - hose->io_base_virt = ioremap(range.cpu_addr, - range.size); - - /* Expect trouble if pci_addr is not 0 */ - if (primary) - isa_io_base = - (unsigned long)hose->io_base_virt; - /* pci_io_size and io_base_phys always represent IO - * space starting at 0 so we factor in pci_addr - */ - hose->pci_io_size = range.pci_addr + range.size; - hose->io_base_phys = range.cpu_addr - range.pci_addr; - - /* Build resource */ - res = &hose->io_resource; - range.cpu_addr = range.pci_addr; - - break; - case IORESOURCE_MEM: - pr_info(" MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n", - range.cpu_addr, range.cpu_addr + range.size - 1, - range.pci_addr, - (range.flags & IORESOURCE_PREFETCH) ? - "Prefetch" : ""); - - /* We support only 3 memory ranges */ - if (memno >= 3) { - pr_info(" \\--> Skipped (too many) !\n"); - continue; - } - /* Handles ISA memory hole space here */ - if (range.pci_addr == 0) { - isa_mb = range.cpu_addr; - isa_hole = memno; - if (primary || isa_mem_base == 0) - isa_mem_base = range.cpu_addr; - hose->isa_mem_phys = range.cpu_addr; - hose->isa_mem_size = range.size; - } - - /* We get the PCI/Mem offset from the first range or - * the, current one if the offset came from an ISA - * hole. If they don't match, bugger. - */ - if (memno == 0 || - (isa_hole >= 0 && range.pci_addr != 0 && - hose->pci_mem_offset == isa_mb)) - hose->pci_mem_offset = range.cpu_addr - - range.pci_addr; - else if (range.pci_addr != 0 && - hose->pci_mem_offset != range.cpu_addr - - range.pci_addr) { - pr_info(" \\--> Skipped (offset mismatch) !\n"); - continue; - } - - /* Build resource */ - res = &hose->mem_resources[memno++]; - break; - } - if (res != NULL) { - res->name = dev->full_name; - res->flags = range.flags; - res->start = range.cpu_addr; - res->end = range.cpu_addr + range.size - 1; - res->parent = res->child = res->sibling = NULL; - } - } - - /* If there's an ISA hole and the pci_mem_offset is -not- matching - * the ISA hole offset, then we need to remove the ISA hole from - * the resource list for that brige - */ - if (isa_hole >= 0 && hose->pci_mem_offset != isa_mb) { - unsigned int next = isa_hole + 1; - pr_info(" Removing ISA hole at 0x%016llx\n", isa_mb); - if (next < memno) - memmove(&hose->mem_resources[isa_hole], - &hose->mem_resources[next], - sizeof(struct resource) * (memno - next)); - hose->mem_resources[--memno].flags = 0; - } -} - /* Display the domain number in /proc */ int pci_proc_domain(struct pci_bus *bus) { diff --git a/arch/microblaze/pci/xilinx_pci.c b/arch/microblaze/pci/xilinx_pci.c index 7ed6647..f1a5112 100644 --- a/arch/microblaze/pci/xilinx_pci.c +++ b/arch/microblaze/pci/xilinx_pci.c @@ -114,9 +114,4 @@ void __init xilinx_pci_init(void) out_be32(pci_reg + XPLB_PCI_BUS, 0x000000ff); iounmap(pci_reg); - /* Register the host bridge with the linux kernel! */ - pci_process_bridge_OF_ranges(hose, pci_node, - INDIRECT_TYPE_SET_CFG_TYPE); - - pr_info("xilinx-pci: Registered PCI host bridge\n"); } From patchwork Tue Oct 25 06:52:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018531 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1196FA373F for ; Tue, 25 Oct 2022 06:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231394AbiJYGx5 (ORCPT ); Tue, 25 Oct 2022 02:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231367AbiJYGxy (ORCPT ); Tue, 25 Oct 2022 02:53:54 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2066.outbound.protection.outlook.com [40.107.94.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE61C4332A; Mon, 24 Oct 2022 23:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fb74m58qKYf33zF2Is5CSesvCtN5VkQ8gAOOtCi1zZ1wESv8YS5ZHYnZ4XbU/6CtPVvmzlhP2Mp0h+sXcD32qVJ8YTdG0DqpjKjIdfOFifaBK/oF8ey4PcUy++WCi2tOxWHrnNYcsJzjNN8zMzGr8bNUWDykJoz8nfHw4RFbYZySJC1PFXj8MBFDYiPZ/CbARe7Bk58yGBfTH6CpJ1F5J7w/KqmYLMUyA9vITQXtHFQ8WVO53SLYz90UxvN4Bt2YfEDEp3TAp+t8MKxs5K3uIQHqicRdr+t+znCZ+0PW+vhDa5Nuy22bSdm6+ZS2pAHLvn5QLyPWwpH/jt4YZwJyaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UH/cfqf9ieuKLueHLHhaOcJB6Bv30CVf3bh3wwEhjIA=; b=N2IBSDXvaweFkbKW6GR2LlV2HzZnaTBtFqf4z/pX3gj4BJZCvTBla6ePo3qzTuIVdXftRt15El+ERgCP6IPP4rWL9x8wDp/toQ9G5FGuL0zFg17YRf4zGVFodDHm4dzA+lLtl7RpBfEVCx3tMdjYukDhVLbDP1toak+Bk4UTf1Q4gsu+mAUE6qKmHbB56cZc2V/eNVtN85/uKghvsvv7ju+wbeBn5s6v8kJyjXFRSm13LJjoNn1JyojGIZt5ZkF1UeialRJQ+G+YWwRbsnrnG9tWPLiLvzZ/gp3ejXMDoxDysECHH0xoo2DbJd6DcyZN+iJRUEpVU3wAKsC7pri+rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UH/cfqf9ieuKLueHLHhaOcJB6Bv30CVf3bh3wwEhjIA=; b=miZDp6/SVgateYEdAUper6stg5CKenVfiw/Pt1lfqR/GOvaYLdzP63ePofIBBWq8s8aZnDDxHt5BSdcjM6u0RYCqLIZ6fxUFQMCxr70og4w8M4eBjGsGPZ2YAlvAG38EQW91Lo93kctX8MTQCzI+IYPml57oyIuSFna8Tc24Q7c= Received: from DS7PR05CA0079.namprd05.prod.outlook.com (2603:10b6:8:57::9) by BL1PR12MB5239.namprd12.prod.outlook.com (2603:10b6:208:315::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Tue, 25 Oct 2022 06:53:50 +0000 Received: from DM6NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::b6) by DS7PR05CA0079.outlook.office365.com (2603:10b6:8:57::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.8 via Frontend Transport; Tue, 25 Oct 2022 06:53:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT026.mail.protection.outlook.com (10.13.172.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:50 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:49 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:46 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 06/13] microblaze/PCI: Remove unused allocation & free of PCI host bridge structure Date: Tue, 25 Oct 2022 12:22:07 +0530 Message-ID: <20221025065214.4663-7-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT026:EE_|BL1PR12MB5239:EE_ X-MS-Office365-Filtering-Correlation-Id: 304f5851-1a0e-4d50-9752-08dab655ac3e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Gw17mJxEDPptZf/ce2yGk1qGPeBaZXmAsJ4etBikbIeN0NYwhHgg6aeyiTLd279vlbba8E+GTbPI+mgPepX7hOI05yVAwUSvq6IJTt4pgz4JR02OGzBpMMDMWOjEHfCJXnVG8hUWBpNZOM7dq6zaJxh16FvEr3RZejDhOryPmoZagZcPkLAc4aEY7avSzHLEqhIuwYir4SkXMR+Jxzc/7Rv9y4eOKVzLWYq6jp0D2M7gvEXQySngm1Rvz/OxLiuODZzzQWo6duUHD+BoIj5ftjT6m4Jkec7M1lNf454/QRrg/WAcuYlSTKR3QBN18nYtRAZQLug+E3mW9KgqFCA2pueFUV3y8lO/UJZa8c8I3mQLmpH6Kq6nVz9cmkxhLHc391f7N6fo6Nd/Aq7iwV8Z722jMteKZ05dIpW6LrI5pLvDEsfYDlLEO0WlApjd4Ra0i41PO41kfHhxZJIKydci5gvGbzqNMs3CRGtlIteoImJl1nnXIn4oyxchmMcjxdMdfaugO736L1sh0/jBW4RWFcV9dOnQmI2czLBSi20Yeubzs6GVzpWDp5DoNw2fE+LGKIrT4ZGjiOrGWoov686SJ15gTST0A2N6me9zSLG9pEtzVPwD13iyKFrhIty2U0Bzl4yqRFFW0WN1AImcgxDj8NPWqwL2a+YOtZFHXAWKsQhby2S36Ls87MfzQ+J1utVU4rSU2nl9CMwxulITPZQkmdniOs3zTb5YD9Kj5XpHCHONx81fipnwQZPguMlUbTAMgMBsY8imimrvMnz3Y9bdnWALXkzEjZy0LkGJNcZLVS8DhuiCaU35L4jTzL+Nq0LupgHwgpse7THoKNtafGMZw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199015)(36840700001)(40470700004)(46966006)(82310400005)(2906002)(36756003)(2616005)(70206006)(70586007)(44832011)(5660300002)(82740400003)(8676002)(36860700001)(8936002)(41300700001)(4326008)(110136005)(54906003)(6666004)(40480700001)(86362001)(47076005)(316002)(478600001)(26005)(186003)(1076003)(336012)(81166007)(356005)(40460700003)(426003)(83380400001)(21314003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:50.3823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 304f5851-1a0e-4d50-9752-08dab655ac3e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5239 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unused allocation and freeing of PCI host bridge structure. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 5 ----- arch/microblaze/pci/pci-common.c | 29 ----------------------------- arch/microblaze/pci/xilinx_pci.c | 6 ------ 3 files changed, 40 deletions(-) diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 252bcc1..018c632 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -25,7 +25,6 @@ static inline int pcibios_vaddr_is_ioport(void __iomem *address) */ struct pci_controller { struct pci_bus *bus; - char is_dynamic; struct device_node *dn; struct list_head list_node; struct device *parent; @@ -98,9 +97,5 @@ extern void setup_indirect_pci(struct pci_controller *hose, resource_size_t cfg_addr, resource_size_t cfg_data, u32 flags); -/* Allocate & free a PCI host bridge structure */ -extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev); -extern void pcibios_free_controller(struct pci_controller *phb); - #endif /* __KERNEL__ */ #endif /* _ASM_MICROBLAZE_PCI_BRIDGE_H */ diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 12764df0..2965892 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -38,9 +38,6 @@ static DEFINE_SPINLOCK(hose_spinlock); LIST_HEAD(hose_list); -/* XXX kill that some day ... */ -static int global_phb_number; /* Global phb counter */ - /* ISA Memory physical address */ resource_size_t isa_mem_base; @@ -49,32 +46,6 @@ static int pci_bus_count; -struct pci_controller *pcibios_alloc_controller(struct device_node *dev) -{ - struct pci_controller *phb; - - phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL); - if (!phb) - return NULL; - spin_lock(&hose_spinlock); - phb->global_number = global_phb_number++; - list_add_tail(&phb->list_node, &hose_list); - spin_unlock(&hose_spinlock); - phb->dn = dev; - phb->is_dynamic = mem_init_done; - return phb; -} - -void pcibios_free_controller(struct pci_controller *phb) -{ - spin_lock(&hose_spinlock); - list_del(&phb->list_node); - spin_unlock(&hose_spinlock); - - if (phb->is_dynamic) - kfree(phb); -} - static resource_size_t pcibios_io_size(const struct pci_controller *hose) { return resource_size(&hose->io_resource); diff --git a/arch/microblaze/pci/xilinx_pci.c b/arch/microblaze/pci/xilinx_pci.c index f1a5112..3fa16e3 100644 --- a/arch/microblaze/pci/xilinx_pci.c +++ b/arch/microblaze/pci/xilinx_pci.c @@ -97,12 +97,6 @@ void __init xilinx_pci_init(void) return; } - hose = pcibios_alloc_controller(pci_node); - if (!hose) { - pr_err("xilinx-pci: pcibios_alloc_controller() failed\n"); - return; - } - /* Setup config space */ setup_indirect_pci(hose, r.start + XPLB_PCI_ADDR, r.start + XPLB_PCI_DATA, From patchwork Tue Oct 25 06:52:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018533 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F454FA3744 for ; Tue, 25 Oct 2022 06:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231414AbiJYGx7 (ORCPT ); Tue, 25 Oct 2022 02:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231398AbiJYGx5 (ORCPT ); Tue, 25 Oct 2022 02:53:57 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2077.outbound.protection.outlook.com [40.107.220.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC728437E0; Mon, 24 Oct 2022 23:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mLYCC2ZNnYFzwNAMsXHL1lZbTD138xgIncNDQFAyvd5qW/i4RsQGzwHWB8adMCHdSgSQ6/jzxh+XVEXUMcmXvC7ZJbqraSUz6C4jqrSCfnE9yrlm/uCnFU2EmduMWXGBmabtNF2GXZ6wk98Kof/e9XjkCmQEpPr2Gjhpx3/Cuhc1K2i+WhNCz3B/q3ZHVNGKksSvWjwwL5J0k3Oqt9xU2IzYRpbElzuf3ftm+a8QGWbhtyB9s9V5oQt6pGW8HSRqQ/8gjOyxepxKKRGLHZv5r6c67WiShkcUwUcMbcZ50YgThvlQbLvti87x7WuOzglh/qxdXfkU1ACxdXpzU7VyAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r424ozFlp8CoQXRkRVuBvLkXFlZUchFIHoYw+54Td3I=; b=USlvQ02H7PkbBn8K8hAttsIys/NR0G8Kf6h8UF9vtR2OLo4GYoaII/ZR2CBB+uA2y7iNRWHEZWfeNcE7SjKyQwBLiNHImSPRzssASLYguSUFkkULwli9xSuFASkfmsYaBlEbllSACeoqIjjehhC6fBnGafOrAIKJ46CiTVmRzgHA0T3PUcxtu2JQsCymd/6NdtswUxnwn4lBr32chlhz6EgWZ1Zxb8NGhJrx0TmPmP8NCI9IxcY/ntk+qyuFW9BeMFy2ntJU2nCfPo2oeqwIDPm8xjTBoQWq2tB9KSFz1MaxV3khyxbK73KUerDhC3dmTNcHWugBabPIVprE3I1vFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r424ozFlp8CoQXRkRVuBvLkXFlZUchFIHoYw+54Td3I=; b=IZjqIaWSUhKPD+1N2GfbLHHhaZjkJcVIRHCguyauZEIBfyqXH2GRx7jT+WZ0mZPJZ1TnGVrqr/9YL2M2L3zDMOe6Q9KTCrCvPAHksZCyAR19PpTpVqw3mo9XDeC7D7pwhftdfwCcGdP9lM2aAgaosDDDEVaiGfm701Xxu0S9DuE= Received: from DM6PR18CA0019.namprd18.prod.outlook.com (2603:10b6:5:15b::32) by IA1PR12MB7590.namprd12.prod.outlook.com (2603:10b6:208:42a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.27; Tue, 25 Oct 2022 06:53:53 +0000 Received: from DM6NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:5:15b:cafe::7f) by DM6PR18CA0019.outlook.office365.com (2603:10b6:5:15b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21 via Frontend Transport; Tue, 25 Oct 2022 06:53:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT081.mail.protection.outlook.com (10.13.172.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:53 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:52 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:50 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 07/13] microblaze/PCI: Remove unused PCI BIOS resource allocation Date: Tue, 25 Oct 2022 12:22:08 +0530 Message-ID: <20221025065214.4663-8-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT081:EE_|IA1PR12MB7590:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b11959b-26d4-47f5-25ae-08dab655ae34 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MfGebZlJ86LDXKmseJBQWBGsoLyqpxTe+W0NnxvTOJMHyLEPv2zncKlqulWxRIrcQ+c9HOCi3gsFaeddjIuLTVGj98vZqtIOCv5dX28ZZPzbAautX9KQGRUoNxc2XktQF+9M4LFHFgNZKgPP9czp4l16IK60dJMScKZwA10fMdZQSEaZO4iSuwxBKyBvPvpErXb4YQLz9hx0mBCfFGTIfTEsIFZfcPpYDCvNbFhj0J9AeqO7O5PJACMCmdTiksZiqNMpojk24/2B5dmFwu1kvvuOp19d0hpgemELYZaMTodQ33cIKZO2YLNLjfQZpXabntb+kXHUyvofuTv33/5smeKdrprvmcvjVpKIJu9wBZBXwpAfSEK7kLQIpMW6BlFN7Cx7WoPB1yZfvGpXx4Q7rdrfc9fkEOCh76RJhwsHT+6CypDh6F31cWlXSElSMXGwQqKyz05pvea6Crqbc4pedGv18VX70pLKXeqOJI6ne6fyt4ZgIGxnHNqb9+P3j0gt4q/3GBlWOv4Z3X4lM4NY/9S8XTLhionYGCewLxLimLgdYrIEz6+1wEeIXUNXD3csarKeuOG+pAwMI1Kc2ZOFTqFEaQ4N8uAJAKO0eJX6R3QbZxdCsMMFyEkNzBQS52Lp1ifPeOEib1n80Hl9BFD/EIAkBmT2KhmLdQYBGh8XmBiBbxQzyT37UmNzTTkfGzTaUuBOUOrIt+HifpNSsmpZA3RwuCknLFLqEgdLEisw8EfoXJJEwTZoWM9qYMDXZn/aYLtIL+p7Da8lZa6EQj0a6e+OhB2sbLCtrAZ2NE5UjcZnt++APzyX+xYqiJAp979+ X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(396003)(136003)(376002)(451199015)(36840700001)(46966006)(40470700004)(426003)(2616005)(336012)(40480700001)(356005)(81166007)(40460700003)(36756003)(478600001)(110136005)(316002)(54906003)(82740400003)(86362001)(6666004)(36860700001)(30864003)(82310400005)(83380400001)(47076005)(1076003)(186003)(8676002)(26005)(8936002)(41300700001)(44832011)(4326008)(2906002)(70586007)(5660300002)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:53.6693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b11959b-26d4-47f5-25ae-08dab655ae34 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7590 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove PCI BIOSn unused code which provide's resource allocation for all pci bus and pci host controller memory initialization. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 2 - arch/microblaze/include/asm/pci.h | 4 - arch/microblaze/pci/pci-common.c | 489 ------------------------------- 3 files changed, 495 deletions(-) diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 018c632..170369d 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -74,8 +74,6 @@ struct pci_controller { * ranges since the common pci_bus structure can't handle more */ struct resource io_resource; - struct resource mem_resources[3]; - int global_number; /* PCI domain number */ }; #ifdef CONFIG_PCI diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index 34337e2..6da7523 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h @@ -28,8 +28,6 @@ #define IOBASE_ISA_IO 3 #define IOBASE_ISA_MEM 4 -#define pcibios_scan_all_fns(a, b) 0 - /* * Set this to 1 if you want the kernel to re-assign all PCI * bus numbers (don't do that on ppc64 yet !) @@ -48,8 +46,6 @@ #define ARCH_GENERIC_PCI_MMAP_RESOURCE 1 #define arch_can_pci_mmap_io() 1 -extern void pcibios_resource_survey(void); - struct file; /* This part of code was originally in xilinx-pci.h */ diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 2965892..085e673 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -44,8 +44,6 @@ unsigned long isa_io_base; EXPORT_SYMBOL(isa_io_base); -static int pci_bus_count; - static resource_size_t pcibios_io_size(const struct pci_controller *hose) { return resource_size(&hose->io_resource); @@ -93,11 +91,6 @@ unsigned long pci_address_to_pio(phys_addr_t address) } EXPORT_SYMBOL_GPL(pci_address_to_pio); -void pcibios_set_master(struct pci_dev *dev) -{ - /* No special bus mastering setup handling */ -} - /* * Platform support for /proc/bus/pci/X/Y mmap()s. */ @@ -117,494 +110,12 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma) return 0; } -void pci_resource_to_user(const struct pci_dev *dev, int bar, - const struct resource *rsrc, - resource_size_t *start, resource_size_t *end) -{ - struct pci_bus_region region; - - if (rsrc->flags & IORESOURCE_IO) { - pcibios_resource_to_bus(dev->bus, ®ion, - (struct resource *) rsrc); - *start = region.start; - *end = region.end; - return; - } - - /* We pass a CPU physical address to userland for MMIO instead of a - * BAR value because X is lame and expects to be able to use that - * to pass to /dev/mem! - * - * That means we may have 64-bit values where some apps only expect - * 32 (like X itself since it thinks only Sparc has 64-bit MMIO). - */ - *start = rsrc->start; - *end = rsrc->end; -} - /* Display the domain number in /proc */ int pci_proc_domain(struct pci_bus *bus) { return pci_domain_nr(bus); } -/* This header fixup will do the resource fixup for all devices as they are - * probed, but not for bridge ranges - */ -static void pcibios_fixup_resources(struct pci_dev *dev) -{ - struct pci_controller *hose = pci_bus_to_host(dev->bus); - int i; - - if (!hose) { - pr_err("No host bridge for PCI dev %s !\n", - pci_name(dev)); - return; - } - for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { - struct resource *res = dev->resource + i; - if (!res->flags) - continue; - if (res->start == 0) { - pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]", - pci_name(dev), i, - (unsigned long long)res->start, - (unsigned long long)res->end, - (unsigned int)res->flags); - pr_debug("is unassigned\n"); - res->end -= res->start; - res->start = 0; - res->flags |= IORESOURCE_UNSET; - continue; - } - - pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]\n", - pci_name(dev), i, - (unsigned long long)res->start, - (unsigned long long)res->end, - (unsigned int)res->flags); - } -} -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources); - -int pcibios_device_add(struct pci_dev *dev) -{ - dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); - - return 0; -} - -/* - * Reparent resource children of pr that conflict with res - * under res, and make res replace those children. - */ -static int __init reparent_resources(struct resource *parent, - struct resource *res) -{ - struct resource *p, **pp; - struct resource **firstpp = NULL; - - for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) { - if (p->end < res->start) - continue; - if (res->end < p->start) - break; - if (p->start < res->start || p->end > res->end) - return -1; /* not completely contained */ - if (firstpp == NULL) - firstpp = pp; - } - if (firstpp == NULL) - return -1; /* didn't find any conflicting entries? */ - res->parent = parent; - res->child = *firstpp; - res->sibling = *pp; - *firstpp = res; - *pp = NULL; - for (p = res->child; p != NULL; p = p->sibling) { - p->parent = res; - pr_debug("PCI: Reparented %s [%llx..%llx] under %s\n", - p->name, - (unsigned long long)p->start, - (unsigned long long)p->end, res->name); - } - return 0; -} - -/* - * Handle resources of PCI devices. If the world were perfect, we could - * just allocate all the resource regions and do nothing more. It isn't. - * On the other hand, we cannot just re-allocate all devices, as it would - * require us to know lots of host bridge internals. So we attempt to - * keep as much of the original configuration as possible, but tweak it - * when it's found to be wrong. - * - * Known BIOS problems we have to work around: - * - I/O or memory regions not configured - * - regions configured, but not enabled in the command register - * - bogus I/O addresses above 64K used - * - expansion ROMs left enabled (this may sound harmless, but given - * the fact the PCI specs explicitly allow address decoders to be - * shared between expansion ROMs and other resource regions, it's - * at least dangerous) - * - * Our solution: - * (1) Allocate resources for all buses behind PCI-to-PCI bridges. - * This gives us fixed barriers on where we can allocate. - * (2) Allocate resources for all enabled devices. If there is - * a collision, just mark the resource as unallocated. Also - * disable expansion ROMs during this step. - * (3) Try to allocate resources for disabled devices. If the - * resources were assigned correctly, everything goes well, - * if they weren't, they won't disturb allocation of other - * resources. - * (4) Assign new addresses to resources which were either - * not configured at all or misconfigured. If explicitly - * requested by the user, configure expansion ROM address - * as well. - */ - -static void pcibios_allocate_bus_resources(struct pci_bus *bus) -{ - struct pci_bus *b; - int i; - struct resource *res, *pr; - - pr_debug("PCI: Allocating bus resources for %04x:%02x...\n", - pci_domain_nr(bus), bus->number); - - pci_bus_for_each_resource(bus, res, i) { - if (!res || !res->flags - || res->start > res->end || res->parent) - continue; - if (bus->parent == NULL) - pr = (res->flags & IORESOURCE_IO) ? - &ioport_resource : &iomem_resource; - else { - /* Don't bother with non-root busses when - * re-assigning all resources. We clear the - * resource flags as if they were colliding - * and as such ensure proper re-allocation - * later. - */ - pr = pci_find_parent_resource(bus->self, res); - if (pr == res) { - /* this happens when the generic PCI - * code (wrongly) decides that this - * bridge is transparent -- paulus - */ - continue; - } - } - - pr_debug("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx ", - bus->self ? pci_name(bus->self) : "PHB", - bus->number, i, - (unsigned long long)res->start, - (unsigned long long)res->end); - pr_debug("[0x%x], parent %p (%s)\n", - (unsigned int)res->flags, - pr, (pr && pr->name) ? pr->name : "nil"); - - if (pr && !(pr->flags & IORESOURCE_UNSET)) { - struct pci_dev *dev = bus->self; - - if (request_resource(pr, res) == 0) - continue; - /* - * Must be a conflict with an existing entry. - * Move that entry (or entries) under the - * bridge resource and try again. - */ - if (reparent_resources(pr, res) == 0) - continue; - - if (dev && i < PCI_BRIDGE_RESOURCE_NUM && - pci_claim_bridge_resource(dev, - i + PCI_BRIDGE_RESOURCES) == 0) - continue; - - } - pr_warn("PCI: Cannot allocate resource region "); - pr_cont("%d of PCI bridge %d, will remap\n", i, bus->number); - res->start = res->end = 0; - res->flags = 0; - } - - list_for_each_entry(b, &bus->children, node) - pcibios_allocate_bus_resources(b); -} - -static inline void alloc_resource(struct pci_dev *dev, int idx) -{ - struct resource *pr, *r = &dev->resource[idx]; - - pr_debug("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n", - pci_name(dev), idx, - (unsigned long long)r->start, - (unsigned long long)r->end, - (unsigned int)r->flags); - - pr = pci_find_parent_resource(dev, r); - if (!pr || (pr->flags & IORESOURCE_UNSET) || - request_resource(pr, r) < 0) { - pr_warn("PCI: Cannot allocate resource region %d ", idx); - pr_cont("of device %s, will remap\n", pci_name(dev)); - if (pr) - pr_debug("PCI: parent is %p: %016llx-%016llx [%x]\n", - pr, - (unsigned long long)pr->start, - (unsigned long long)pr->end, - (unsigned int)pr->flags); - /* We'll assign a new address later */ - r->flags |= IORESOURCE_UNSET; - r->end -= r->start; - r->start = 0; - } -} - -static void __init pcibios_allocate_resources(int pass) -{ - struct pci_dev *dev = NULL; - int idx, disabled; - u16 command; - struct resource *r; - - for_each_pci_dev(dev) { - pci_read_config_word(dev, PCI_COMMAND, &command); - for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) { - r = &dev->resource[idx]; - if (r->parent) /* Already allocated */ - continue; - if (!r->flags || (r->flags & IORESOURCE_UNSET)) - continue; /* Not assigned at all */ - /* We only allocate ROMs on pass 1 just in case they - * have been screwed up by firmware - */ - if (idx == PCI_ROM_RESOURCE) - disabled = 1; - if (r->flags & IORESOURCE_IO) - disabled = !(command & PCI_COMMAND_IO); - else - disabled = !(command & PCI_COMMAND_MEMORY); - if (pass == disabled) - alloc_resource(dev, idx); - } - if (pass) - continue; - r = &dev->resource[PCI_ROM_RESOURCE]; - if (r->flags) { - /* Turn the ROM off, leave the resource region, - * but keep it unregistered. - */ - u32 reg; - pci_read_config_dword(dev, dev->rom_base_reg, ®); - if (reg & PCI_ROM_ADDRESS_ENABLE) { - pr_debug("PCI: Switching off ROM of %s\n", - pci_name(dev)); - r->flags &= ~IORESOURCE_ROM_ENABLE; - pci_write_config_dword(dev, dev->rom_base_reg, - reg & ~PCI_ROM_ADDRESS_ENABLE); - } - } - } -} - -static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus) -{ - struct pci_controller *hose = pci_bus_to_host(bus); - resource_size_t offset; - struct resource *res, *pres; - int i; - - pr_debug("Reserving legacy ranges for domain %04x\n", - pci_domain_nr(bus)); - - /* Check for IO */ - if (!(hose->io_resource.flags & IORESOURCE_IO)) - goto no_io; - offset = (unsigned long)hose->io_base_virt - _IO_BASE; - res = kzalloc(sizeof(struct resource), GFP_KERNEL); - BUG_ON(res == NULL); - res->name = "Legacy IO"; - res->flags = IORESOURCE_IO; - res->start = offset; - res->end = (offset + 0xfff) & 0xfffffffful; - pr_debug("Candidate legacy IO: %pR\n", res); - if (request_resource(&hose->io_resource, res)) { - pr_debug("PCI %04x:%02x Cannot reserve Legacy IO %pR\n", - pci_domain_nr(bus), bus->number, res); - kfree(res); - } - - no_io: - /* Check for memory */ - offset = hose->pci_mem_offset; - pr_debug("hose mem offset: %016llx\n", (unsigned long long)offset); - for (i = 0; i < 3; i++) { - pres = &hose->mem_resources[i]; - if (!(pres->flags & IORESOURCE_MEM)) - continue; - pr_debug("hose mem res: %pR\n", pres); - if ((pres->start - offset) <= 0xa0000 && - (pres->end - offset) >= 0xbffff) - break; - } - if (i >= 3) - return; - res = kzalloc(sizeof(struct resource), GFP_KERNEL); - BUG_ON(res == NULL); - res->name = "Legacy VGA memory"; - res->flags = IORESOURCE_MEM; - res->start = 0xa0000 + offset; - res->end = 0xbffff + offset; - pr_debug("Candidate VGA memory: %pR\n", res); - if (request_resource(pres, res)) { - pr_debug("PCI %04x:%02x Cannot reserve VGA memory %pR\n", - pci_domain_nr(bus), bus->number, res); - kfree(res); - } -} - -void __init pcibios_resource_survey(void) -{ - struct pci_bus *b; - - /* Allocate and assign resources. If we re-assign everything, then - * we skip the allocate phase - */ - list_for_each_entry(b, &pci_root_buses, node) - pcibios_allocate_bus_resources(b); - - pcibios_allocate_resources(0); - pcibios_allocate_resources(1); - - /* Before we start assigning unassigned resource, we try to reserve - * the low IO area and the VGA memory area if they intersect the - * bus available resources to avoid allocating things on top of them - */ - list_for_each_entry(b, &pci_root_buses, node) - pcibios_reserve_legacy_regions(b); - - /* Now proceed to assigning things that were left unassigned */ - pr_debug("PCI: Assigning unassigned resources...\n"); - pci_assign_unassigned_resources(); -} - -static void pcibios_setup_phb_resources(struct pci_controller *hose, - struct list_head *resources) -{ - unsigned long io_offset; - struct resource *res; - int i; - - /* Hookup PHB IO resource */ - res = &hose->io_resource; - - /* Fixup IO space offset */ - io_offset = (unsigned long)hose->io_base_virt - isa_io_base; - res->start = (res->start + io_offset) & 0xffffffffu; - res->end = (res->end + io_offset) & 0xffffffffu; - - if (!res->flags) { - pr_warn("PCI: I/O resource not set for host "); - pr_cont("bridge %pOF (domain %d)\n", - hose->dn, hose->global_number); - /* Workaround for lack of IO resource only on 32-bit */ - res->start = (unsigned long)hose->io_base_virt - isa_io_base; - res->end = res->start + IO_SPACE_LIMIT; - res->flags = IORESOURCE_IO; - } - pci_add_resource_offset(resources, res, - (__force resource_size_t)(hose->io_base_virt - _IO_BASE)); - - pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n", - (unsigned long long)res->start, - (unsigned long long)res->end, - (unsigned long)res->flags); - - /* Hookup PHB Memory resources */ - for (i = 0; i < 3; ++i) { - res = &hose->mem_resources[i]; - if (!res->flags) { - if (i > 0) - continue; - pr_err("PCI: Memory resource 0 not set for "); - pr_cont("host bridge %pOF (domain %d)\n", - hose->dn, hose->global_number); - - /* Workaround for lack of MEM resource only on 32-bit */ - res->start = hose->pci_mem_offset; - res->end = (resource_size_t)-1LL; - res->flags = IORESOURCE_MEM; - - } - pci_add_resource_offset(resources, res, hose->pci_mem_offset); - - pr_debug("PCI: PHB MEM resource %d = %016llx-%016llx [%lx]\n", - i, (unsigned long long)res->start, - (unsigned long long)res->end, - (unsigned long)res->flags); - } - - pr_debug("PCI: PHB MEM offset = %016llx\n", - (unsigned long long)hose->pci_mem_offset); - pr_debug("PCI: PHB IO offset = %08lx\n", - (unsigned long)hose->io_base_virt - _IO_BASE); -} - -static void pcibios_scan_phb(struct pci_controller *hose) -{ - LIST_HEAD(resources); - struct pci_bus *bus; - struct device_node *node = hose->dn; - - pr_debug("PCI: Scanning PHB %pOF\n", node); - - pcibios_setup_phb_resources(hose, &resources); - - bus = pci_scan_root_bus(hose->parent, hose->first_busno, - hose->ops, hose, &resources); - if (bus == NULL) { - pr_err("Failed to create bus for PCI domain %04x\n", - hose->global_number); - pci_free_resource_list(&resources); - return; - } - bus->busn_res.start = hose->first_busno; - hose->bus = bus; - - hose->last_busno = bus->busn_res.end; -} - -static int __init pcibios_init(void) -{ - struct pci_controller *hose, *tmp; - int next_busno = 0; - - pr_info("PCI: Probing PCI hardware\n"); - - /* Scan all of the recorded PCI controllers. */ - list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { - hose->last_busno = 0xff; - pcibios_scan_phb(hose); - if (next_busno <= hose->last_busno) - next_busno = hose->last_busno + 1; - } - pci_bus_count = next_busno; - - /* Call common code to handle resource allocation */ - pcibios_resource_survey(); - list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { - if (hose->bus) - pci_bus_add_devices(hose->bus); - } - - return 0; -} - -subsys_initcall(pcibios_init); - static struct pci_controller *pci_bus_to_hose(int bus) { struct pci_controller *hose, *tmp; From patchwork Tue Oct 25 06:52:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018535 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22C4DC38A2D for ; Tue, 25 Oct 2022 06:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231468AbiJYGyL (ORCPT ); Tue, 25 Oct 2022 02:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231441AbiJYGyA (ORCPT ); Tue, 25 Oct 2022 02:54:00 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB5DA43301; Mon, 24 Oct 2022 23:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aKFvQBEZfEDR63gRjhomQ3lidc7TFn6I1+IVDu0J9sBaPJK5hFQU+5lZbH4NxXZIZ2IvZq8EZ6uNluf6Wx/4xIOahgvigGO6h9zaa6x0qKQvrbnDI+6hrXY3FGVezVtYqnB6+6GjFpAN8fUcotIEvnWovgfwKdGOxGFPew0ffYQSeiKLFNeLzBMIThmxVXjxyEw+O326dto7hoQm/iw7IAY03zNeUSz4nOYtAcsJm3MwRGt1e+1CKYU8fr2QofZncIJMiyhKXppGVXpZsIVOzlLAPRjgM2f74y0al/0VaHIHnHWcBG2TPURpRPzcobKD/zaENPsiWcrQNoGf2P4d8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5OlJneRi2U1pLc3VrOTJl+hE6sjfNt4he202WZf6aDQ=; b=LQrPSsl0vEMmw9Q8iUnHMF02J8l4opiYEwkKtQTPxSOSWrQsfHDasIukY4QnrSpPKEUMiAGMupYHrgHM8t6IrZ0cQc+8CvFYzn14LdhRv6G8OcK5HT7EyLn6tERgsfP7RTU/7TyY3qArwF+rnKJw2GZTgqG12eM+LUvJyf3rNj+eiwQ467W4rQ/2ToABdhSjA66ZWvh52qeBWs4+I773Lezvgvu1WKnFzd0FIpKVrEQLMHzfqj7jIy9oaryoncl8criSINCpATU2e4z7lFTuRFwX4Qcw0ANGBa44dMrznmlGRBdvPlp0erlQGV7WJXI2XygenfWDzpkx5GtCA7WY6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5OlJneRi2U1pLc3VrOTJl+hE6sjfNt4he202WZf6aDQ=; b=O3ojNyFSMX6HBr8p6MiMvOK7uv4K9J9v98wXfPpiScnE9r6LrnhLwwOjeIjCX+Pa6CSmlvNEN2fx8wwYibteFsdbVfLDbZQ71Pitof4ua8SCpVTHvCakhw1PnF7DTtv3NgArusKnVhpko+k4xF5mdT/gv4iBSZm6VdmuOhQ4p5U= Received: from DM6PR07CA0083.namprd07.prod.outlook.com (2603:10b6:5:337::16) by PH0PR12MB5605.namprd12.prod.outlook.com (2603:10b6:510:129::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Tue, 25 Oct 2022 06:53:56 +0000 Received: from DM6NAM11FT107.eop-nam11.prod.protection.outlook.com (2603:10b6:5:337:cafe::79) by DM6PR07CA0083.outlook.office365.com (2603:10b6:5:337::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Tue, 25 Oct 2022 06:53:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT107.mail.protection.outlook.com (10.13.172.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:56 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:55 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:53 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 08/13] microblaze/PCI: Remove unused PCI Indirect ops Date: Tue, 25 Oct 2022 12:22:09 +0530 Message-ID: <20221025065214.4663-9-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT107:EE_|PH0PR12MB5605:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ddbd582-d17a-40f8-e37c-08dab655affb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +5EnBRXirMoK9BpifcIfrVz6YsbyTABVfEvLFLNpQiBRGEJ/5s2nY5jMboUpmQgAN8e89VqwoNYF7hGb+Os0mwp0PBm5fT0RcfI9M/xz5f9JLwbJW7b6mq4VWKwyfiQwZ45kah403MNBjPsHA2Xl5hZSYWhpn84hFPhehtjU+ax9YpVibtCnDjJgtf+38ACz1zSnTdSFp6S+TxD6bAEy6DQyRRJymT2fPjSakm+GPheo3/IV513xmK2/rMHEKi34X4Zo0MKgbolixA7G7lPwzBkWC+7XATPDDeX6o1fmWCsoJ9DzZGhbYkPOlYCkG1YZYItS+GTwqPzrOgnHvgpzXlEkprw5LOrN/Y2M5brjlSEPFA5dKG7FwtV4yxlGeTLTWec5/7Sf/yQC2SWSv4TegQNaclHuFcfIHKpIz8sj/ye30PLfc+Ab40XO2XgWdmGMR667bGUasvjN+iGMBNgHDFGzIr29XMFrwCyr+pqHExBM6MwVcnvfImlh3owK6QoWeAmajJCXY/PwgRgd2TnNYFckLo8GDhS5Yr0i1Ct83HhB70q7GJg7u9XBBYT3LYSWUwVMxizhwi4Y37KN5qOhX4Sx2MxdpmkFnre8RnvaJny/7iOtdjNznk/Zb0agHYVoCzH9DZFhfgQYBFPI9B0OcPO8ug+Pfdu0/dxZTTbJNzBh3UEKG/cYWLnj+/68MWu4v0fArEVgNogaNeTeoxCwHaZJD+dMmmpJXkSkzF2xyLmGF5qS8hpSZ3lOiKe+rlEjNbbDiBA0zP+12nOM71i6fegs4rg+Qy4Cz7xQ631PC8WRbEwhX2UsyX061p5qyX3i X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199015)(46966006)(36840700001)(40470700004)(36860700001)(8676002)(44832011)(316002)(41300700001)(54906003)(110136005)(4326008)(40480700001)(8936002)(70206006)(70586007)(5660300002)(82740400003)(6666004)(478600001)(2616005)(1076003)(186003)(26005)(426003)(83380400001)(356005)(81166007)(40460700003)(47076005)(86362001)(336012)(82310400005)(36756003)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:56.6717 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ddbd582-d17a-40f8-e37c-08dab655affb X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT107.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5605 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unused variants of PCI indirect handling. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 34 ------- arch/microblaze/pci/Makefile | 2 +- arch/microblaze/pci/indirect_pci.c | 158 ------------------------------- arch/microblaze/pci/xilinx_pci.c | 6 -- 4 files changed, 1 insertion(+), 199 deletions(-) delete mode 100644 arch/microblaze/pci/indirect_pci.c diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 170369d..cd9ae71 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -32,8 +32,6 @@ struct pci_controller { int first_busno; int last_busno; - int self_busno; - void __iomem *io_base_virt; resource_size_t io_base_phys; @@ -42,34 +40,6 @@ struct pci_controller { */ resource_size_t pci_mem_offset; - struct pci_ops *ops; - unsigned int __iomem *cfg_addr; - void __iomem *cfg_data; - - /* - * Used for variants of PCI indirect handling and possible quirks: - * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1 - * EXT_REG - provides access to PCI-e extended registers - * SURPRESS_PRIMARY_BUS - we suppress the setting of PCI_PRIMARY_BUS - * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS - * to determine which bus number to match on when generating type0 - * config cycles - * NO_PCIE_LINK - the Freescale PCI-e controllers have issues with - * hanging if we don't have link and try to do config cycles to - * anything but the PHB. Only allow talking to the PHB if this is - * set. - * BIG_ENDIAN - cfg_addr is a big endian register - * BROKEN_MRM - the 440EPx/GRx chips have an errata that causes hangs - * on the PLB4. Effectively disable MRM commands by setting this. - */ -#define INDIRECT_TYPE_SET_CFG_TYPE 0x00000001 -#define INDIRECT_TYPE_EXT_REG 0x00000002 -#define INDIRECT_TYPE_SURPRESS_PRIMARY_BUS 0x00000004 -#define INDIRECT_TYPE_NO_PCIE_LINK 0x00000008 -#define INDIRECT_TYPE_BIG_ENDIAN 0x00000010 -#define INDIRECT_TYPE_BROKEN_MRM 0x00000020 - u32 indirect_type; - /* Currently, we limit ourselves to 1 IO range and 3 mem * ranges since the common pci_bus structure can't handle more */ @@ -91,9 +61,5 @@ static inline int isa_vaddr_is_ioport(void __iomem *address) } #endif /* CONFIG_PCI */ -extern void setup_indirect_pci(struct pci_controller *hose, - resource_size_t cfg_addr, - resource_size_t cfg_data, u32 flags); - #endif /* __KERNEL__ */ #endif /* _ASM_MICROBLAZE_PCI_BRIDGE_H */ diff --git a/arch/microblaze/pci/Makefile b/arch/microblaze/pci/Makefile index 0251c20..3cbdf25 100644 --- a/arch/microblaze/pci/Makefile +++ b/arch/microblaze/pci/Makefile @@ -3,5 +3,5 @@ # Makefile # -obj-$(CONFIG_PCI) += pci-common.o indirect_pci.o iomap.o +obj-$(CONFIG_PCI) += pci-common.o iomap.o obj-$(CONFIG_PCI_XILINX) += xilinx_pci.o diff --git a/arch/microblaze/pci/indirect_pci.c b/arch/microblaze/pci/indirect_pci.c deleted file mode 100644 index 1caf7d3..0000000 --- a/arch/microblaze/pci/indirect_pci.c +++ /dev/null @@ -1,158 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Support for indirect PCI bridges. - * - * Copyright (C) 1998 Gabriel Paubert. - */ - -#include -#include -#include -#include -#include - -#include -#include - -static int -indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, - int len, u32 *val) -{ - struct pci_controller *hose = pci_bus_to_host(bus); - volatile void __iomem *cfg_data; - u8 cfg_type = 0; - u32 bus_no, reg; - - if (hose->indirect_type & INDIRECT_TYPE_NO_PCIE_LINK) { - if (bus->number != hose->first_busno) - return PCIBIOS_DEVICE_NOT_FOUND; - if (devfn != 0) - return PCIBIOS_DEVICE_NOT_FOUND; - } - - if (hose->indirect_type & INDIRECT_TYPE_SET_CFG_TYPE) - if (bus->number != hose->first_busno) - cfg_type = 1; - - bus_no = (bus->number == hose->first_busno) ? - hose->self_busno : bus->number; - - if (hose->indirect_type & INDIRECT_TYPE_EXT_REG) - reg = ((offset & 0xf00) << 16) | (offset & 0xfc); - else - reg = offset & 0xfc; /* Only 3 bits for function */ - - if (hose->indirect_type & INDIRECT_TYPE_BIG_ENDIAN) - out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | - (devfn << 8) | reg | cfg_type)); - else - out_le32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | - (devfn << 8) | reg | cfg_type)); - - /* - * Note: the caller has already checked that offset is - * suitably aligned and that len is 1, 2 or 4. - */ - cfg_data = hose->cfg_data + (offset & 3); /* Only 3 bits for function */ - switch (len) { - case 1: - *val = in_8(cfg_data); - break; - case 2: - *val = in_le16(cfg_data); - break; - default: - *val = in_le32(cfg_data); - break; - } - return PCIBIOS_SUCCESSFUL; -} - -static int -indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, - int len, u32 val) -{ - struct pci_controller *hose = pci_bus_to_host(bus); - volatile void __iomem *cfg_data; - u8 cfg_type = 0; - u32 bus_no, reg; - - if (hose->indirect_type & INDIRECT_TYPE_NO_PCIE_LINK) { - if (bus->number != hose->first_busno) - return PCIBIOS_DEVICE_NOT_FOUND; - if (devfn != 0) - return PCIBIOS_DEVICE_NOT_FOUND; - } - - if (hose->indirect_type & INDIRECT_TYPE_SET_CFG_TYPE) - if (bus->number != hose->first_busno) - cfg_type = 1; - - bus_no = (bus->number == hose->first_busno) ? - hose->self_busno : bus->number; - - if (hose->indirect_type & INDIRECT_TYPE_EXT_REG) - reg = ((offset & 0xf00) << 16) | (offset & 0xfc); - else - reg = offset & 0xfc; - - if (hose->indirect_type & INDIRECT_TYPE_BIG_ENDIAN) - out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | - (devfn << 8) | reg | cfg_type)); - else - out_le32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | - (devfn << 8) | reg | cfg_type)); - - /* suppress setting of PCI_PRIMARY_BUS */ - if (hose->indirect_type & INDIRECT_TYPE_SURPRESS_PRIMARY_BUS) - if ((offset == PCI_PRIMARY_BUS) && - (bus->number == hose->first_busno)) - val &= 0xffffff00; - - /* Workaround for PCI_28 Errata in 440EPx/GRx */ - if ((hose->indirect_type & INDIRECT_TYPE_BROKEN_MRM) && - offset == PCI_CACHE_LINE_SIZE) { - val = 0; - } - - /* - * Note: the caller has already checked that offset is - * suitably aligned and that len is 1, 2 or 4. - */ - cfg_data = hose->cfg_data + (offset & 3); - switch (len) { - case 1: - out_8(cfg_data, val); - break; - case 2: - out_le16(cfg_data, val); - break; - default: - out_le32(cfg_data, val); - break; - } - - return PCIBIOS_SUCCESSFUL; -} - -static struct pci_ops indirect_pci_ops = { - .read = indirect_read_config, - .write = indirect_write_config, -}; - -void __init -setup_indirect_pci(struct pci_controller *hose, - resource_size_t cfg_addr, - resource_size_t cfg_data, u32 flags) -{ - resource_size_t base = cfg_addr & PAGE_MASK; - void __iomem *mbase; - - mbase = ioremap(base, PAGE_SIZE); - hose->cfg_addr = mbase + (cfg_addr & ~PAGE_MASK); - if ((cfg_data & PAGE_MASK) != base) - mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE); - hose->cfg_data = mbase + (cfg_data & ~PAGE_MASK); - hose->ops = &indirect_pci_ops; - hose->indirect_type = flags; -} diff --git a/arch/microblaze/pci/xilinx_pci.c b/arch/microblaze/pci/xilinx_pci.c index 3fa16e3..5dc4182 100644 --- a/arch/microblaze/pci/xilinx_pci.c +++ b/arch/microblaze/pci/xilinx_pci.c @@ -83,7 +83,6 @@ static void xilinx_pci_fixup_bridge(struct pci_dev *dev) */ void __init xilinx_pci_init(void) { - struct pci_controller *hose; struct resource r; void __iomem *pci_reg; struct device_node *pci_node; @@ -97,11 +96,6 @@ void __init xilinx_pci_init(void) return; } - /* Setup config space */ - setup_indirect_pci(hose, r.start + XPLB_PCI_ADDR, - r.start + XPLB_PCI_DATA, - INDIRECT_TYPE_SET_CFG_TYPE); - /* Set the max bus number to 255, and bus/subbus no's to 0 */ pci_reg = of_iomap(pci_node, 0); WARN_ON(!pci_reg); From patchwork Tue Oct 25 06:52:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018536 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D415FA373F for ; Tue, 25 Oct 2022 06:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbiJYGyM (ORCPT ); Tue, 25 Oct 2022 02:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231492AbiJYGyG (ORCPT ); Tue, 25 Oct 2022 02:54:06 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on20610.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8b::610]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04E2013A5AE; Mon, 24 Oct 2022 23:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K9ecFPbqgjnaUNp9wKoqPtFxFQIzREskmZXT/+2T0iTZ4nI1BBaXPome5g6lgUKkem501NJ+R9k9wgejXfYKVdt9H/zwL5H6FyuPkoPYLhqEZwm6/oovB4EAZLt2gEaxGHeg8cI4Y7PtRYaCcQH8X/elCI+p9RmnAXytMcVAevvKNFwTK0X+Fa0Sk2VtxiF2Z8mdP8n8En9XIqlozSEEsCaDYYU91c4TXVIK9Ho1elEMOsjWM0paD9afyTEG/ZQVB/YDvSCIn3fQLC99baxMPZD6KKS2/2oWaFpMTYxtUuqoWyesvPDCjUwPNvLouLEGR3RFmol7fDfN5YU45Ze3jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lUctBlJERuwrSI3gA8HvJQePg/GtTmxRoBwMQwLiI54=; b=PeK3aYdzePizLWz8uq0n0K3e19O/W8RGmRVE2g6iS38QqyyzYew6QDqunDtT7ri8BpbKjwyDWGu0aGDfUhg99IavICP5pMn91HuuyH3xCUofZGuMupb6fVWJclkvHwp8A9vMihBxEaJhqLOQ1yIaoDtrMJsQNSguNrNsrz6xHd8RpcO7PM6WgG18P9QyxdVLSceTF67W5uEurmJfl2E9ENuLnAc8qItK3upJr/lDR9sh6Bw0vV1z1T3LoEriavZ463DmXSDydNKrNhAYkdptjSHB+OERnVKyqiklQX7Ozpc3kUpwjJgckq3aOj5rNLCO3BGhGcATlQiyQalT6N35+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lUctBlJERuwrSI3gA8HvJQePg/GtTmxRoBwMQwLiI54=; b=Q/xmM9QqU2fIQN2SqOmqP2L5I6/LBweqnTRZP93JgSnNSMa8Ha4Oc4Sorg4TWCLKYNXI47WtedN30fog8exyBvjJWFNtCRSGdwOT7Xs0QV3fX0ixlnmpgJNPgc8xXq0XQJlLhT4sDNeREKdgZPmkv7aWvCx2ewizZu9T7w0/zYs= Received: from DM6PR17CA0013.namprd17.prod.outlook.com (2603:10b6:5:1b3::26) by PH7PR12MB7283.namprd12.prod.outlook.com (2603:10b6:510:20a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.26; Tue, 25 Oct 2022 06:54:00 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::1a) by DM6PR17CA0013.outlook.office365.com (2603:10b6:5:1b3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23 via Frontend Transport; Tue, 25 Oct 2022 06:54:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:53:59 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:59 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:53:59 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:56 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 09/13] microblaze/PCI: Remove unused pci_address_to_pio() conversion of CPU address to I/O port Date: Tue, 25 Oct 2022 12:22:10 +0530 Message-ID: <20221025065214.4663-10-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT031:EE_|PH7PR12MB7283:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ffda11d-ee2c-4756-9a18-08dab655b1f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k12s6wiOd5e28g1YzE0D6Mtex7tkfrAvlbSc7oqwO6TyTGUZygOv7VcAfzw4x1B4TEnHusCmGJ3B0If6RU6jOdtopErfzbJGUl1rOdNG+yWfSVs23OC++g0cs+rLg8akZsH3CrqP51IawJDwNbC7Su1uFEEJ9fHxBM5RfEEMPQOnJkvPyEq7EojgrILzq4V9r0aaTtV4Jc7s7EigV7aTT2bSwoy2FnXedt62hz38FNKJ/oXIs0GKKIyuq/DYEBdSXjqbsK0BbKNVvsjkZm/i7ofNEufJXt5wR9qiiceLp83dMCj4Z+gmLeWRolW9fSM3UOXYAVI1EYdbRunChKl+G7hnQEDcGyMZeWsjGXIB1eynNPam0PBbmMfRXiVE2ZgzVF1dpXKBcX+onc4WqQMqBq8ttjNNgPU8m0rD5NsJXVAh0gXi/dztUadtloCp36awqCC7YX8ywQcOPNeqpM9i2HeJERu0HqvjPvVs3Fh/pth2uwOwq6P1MeDkJN0MQ0qhL3HZyzGCr19MMceWNPUSdCrsRV3NJh4A4K5LkitOaFYaNx2dp4RR32OgE0OfuuLJR9B6+HPEXK1uG6CPIEZJPVE7jHtT6LFgmlfUQkkAv85m0+2L9CPbey0FQv3LKN4LkuRyXntQhYieYLUWFVz6n6wEDMkcJwbC68U3RRRT/nPL+KHgrtyT3/xFuiyM9yGT+rr1LKR7fSYZgbuUPDg1Uf6yusSkIDLIkGScGslqForMeuc5oPhIreGJHe2V6nBfm3WOgh16cQMGuXLD1R7w38LJKERwdCbD0uS1imBtKiWD+ds3XDTy26WhH4dl8LMC X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199015)(36840700001)(40470700004)(46966006)(36756003)(356005)(82740400003)(81166007)(5660300002)(70586007)(70206006)(8936002)(47076005)(426003)(83380400001)(36860700001)(86362001)(54906003)(110136005)(2616005)(26005)(40480700001)(186003)(336012)(40460700003)(1076003)(316002)(478600001)(82310400005)(44832011)(41300700001)(8676002)(4326008)(2906002)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:53:59.9900 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ffda11d-ee2c-4756-9a18-08dab655b1f8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7283 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unused pci_address_to_pio() conversion of CPU address to I/O port function. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/pci/pci-common.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 085e673..555281c 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -68,29 +68,6 @@ int pcibios_vaddr_is_ioport(void __iomem *address) return ret; } -unsigned long pci_address_to_pio(phys_addr_t address) -{ - struct pci_controller *hose; - resource_size_t size; - unsigned long ret = ~0; - - spin_lock(&hose_spinlock); - list_for_each_entry(hose, &hose_list, list_node) { - size = pcibios_io_size(hose); - if (address >= hose->io_base_phys && - address < (hose->io_base_phys + size)) { - unsigned long base = - (unsigned long)hose->io_base_virt - _IO_BASE; - ret = base + (address - hose->io_base_phys); - break; - } - } - spin_unlock(&hose_spinlock); - - return ret; -} -EXPORT_SYMBOL_GPL(pci_address_to_pio); - /* * Platform support for /proc/bus/pci/X/Y mmap()s. */ From patchwork Tue Oct 25 06:52:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018534 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82F6EFA3740 for ; Tue, 25 Oct 2022 06:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231433AbiJYGyK (ORCPT ); Tue, 25 Oct 2022 02:54:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231504AbiJYGyH (ORCPT ); Tue, 25 Oct 2022 02:54:07 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2050.outbound.protection.outlook.com [40.107.220.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D9E743323; Mon, 24 Oct 2022 23:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NKGZ+hVHz7CM13uZavl4ohtF0qeaJHaXHI+imRaNqSxkKP4GDG7FqRi1jwcOC1MFTF1aP/RNLmSIPhy7Ciahiry+F5VVLWpeSpHknDDcNgop68rjNVkG4vX+hpQdm5XLmt/wTsJo3ueB61cYi+5h8+JRySPPl0XqzhSurn598YrUhQSFmQxfuFYZszfoPTShpKKfs0BuDVbfJxeEISiDFLtSex0LGUtT9xpUOWs27NySb8XFd5c0VWULp5JMJNBDMimFXNPFr+zKkhi95CxZQ0P+cSK9lP7Cz751KJ4EeEBQb8nbAmhPImM3ecX3CMOGYaZLYEgZSn2qnCW8Nqf/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Htx3gIc80b32CjNddX8xJD26o9LADLRUJpXyr/y/+3g=; b=NBVMOLD1GtoemfPwAGKd7LK99nt2770w1oSy4Q61qA3s/WghKVi5FQBheBmq+yFzQ8gloh63/g3syJyTIfvsmjShTSj0rf/TNqik31SUBsyU8vXHfGn2xuu4j7HOOqEj/nBJjdNufNK5o0p3RASqFQZLyb2J4VmHe+DYDD/85qoc1VRNSVbFMGbTHmPTsa7uvyVRWpPvNQsTbT66pphzSsE8EFKn/ic6SXxm0frupQVNWxFfh9Giu3g1fDIAhMPFTH+iM58EvFgR42b5M/apejkgj4ip87LxwZi6s8xzTRQ7DMfNMomBX3Hvd3fNLs9frjGFekbQZXO3jtlf8vR19Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Htx3gIc80b32CjNddX8xJD26o9LADLRUJpXyr/y/+3g=; b=gpb0C4PnMtl72DCdW1azN3Kq6+oZ9TS69tEG1GqkXeAV3nIPLKy8PlIzc+afEz6MQQNFymx7t3VR9Ples7sUTXy9zVqMmjQtSuKLXUCyMetMp2gkyCl9K7fgqM811yOzHGoHEfCJIlWW+rI+38c8fWI9vA9tVZVWBDK/BVPE7UI= Received: from DS7PR03CA0024.namprd03.prod.outlook.com (2603:10b6:5:3b8::29) by CH0PR12MB5155.namprd12.prod.outlook.com (2603:10b6:610:ba::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Tue, 25 Oct 2022 06:54:03 +0000 Received: from DM6NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::79) by DS7PR03CA0024.outlook.office365.com (2603:10b6:5:3b8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Tue, 25 Oct 2022 06:54:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT064.mail.protection.outlook.com (10.13.172.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:54:02 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:54:02 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:53:59 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 10/13] microblaze/PCI: Remove unused sys_pciconfig_iobase() and et al declaration Date: Tue, 25 Oct 2022 12:22:11 +0530 Message-ID: <20221025065214.4663-11-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT064:EE_|CH0PR12MB5155:EE_ X-MS-Office365-Filtering-Correlation-Id: 91b62dc9-3d1d-4093-9e29-08dab655b3b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fsz3MJwfAkv9I0dkM3T8DYXFooPFMF6ov1JwdnybMybVPov5EwHuzf06U0hAf/+LtbsRSdcennCgcFZ0yTWdT16UqYDAoURjuXpdEUQxTFmPne+PZ2gxmFY17RU1VSjAe1QToarKndSX2Jr/xr9PkUzqe5/iRg1UDNjHkLpymBu0CHIOhJLTRdyJYMJifX/GuAExkQye62HfciJjWiF6xMM/YTyjEQBU8J+SPFGCuJqStURTQxxlv95REV/6JoObFgAP6XhCTfPVY6b4Q6YLdcTm8HygT2zzIN9jkbUM1QZFfvIcPVPjs3GP+TQoD0cXC2A4b34uWcpmKRvmgc1iVwMi0ezBw1DqtI22ROhpRHb3C+6ZjkUkXoph9nGywZEz/y2HG10WWx03BSHbxvn/dq9Lninw+gbWsoy4Sm8HseA3QHViKvthWgDUisKeVZigiL+wz3Tgwkyr0GlK6ZFh2eX5F8eIXZnXgj9jHSY3m0ZdVfTfLPviNJNJzftgjS4jfT01zEc1hTB5BI2nH+RM9LDm1Jn3j61uQOr6jZOSoGqA8vwSDvyuITkddyqPgmxV+Hf2obTV1odiQ5nu2w6aJ4DVaXZpFb6K9rYfjf7HR+wURtVb0023s+BKnDXRIxLxeyFrH4ed9ZJlAxEClaBcLfEOitoAi636YjfvBqTSmumG9QEBpD3bYeexFa+HgnhoCl/b6G49Gu6YOWyal8Ku8z9zUcGBpqEwNivQgH9U4uticFQ9wtMDgiktP8TdS1alPhHjNs/ueWJv9cLzLgEz9ZJCWXDOz90T8y/K/e9HVnTt1tU77M+EM2mpsXR7ECOE X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(39860400002)(346002)(376002)(396003)(451199015)(40470700004)(46966006)(36840700001)(83380400001)(86362001)(478600001)(1076003)(70586007)(36756003)(4326008)(6666004)(8676002)(41300700001)(316002)(5660300002)(26005)(8936002)(54906003)(110136005)(40460700003)(44832011)(40480700001)(426003)(47076005)(336012)(186003)(2906002)(2616005)(82310400005)(70206006)(356005)(81166007)(36860700001)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:54:02.8802 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91b62dc9-3d1d-4093-9e29-08dab655b3b1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5155 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Removed unused code which provides information of various I/O regions. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 8 ------ arch/microblaze/include/asm/pci.h | 7 ----- arch/microblaze/pci/pci-common.c | 44 -------------------------------- 3 files changed, 59 deletions(-) diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index cd9ae71..9c89ae4 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -29,17 +29,9 @@ struct pci_controller { struct list_head list_node; struct device *parent; - int first_busno; - int last_busno; - void __iomem *io_base_virt; resource_size_t io_base_phys; - /* Some machines (PReP) have a non 1:1 mapping of - * the PCI memory space in the CPU bus space - */ - resource_size_t pci_mem_offset; - /* Currently, we limit ourselves to 1 IO range and 3 mem * ranges since the common pci_bus structure can't handle more */ diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index 6da7523..52d572d 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h @@ -21,13 +21,6 @@ #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 -/* Values for the `which' argument to sys_pciconfig_iobase syscall. */ -#define IOBASE_BRIDGE_NUMBER 0 -#define IOBASE_MEMORY 1 -#define IOBASE_IO 2 -#define IOBASE_ISA_IO 3 -#define IOBASE_ISA_MEM 4 - /* * Set this to 1 if you want the kernel to re-assign all PCI * bus numbers (don't do that on ppc64 yet !) diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 555281c..a1de853 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -38,9 +38,6 @@ static DEFINE_SPINLOCK(hose_spinlock); LIST_HEAD(hose_list); -/* ISA Memory physical address */ -resource_size_t isa_mem_base; - unsigned long isa_io_base; EXPORT_SYMBOL(isa_io_base); @@ -92,44 +89,3 @@ int pci_proc_domain(struct pci_bus *bus) { return pci_domain_nr(bus); } - -static struct pci_controller *pci_bus_to_hose(int bus) -{ - struct pci_controller *hose, *tmp; - - list_for_each_entry_safe(hose, tmp, &hose_list, list_node) - if (bus >= hose->first_busno && bus <= hose->last_busno) - return hose; - return NULL; -} - -/* Provide information on locations of various I/O regions in physical - * memory. Do this on a per-card basis so that we choose the right - * root bridge. - * Note that the returned IO or memory base is a physical address - */ - -long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn) -{ - struct pci_controller *hose; - long result = -EOPNOTSUPP; - - hose = pci_bus_to_hose(bus); - if (!hose) - return -ENODEV; - - switch (which) { - case IOBASE_BRIDGE_NUMBER: - return (long)hose->first_busno; - case IOBASE_MEMORY: - return (long)hose->pci_mem_offset; - case IOBASE_IO: - return (long)hose->io_base_phys; - case IOBASE_ISA_IO: - return (long)isa_io_base; - case IOBASE_ISA_MEM: - return (long)isa_mem_base; - } - - return result; -} From patchwork Tue Oct 25 06:52:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018537 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADEF4C38A2D for ; Tue, 25 Oct 2022 06:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231538AbiJYGyR (ORCPT ); Tue, 25 Oct 2022 02:54:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231345AbiJYGyK (ORCPT ); Tue, 25 Oct 2022 02:54:10 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C636944574; Mon, 24 Oct 2022 23:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IqWwrE3pgnb2oVGQVIQlfkfjbs04vRBsRh/t1NrDh7GLTAdpdoxBPgD1v2KxKYDINqVbMPkCGpip5HeM2kyQ3Lt9m/cjk11wleepmuzrjqNRSBQsihybK+6lJDMZlXKrSBb9jd0KA3UOuzPF3s3fVDimhTKnfFq+EGni0ON+QJKxNQ+lZPzk6Mq07w5xB3cI81AkS9nqZse00vlZurkIrMJavTyzQxgmLVtKsxksCoSs/EOXm6Ae80zg/M6LkjKJeT7jVG/qrdgHPutop/Ctq+8eU4Isi16HJ1TxAhjSJtTXxqXdz9yWEhJxSC4Yp8oLTTB89F3Yum7hnoORVPoRtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d96QDtTe1aiAT6E0PjQywwcdCdDnBkq+Cp4QiSx0sWs=; b=SYNQR6x+YVGvugkx/5+RqpWjUtEKKPTREEuL4Ob9zWOo2YCipCwcXDmC90JyInf9x+Nv+p/mxmPOd+AyH4z6eEBv6FY0vfBCsK817cVBnICLZ6NyNYNEqOGg8vr9jgqHo9rmzxAm0vxbIIXdWyZ5QIMRu6FRqkpLQ960Jp1cTaSGSOcSIVUfDklf4qYnvndPvzZlzp64tbm9eqzRZKy9Ej2YGB3n2/uMBP5Zy99u3MZtb1rDqZBcsku5mszBzI1I+8D9+7+HyxgopiLf520iSFR32mYXebWBa7ABIoFrMTlG0YLqL2jtJqfD2VLil2gUK9Dq3KCDf/0f6oTAyWu92A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d96QDtTe1aiAT6E0PjQywwcdCdDnBkq+Cp4QiSx0sWs=; b=Y51ejOFr9fUIh9kgIuvz/C9ZqJehIOegbsfhJfqvWJxcmikU92hw3Pca0LJATB8MRpQtTrMBM3wg2gtRw21rqXgy4fab2yZTX1AMftsKXvpl1NFOo8AwqvjjkaDW1hE0QwHHtNJHELASPYzpnsITU69dGBWPOcDuAh4y2WdRWvI= Received: from DM6PR03CA0068.namprd03.prod.outlook.com (2603:10b6:5:100::45) by MN0PR12MB6032.namprd12.prod.outlook.com (2603:10b6:208:3cc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Tue, 25 Oct 2022 06:54:06 +0000 Received: from DM6NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:5:100:cafe::fa) by DM6PR03CA0068.outlook.office365.com (2603:10b6:5:100::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Tue, 25 Oct 2022 06:54:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT109.mail.protection.outlook.com (10.13.173.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:54:05 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:54:05 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:54:02 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 11/13] microblaze/PCI: Remove unused pci_iobar_pfn() and et al declarations Date: Tue, 25 Oct 2022 12:22:12 +0530 Message-ID: <20221025065214.4663-12-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT109:EE_|MN0PR12MB6032:EE_ X-MS-Office365-Filtering-Correlation-Id: b7d3776a-5825-40fc-16c7-08dab655b58d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h22axXyyCRB3nIpP0D7iLOqNjU15O87XWLl+lxo07HXLTrKcaotB2CBlUY+8pHutlxrlC7gLHXN9qhCbxZKK2R5Y3J1s9QE5wfwV98qdHb8r6lXjdPT337LQP4s2ksnlFxd+eopBqnRt6wNKizvlb0fGSE6rpiUqKt0H+ulZfwQzH8xFm8vZwSCyLUPlvzl1pyedc/hofdEOv6CisN6A5iT4vLo4QxHWFCQSs+JzaGyHVWXBc6Ld4msXzz1XmEFeoSXuJUdZKTRJdqDKNdkLT9qqeRAG+N4OH0rB4FCs9Sx998kxWo6nKxa/NQwQi3X5BZYE1GhoK170yQFVAKGKOnpkD2I5Aakm1ZphhumOexQLZHWPKKX/fnoFq6TRunKNYqWUXQGP8wRi0yPybArt8dK8SPVT9gx8HWpvcBCU3mUGOtEuL4qC6ECEaUxnJsMNs3CMnI2JZn0jmtr9AFOEQ080VbHc/jOmSJVNJugi5oF3L5rVuYhNftrWeCTu71wuT90ENa0Z2qexsYqQpSuDjrXpeLn2xspxtcD6wpAcbJhP/SMvpTLQKB8/+zbpXy7OdZUxRMEXtAPrVeJop3yap6lK9zbjIcLsZXt38hO7rh9obVx188UfId19hVo1m9QItJtLz87hiOwcb1jl1bGftcjw7pGWgIuGW7TUtuvW3x6KR9M90BjmXZqpLKMNiEt9XydP2H9rC44lKpgm/0sSPtebbp/Y/OdR0KTAFRK0Qxl9K/rAwq0jWWYvaaeRf2UNteWhJPeX2bA9uGaomTXFaYQHUCRthDYcYKcIPtAtyzvPR6+izoGcJT3F/U+jDkeH X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(41300700001)(40460700003)(426003)(110136005)(54906003)(70206006)(83380400001)(6666004)(8676002)(36756003)(70586007)(36860700001)(4326008)(316002)(26005)(5660300002)(40480700001)(8936002)(47076005)(86362001)(2906002)(2616005)(81166007)(82740400003)(1076003)(478600001)(356005)(44832011)(186003)(336012)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:54:05.9963 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7d3776a-5825-40fc-16c7-08dab655b58d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6032 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Remove unused pci_iobar_pfn() and et al declarations. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/include/asm/pci-bridge.h | 2 -- arch/microblaze/include/asm/pci.h | 3 --- arch/microblaze/pci/pci-common.c | 19 ------------------- 3 files changed, 24 deletions(-) diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 9c89ae4..5db2c66 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -27,10 +27,8 @@ struct pci_controller { struct pci_bus *bus; struct device_node *dn; struct list_head list_node; - struct device *parent; void __iomem *io_base_virt; - resource_size_t io_base_phys; /* Currently, we limit ourselves to 1 IO range and 3 mem * ranges since the common pci_bus structure can't handle more diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index 52d572d..a75bf3b 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h @@ -32,12 +32,9 @@ /* Decide whether to display the domain number in /proc */ extern int pci_proc_domain(struct pci_bus *bus); -struct vm_area_struct; - /* Tell PCI code what kind of PCI resource mappings we support */ #define HAVE_PCI_MMAP 1 #define ARCH_GENERIC_PCI_MMAP_RESOURCE 1 -#define arch_can_pci_mmap_io() 1 struct file; diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index a1de853..e5c2051 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c @@ -65,25 +65,6 @@ int pcibios_vaddr_is_ioport(void __iomem *address) return ret; } -/* - * Platform support for /proc/bus/pci/X/Y mmap()s. - */ - -int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma) -{ - struct pci_controller *hose = pci_bus_to_host(pdev->bus); - resource_size_t ioaddr = pci_resource_start(pdev, bar); - - if (!hose) - return -EINVAL; /* should never happen */ - - /* Convert to an offset within this PCI controller */ - ioaddr -= (unsigned long)hose->io_base_virt - _IO_BASE; - - vma->vm_pgoff += (ioaddr + hose->io_base_phys) >> PAGE_SHIFT; - return 0; -} - /* Display the domain number in /proc */ int pci_proc_domain(struct pci_bus *bus) { From patchwork Tue Oct 25 06:52:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018538 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF85AFA373F for ; Tue, 25 Oct 2022 06:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231511AbiJYGyp (ORCPT ); Tue, 25 Oct 2022 02:54:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231520AbiJYGyP (ORCPT ); Tue, 25 Oct 2022 02:54:15 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2078.outbound.protection.outlook.com [40.107.96.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57ED9F5CDD; Mon, 24 Oct 2022 23:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R5mF3Lgar9S5JjJ6yChDrncPaFLvpbFk0Wfb+5WKcp33gMN5r8VMdtUE5ac0hnEmu8u1WnP+JU17KXBL2vCtQJRSA7ZRgdM7tEgkcjVqhi4fX7cH7yUHI0sla5ZxXCjOzngKB+rK+ZEbkvEK22AXaetzi/PmtCf3czBmfpJ7wbVM0In9QLYLEJMTjJBB1CldmJ0ODsQoPiisyE8gyInXom0xRtqeDEPG7qlAP4d915qWbgnbiBL+7A4RQZQLzMoMnvJw7wBsUv0wUYK6oTRYz2Vax1v+G5QcWNkKjlAkigmJvq1lqYFc2P91IJCZHUKgIl5t1SwAFep4vEBjg6PS9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uNmc0ViRQ0BiI9dEUPMNkAPWKmquEQOo/ZcNAn88p18=; b=YScW3la8+xSGKmZS491lWYDklUBdSMlImineQnIA6LFLGZWQL8FwjvkzZkSRKnyFkCzNhHo0VTbJKBIJcJ8J4FNU93+NeRB5JdI1Ic2Q0dyrGQ3ZRWVH50IVm9QV25rAZiHXp0r8q/6neOQnDsWhrjJictCyLqECkMMXymyOwfpcxnHjJoDpgyzb5fOQU2GNn8GWSf6SEcGFO5e7vd1PLL6ts5e03pCAxcN9P7n9/WGUuTrkncE7nwckoO7Z7PykAJ+u/FnyxTH07tdQP++GJTO0Uc9XujH7Oc5YeebIfycPS9+Z7T/OHDtFyhPGA6zh3w0T16e4kjEnVmwmiJKsVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uNmc0ViRQ0BiI9dEUPMNkAPWKmquEQOo/ZcNAn88p18=; b=x4niXnQUxNmm44Wp255fB1L7EOEdPkVJk2lbhIV9c8RLO80m9LCRBxZ2pSXL8oZrtDohl6mrznlcU+yuNoXFE85DJ8SaTBe13EgN4cu0gWpEjWKXpMenoIOx6z4MX6qOJ8avTNbJH22zjUpM4UXCmZ3I8adttY6xuCh9GV3NL7E= Received: from DM6PR11CA0027.namprd11.prod.outlook.com (2603:10b6:5:190::40) by IA0PR12MB7776.namprd12.prod.outlook.com (2603:10b6:208:430::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Tue, 25 Oct 2022 06:54:09 +0000 Received: from DM6NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::31) by DM6PR11CA0027.outlook.office365.com (2603:10b6:5:190::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Tue, 25 Oct 2022 06:54:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT040.mail.protection.outlook.com (10.13.173.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:54:09 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:54:08 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:54:05 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 12/13] microblaze/PCI: Remove support for Xilinx PCI host bridge Date: Tue, 25 Oct 2022 12:22:13 +0530 Message-ID: <20221025065214.4663-13-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT040:EE_|IA0PR12MB7776:EE_ X-MS-Office365-Filtering-Correlation-Id: a47f1b61-5d91-40df-a81d-08dab655b76a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kqHu0DFl6j+xHnqgMfMgaBnNspr7fy2AspCxllqB97t/aTO7+n7cH2yAoqOJ+vDc2GmXinUtbg0udpsTuz7S5ob41bPAOXNyQeY1b1EEoaMu3dKvkyNLxCmX2IgxgoygrXyI86cRaqyN/zPbo6PrcOhDabaQV8udOwuZr5vq7YYO2TGcRxyTxwOoGT8qlmI/3N3xgkMNkw6ujEcaHXl3ey62Hci251ciyeV5CIYZxbgreBq3jS0zCCPxRxiXWp08NL9/VvX3q1xsNLPYwJ4r03vHKLRZ3EqaExgRQrje72x8V9aGYcKYFWIusZUx159qtSc+CaImQ4ObYbB4YPHlnIvHU2UdXubqJFQDfcV0F8A2Tyz6GhjEvFy6rBMgwflf4kLGauaHhv5nYxJcfMeFNtbEjJ0zmlE1HV6/FHxJpq6XKgsK6ONp0RB/sZVUqWFsepWGzWOZIk5mrKD/m6N7wpiLJb2NqetQRbdM3KizyTXWavzm2YIHJWeJhlBRyz/I9FjRIDI2t6we8mSUYz3aHHqmaCaryvevY/qahB/XzR4VC3tnyCk2qw7zVUCqdATiv0j44xVsYEGpKkR7uPrRfAR1KStekiUEBxlao5sOMtk/WtSoAkGZnOv3sBpGBG8orOdxPZplijwX7hrW/HeKJZsECYtsn4Bl14haF9SkWh08TPvX0DJcu/QDS2jfHj3atybsMuOv4svyQ28xXh68aaRANNJYjASueP6TGSaY/4HTT5gDBp3AJmmWKj7fU9ZpQef54bsfPS67Ubfowcpxmo/j7Juo4H9GVzrtGUSmm0pTYv66gm6p6CD7mSlZEMCC X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199015)(46966006)(36840700001)(40470700004)(316002)(81166007)(40480700001)(54906003)(110136005)(36860700001)(356005)(5660300002)(82740400003)(4326008)(70586007)(70206006)(8676002)(8936002)(41300700001)(426003)(26005)(86362001)(336012)(6666004)(478600001)(1076003)(186003)(40460700003)(83380400001)(2616005)(47076005)(82310400005)(2906002)(36756003)(44832011)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:54:09.1261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a47f1b61-5d91-40df-a81d-08dab655b76a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7776 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This patch removes support for the Xilinx PCI host bridge IPcore. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/Kconfig | 8 --- arch/microblaze/include/asm/pci-bridge.h | 6 -- arch/microblaze/include/asm/pci.h | 5 -- arch/microblaze/pci/Makefile | 1 - arch/microblaze/pci/xilinx_pci.c | 105 ------------------------------- 5 files changed, 125 deletions(-) delete mode 100644 arch/microblaze/pci/xilinx_pci.c diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 996132a..9bacdab 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -205,11 +205,3 @@ config TASK_SIZE default "0x80000000" endmenu - -menu "Bus Options" - -config PCI_XILINX - bool "Xilinx PCI host bridge support" - depends on PCI - -endmenu diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h index 5db2c66..be5f504 100644 --- a/arch/microblaze/include/asm/pci-bridge.h +++ b/arch/microblaze/include/asm/pci-bridge.h @@ -25,7 +25,6 @@ static inline int pcibios_vaddr_is_ioport(void __iomem *address) */ struct pci_controller { struct pci_bus *bus; - struct device_node *dn; struct list_head list_node; void __iomem *io_base_virt; @@ -37,11 +36,6 @@ struct pci_controller { }; #ifdef CONFIG_PCI -static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) -{ - return bus->sysdata; -} - static inline int isa_vaddr_is_ioport(void __iomem *address) { /* No specific ISA handling on ppc32 at this stage, it diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index a75bf3b..91f1f71 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h @@ -38,12 +38,7 @@ struct file; -/* This part of code was originally in xilinx-pci.h */ -#ifdef CONFIG_PCI_XILINX -extern void __init xilinx_pci_init(void); -#else static inline void __init xilinx_pci_init(void) { return; } -#endif #endif /* __KERNEL__ */ #endif /* __ASM_MICROBLAZE_PCI_H */ diff --git a/arch/microblaze/pci/Makefile b/arch/microblaze/pci/Makefile index 3cbdf25..293b416 100644 --- a/arch/microblaze/pci/Makefile +++ b/arch/microblaze/pci/Makefile @@ -4,4 +4,3 @@ # obj-$(CONFIG_PCI) += pci-common.o iomap.o -obj-$(CONFIG_PCI_XILINX) += xilinx_pci.o diff --git a/arch/microblaze/pci/xilinx_pci.c b/arch/microblaze/pci/xilinx_pci.c deleted file mode 100644 index 5dc4182..0000000 --- a/arch/microblaze/pci/xilinx_pci.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * PCI support for Xilinx plbv46_pci soft-core which can be used on - * Xilinx Virtex ML410 / ML510 boards. - * - * Copyright 2009 Roderick Colenbrander - * Copyright 2009 Secret Lab Technologies Ltd. - * - * The pci bridge fixup code was copied from ppc4xx_pci.c and was written - * by Benjamin Herrenschmidt. - * Copyright 2007 Ben. Herrenschmidt , IBM Corp. - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - */ - -#include -#include -#include -#include -#include - -#define XPLB_PCI_ADDR 0x10c -#define XPLB_PCI_DATA 0x110 -#define XPLB_PCI_BUS 0x114 - -#define PCI_HOST_ENABLE_CMD (PCI_COMMAND_SERR | PCI_COMMAND_PARITY | \ - PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY) - -static const struct of_device_id xilinx_pci_match[] = { - { .compatible = "xlnx,plbv46-pci-1.03.a", }, - {} -}; - -/** - * xilinx_pci_fixup_bridge - Block Xilinx PHB configuration. - */ -static void xilinx_pci_fixup_bridge(struct pci_dev *dev) -{ - struct pci_controller *hose; - int i; - - if (dev->devfn || dev->bus->self) - return; - - hose = pci_bus_to_host(dev->bus); - if (!hose) - return; - - if (!of_match_node(xilinx_pci_match, hose->dn)) - return; - - /* Hide the PCI host BARs from the kernel as their content doesn't - * fit well in the resource management - */ - for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { - dev->resource[i].start = 0; - dev->resource[i].end = 0; - dev->resource[i].flags = 0; - } - - dev_info(&dev->dev, "Hiding Xilinx plb-pci host bridge resources %s\n", - pci_name(dev)); -} -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, xilinx_pci_fixup_bridge); - -#ifdef DEBUG -/** - * xilinx_pci_exclude_device - Don't do config access for non-root bus - * - * This is a hack. Config access to any bus other than bus 0 does not - * currently work on the ML510 so we prevent it here. - */ -static int -xilinx_pci_exclude_device(struct pci_controller *hose, u_char bus, u8 devfn) -{ - return (bus != 0); -} -#endif - -/** - * xilinx_pci_init - Find and register a Xilinx PCI host bridge - */ -void __init xilinx_pci_init(void) -{ - struct resource r; - void __iomem *pci_reg; - struct device_node *pci_node; - - pci_node = of_find_matching_node(NULL, xilinx_pci_match); - if (!pci_node) - return; - - if (of_address_to_resource(pci_node, 0, &r)) { - pr_err("xilinx-pci: cannot resolve base address\n"); - return; - } - - /* Set the max bus number to 255, and bus/subbus no's to 0 */ - pci_reg = of_iomap(pci_node, 0); - WARN_ON(!pci_reg); - out_be32(pci_reg + XPLB_PCI_BUS, 0x000000ff); - iounmap(pci_reg); - -} From patchwork Tue Oct 25 06:52:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Havalige, Thippeswamy" X-Patchwork-Id: 13018539 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88F81FA373E for ; Tue, 25 Oct 2022 06:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231638AbiJYGzR (ORCPT ); Tue, 25 Oct 2022 02:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbiJYGyw (ORCPT ); Tue, 25 Oct 2022 02:54:52 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2077.outbound.protection.outlook.com [40.107.220.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 126EC14DF07; Mon, 24 Oct 2022 23:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z7vipnu1DgSPdzUjyua4fL+vBfzDllISKiCW/pxF67a8GTAYnp9BgnOrrGZgMxU5Psu+Ezl4zcQAvzwyS4mBMMvLDF9ZJZwTtkxMGoogP34Gb6y6DfoNhIkXaMe0N75acqobh8oF/Epa90QbAk7l45tWXTYQLHAY4FMdK5/A8Pc5mEADRXqj/vCLoY0nPF0bPkri9SNNK311yF1pHeC8l1dLEAZPF4HFSuLlbzTa2TxukqjQIorImYfzAZqv0qFj/xGcGcsqP7JacnyBpgKktkg54phQCxUpRz53lAd/7RNlxUAOxQ+jNrZ74SNfOLfoEPpoc/MwI2JjjsYj61C0uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t9rUzid7b6GVMO/jRlFMvNVWbJt8BhirHY7i+auu5Qw=; b=dNK5lfHtdN2ZlAuK5lA6eOVkpotyTkcIPAZo+wXPim846wfqBrAqVrZvPQIISu0CJ+Si8zGgLLa16YuuEyCbwBQFwBzASOTCPaYwLE1Pxoo9gAyMyPdLVDUR3ShFLQGFMREIAbcAemEYk3cqs/ccLCbpgCtWIIklqrgUf/Tbr9GkDSRaQZU+CQi1FabZ1dc+vhGT5NPzw+lCHpa1800tmya15b0IUj67Hu4Cyo6C1RjzV3HKXSht9XWKseKQ0fuCN2x27Q0ccPIyrhXhqmv80BG7TLOmWsEZcOuiuZhNzQr5cmTftoUOpUg9uuxvUM5hOoIsThm4UZRyvIts3cQRIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t9rUzid7b6GVMO/jRlFMvNVWbJt8BhirHY7i+auu5Qw=; b=nCV4V/h6RdgUDQEdeLSRMvFPaWzMRw4Qd2retae9q+7oLjxS92AqjJ+qymVEdldsYy9YKf4xo5UYeTBvs0HI8boj7f648KQvwewsdBq0M1AxeLl9r36PXynZaL/6zu8isTDfAseEEYvuhNPD+xrPJWqkF9yzuPRJXfNzh55KUAk= Received: from DS7PR03CA0126.namprd03.prod.outlook.com (2603:10b6:5:3b4::11) by BY5PR12MB4886.namprd12.prod.outlook.com (2603:10b6:a03:1c5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Tue, 25 Oct 2022 06:54:12 +0000 Received: from DM6NAM11FT087.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::c0) by DS7PR03CA0126.outlook.office365.com (2603:10b6:5:3b4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Tue, 25 Oct 2022 06:54:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT087.mail.protection.outlook.com (10.13.172.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 25 Oct 2022 06:54:12 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 01:54:11 -0500 Received: from xhdbharatku40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 25 Oct 2022 01:54:08 -0500 From: Thippeswamy Havalige To: , , , CC: , , , , , "Thippeswamy Havalige" Subject: [PATCH 13/13] microblaze/PCI: Moving PCI iounmap and dependent code Date: Tue, 25 Oct 2022 12:22:14 +0530 Message-ID: <20221025065214.4663-14-thippeswamy.havalige@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221025065214.4663-1-thippeswamy.havalige@amd.com> References: <20221025065214.4663-1-thippeswamy.havalige@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT087:EE_|BY5PR12MB4886:EE_ X-MS-Office365-Filtering-Correlation-Id: 747400ca-ba91-4245-9a52-08dab655b94b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iF+Xawzj20gL3bP7aLnE4VF5zJ19vOVDcm9zkAOMmW3oyhMgYFOV6gybx4JUeKjUqGExRANmD6IlHhtA0zVBtGCpGqG+kv2+j7gCqI9FwCo50y+IFeABkZy3enNlTy9sU7u/sNx+M2P4BYulmNYiph1w+sTMQu6lZ2lE3uovq/e7ro1Qjqop24+bUUDNvqjlR6Kzg8b6Tn3gKi0XQlK/A0u9T4oSDsDG5hXAqO/T3kGdzfwb4yMqUIoXFPzFxBcBmPn9pSGu4CtPzXIFe1NBfJz0GvGemlJ4yhDOdiFUblV+vAdNN+31TAbazWnwWS3fTFmQgvLUls3jXMBlPcKKznwwygG6Akh+3rEBkLnMxc3EqlsYF5NhSTs/b7EOkOTbCHsfwqHLTAbJJPTkMo6FqN6di8X5JGZJz8D0SdLvPpI9GZfR0a2cQmzvvDECOR9R3f+AWopGD8VmmLUFxgrtG0ofgxKEUGpHyukp1iXZFqqFfK+x398hgF+rTJUr8fBxEDsyItoAm50dQdwCD1ZUE/g9xI5Ft9IvpZmRSDSgAkbRQTYb0050QnlqubjY+9mPiU61QW1HVWUVkXULJs48lkjVLhLYnydUVPapdgm8eR1imVBtA986wVcrhAF+7GBlKCBTnXNrIz1C+iynsxmWfZaWch2mTxwJT3t/zp7ehG44be7RaXBRDimWloA1eJQuFlFaLibjosa7YBG3rGsGAhoTzUKmF6PYVFVIZ+gdKuHZns+RP15Z2yt6P7H3NqNsCmCesFfHUoQsefC4cBxaJsSo36Y+cGmL/04cuEvGptY= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(39860400002)(136003)(346002)(451199015)(36840700001)(46966006)(40470700004)(2616005)(1076003)(186003)(426003)(47076005)(336012)(356005)(81166007)(83380400001)(86362001)(36860700001)(41300700001)(82740400003)(44832011)(2906002)(40460700003)(316002)(8936002)(5660300002)(82310400005)(40480700001)(478600001)(26005)(6666004)(70586007)(70206006)(4326008)(8676002)(110136005)(54906003)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2022 06:54:12.2780 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 747400ca-ba91-4245-9a52-08dab655b94b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT087.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4886 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Moving PCI iounmap function and et all dependent code to iomap.c. Signed-off-by: Thippeswamy Havalige --- arch/microblaze/pci/Makefile | 2 +- arch/microblaze/pci/iomap.c | 36 ++++++++++++++++++++ arch/microblaze/pci/pci-common.c | 72 ---------------------------------------- 3 files changed, 37 insertions(+), 73 deletions(-) delete mode 100644 arch/microblaze/pci/pci-common.c diff --git a/arch/microblaze/pci/Makefile b/arch/microblaze/pci/Makefile index 293b416..f8267d2 100644 --- a/arch/microblaze/pci/Makefile +++ b/arch/microblaze/pci/Makefile @@ -3,4 +3,4 @@ # Makefile # -obj-$(CONFIG_PCI) += pci-common.o iomap.o +obj-$(CONFIG_PCI) += iomap.o diff --git a/arch/microblaze/pci/iomap.c b/arch/microblaze/pci/iomap.c index bde74af..b2ee8ac 100644 --- a/arch/microblaze/pci/iomap.c +++ b/arch/microblaze/pci/iomap.c @@ -11,6 +11,42 @@ #include #include +static DEFINE_SPINLOCK(hose_spinlock); +LIST_HEAD(hose_list); + +unsigned long isa_io_base; +EXPORT_SYMBOL(isa_io_base); + +static resource_size_t pcibios_io_size(const struct pci_controller *hose) +{ + return resource_size(&hose->io_resource); +} + +int pcibios_vaddr_is_ioport(void __iomem *address) +{ + int ret = 0; + struct pci_controller *hose; + resource_size_t size; + + spin_lock(&hose_spinlock); + list_for_each_entry(hose, &hose_list, list_node) { + size = pcibios_io_size(hose); + if (address >= hose->io_base_virt && + address < (hose->io_base_virt + size)) { + ret = 1; + break; + } + } + spin_unlock(&hose_spinlock); + return ret; +} + +/* Display the domain number in /proc */ +int pci_proc_domain(struct pci_bus *bus) +{ + return pci_domain_nr(bus); +} + void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { if (isa_vaddr_is_ioport(addr)) diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c deleted file mode 100644 index e5c2051..0000000 --- a/arch/microblaze/pci/pci-common.c +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Contains common pci routines for ALL ppc platform - * (based on pci_32.c and pci_64.c) - * - * Port for PPC64 David Engebretsen, IBM Corp. - * Contains common pci routines for ppc64 platform, pSeries and iSeries brands. - * - * Copyright (C) 2003 Anton Blanchard , IBM - * Rework, based on alpha PCI code. - * - * Common pmac/prep/chrp pci routines. -- Cort - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -static DEFINE_SPINLOCK(hose_spinlock); -LIST_HEAD(hose_list); - -unsigned long isa_io_base; -EXPORT_SYMBOL(isa_io_base); - -static resource_size_t pcibios_io_size(const struct pci_controller *hose) -{ - return resource_size(&hose->io_resource); -} - -int pcibios_vaddr_is_ioport(void __iomem *address) -{ - int ret = 0; - struct pci_controller *hose; - resource_size_t size; - - spin_lock(&hose_spinlock); - list_for_each_entry(hose, &hose_list, list_node) { - size = pcibios_io_size(hose); - if (address >= hose->io_base_virt && - address < (hose->io_base_virt + size)) { - ret = 1; - break; - } - } - spin_unlock(&hose_spinlock); - return ret; -} - -/* Display the domain number in /proc */ -int pci_proc_domain(struct pci_bus *bus) -{ - return pci_domain_nr(bus); -}