From nobody Thu Sep 11 14:08:51 2025 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 7981DC61DA4 for ; Sat, 18 Feb 2023 11:26:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbjBRL0z (ORCPT ); Sat, 18 Feb 2023 06:26:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjBRL0x (ORCPT ); Sat, 18 Feb 2023 06:26:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77ACA1420D for ; Sat, 18 Feb 2023 03:26:52 -0800 (PST) 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 107D960B75 for ; Sat, 18 Feb 2023 11:26:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4966EC433D2; Sat, 18 Feb 2023 11:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719611; bh=UD5jorQCVmKiXH0v3VkIP3iO7pPTI+aaxJhMgfUmopA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XcCh4sLrBNX6YqrkGegjUggS6HIQUmPJKLArq70/WAkXK9NkXZ5fibNjlX0MC9Ryf 3TjrQDOcOZj7BDgifP94+50+DKM8eXnIGBVdyOeVAYmqVFt/EBtkOAqsaEERgI2ReP 8Gb+aCxlvhlLecCuvxgVO5bYV9CU88UPXKMNU1wILqzkPntFzyv2Ipr0FMbbVphWaX +DIwe1Hy32yAC/cSjZawR9iZJlynJYQEJ4JAcMNadm3t8P6W7mMBfwgZk0oY/2ZCgp bXQSDSJDt69eU+yz4TvPoPeLOprQ7uN1SxBXnmLi+v1JHEM7jP1RyQBQjIJa3Y+roS YPET6OORyZ7UQ== Received: by pali.im (Postfix) id A4DF5CB0; Sat, 18 Feb 2023 12:26:48 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/8] powerpc/85xx: Mark mpc85xx_rdb_pic_init() as static Date: Sat, 18 Feb 2023 12:13:58 +0100 Message-Id: <20230218111405.27688-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function mpc85xx_rdb_pic_init() is not used out of the mpc85xx_rdb.c file. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platf= orms/85xx/mpc85xx_rdb.c index d99aba158235..b6129c148fea 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c @@ -38,7 +38,7 @@ #endif =20 =20 -void __init mpc85xx_rdb_pic_init(void) +static void __init mpc85xx_rdb_pic_init(void) { struct mpic *mpic; =20 --=20 2.20.1 From nobody Thu Sep 11 14:08:51 2025 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 70643C64EC4 for ; Sat, 18 Feb 2023 11:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbjBRL05 (ORCPT ); Sat, 18 Feb 2023 06:26:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbjBRL0x (ORCPT ); Sat, 18 Feb 2023 06:26:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B181F15CAF for ; Sat, 18 Feb 2023 03:26:52 -0800 (PST) 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 4A5C460B7A for ; Sat, 18 Feb 2023 11:26:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D2EC4339E; Sat, 18 Feb 2023 11:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719611; bh=RoXrwfU/s5vurCwlxvo8Vd+Lw1JXCW4diLyk4VZ6JDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EpN4RX+zYfFJn15etn06qSov77BUIqo5+WG2LPPmev5iERncqKwxALpHcWNFZzpfh h8zMdh5a2x9pLQAcVh/AHUIJWRLEITbqgwMU6KQIU46ui/piXprYQoJeo4qjO5tfvu iLCFnBIclwFFOotp+LrKfZTWZFceOOsKmlv7rB04diNrqrprJrVMfA+GRLht36JyKv 2twMGTNM1kV4kQdGWNFg+tqsgPiSK0vmi0gQMJUfvL0sjSmtZDeGzpQaLH3qwkFIwT Wk6jzpaVpaqIpAAyLwyDc7PcXfGoC/CrUf22SqCUljpmRrcZQfbX/T8Mz+Uia848u4 LhkYfCK8TnB8A== Received: by pali.im (Postfix) id CFE42CE3; Sat, 18 Feb 2023 12:26:48 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/8] powerpc/85xx: Mark mpc85xx_ds_pic_init() as static Date: Sat, 18 Feb 2023 12:13:59 +0100 Message-Id: <20230218111405.27688-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function mpc85xx_ds_pic_init() is not used out of the mpc85xx_ds.c file. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/platforms/85xx/mpc85xx_ds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platfo= rms/85xx/mpc85xx_ds.c index f8d2c97f39bd..9a6d637ef54a 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c @@ -54,7 +54,7 @@ static void mpc85xx_8259_cascade(struct irq_desc *desc) } #endif /* CONFIG_PPC_I8259 */ =20 -void __init mpc85xx_ds_pic_init(void) +static void __init mpc85xx_ds_pic_init(void) { struct mpic *mpic; #ifdef CONFIG_PPC_I8259 --=20 2.20.1 From nobody Thu Sep 11 14:08:51 2025 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 48ACCC61DA4 for ; Sat, 18 Feb 2023 11:27:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229842AbjBRL1L (ORCPT ); Sat, 18 Feb 2023 06:27:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjBRL04 (ORCPT ); Sat, 18 Feb 2023 06:26:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2C2317140 for ; Sat, 18 Feb 2023 03:26:54 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 4776DB822AC for ; Sat, 18 Feb 2023 11:26:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8923BC433A1; Sat, 18 Feb 2023 11:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719611; bh=fmdelvMY6ZWnjxb2csSd0N99QoVRsuyNJYqKL2TPle8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZGGh5wnpyDSComjd7yXgpvIRVBrfdVbhejpi2HX+O4E4TLRILDhW0c/19JuqgTMHg PiLpBt28P3Am2Tigz41DmaPkXizlYY3wQZ0N7NtAxJz1SfEoymW+mDyCHAtChnNUHH RHE4yU3napJ0CAjmzXs3vNbcXpCi7Qi/OIWkvcbPDiOXoGsQ7VD/qj8DfyYgywFmbV uswXe2dbtWKE7Au4193oOvC7zOSIk0bvZU19kycK1zhr1rY2CSCbw3Lcr5BSSkolDE FaeQ/psO7NnQ0WXpHu6PgHlBX4YUmeMEkDIYN0fJj7utcTvIfP1T9PMPzHwqtwC6j7 hXX7LRaVzbIfw== Received: by pali.im (Postfix) id 00442DEF; Sat, 18 Feb 2023 12:26:48 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/8] powerpc/85xx: p2020: Move all P2020 machine descriptions to p2020.c Date: Sat, 18 Feb 2023 12:14:00 +0100 Message-Id: <20230218111405.27688-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This moves machine descriptions and all related code for all P2020 boards into new p2020.c source file. This change also copies helper static functions from other mpc85xx*.c files into p2020.c, which are required for machine descriptions. This is preparation for code de-duplication and providing one unified machine description for all P2020 boards. In follow-up patches would be copied functions refactored and simplified to be specific just for P2020 boards. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/platforms/85xx/Makefile | 2 + arch/powerpc/platforms/85xx/mpc85xx_ds.c | 23 --- arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 44 ------ .../platforms/85xx/{mpc85xx_ds.c =3D> p2020.c} | 134 ++++++++++++------ 4 files changed, 91 insertions(+), 112 deletions(-) copy arch/powerpc/platforms/85xx/{mpc85xx_ds.c =3D> p2020.c} (65%) diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/= 85xx/Makefile index 260fbad7967b..1ad261b4eeb6 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile @@ -23,6 +23,8 @@ obj-$(CONFIG_P1010_RDB) +=3D p1010rdb.o obj-$(CONFIG_P1022_DS) +=3D p1022_ds.o obj-$(CONFIG_P1022_RDK) +=3D p1022_rdk.o obj-$(CONFIG_P1023_RDB) +=3D p1023_rdb.o +obj-$(CONFIG_MPC85xx_DS) +=3D p2020.o +obj-$(CONFIG_MPC85xx_RDB) +=3D p2020.o obj-$(CONFIG_TWR_P102x) +=3D twr_p102x.o obj-$(CONFIG_CORENET_GENERIC) +=3D corenet_generic.o obj-$(CONFIG_FB_FSL_DIU) +=3D t1042rdb_diu.o diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platfo= rms/85xx/mpc85xx_ds.c index 9a6d637ef54a..05aac997b5ed 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c @@ -168,7 +168,6 @@ static int __init mpc8544_ds_probe(void) =20 machine_arch_initcall(mpc8544_ds, mpc85xx_common_publish_devices); machine_arch_initcall(mpc8572_ds, mpc85xx_common_publish_devices); -machine_arch_initcall(p2020_ds, mpc85xx_common_publish_devices); =20 /* * Called very early, device-tree isn't unflattened @@ -178,14 +177,6 @@ static int __init mpc8572_ds_probe(void) return !!of_machine_is_compatible("fsl,MPC8572DS"); } =20 -/* - * Called very early, device-tree isn't unflattened - */ -static int __init p2020_ds_probe(void) -{ - return !!of_machine_is_compatible("fsl,P2020DS"); -} - define_machine(mpc8544_ds) { .name =3D "MPC8544 DS", .probe =3D mpc8544_ds_probe, @@ -213,17 +204,3 @@ define_machine(mpc8572_ds) { .calibrate_decr =3D generic_calibrate_decr, .progress =3D udbg_progress, }; - -define_machine(p2020_ds) { - .name =3D "P2020 DS", - .probe =3D p2020_ds_probe, - .setup_arch =3D mpc85xx_ds_setup_arch, - .init_IRQ =3D mpc85xx_ds_pic_init, -#ifdef CONFIG_PCI - .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, - .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, -#endif - .get_irq =3D mpic_get_irq, - .calibrate_decr =3D generic_calibrate_decr, - .progress =3D udbg_progress, -}; diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platf= orms/85xx/mpc85xx_rdb.c index b6129c148fea..05f1ed635735 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c @@ -108,8 +108,6 @@ static void __init mpc85xx_rdb_setup_arch(void) printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); } =20 -machine_arch_initcall(p2020_rdb, mpc85xx_common_publish_devices); -machine_arch_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices); machine_arch_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices); machine_arch_initcall(p1020_rdb, mpc85xx_common_publish_devices); machine_arch_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices); @@ -122,13 +120,6 @@ machine_arch_initcall(p1024_rdb, mpc85xx_common_publis= h_devices); /* * Called very early, device-tree isn't unflattened */ -static int __init p2020_rdb_probe(void) -{ - if (of_machine_is_compatible("fsl,P2020RDB")) - return 1; - return 0; -} - static int __init p1020_rdb_probe(void) { if (of_machine_is_compatible("fsl,P1020RDB")) @@ -153,13 +144,6 @@ static int __init p1021_rdb_pc_probe(void) return 0; } =20 -static int __init p2020_rdb_pc_probe(void) -{ - if (of_machine_is_compatible("fsl,P2020RDB-PC")) - return 1; - return 0; -} - static int __init p1025_rdb_probe(void) { return of_machine_is_compatible("fsl,P1025RDB"); @@ -180,20 +164,6 @@ static int __init p1024_rdb_probe(void) return of_machine_is_compatible("fsl,P1024RDB"); } =20 -define_machine(p2020_rdb) { - .name =3D "P2020 RDB", - .probe =3D p2020_rdb_probe, - .setup_arch =3D mpc85xx_rdb_setup_arch, - .init_IRQ =3D mpc85xx_rdb_pic_init, -#ifdef CONFIG_PCI - .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, - .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, -#endif - .get_irq =3D mpic_get_irq, - .calibrate_decr =3D generic_calibrate_decr, - .progress =3D udbg_progress, -}; - define_machine(p1020_rdb) { .name =3D "P1020 RDB", .probe =3D p1020_rdb_probe, @@ -222,20 +192,6 @@ define_machine(p1021_rdb_pc) { .progress =3D udbg_progress, }; =20 -define_machine(p2020_rdb_pc) { - .name =3D "P2020RDB-PC", - .probe =3D p2020_rdb_pc_probe, - .setup_arch =3D mpc85xx_rdb_setup_arch, - .init_IRQ =3D mpc85xx_rdb_pic_init, -#ifdef CONFIG_PCI - .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, - .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, -#endif - .get_irq =3D mpic_get_irq, - .calibrate_decr =3D generic_calibrate_decr, - .progress =3D udbg_progress, -}; - define_machine(p1025_rdb) { .name =3D "P1025 RDB", .probe =3D p1025_rdb_probe, diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platfo= rms/85xx/p2020.c similarity index 65% copy from arch/powerpc/platforms/85xx/mpc85xx_ds.c copy to arch/powerpc/platforms/85xx/p2020.c index 9a6d637ef54a..d65d4c88ac47 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/p2020.c @@ -1,11 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * MPC85xx DS Board Setup + * Freescale P2020 board Setup * - * Author Xianghua Xiao (x.xiao@freescale.com) - * Roy Zang - * - Add PCI/PCI Exprees support - * Copyright 2007 Freescale Semiconductor Inc. + * Copyright 2007,2009,2012-2013 Freescale Semiconductor Inc. + * Copyright 2022 Pali Roh=C3=A1r */ =20 #include @@ -17,6 +15,7 @@ #include #include #include +#include =20 #include #include @@ -27,6 +26,8 @@ #include #include =20 +#include + #include #include #include "smp.h" @@ -41,6 +42,8 @@ #define DBG(fmt, args...) #endif =20 +#ifdef CONFIG_MPC85xx_DS + #ifdef CONFIG_PPC_I8259 static void mpc85xx_8259_cascade(struct irq_desc *desc) { @@ -62,18 +65,11 @@ static void __init mpc85xx_ds_pic_init(void) struct device_node *cascade_node =3D NULL; int cascade_irq; #endif - if (of_machine_is_compatible("fsl,MPC8572DS-CAMP")) { - mpic =3D mpic_alloc(NULL, 0, - MPIC_NO_RESET | - MPIC_BIG_ENDIAN | - MPIC_SINGLE_DEST_CPU, - 0, 256, " OpenPIC "); - } else { - mpic =3D mpic_alloc(NULL, 0, - MPIC_BIG_ENDIAN | - MPIC_SINGLE_DEST_CPU, - 0, 256, " OpenPIC "); - } + + mpic =3D mpic_alloc(NULL, 0, + MPIC_BIG_ENDIAN | + MPIC_SINGLE_DEST_CPU, + 0, 256, " OpenPIC "); =20 BUG_ON(mpic =3D=3D NULL); mpic_init(mpic); @@ -142,9 +138,27 @@ static void __init mpc85xx_ds_uli_init(void) #endif } =20 +#endif /* CONFIG_MPC85xx_DS */ + +#ifdef CONFIG_MPC85xx_RDB +static void __init mpc85xx_rdb_pic_init(void) +{ + struct mpic *mpic; + + mpic =3D mpic_alloc(NULL, 0, + MPIC_BIG_ENDIAN | + MPIC_SINGLE_DEST_CPU, + 0, 256, " OpenPIC "); + + BUG_ON(mpic =3D=3D NULL); + mpic_init(mpic); +} +#endif /* CONFIG_MPC85xx_RDB */ + /* * Setup the architecture */ +#ifdef CONFIG_MPC85xx_DS static void __init mpc85xx_ds_setup_arch(void) { if (ppc_md.progress) @@ -157,38 +171,65 @@ static void __init mpc85xx_ds_setup_arch(void) =20 printk("MPC85xx DS board from Freescale Semiconductor\n"); } +#endif /* CONFIG_MPC85xx_DS */ =20 -/* - * Called very early, device-tree isn't unflattened - */ -static int __init mpc8544_ds_probe(void) +#ifdef CONFIG_MPC85xx_RDB +static void __init mpc85xx_rdb_setup_arch(void) { - return !!of_machine_is_compatible("MPC8544DS"); + if (ppc_md.progress) + ppc_md.progress("mpc85xx_rdb_setup_arch()", 0); + + mpc85xx_smp_init(); + + fsl_pci_assign_primary(); + +#ifdef CONFIG_QUICC_ENGINE + mpc85xx_qe_par_io_init(); +#endif /* CONFIG_QUICC_ENGINE */ + + printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); } +#endif /* CONFIG_MPC85xx_RDB */ =20 -machine_arch_initcall(mpc8544_ds, mpc85xx_common_publish_devices); -machine_arch_initcall(mpc8572_ds, mpc85xx_common_publish_devices); +#ifdef CONFIG_MPC85xx_DS machine_arch_initcall(p2020_ds, mpc85xx_common_publish_devices); +#endif /* CONFIG_MPC85xx_DS */ =20 -/* - * Called very early, device-tree isn't unflattened - */ -static int __init mpc8572_ds_probe(void) -{ - return !!of_machine_is_compatible("fsl,MPC8572DS"); -} +#ifdef CONFIG_MPC85xx_RDB +machine_arch_initcall(p2020_rdb, mpc85xx_common_publish_devices); +machine_arch_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices); +#endif /* CONFIG_MPC85xx_RDB */ =20 /* * Called very early, device-tree isn't unflattened */ +#ifdef CONFIG_MPC85xx_DS static int __init p2020_ds_probe(void) { return !!of_machine_is_compatible("fsl,P2020DS"); } +#endif /* CONFIG_MPC85xx_DS */ + +#ifdef CONFIG_MPC85xx_RDB +static int __init p2020_rdb_probe(void) +{ + if (of_machine_is_compatible("fsl,P2020RDB")) + return 1; + return 0; +} + +static int __init p2020_rdb_pc_probe(void) +{ + if (of_machine_is_compatible("fsl,P2020RDB-PC")) + return 1; + return 0; +} +#endif /* CONFIG_MPC85xx_RDB */ =20 -define_machine(mpc8544_ds) { - .name =3D "MPC8544 DS", - .probe =3D mpc8544_ds_probe, +#ifdef CONFIG_MPC85xx_DS +define_machine(p2020_ds) { + .name =3D "P2020 DS", + .probe =3D p2020_ds_probe, .setup_arch =3D mpc85xx_ds_setup_arch, .init_IRQ =3D mpc85xx_ds_pic_init, #ifdef CONFIG_PCI @@ -199,12 +240,14 @@ define_machine(mpc8544_ds) { .calibrate_decr =3D generic_calibrate_decr, .progress =3D udbg_progress, }; - -define_machine(mpc8572_ds) { - .name =3D "MPC8572 DS", - .probe =3D mpc8572_ds_probe, - .setup_arch =3D mpc85xx_ds_setup_arch, - .init_IRQ =3D mpc85xx_ds_pic_init, +#endif /* CONFIG_MPC85xx_DS */ + +#ifdef CONFIG_MPC85xx_RDB +define_machine(p2020_rdb) { + .name =3D "P2020 RDB", + .probe =3D p2020_rdb_probe, + .setup_arch =3D mpc85xx_rdb_setup_arch, + .init_IRQ =3D mpc85xx_rdb_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, @@ -214,11 +257,11 @@ define_machine(mpc8572_ds) { .progress =3D udbg_progress, }; =20 -define_machine(p2020_ds) { - .name =3D "P2020 DS", - .probe =3D p2020_ds_probe, - .setup_arch =3D mpc85xx_ds_setup_arch, - .init_IRQ =3D mpc85xx_ds_pic_init, +define_machine(p2020_rdb_pc) { + .name =3D "P2020RDB-PC", + .probe =3D p2020_rdb_pc_probe, + .setup_arch =3D mpc85xx_rdb_setup_arch, + .init_IRQ =3D mpc85xx_rdb_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, @@ -227,3 +270,4 @@ define_machine(p2020_ds) { .calibrate_decr =3D generic_calibrate_decr, .progress =3D udbg_progress, }; +#endif /* CONFIG_MPC85xx_RDB */ --=20 2.20.1 From nobody Thu Sep 11 14:08:51 2025 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 778EBC636CC for ; Sat, 18 Feb 2023 11:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbjBRL1E (ORCPT ); Sat, 18 Feb 2023 06:27:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjBRL0z (ORCPT ); Sat, 18 Feb 2023 06:26:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD5215CAF for ; Sat, 18 Feb 2023 03:26:54 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id DAAE2B822AD for ; Sat, 18 Feb 2023 11:26:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F2EAC4339C; Sat, 18 Feb 2023 11:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719611; bh=vLdbEYs9J1EPtjUtdMqj8bjqBT+nhEDREqgOhl9+6dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EiLsj2hep87sOE4NvcWDKU0XAlOcSB5+fjp1KdhxQhU1ocx5yyRBZMUVPIuCsQEOD drDoJyBYkDn/2jCQ2+kdhV1BmGWGs+4BEo1CmNFTd3tiGrXobCUPqMQz1Rr2HF3/OC REF52nPeqqFCfahETmtobad6+GItJbDawyv4MBLbuJitFnFjvz//q2aMFZNvEWUGS1 0C3CaKnXSH3lzOZQjFwDqDLlflV1cXYOCNI4hDs4lsGv1Mi7lxxaCkRc8VuPUd83B8 ybwsMVMBxfBza8tF10yEkX76X9NOEjBaYYDIS2C0j4TbCvpmQyIz+xLsnryMxKaZoI PM/S7jcDTqLXw== Received: by pali.im (Postfix) id 231C010C6; Sat, 18 Feb 2023 12:26:49 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/8] powerpc/85xx: p2020: Move i8259 code into own function Date: Sat, 18 Feb 2023 12:14:01 +0100 Message-Id: <20230218111405.27688-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Splits mpic and i8259 initialization codes into separate functions. Use 'if (IS_ENABLED(CONFIG_PPC_I8259))' instead of '#ifdef CONFIG_PPC_I8259= '. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/platforms/85xx/p2020.c | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/platforms/85xx/p2020.c b/arch/powerpc/platforms/8= 5xx/p2020.c index d65d4c88ac47..1cc468dc4caf 100644 --- a/arch/powerpc/platforms/85xx/p2020.c +++ b/arch/powerpc/platforms/85xx/p2020.c @@ -44,7 +44,6 @@ =20 #ifdef CONFIG_MPC85xx_DS =20 -#ifdef CONFIG_PPC_I8259 static void mpc85xx_8259_cascade(struct irq_desc *desc) { struct irq_chip *chip =3D irq_desc_get_chip(desc); @@ -55,27 +54,13 @@ static void mpc85xx_8259_cascade(struct irq_desc *desc) } chip->irq_eoi(&desc->irq_data); } -#endif /* CONFIG_PPC_I8259 */ =20 -static void __init mpc85xx_ds_pic_init(void) +static void __init mpc85xx_8259_init(void) { - struct mpic *mpic; -#ifdef CONFIG_PPC_I8259 struct device_node *np; struct device_node *cascade_node =3D NULL; int cascade_irq; -#endif =20 - mpic =3D mpic_alloc(NULL, 0, - MPIC_BIG_ENDIAN | - MPIC_SINGLE_DEST_CPU, - 0, 256, " OpenPIC "); - - BUG_ON(mpic =3D=3D NULL); - mpic_init(mpic); - -#ifdef CONFIG_PPC_I8259 - /* Initialize the i8259 controller */ for_each_node_by_type(np, "interrupt-controller") if (of_device_is_compatible(np, "chrp,iic")) { cascade_node =3D np; @@ -93,13 +78,28 @@ static void __init mpc85xx_ds_pic_init(void) return; } =20 - DBG("mpc85xxds: cascade mapped to irq %d\n", cascade_irq); + DBG("i8259: cascade mapped to irq %d\n", cascade_irq); =20 i8259_init(cascade_node, 0); of_node_put(cascade_node); =20 irq_set_chained_handler(cascade_irq, mpc85xx_8259_cascade); -#endif /* CONFIG_PPC_I8259 */ +} + +static void __init mpc85xx_ds_pic_init(void) +{ + struct mpic *mpic; + + mpic =3D mpic_alloc(NULL, 0, + MPIC_BIG_ENDIAN | + MPIC_SINGLE_DEST_CPU, + 0, 256, " OpenPIC "); + + BUG_ON(mpic =3D=3D NULL); + mpic_init(mpic); + + if (IS_ENABLED(CONFIG_PPC_I8259)) + mpc85xx_8259_init(); } =20 #ifdef CONFIG_PCI --=20 2.20.1 From nobody Thu Sep 11 14:08:51 2025 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 57C17C636CC for ; Sat, 18 Feb 2023 11:27:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbjBRL07 (ORCPT ); Sat, 18 Feb 2023 06:26:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbjBRL0y (ORCPT ); Sat, 18 Feb 2023 06:26:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 368961632C for ; Sat, 18 Feb 2023 03:26:53 -0800 (PST) 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 BA95B60B7F for ; Sat, 18 Feb 2023 11:26:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D634AC433A0; Sat, 18 Feb 2023 11:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719612; bh=jGRbes1qfF5eX/m0mTgtaEiMEXtloCCuJQ0jRPGZpLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ML3ph7iDs4nYKIXl+E5PZQMgZU+yxf63QJGEnEbhnR8tiRiHUgLtKLhRBNhPdXkV8 V386llNNuVGyCoJ5IE63heNMMwtCyrKSS/LOlAVnNpOBOgIaV6roVRXrk26dbkr67q iCi8bH57aMpjPSsGIT7dz/XF2Wwn15M5hL2pyaAweam2BICEwXpCw25R3ym1CYE4RU PCUPA0Il5m///NH0v01ZlxfmXf6/HWMUVgeYS3jE6OqzrY8QRBABvl02bBFlNWT4/I F3TzGQp6mWslMx+J/F+SjnahTIyWs1nRTNrTnfXcbb6K8qMEndiGWnTojJJjzWWbQ7 08cGwRAxkSkYA== Received: by pali.im (Postfix) id 58EC82558; Sat, 18 Feb 2023 12:26:49 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/8] powerpc/85xx: p2020: Unify .setup_arch and .init_IRQ callbacks Date: Sat, 18 Feb 2023 12:14:02 +0100 Message-Id: <20230218111405.27688-6-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make just one .setup_arch and one .init_IRQ callback implementation for all P2020 board code. This deduplicate repeated and same code. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/platforms/85xx/p2020.c | 58 +++++------------------------ 1 file changed, 9 insertions(+), 49 deletions(-) diff --git a/arch/powerpc/platforms/85xx/p2020.c b/arch/powerpc/platforms/8= 5xx/p2020.c index 1cc468dc4caf..1033b7bb05cc 100644 --- a/arch/powerpc/platforms/85xx/p2020.c +++ b/arch/powerpc/platforms/85xx/p2020.c @@ -42,8 +42,6 @@ #define DBG(fmt, args...) #endif =20 -#ifdef CONFIG_MPC85xx_DS - static void mpc85xx_8259_cascade(struct irq_desc *desc) { struct irq_chip *chip =3D irq_desc_get_chip(desc); @@ -86,7 +84,7 @@ static void __init mpc85xx_8259_init(void) irq_set_chained_handler(cascade_irq, mpc85xx_8259_cascade); } =20 -static void __init mpc85xx_ds_pic_init(void) +static void __init p2020_pic_init(void) { struct mpic *mpic; =20 @@ -138,58 +136,20 @@ static void __init mpc85xx_ds_uli_init(void) #endif } =20 -#endif /* CONFIG_MPC85xx_DS */ - -#ifdef CONFIG_MPC85xx_RDB -static void __init mpc85xx_rdb_pic_init(void) -{ - struct mpic *mpic; - - mpic =3D mpic_alloc(NULL, 0, - MPIC_BIG_ENDIAN | - MPIC_SINGLE_DEST_CPU, - 0, 256, " OpenPIC "); - - BUG_ON(mpic =3D=3D NULL); - mpic_init(mpic); -} -#endif /* CONFIG_MPC85xx_RDB */ - /* * Setup the architecture */ -#ifdef CONFIG_MPC85xx_DS -static void __init mpc85xx_ds_setup_arch(void) +static void __init p2020_setup_arch(void) { - if (ppc_md.progress) - ppc_md.progress("mpc85xx_ds_setup_arch()", 0); - swiotlb_detect_4g(); fsl_pci_assign_primary(); mpc85xx_ds_uli_init(); mpc85xx_smp_init(); =20 - printk("MPC85xx DS board from Freescale Semiconductor\n"); -} -#endif /* CONFIG_MPC85xx_DS */ - -#ifdef CONFIG_MPC85xx_RDB -static void __init mpc85xx_rdb_setup_arch(void) -{ - if (ppc_md.progress) - ppc_md.progress("mpc85xx_rdb_setup_arch()", 0); - - mpc85xx_smp_init(); - - fsl_pci_assign_primary(); - #ifdef CONFIG_QUICC_ENGINE mpc85xx_qe_par_io_init(); -#endif /* CONFIG_QUICC_ENGINE */ - - printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n"); +#endif } -#endif /* CONFIG_MPC85xx_RDB */ =20 #ifdef CONFIG_MPC85xx_DS machine_arch_initcall(p2020_ds, mpc85xx_common_publish_devices); @@ -230,8 +190,8 @@ static int __init p2020_rdb_pc_probe(void) define_machine(p2020_ds) { .name =3D "P2020 DS", .probe =3D p2020_ds_probe, - .setup_arch =3D mpc85xx_ds_setup_arch, - .init_IRQ =3D mpc85xx_ds_pic_init, + .setup_arch =3D p2020_setup_arch, + .init_IRQ =3D p2020_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, @@ -246,8 +206,8 @@ define_machine(p2020_ds) { define_machine(p2020_rdb) { .name =3D "P2020 RDB", .probe =3D p2020_rdb_probe, - .setup_arch =3D mpc85xx_rdb_setup_arch, - .init_IRQ =3D mpc85xx_rdb_pic_init, + .setup_arch =3D p2020_setup_arch, + .init_IRQ =3D p2020_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, @@ -260,8 +220,8 @@ define_machine(p2020_rdb) { define_machine(p2020_rdb_pc) { .name =3D "P2020RDB-PC", .probe =3D p2020_rdb_pc_probe, - .setup_arch =3D mpc85xx_rdb_setup_arch, - .init_IRQ =3D mpc85xx_rdb_pic_init, + .setup_arch =3D p2020_setup_arch, + .init_IRQ =3D p2020_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, --=20 2.20.1 From nobody Thu Sep 11 14:08:51 2025 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 05A2AC61DA4 for ; Sat, 18 Feb 2023 11:27:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbjBRL1I (ORCPT ); Sat, 18 Feb 2023 06:27:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjBRL0z (ORCPT ); Sat, 18 Feb 2023 06:26:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8F281632C for ; Sat, 18 Feb 2023 03:26:54 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 666F0B822AE for ; Sat, 18 Feb 2023 11:26:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7D4EC433A7; Sat, 18 Feb 2023 11:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719612; bh=FAbayckINTcRtQEApIU4KxM0IuLRQEFTI2dIvymgGt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bm8dQF+Fektu6qZvLgRICtgM0fuRiUYW50iz2fPx+MO0GMQxxFIPOOubK3guWhQIG /6CRarXi1GWgOIZM6G3fA253xCdDbabAwQZpgvgvZ9aV2gJDUyBaf0XhJ5qX9JUFln jnGSH7gSEPAMZCNmPn3cWNoi8DyAmF0xTKN2WOyMB2l8cifUGGGgVNKARsuQXvjLzK 5+3EXz6JRk0cEDWlX0+J8JyO2mnXXjA82iVJJRv3xNRP2gu2LTmVKErVzxcmQO83tu mDsorRQCR5C7sZ7WJD+P/mcwu/2ZjGAUQlfevKaA+/wOFVXPNjIz/XmE7Wk9j/fa8w zk5eQkS5Zj5Qg== Received: by pali.im (Postfix) id 82DCA2619; Sat, 18 Feb 2023 12:26:49 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/8] powerpc/85xx: p2020: Define just one machine description Date: Sat, 18 Feb 2023 12:14:03 +0100 Message-Id: <20230218111405.27688-7-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Combine machine descriptions and code of all P2020 boards into just one generic unified P2020 machine description. This allows kernel to boot on any P2020-based board with P2020 DTS file without need to patch kernel and define a new machine description in 85xx powerpc platform directory. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/platforms/85xx/p2020.c | 77 ++++++----------------------- 1 file changed, 15 insertions(+), 62 deletions(-) diff --git a/arch/powerpc/platforms/85xx/p2020.c b/arch/powerpc/platforms/8= 5xx/p2020.c index 1033b7bb05cc..feb5507bfc89 100644 --- a/arch/powerpc/platforms/85xx/p2020.c +++ b/arch/powerpc/platforms/85xx/p2020.c @@ -151,83 +151,36 @@ static void __init p2020_setup_arch(void) #endif } =20 -#ifdef CONFIG_MPC85xx_DS -machine_arch_initcall(p2020_ds, mpc85xx_common_publish_devices); -#endif /* CONFIG_MPC85xx_DS */ - -#ifdef CONFIG_MPC85xx_RDB -machine_arch_initcall(p2020_rdb, mpc85xx_common_publish_devices); -machine_arch_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices); -#endif /* CONFIG_MPC85xx_RDB */ +machine_arch_initcall(p2020, mpc85xx_common_publish_devices); =20 /* * Called very early, device-tree isn't unflattened */ -#ifdef CONFIG_MPC85xx_DS -static int __init p2020_ds_probe(void) +static int __init p2020_probe(void) { - return !!of_machine_is_compatible("fsl,P2020DS"); -} -#endif /* CONFIG_MPC85xx_DS */ + struct device_node *p2020_cpu; =20 -#ifdef CONFIG_MPC85xx_RDB -static int __init p2020_rdb_probe(void) -{ - if (of_machine_is_compatible("fsl,P2020RDB")) - return 1; - return 0; -} + /* + * There is no common compatible string for all P2020 boards. + * The only common thing is "PowerPC,P2020@0" cpu node. + * So check for P2020 board via this cpu node. + */ + p2020_cpu =3D of_find_node_by_path("/cpus/PowerPC,P2020@0"); + of_node_put(p2020_cpu); =20 -static int __init p2020_rdb_pc_probe(void) -{ - if (of_machine_is_compatible("fsl,P2020RDB-PC")) - return 1; - return 0; + return !!p2020_cpu; } -#endif /* CONFIG_MPC85xx_RDB */ - -#ifdef CONFIG_MPC85xx_DS -define_machine(p2020_ds) { - .name =3D "P2020 DS", - .probe =3D p2020_ds_probe, - .setup_arch =3D p2020_setup_arch, - .init_IRQ =3D p2020_pic_init, -#ifdef CONFIG_PCI - .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, - .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, -#endif - .get_irq =3D mpic_get_irq, - .calibrate_decr =3D generic_calibrate_decr, - .progress =3D udbg_progress, -}; -#endif /* CONFIG_MPC85xx_DS */ - -#ifdef CONFIG_MPC85xx_RDB -define_machine(p2020_rdb) { - .name =3D "P2020 RDB", - .probe =3D p2020_rdb_probe, - .setup_arch =3D p2020_setup_arch, - .init_IRQ =3D p2020_pic_init, -#ifdef CONFIG_PCI - .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, - .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, -#endif - .get_irq =3D mpic_get_irq, - .calibrate_decr =3D generic_calibrate_decr, - .progress =3D udbg_progress, -}; =20 -define_machine(p2020_rdb_pc) { - .name =3D "P2020RDB-PC", - .probe =3D p2020_rdb_pc_probe, +define_machine(p2020) { + .name =3D "Freescale P2020", + .probe =3D p2020_probe, .setup_arch =3D p2020_setup_arch, .init_IRQ =3D p2020_pic_init, #ifdef CONFIG_PCI .pcibios_fixup_bus =3D fsl_pcibios_fixup_bus, - .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, + .pcibios_fixup_phb =3D fsl_pcibios_fixup_phb, #endif .get_irq =3D mpic_get_irq, .calibrate_decr =3D generic_calibrate_decr, .progress =3D udbg_progress, }; -#endif /* CONFIG_MPC85xx_RDB */ --=20 2.20.1 From nobody Thu Sep 11 14:08:51 2025 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 20764C61DA4 for ; Sat, 18 Feb 2023 11:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbjBRL1O (ORCPT ); Sat, 18 Feb 2023 06:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbjBRL05 (ORCPT ); Sat, 18 Feb 2023 06:26:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 797C319F03 for ; Sat, 18 Feb 2023 03:26:56 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 27260B822AF for ; Sat, 18 Feb 2023 11:26:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E7B3C433EF; Sat, 18 Feb 2023 11:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719613; bh=13zOblXSPCKmmAdfWqVJT/RFm4vtSa7vCpTc5iq/PY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lQkQmvwuX2P1OgBW2o/F6sbAKjRbd803TOjHGQFgMM+No9N/ybO2n9PQTWV4oHKRk oOb2iNdH0G07zhZerfWUw3p6ELkh01j8q+1xXnCTWCtRKjKnu9BU6S0RoNXNc5t+vR ovYz+2K/F/hnSeRTxG5Z1uSqGpXUTY7zUGP6GdGBODulMtqx1257dE//6rA7+1Dke1 hRzs5RvVYVjwGIGi7NVKexPwizW5OyMwh7tyBV2brgUpqMv6SOKe7BdvC/bwTL7+FJ ChJ0vsXp1ouLesK+BdYB+qULADc4gZqctLF14y7M2KUTqShnsGgMY3YS6QEnP3oSnC veqaRw3Hlp3gQ== Received: by pali.im (Postfix) id AF850274A; Sat, 18 Feb 2023 12:26:49 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/8] powerpc/85xx: p2020: Enable boards by new config option CONFIG_PPC_P2020 Date: Sat, 18 Feb 2023 12:14:04 +0100 Message-Id: <20230218111405.27688-8-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generic unified P2020 machine description which supports all P2020-based boards is now in separate file p2020.c. So create a separate config option CONFIG_PPC_P2020 for it. Previously machine descriptions for P2020 boards were enabled by CONFIG_MPC85xx_DS or CONFIG_MPC85xx_RDB option. So set CONFIG_PPC_P2020 to be enabled by default when one of those option is enabled. This allows to compile support for P2020 boards without need to have enabled support for older mpc85xx boards. And to compile kernel for old mpc85xx boards without having enabled support for new P2020 boards. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/platforms/85xx/Kconfig | 22 ++++++++++++++++++---- arch/powerpc/platforms/85xx/Makefile | 3 +-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/8= 5xx/Kconfig index b92cb2b4d54d..90665882143b 100644 --- a/arch/powerpc/platforms/85xx/Kconfig +++ b/arch/powerpc/platforms/85xx/Kconfig @@ -78,16 +78,16 @@ config MPC8536_DS This option enables support for the MPC8536 DS board =20 config MPC85xx_DS - bool "Freescale MPC8544 DS / MPC8572 DS / P2020 DS" + bool "Freescale MPC8544 DS / MPC8572 DS" select PPC_I8259 select DEFAULT_UIMAGE select FSL_ULI1575 if PCI select SWIOTLB help - This option enables support for the MPC8544 DS, MPC8572 DS and P2020 DS= boards + This option enables support for the MPC8544 DS and MPC8572 DS boards =20 config MPC85xx_RDB - bool "Freescale P102x MBG/UTM/RDB and P2020 RDB" + bool "Freescale P102x MBG/UTM/RDB" select PPC_I8259 select DEFAULT_UIMAGE select FSL_ULI1575 if PCI @@ -95,7 +95,21 @@ config MPC85xx_RDB help This option enables support for the P1020 MBG PC, P1020 UTM PC, P1020 RDB PC, P1020 RDB PD, P1020 RDB, P1021 RDB PC, P1024 RDB, - P1025 RDB, P2020 RDB and P2020 RDB PC boards + and P1025 RDB boards + +config PPC_P2020 + bool "Freescale P2020" + default y if MPC85xx_DS || MPC85xx_RDB + select DEFAULT_UIMAGE + select SWIOTLB + imply PPC_I8259 + imply FSL_ULI1575 if PCI + help + This option enables generic unified support for any board with the + Freescale P2020 processor. + + For example: P2020 DS board, P2020 RDB board, P2020 RDB PC board or + CZ.NIC Turris 1.x boards. =20 config P1010_RDB bool "Freescale P1010 RDB" diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/= 85xx/Makefile index 1ad261b4eeb6..76ee691d29b5 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile @@ -23,8 +23,7 @@ obj-$(CONFIG_P1010_RDB) +=3D p1010rdb.o obj-$(CONFIG_P1022_DS) +=3D p1022_ds.o obj-$(CONFIG_P1022_RDK) +=3D p1022_rdk.o obj-$(CONFIG_P1023_RDB) +=3D p1023_rdb.o -obj-$(CONFIG_MPC85xx_DS) +=3D p2020.o -obj-$(CONFIG_MPC85xx_RDB) +=3D p2020.o +obj-$(CONFIG_PPC_P2020) +=3D p2020.o obj-$(CONFIG_TWR_P102x) +=3D twr_p102x.o obj-$(CONFIG_CORENET_GENERIC) +=3D corenet_generic.o obj-$(CONFIG_FB_FSL_DIU) +=3D t1042rdb_diu.o --=20 2.20.1 From nobody Thu Sep 11 14:08:51 2025 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 C9B6BC64EC4 for ; Sat, 18 Feb 2023 11:27:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjBRL1G (ORCPT ); Sat, 18 Feb 2023 06:27:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbjBRL0z (ORCPT ); Sat, 18 Feb 2023 06:26:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD75C1714C for ; Sat, 18 Feb 2023 03:26:54 -0800 (PST) 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 597F160B75 for ; Sat, 18 Feb 2023 11:26:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E9DEC4339B; Sat, 18 Feb 2023 11:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676719613; bh=5jg2jqGPIyL6vN19Ng9QZ/xR8UUjQOy1EGr++zpbTmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CQRyzWHzrkxJ03GZ8egiJEl13aeI8SFTPT6ryxKMdrLNwGNPhVoVVIMcOIbfbv01y r8leIqNsTYTpUOBDlWOtZS/LRi93keSh5by0i6Qv0HJ1S9CjVEzfx6iVdQc/GraWJ8 nuoiygLirqQyEHVFTi+9wS+VXgM+CEwyjtg6LvPpN2C49iBDedHD9TIlI5PJC3Esm7 voAZLWaMayUVmN8ycPb5R365kHKXlEQda6tRToBJFZ1gqsZu7skM+qch3yO0ldz7tc nXsUWr3PD4GWGXLA0/CQYa/P9ZVJTNZKfavNw4lhVwUcuMSjNQeyj+l5qqRKFrfrjN SUrEt/fnERu3Q== Received: by pali.im (Postfix) id E93DA2761; Sat, 18 Feb 2023 12:26:49 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Scott Wood , Sinan Akman , Martin Kennedy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 8/8] powerpc: dts: turris1x.dts: Remove "fsl,P2020RDB-PC" compatible string Date: Sat, 18 Feb 2023 12:14:05 +0100 Message-Id: <20230218111405.27688-9-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230218111405.27688-1-pali@kernel.org> References: <20230218111405.27688-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "fsl,P2020RDB-PC" compatible string was present in Turris 1.x DTS file just because Linux kernel required it for proper detection of P2020 processor during boot. This was quite a hack as CZ.NIC Turris 1.x is not compatible with Freescale P2020-RDB-PC board. Now when kernel has generic unified support for boards with P2020 processors, there is no need to have this "hack" in turris1x.dts file. So remove incorrect "fsl,P2020RDB-PC" compatible string from turris1x.dts. Signed-off-by: Pali Roh=C3=A1r --- arch/powerpc/boot/dts/turris1x.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/boot/dts/turris1x.dts b/arch/powerpc/boot/dts/tur= ris1x.dts index e9cda34a140e..a95857de6858 100644 --- a/arch/powerpc/boot/dts/turris1x.dts +++ b/arch/powerpc/boot/dts/turris1x.dts @@ -15,7 +15,7 @@ =20 / { model =3D "Turris 1.x"; - compatible =3D "cznic,turris1x", "fsl,P2020RDB-PC"; /* fsl,P2020RDB-PC is= required for booting Linux */ + compatible =3D "cznic,turris1x"; =20 aliases { ethernet0 =3D &enet0; --=20 2.20.1