obs266_autoconf.c revision 1.9
11.9Srin/* $NetBSD: obs266_autoconf.c,v 1.9 2021/03/29 13:38:31 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.9Srin__KERNEL_RCSID(0, "$NetBSD: obs266_autoconf.c,v 1.9 2021/03/29 13:38:31 rin Exp $"); 371.1Sshige 381.1Sshige#include <sys/systm.h> 391.1Sshige#include <sys/device.h> 401.6Smatt#include <sys/cpu.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.5Skiyohara#include <dev/ic/comreg.h> 481.3Sshige 491.3Sshige/* 501.3Sshige * Determine device configuration for a machine. 511.3Sshige */ 521.3Sshigevoid 531.3Sshigecpu_configure(void) 541.3Sshige{ 551.3Sshige 561.3Sshige intr_init(); 571.3Sshige calc_delayconst(); 581.3Sshige 591.3Sshige /* Make sure that timers run at CPU frequency */ 601.3Sshige mtdcr(DCR_CPC0_CR1, mfdcr(DCR_CPC0_CR1) & ~CPC0_CR1_CETE); 611.3Sshige 621.3Sshige if (config_rootfound("plb", NULL) == NULL) 631.3Sshige panic("configure: mainbus not configured"); 641.3Sshige 651.8Srin genppc_cpu_configure(); 661.3Sshige} 671.3Sshige 681.6Smattvoid 691.6Smattdevice_register(device_t dev, void *aux) 701.1Sshige{ 711.1Sshige 721.9Srin ibm4xx_device_register(dev, aux, OBS266_COM_FREQ); 731.1Sshige} 74