Module Name: src Committed By: thorpej Date: Sat Feb 27 01:16:52 UTC 2021
Modified Files: src/sys/arch/powerpc/include/oea: sr_601.h src/sys/arch/powerpc/oea: oea_machdep.c Log Message: Rather than putting it on the caller, just let oea_iobat_add() decide whether to call mpc601_ioseg_add(). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/oea/sr_601.h cvs rdiff -u -r1.81 -r1.82 src/sys/arch/powerpc/oea/oea_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/include/oea/sr_601.h diff -u src/sys/arch/powerpc/include/oea/sr_601.h:1.5 src/sys/arch/powerpc/include/oea/sr_601.h:1.6 --- src/sys/arch/powerpc/include/oea/sr_601.h:1.5 Mon Apr 28 20:23:32 2008 +++ src/sys/arch/powerpc/include/oea/sr_601.h Sat Feb 27 01:16:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sr_601.h,v 1.5 2008/04/28 20:23:32 martin Exp $ */ +/* $NetBSD: sr_601.h,v 1.6 2021/02/27 01:16:52 thorpej Exp $ */ /*- * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc. @@ -64,8 +64,4 @@ #define SR601_PA_MATCH_P(sr, pa) \ (((sr) & SR601_PACKET1) == ((pa) >> ADDR_SR_SHFT)) -#ifdef _KERNEL -void mpc601_ioseg_add(paddr_t, register_t); -#endif - #endif /* !_POWERPC_OEA_SR_601_H_ */ Index: src/sys/arch/powerpc/oea/oea_machdep.c diff -u src/sys/arch/powerpc/oea/oea_machdep.c:1.81 src/sys/arch/powerpc/oea/oea_machdep.c:1.82 --- src/sys/arch/powerpc/oea/oea_machdep.c:1.81 Mon Jul 6 10:34:23 2020 +++ src/sys/arch/powerpc/oea/oea_machdep.c Sat Feb 27 01:16:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: oea_machdep.c,v 1.81 2020/07/06 10:34:23 rin Exp $ */ +/* $NetBSD: oea_machdep.c,v 1.82 2021/02/27 01:16:52 thorpej Exp $ */ /* * Copyright (C) 2002 Matt Thomas @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.81 2020/07/06 10:34:23 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.82 2021/02/27 01:16:52 thorpej Exp $"); #ifdef _KERNEL_OPT #include "opt_altivec.h" @@ -480,7 +480,7 @@ oea_init(void (*handler)(void)) } #ifdef PPC_OEA601 -void +static void mpc601_ioseg_add(paddr_t pa, register_t len) { const u_int i = pa >> ADDR_SR_SHFT; @@ -531,6 +531,14 @@ oea_iobat_add(paddr_t pa, register_t len KASSERT(len >= BAT_BL_8M); +#ifdef PPC_OEA601 + if (mfpvr() >> 16 == MPC601) { + /* Use I/O segments on the BAT-starved 601. */ + mpc601_ioseg_add(pa, len); + return; + } +#endif /* PPC_OEA601 */ + /* * If the caller wanted a bigger BAT than the hardware supports, * split it into smaller BATs. @@ -778,29 +786,15 @@ oea_batinit(paddr_t pa, ...) * registers were cleared above. */ - va_start(ap, pa); - /* * Add any I/O BATs specificed; - * use I/O segments on the BAT-starved 601. */ -#ifdef PPC_OEA601 - if (cpuvers == MPC601) { - while (pa != 0) { - register_t len = va_arg(ap, register_t); - mpc601_ioseg_add(pa, len); - pa = va_arg(ap, paddr_t); - } - } else -#endif - { - while (pa != 0) { - register_t len = va_arg(ap, register_t); - oea_iobat_add(pa, len); - pa = va_arg(ap, paddr_t); - } + va_start(ap, pa); + while (pa != 0) { + register_t len = va_arg(ap, register_t); + oea_iobat_add(pa, len); + pa = va_arg(ap, paddr_t); } - va_end(ap); /*