Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2167133rwl; Sat, 8 Apr 2023 09:02:30 -0700 (PDT) X-Google-Smtp-Source: AKy350bnm+zbvTwyodNQRYqkjDnPh7tuqEe3GRk1tKBtNQaKrc3ch7/MK8j9dEZdXux5snedccPX X-Received: by 2002:a17:906:4cc2:b0:947:ebd5:c798 with SMTP id q2-20020a1709064cc200b00947ebd5c798mr2600947ejt.54.1680969750379; Sat, 08 Apr 2023 09:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680969750; cv=none; d=google.com; s=arc-20160816; b=bYBi0ehRhIZChE4Q7sRyvGL7C+j1V/Aj7V0BGIRIa7ZSbQLg3HjhFgluPUvwNxBCXY ZuSWeexKXRJeY2Z8ItTLMbw7fKPBZhaTQUsI0e8XXFnrVgqn4flKfDptqqY/ayd9YLsq O6hwiG8//608cyKhXDriHYjtW8sGkwMXS4jzg7g8JhnOMD/aoAV41PoQjvsfftG2rLvV ZvzV2B0EKn2VqPunkPY7MxhJpO19T8Vf3v1iq+sI+u1iUxj6lemLv9PjX8hGAz1Z0MNU F0HdOCc1DXyce8lb3YFhv80Ah/nSigSME1ztJ+SST0fbyVYS14mf6ikbn0HfXuyDY6QD Zd0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WuchoDXRaPeSxQFuYy/TELyaUNVk6he4MNZdh9VwfJU=; b=YaHDTgyluHdO/qfaPG3FzGSWJwNFx0H7U6I0rWSA/kZ98S8mk0obja5ibPf9ORLHyn u2olOTZnVQxPzkIzj2TkgXlXTY5+X/G2wdG3ZB6BRBcqDbc+p7fbnnAai5JhJUI3t2Wv 5uM0SSDpAE+f8Vk/xzegqyZ1K8ScOspW3sUsGYrt9J3D/qvFyHGenlpPfiRYPaIuYL09 28ptOX1JXf6AAO8MPPbwzuOXHZi3p0Xqbo4eTCg60ltstXYS+xI3iqBFo/B2T4iI/Hf5 zQcb7o0VANL2xs+D/tkxwBrhUESHY6kqpHepQCTiIBAbi419AOkWYUYHWrfWxX68c2ZY U2aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JETl010j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf20-20020a17090776d400b009268b9aa263si4701891ejc.306.2023.04.08.09.01.48; Sat, 08 Apr 2023 09:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JETl010j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230120AbjDHPt3 (ORCPT + 99 others); Sat, 8 Apr 2023 11:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbjDHPtX (ORCPT ); Sat, 8 Apr 2023 11:49:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B3F8CA1C for ; Sat, 8 Apr 2023 08:49:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 83D7B60AB1 for ; Sat, 8 Apr 2023 15:49:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAE6DC433D2; Sat, 8 Apr 2023 15:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680968960; bh=HhZeWrgAig2HaS6hHyjC+NpmU7/VpU/d+SrMRHkoT6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JETl010jO7DNwfcUKG4lc8k4011bIVfIUVHSDZ/sQv8R2cOWU/DViRDNsBhoyIKN5 580JJc04QJr/KPOHUynhdmbTx+HIRytVyF+vf30My9rn1DE46HLxGywedN+t87D4qt GliSWtEHu9OS0MIhBT+oSCIwDfqXgLhD5yxjIKP9k7MlsCuXCeN1Zu85ofe/j0o0o7 xUihEQMmBxataHrDN02sz7eDSvDKX/nOL4IsWrV2O9LNEXvbv+I+YnQE+KpMG22+bq bVhDtuUfAyVq6dVB5pPm1RFSuYzX87b6lOJDo5tySzxB6hWmV+YF8nGzL/g5lKkM7+ GDRVBq/UFT1UQ== Received: by pali.im (Postfix) id 5F580209C; Sat, 8 Apr 2023 17:49:18 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Christophe Leroy , Nicholas Piggin Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/8] powerpc/85xx: mpc85xx_ds: Move uli_init() code into its own driver file Date: Sat, 8 Apr 2023 17:48:10 +0200 Message-Id: <20230408154814.10400-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230408154814.10400-1-pali@kernel.org> References: <20230408154814.10400-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move uli_init() function into existing driver fsl_uli1575.c file in order to share its code between more platforms and board files. Signed-off-by: Pali Rohár --- arch/powerpc/include/asm/ppc-pci.h | 2 ++ arch/powerpc/platforms/85xx/mpc85xx_ds.c | 23 +---------------------- arch/powerpc/platforms/fsl_uli1575.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h index a8db969dd595..0e393aeed912 100644 --- a/arch/powerpc/include/asm/ppc-pci.h +++ b/arch/powerpc/include/asm/ppc-pci.h @@ -59,6 +59,7 @@ void eeh_sysfs_remove_device(struct pci_dev *pdev); #ifdef CONFIG_FSL_ULI1575 int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn); +void __init uli_init(void); #endif /* CONFIG_FSL_ULI1575 */ #define PCI_BUSNO(bdfn) ((bdfn >> 8) & 0xff) @@ -70,6 +71,7 @@ static inline void init_pci_config_tokens(void) { } #if !defined(CONFIG_PCI) || !defined(CONFIG_FSL_ULI1575) #include static inline int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) { return PCIBIOS_SUCCESSFUL; } +static inline void __init uli_init(void) {} #endif /* !defined(CONFIG_PCI) || !defined(CONFIG_FSL_ULI1575) */ #endif /* __KERNEL__ */ diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 581b5f0ef3be..c474da3eeea8 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c @@ -107,27 +107,6 @@ void __init mpc85xx_ds_pic_init(void) #endif /* CONFIG_PPC_I8259 */ } -static void __init mpc85xx_ds_uli_init(void) -{ -#ifdef CONFIG_PCI - struct device_node *node; - struct device_node *pci_with_uli; - - /* See if we have a ULI under the primary */ - - node = of_find_node_by_name(NULL, "uli1575"); - while ((pci_with_uli = of_get_parent(node))) { - of_node_put(node); - node = pci_with_uli; - - if (pci_with_uli == fsl_pci_primary) { - ppc_md.pci_exclude_device = uli_exclude_device; - break; - } - } -#endif -} - /* * Setup the architecture */ @@ -138,7 +117,7 @@ static void __init mpc85xx_ds_setup_arch(void) swiotlb_detect_4g(); fsl_pci_assign_primary(); - mpc85xx_ds_uli_init(); + uli_init(); mpc85xx_smp_init(); printk("MPC85xx DS board from Freescale Semiconductor\n"); diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index 1350db0b935d..b073db9d7c79 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c @@ -358,3 +358,22 @@ int uli_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) return PCIBIOS_SUCCESSFUL; } + +void __init uli_init(void) +{ + struct device_node *node; + struct device_node *pci_with_uli; + + /* See if we have a ULI under the primary */ + + node = of_find_node_by_name(NULL, "uli1575"); + while ((pci_with_uli = of_get_parent(node))) { + of_node_put(node); + node = pci_with_uli; + + if (pci_with_uli == fsl_pci_primary) { + ppc_md.pci_exclude_device = uli_exclude_device; + break; + } + } +} -- 2.20.1