11.10Srin/* $NetBSD: obs266_autoconf.c,v 1.10 2021/03/30 04:11:29 rin Exp $ */ 21.1Sshige 31.1Sshige/* 41.1Sshige * Copyright 2004 Shigeyuki Fukushima. 51.1Sshige * All rights reserved. 61.1Sshige * 71.1Sshige * Written by Shigeyuki Fukushima for The NetBSD Project. 81.1Sshige * 91.1Sshige * Redistribution and use in source and binary forms, with or without 101.1Sshige * modification, are permitted provided that the following conditions 111.1Sshige * are met: 121.1Sshige * 1. Redistributions of source code must retain the above copyright 131.1Sshige * notice, this list of conditions and the following disclaimer. 141.1Sshige * 2. Redistributions in binary form must reproduce the above 151.1Sshige * copyright notice, this list of conditions and the following 161.1Sshige * disclaimer in the documentation and/or other materials provided 171.1Sshige * with the distribution. 181.1Sshige * 3. The name of the author may not be used to endorse or promote 191.1Sshige * products derived from this software without specific prior 201.1Sshige * written permission. 211.1Sshige * 221.1Sshige * THIS SOFTWARE IS PROVIDED THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 231.1Sshige * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 241.1Sshige * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 251.1Sshige * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 261.1Sshige * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 271.1Sshige * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 281.1Sshige * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 291.1Sshige * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 301.1Sshige * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 311.1Sshige * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 321.1Sshige * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 331.1Sshige * DAMAGE. 341.1Sshige */ 351.1Sshige#include <sys/cdefs.h> 361.10Srin__KERNEL_RCSID(0, "$NetBSD: obs266_autoconf.c,v 1.10 2021/03/30 04:11:29 rin Exp $"); 371.1Sshige 381.10Srin#include <sys/param.h> 391.10Srin#include <sys/device.h> 401.1Sshige#include <sys/systm.h> 411.1Sshige 421.1Sshige#include <machine/obs266.h> 431.1Sshige 441.5Skiyohara#include <powerpc/ibm4xx/cpu.h> 451.5Skiyohara#include <powerpc/ibm4xx/dcr4xx.h> 461.5Skiyohara 471.3Sshige/* 481.3Sshige * Determine device configuration for a machine. 491.3Sshige */ 501.3Sshigevoid 511.3Sshigecpu_configure(void) 521.3Sshige{ 531.3Sshige 541.3Sshige intr_init(); 551.3Sshige calc_delayconst(); 561.3Sshige 571.3Sshige /* Make sure that timers run at CPU frequency */ 581.3Sshige mtdcr(DCR_CPC0_CR1, mfdcr(DCR_CPC0_CR1) & ~CPC0_CR1_CETE); 591.3Sshige 601.3Sshige if (config_rootfound("plb", NULL) == NULL) 611.3Sshige panic("configure: mainbus not configured"); 621.3Sshige 631.8Srin genppc_cpu_configure(); 641.3Sshige} 651.3Sshige 661.6Smattvoid 671.6Smattdevice_register(device_t dev, void *aux) 681.1Sshige{ 691.1Sshige 701.9Srin ibm4xx_device_register(dev, aux, OBS266_COM_FREQ); 711.1Sshige} 72