From nobody Wed Apr 8 12:11:01 2026 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 892B1C32771 for ; Fri, 19 Aug 2022 19:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351182AbiHSTRE (ORCPT ); Fri, 19 Aug 2022 15:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349775AbiHSTRC (ORCPT ); Fri, 19 Aug 2022 15:17:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFC0F112328 for ; Fri, 19 Aug 2022 12:17:01 -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 6E867614FA for ; Fri, 19 Aug 2022 19:17:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB497C433C1; Fri, 19 Aug 2022 19:17:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660936620; bh=UD5jorQCVmKiXH0v3VkIP3iO7pPTI+aaxJhMgfUmopA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m9CcfJrr7DxVuuS2Gm2gZKvuwOvb+Vz+Rdqox19HpJlD9HehiRHIKfbSsmysWdFki QMfhZwXQ6C23lVf64npGGtYo7lYWW47CemDU+OqUWI+4kuuXHPuHXC0QIfxEZqQX0d 2DMe3lsL/uFuvHi/k38ThCvd5mHnGbXKMyRtrDCSYfeWWA/IsBk1h2vTo+fTi08a9w YORwgDQWyF5nHWba19ZdaHlYoIqo9e2dPdXDOEYLsevW1VGtSie91GKpvo+2dzj/V9 9HPFEFeRvhirUxhMPmeyFh+9yNwCbBbYgjBhBLxyEhL8cdLlX0G3NT/GHazrSrWdGc aX2ZmQfbdybdA== Received: by pali.im (Postfix) id DCB032821; Fri, 19 Aug 2022 21:16:57 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Christophe Leroy , Sinan Akman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] powerpc/85xx: Mark mpc85xx_rdb_pic_init() as static Date: Fri, 19 Aug 2022 21:15:51 +0200 Message-Id: <20220819191557.28116-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220819191557.28116-1-pali@kernel.org> References: <20220819191557.28116-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 Wed Apr 8 12:11:01 2026 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 AD5FDC32771 for ; Fri, 19 Aug 2022 19:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350824AbiHSTRc (ORCPT ); Fri, 19 Aug 2022 15:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349506AbiHSTRH (ORCPT ); Fri, 19 Aug 2022 15:17:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76BEC112330 for ; Fri, 19 Aug 2022 12:17:04 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2BD42B82886 for ; Fri, 19 Aug 2022 19:17:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8006C433B5; Fri, 19 Aug 2022 19:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660936622; bh=RoXrwfU/s5vurCwlxvo8Vd+Lw1JXCW4diLyk4VZ6JDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g/yIDSq5tz/8o9kUNSGR2WjXk99zL+giUdFlfKqysPvpQHpMEpSV4s+340Igg9BCU Pyn24U/6pa4/MiLG4JKW5a0SVYG+x10i+8RBJLh27uC5b9BNjYC/VOrTjItYfycV5I sQS+TZbnbNe8WB2OQBesyRZjgho1h3+ZzVa6QBu+qHLqYP+MA6Yhq3aPgdxNADh8HV 3GijZPFm7+cDyjbdBSzbJ4QNll2FugdmTyiS22WvplaPh4nZlj5p1o7neZl/6XAilY QKtIETbODj6FHDXQolqp8v/R0qX6aGiRJMr78uDjn9l11cHqu7bLQUxqxcGR3wncI6 yO2X6nIqOhlag== Received: by pali.im (Postfix) id C66E82980; Fri, 19 Aug 2022 21:16:58 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Christophe Leroy , Sinan Akman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] powerpc/85xx: Mark mpc85xx_ds_pic_init() as static Date: Fri, 19 Aug 2022 21:15:52 +0200 Message-Id: <20220819191557.28116-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220819191557.28116-1-pali@kernel.org> References: <20220819191557.28116-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 Wed Apr 8 12:11:01 2026 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 CF4EBC32773 for ; Fri, 19 Aug 2022 19:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350176AbiHSTRk (ORCPT ); Fri, 19 Aug 2022 15:17:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351194AbiHSTRI (ORCPT ); Fri, 19 Aug 2022 15:17:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 073FB112F80 for ; Fri, 19 Aug 2022 12:17:05 -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 ams.source.kernel.org (Postfix) with ESMTPS id B8822B828EA for ; Fri, 19 Aug 2022 19:17:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20B43C43470; Fri, 19 Aug 2022 19:17:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660936622; bh=9wskmcd1b6KSsj/RP4PdY7DWTXMfH6bmhRk8PXBPbkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RHEdo9/TrzA+8517sYoFVRclKoNBlPIHb2wNDXJwVMNjM8n18RcUlakoAYTd3ygye lF0vK4T2lgqclgZ4yyp0aWIIgu7yICQJV2ews6ldB0yJ/9jharryaEYxg31dP0KZ4g HyIiwcwI5IahKPCdPO8+JSjV0VC8LLj18oEoCVp4qgMlY13mGyepVb2KA2COxrExfb khVVidZfLxEW6vDmS20slplY3XIQsrNxNVouFQxwEuZ5Nn0ImQClcte5RyCRU8lgQB +yvHUhIF7MiFIF8GqhpqKG8MUmDRBO/AqZ6+LESi+Ncy7F7UBinYfFqNtBgdgRE6uY 8CeOBLF3oeMqw== Received: by pali.im (Postfix) id BF1CD2ADB; Fri, 19 Aug 2022 21:16:59 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Christophe Leroy , Sinan Akman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] powerpc/85xx: p2020: Move all P2020 machine descriptions to p2020.c Date: Fri, 19 Aug 2022 21:15:53 +0200 Message-Id: <20220819191557.28116-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220819191557.28116-1-pali@kernel.org> References: <20220819191557.28116-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 is preparation for code deduplication and providing one unified machine description for all 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 Wed Apr 8 12:11:01 2026 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 61DA5C32771 for ; Fri, 19 Aug 2022 19:17:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349713AbiHSTRg (ORCPT ); Fri, 19 Aug 2022 15:17:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351193AbiHSTRH (ORCPT ); Fri, 19 Aug 2022 15:17:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FBED11232A for ; Fri, 19 Aug 2022 12:17:04 -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 ams.source.kernel.org (Postfix) with ESMTPS id A162DB827CC for ; Fri, 19 Aug 2022 19:17:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16399C433D7; Fri, 19 Aug 2022 19:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660936621; bh=evTFJOZkg0tavzSABFrNQzTpKadK2avGSqbk5clFvMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XFiU8hLOFxouRha9xeLdMQ7zYGJvI+gF0WnuJNyMxaytSkue2twOU1SXiL3EmDdoe 8OdoJDVhhAZYjn2U6o86fw4W0JxGaci1SimmT7tbsmdeMgVOjszK9HIMGpqqwkMW65 8+uirZAFFN05ROHssQjGF09udyth4mqafBUrR/ZK5iav4jTgKwNiKPReSCoyia9tlY /15EX2RhXPYxMSI7ZRFPc2eUY0l/n+YUFFzKlOzZl6uyxbX07Bg+Mu/JaE75zXRQkb kpvGyeYpJOp//Wyq5vsla/qFzCAIJMkbw3s/7VCF9n6CgbphmAewC0Ln+We3neQPJE X1jJ1U4stYgLg== Received: by pali.im (Postfix) id C2489761; Fri, 19 Aug 2022 21:17:00 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Christophe Leroy , Sinan Akman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] powerpc/85xx: p2020: Unify .setup_arch and .init_IRQ callbacks Date: Fri, 19 Aug 2022 21:15:54 +0200 Message-Id: <20220819191557.28116-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220819191557.28116-1-pali@kernel.org> References: <20220819191557.28116-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 | 97 +++++++++-------------------- 1 file changed, 30 insertions(+), 67 deletions(-) diff --git a/arch/powerpc/platforms/85xx/p2020.c b/arch/powerpc/platforms/8= 5xx/p2020.c index d65d4c88ac47..d327e6c9b838 100644 --- a/arch/powerpc/platforms/85xx/p2020.c +++ b/arch/powerpc/platforms/85xx/p2020.c @@ -42,9 +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) { struct irq_chip *chip =3D irq_desc_get_chip(desc); @@ -55,37 +54,21 @@ 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 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 - - 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); - -#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; break; } =20 - if (cascade_node =3D=3D NULL) { - printk(KERN_DEBUG "Could not find i8259 PIC\n"); + if (cascade_node =3D=3D NULL) return; - } =20 cascade_irq =3D irq_of_parse_and_map(cascade_node, 0); if (!cascade_irq) { @@ -93,12 +76,30 @@ 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 p2020_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); + +#ifdef CONFIG_PPC_I8259 + mpc85xx_8259_init(); #endif /* CONFIG_PPC_I8259 */ } =20 @@ -138,58 +139,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 +193,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 +209,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 +223,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 Wed Apr 8 12:11:01 2026 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 F29F1C32771 for ; Fri, 19 Aug 2022 19:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351293AbiHSTRo (ORCPT ); Fri, 19 Aug 2022 15:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349775AbiHSTRJ (ORCPT ); Fri, 19 Aug 2022 15:17:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3367C112332 for ; Fri, 19 Aug 2022 12:17:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id DD3BEB828EF for ; Fri, 19 Aug 2022 19:17:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4046AC433D6; Fri, 19 Aug 2022 19:17:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660936622; bh=xh2RwUx+IOfvx0O23D32LtyCfn37Im7W6U99oWOdZfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gTNiSBZeRFYczCUQtpOW5j7eoDA7pIH7AyCg4Swt2iy6DLCJFIeXWaV1unG1jbFGp IebK8FdZiOUFI7TXq9ILPQi7/PFEFV1tZdX547zVVGhjfdD4GhXYS6aMDfj0qqxWBa R5lXX8GtM9mZ6O24J5COyMK0JDKcVQDQDrMQnldd0aIw+X/6cz3mZslnzhMW5Qy738 BD1sEOHk5BoTdjdGPPoGmNTFHcuUZm3Pm2VpZANL/Z9YFplwDgrmtvDwG+EcYx7n7V V9AMSQvgyaH7bzlS0brjpdspNNlCXmwFeHl4RT1j/S9XeOuyKxBqEzSN5DnBQGKzu/ p/0M3DvZAm/iA== Received: by pali.im (Postfix) id E723D761; Fri, 19 Aug 2022 21:17:01 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Christophe Leroy , Sinan Akman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] powerpc/85xx: p2020: Define just one machine description Date: Fri, 19 Aug 2022 21:15:55 +0200 Message-Id: <20220819191557.28116-6-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220819191557.28116-1-pali@kernel.org> References: <20220819191557.28116-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 | 83 +++++++---------------------- 1 file changed, 19 insertions(+), 64 deletions(-) diff --git a/arch/powerpc/platforms/85xx/p2020.c b/arch/powerpc/platforms/8= 5xx/p2020.c index d327e6c9b838..1a3ffeb47dfc 100644 --- a/arch/powerpc/platforms/85xx/p2020.c +++ b/arch/powerpc/platforms/85xx/p2020.c @@ -154,83 +154,38 @@ 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) -{ - 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) +static int __init p2020_probe(void) { - if (of_machine_is_compatible("fsl,P2020RDB-PC")) - return 1; - return 0; + struct device_node *p2020_cpu; + + /* + * 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"); + if (!p2020_cpu) + return 0; + + of_node_put(p2020_cpu); + return 1; } -#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 Wed Apr 8 12:11:01 2026 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 D2CBFC32771 for ; Fri, 19 Aug 2022 19:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350282AbiHSTRQ (ORCPT ); Fri, 19 Aug 2022 15:17:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349429AbiHSTRI (ORCPT ); Fri, 19 Aug 2022 15:17:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F8411233F for ; Fri, 19 Aug 2022 12:17:05 -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 ams.source.kernel.org (Postfix) with ESMTPS id ACE2AB82894 for ; Fri, 19 Aug 2022 19:17:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38254C433C1; Fri, 19 Aug 2022 19:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660936623; bh=FunJVKQSfy3ipKaxhp/fmwSG564pofyswuXNHKDIGX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gBqtss7lMKUrZnALSK7L1enBXFMdQzo+Ne+N2zmcqN5b68LDIZxPRVJ5xwoP8vowR 9dzWlCg89mxHbXdnxU+593VLBFP5eug5fc5imlCM1jSNIs25X/tugUSRFOupt6DTbe gu7n9Y9E8xKwxwbIfTxfrt26B1o53eMWhIZ3DihnUaCGzhmL0ik6FviGE4vQ4KIKAf ijsoc9oOJU28dRAunJgR/wsOeyxCXWlUoxYMXjZmonNQZE8OP+Pa6GeFqpQFenHFqH 7QpXEZoVEJMC8qjWuJzFiodSZuvwjpYFHZnvH+Cbrzz2VOwMifrfQ78vKwtv/YNBrl 7HW63a52i5jMw== Received: by pali.im (Postfix) id E4DB1761; Fri, 19 Aug 2022 21:17:02 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Christophe Leroy , Sinan Akman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] powerpc/85xx: p2020: Enable boards by new config option CONFIG_P2020 Date: Fri, 19 Aug 2022 21:15:56 +0200 Message-Id: <20220819191557.28116-7-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220819191557.28116-1-pali@kernel.org> References: <20220819191557.28116-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_P2020 for it. Previously machine descriptions for P2020 boards were enabled by CONFIG_MPC85xx_DS or CONFIG_MPC85xx_RDB option. So set CONFIG_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 be16eba0f704..2cb4e9248b42 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 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..021e168442d7 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_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 Wed Apr 8 12:11:01 2026 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 BFC81C32772 for ; Fri, 19 Aug 2022 19:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351271AbiHSTRW (ORCPT ); Fri, 19 Aug 2022 15:17:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351197AbiHSTRI (ORCPT ); Fri, 19 Aug 2022 15:17:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 823E911232E for ; Fri, 19 Aug 2022 12:17:05 -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 F0C2A614FA for ; Fri, 19 Aug 2022 19:17:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B44CC433C1; Fri, 19 Aug 2022 19:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660936624; bh=rKQ3+23rwRCyvKdPvoD48Z1ZJB9nDvd07zcLWzoAHuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cNcbtq+NDhxyFCb2kO1Ybh5XNmCEeYoVpro0ouE5AC7RTdyYV884eYADONaMhw8os 4FrAj2bq0Dz2R0Ylik42OTiXE/U+fHNC3dnFRma/MsH/3WPQTBOzqnWEIxQw5aa3RC uulwhsXDIigNKpwdiJlebJI5yt5T4GV+u7v5JuLmjz4YJ4PK/UXvyMftAHMgChro6d efb8P2hCaJYX+NDV38gTP+mLooB7YJWGUTBxH1l6Frv5aUfJUGQxhuXTDmOh9pNdtg 6FYnJpzK7VELF7TOf0MfoaBNGBqdZUO95zFKjnSvaUX79U1prkU+ucypkJiv3B4Sgf DG0e26bSgT+Uw== Received: by pali.im (Postfix) id E8CA6761; Fri, 19 Aug 2022 21:17:03 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Christophe Leroy , Sinan Akman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] powerpc: dts: turris1x.dts: Remove "fsl,P2020RDB-PC" compatible string Date: Fri, 19 Aug 2022 21:15:57 +0200 Message-Id: <20220819191557.28116-8-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220819191557.28116-1-pali@kernel.org> References: <20220819191557.28116-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 12e08271e61f..69c38ed8a3a5 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