Module Name: src Committed By: rin Date: Mon Mar 29 13:40:21 UTC 2021
Modified Files: src/sys/arch/powerpc/ibm4xx: ibm4xx_autoconf.c src/sys/arch/powerpc/include/ibm4xx: cpu.h Log Message: Set com(4) frequency in ibm4xx_device_register() in order to dedup codes. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/powerpc/ibm4xx/ibm4xx_autoconf.c cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/include/ibm4xx/cpu.h 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/ibm4xx/ibm4xx_autoconf.c diff -u src/sys/arch/powerpc/ibm4xx/ibm4xx_autoconf.c:1.16 src/sys/arch/powerpc/ibm4xx/ibm4xx_autoconf.c:1.17 --- src/sys/arch/powerpc/ibm4xx/ibm4xx_autoconf.c:1.16 Mon Mar 29 13:17:53 2021 +++ src/sys/arch/powerpc/ibm4xx/ibm4xx_autoconf.c Mon Mar 29 13:40:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ibm4xx_autoconf.c,v 1.16 2021/03/29 13:17:53 rin Exp $ */ +/* $NetBSD: ibm4xx_autoconf.c,v 1.17 2021/03/29 13:40:21 rin Exp $ */ /* Original Tag: ibm4xxgpx_autoconf.c,v 1.2 2004/10/23 17:12:22 thorpej Exp $ */ /* @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibm4xx_autoconf.c,v 1.16 2021/03/29 13:17:53 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibm4xx_autoconf.c,v 1.17 2021/03/29 13:40:21 rin Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -45,6 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: ibm4xx_autoc #include <net/if_ether.h> #include <powerpc/ibm4xx/cpu.h> +#include <powerpc/ibm4xx/dev/comopbvar.h> #include <powerpc/ibm4xx/dev/opbvar.h> void @@ -55,10 +56,16 @@ cpu_rootconf(void) } void -ibm4xx_device_register(device_t dev, void *aux) +ibm4xx_device_register(device_t dev, void *aux, int com_freq) { device_t parent = device_parent(dev); + if (device_is_a(dev, "com") && device_is_a(parent, "opb")) { + /* Set the frequency of the on-chip UART. */ + com_opb_device_register(dev, com_freq); + return; + } + if (device_is_a(dev, "emac") && device_is_a(parent, "opb")) { /* Set the mac-address of the on-chip Ethernet. */ struct opb_attach_args *oaa = aux; Index: src/sys/arch/powerpc/include/ibm4xx/cpu.h diff -u src/sys/arch/powerpc/include/ibm4xx/cpu.h:1.22 src/sys/arch/powerpc/include/ibm4xx/cpu.h:1.23 --- src/sys/arch/powerpc/include/ibm4xx/cpu.h:1.22 Thu Apr 19 21:50:07 2018 +++ src/sys/arch/powerpc/include/ibm4xx/cpu.h Mon Mar 29 13:40:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.22 2018/04/19 21:50:07 christos Exp $ */ +/* $NetBSD: cpu.h,v 1.23 2021/03/29 13:40:21 rin Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ extern void ibm4xx_dumpsys(void); extern void ibm4xx_install_extint(void (*)(void)); /* export from ibm4xx/ibm4xx_autoconf.c */ -extern void ibm4xx_device_register(device_t dev, void *aux); +extern void ibm4xx_device_register(device_t, void *, int); /* export from ibm4xx/clock.c */ extern void calc_delayconst(void);