Back out last changes.

This commit is contained in:
nonaka 2001-06-19 11:56:27 +00:00
parent b9c1984c7e
commit 595d6a40b4
10 changed files with 71 additions and 175 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bootinfo.h,v 1.2 2001/06/17 15:57:12 nonaka Exp $ */
/* $NetBSD: bootinfo.h,v 1.3 2001/06/19 11:56:27 nonaka Exp $ */
/*
* Copyright (c) 1997
@ -43,7 +43,6 @@ struct btinfo_common {
#define BTINFO_RESIDUAL 0
#define BTINFO_CONSOLE 1
#define BTINFO_CLOCK 2
#define BTINFO_MODEL 3
struct btinfo_residual {
struct btinfo_common common;
@ -62,13 +61,8 @@ struct btinfo_clock {
int ticks_per_sec;
};
struct btinfo_model {
struct btinfo_common common;
int model;
};
#ifdef _KERNEL
void *lookup_bootinfo(int);
void *lookup_bootinfo __P((int));
#endif
#define BOOTINFO_MAXSIZE 0xd0

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.h,v 1.8 2001/06/17 15:57:12 nonaka Exp $ */
/* $NetBSD: intr.h,v 1.9 2001/06/19 11:56:27 nonaka Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -105,8 +105,6 @@ extern long intrcnt[];
extern struct intrhand *intrhand[];
extern int intrtype[];
extern paddr_t prep_intr_reg;
/*
* Reorder protection in the following inline functions is
* achived with the "eieio" instruction which the assembler

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci_machdep.c,v 1.11 2001/06/17 15:57:13 nonaka Exp $ */
/* $NetBSD: pci_machdep.c,v 1.12 2001/06/19 11:56:27 nonaka Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -49,8 +49,8 @@
#define _POWERPC_BUS_DMA_PRIVATE
#include <machine/bus.h>
#include <machine/pio.h>
#include <machine/intr.h>
#include <machine/preptype.h>
#include <dev/isa/isavar.h>
#include <dev/pci/pcivar.h>
@ -224,22 +224,13 @@ pci_attach_hook(parent, self, pba)
/* Fixup intr */
#if 1
/* XXX: table? */
switch (prep_model) {
case IBM_6050:
case IBM_7248:
switch (device) {
case 12:
case 18:
case 22:
line = 15;
break;
default:
line = 0;
break;
}
/* XXX: ibm_machdep : ppc830 depend */
switch (device) {
case 12:
case 18:
case 22:
line = 15;
break;
default:
line = 0;
break;

View File

@ -1,30 +1,4 @@
/* $NetBSD: cpu.c,v 1.2 2001/06/17 15:57:13 nonaka Exp $ */
/*-
* Copyright (C) 2000, 2001 NONAKA Kimihiro. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* $NetBSD: cpu.c,v 1.3 2001/06/19 11:56:27 nonaka Exp $ */
#include <sys/param.h>
#include <sys/systm.h>
@ -33,10 +7,9 @@
#include <machine/autoconf.h>
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/preptype.h>
int cpumatch(struct device *, struct cfdata *, void *);
void cpuattach(struct device *, struct device *, void *);
int cpumatch __P((struct device *, struct cfdata *, void *));
void cpuattach __P((struct device *, struct device *, void *));
struct cfattach cpu_ca = {
sizeof(struct device), cpumatch, cpuattach
@ -67,11 +40,8 @@ cpuattach(parent, dev, aux)
printf("\n");
switch (prep_model) {
case IBM_6050:
case IBM_7248:
case IBM_6040:
{
{
/* XXX: ibm_machdep */
u_char l2ctrl, cpuinf;
/* system control register */
@ -96,10 +66,5 @@ cpuattach(parent, dev, aux)
printf("not present");
printf("\n");
}
break;
default:
break;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: extintr.c,v 1.7 2001/06/17 15:57:14 nonaka Exp $ */
/* $NetBSD: extintr.c,v 1.8 2001/06/19 11:56:28 nonaka Exp $ */
/* $OpenBSD: isabus.c,v 1.12 1999/06/15 02:40:05 rahnds Exp $ */
/*-
@ -95,14 +95,13 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <uvm/uvm_extern.h>
#include <machine/intr.h>
#include <machine/preptype.h>
#include <machine/psl.h>
#include <dev/isa/isavar.h>
void intr_calculatemasks(void);
int fakeintr(void *);
void ext_intr(void);
void intr_calculatemasks __P((void));
int fakeintr __P((void *));
void ext_intr __P((void));
extern paddr_t prep_intr_reg;
extern int cold;
@ -141,14 +140,7 @@ ext_intr()
/* what about enabling external interrupt in here? */
pcpl = splhigh(); /* Turn off all */
switch (prep_model) {
case IBM_6050:
irq = *(u_char *)(prep_intr_reg + INTR_VECTOR_REG);
break;
default:
irq = isa_intr();
break;
}
irq = isa_intr();
intrcnt2[irq]++;
r_imen = 1 << irq;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.20 2001/06/17 15:57:14 nonaka Exp $ */
/* $NetBSD: machdep.c,v 1.21 2001/06/19 11:56:28 nonaka Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -64,7 +64,6 @@
#include <machine/intr.h>
#include <machine/pmap.h>
#include <machine/powerpc.h>
#include <machine/preptype.h>
#include <machine/residual.h>
#include <machine/trap.h>
@ -138,7 +137,6 @@ extern struct user *proc0paddr;
struct bat battable[16];
paddr_t prep_intr_reg; /* PReP interrupt vector register */
int prep_model;
#define OFMEMREGIONS 32
struct mem_region physmemr[OFMEMREGIONS], availmemr[OFMEMREGIONS];
@ -230,20 +228,6 @@ initppc(startkernel, endkernel, args, btinfo)
ns_per_tick = 1000000000 / ticks_per_sec;
}
/*
* Set PReP type.
*/
{
struct btinfo_model *modelinfo;
modelinfo =
(struct btinfo_model *)lookup_bootinfo(BTINFO_MODEL);
if (modelinfo == NULL)
prep_model = PREP_UNKNOWN;
else
prep_model = modelinfo->model;
}
proc0.p_addr = proc0paddr;
bzero(proc0.p_addr, sizeof *proc0.p_addr);
@ -791,29 +775,21 @@ halt_sys:
printf("rebooting...\n\n");
switch (prep_model) {
case IBM_6050:
case IBM_7248:
case IBM_6040:
{
int msr;
u_char reg;
{
/* XXX: ibm_machdep */
int msr;
u_char reg;
asm volatile("mfmsr %0" : "=r"(msr));
msr |= PSL_IP;
asm volatile("mtmsr %0" :: "r"(msr));
asm volatile("mfmsr %0" : "=r"(msr));
msr |= PSL_IP;
asm volatile("mtmsr %0" :: "r"(msr));
reg = *(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92);
reg &= ~1UL;
*(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92) = reg;
reg = *(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92);
reg |= 1;
*(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92) = reg;
}
break;
default:
break;
reg = *(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92);
reg &= ~1UL;
*(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92) = reg;
reg = *(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92);
reg |= 1;
*(volatile u_char *)(PREP_BUS_SPACE_IO + 0x92) = reg;
}
while(1);

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 2001/06/17 15:57:13 nonaka Exp $
# $NetBSD: Makefile,v 1.5 2001/06/19 11:56:28 nonaka Exp $
COMMON= ${.CURDIR}/../common
.ifnmake(print-objdir)
@ -16,7 +16,7 @@ NEWVERSWHAT= "BOOT"
SRCS= srt0.s
SRCS+= boot.c clock.c com.c conf.c cons.c devopen.c fd.c
SRCS+= filesystem.c ident.c inkernel.c io.c tgets.c prf.c monitor.c
SRCS+= filesystem.c inkernel.c io.c tgets.c prf.c monitor.c
SRCS+= kbd.c ns16550.c vers.c vreset.c vga.c video.c
AFLAGS= -x assembler-with-cpp -traditional-cpp

View File

@ -1,4 +1,4 @@
/* $NetBSD: boot.c,v 1.4 2001/06/17 15:57:13 nonaka Exp $ */
/* $NetBSD: boot.c,v 1.5 2001/06/19 11:56:28 nonaka Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -33,10 +33,8 @@
#include <lib/libsa/stand.h>
#include <lib/libsa/loadfile.h>
#include <sys/reboot.h>
#include <sys/boot_flag.h>
#include <machine/bootinfo.h>
#include <machine/cpu.h>
#include <machine/residual.h>
@ -61,7 +59,6 @@ char bootinfo[BOOTINFO_MAXSIZE];
struct btinfo_residual btinfo_residual;
struct btinfo_console btinfo_console;
struct btinfo_clock btinfo_clock;
struct btinfo_model btinfo_model;
RESIDUAL residual;
u_long ladr;
@ -69,8 +66,8 @@ u_long ladr;
extern u_long ns_per_tick;
extern char bootprog_name[], bootprog_rev[], bootprog_maker[], bootprog_date[];
void boot(void *, u_long);
static void exec_kernel(char *);
void boot __P((void *, u_long));
static void exec_kernel __P((char *));
void
boot(resp, loadaddr)
@ -113,26 +110,17 @@ boot(resp, loadaddr)
/*
* clock
*/
btinfo_clock.common.next = sizeof(btinfo_clock);
btinfo_clock.common.next = 0;
btinfo_clock.common.type = BTINFO_CLOCK;
btinfo_clock.ticks_per_sec = resp ?
residual.VitalProductData.ProcessorBusHz / 4 : TICKS_PER_SEC;
/*
* prep vendor & product info
*/
btinfo_model.common.next = 0;
btinfo_model.common.type = BTINFO_MODEL;
btinfo_model.model = prep_identify(resp);
p = bootinfo;
memcpy(p, (void *)&btinfo_residual, sizeof(btinfo_residual));
p += sizeof(btinfo_residual);
memcpy(p, (void *)&btinfo_console, sizeof(btinfo_console));
p += sizeof(btinfo_console);
memcpy(p, (void *)&btinfo_clock, sizeof(btinfo_clock));
p += sizeof(btinfo_model);
memcpy(p, (void *)&btinfo_model, sizeof(btinfo_model));
/*
* attached kernel check

View File

@ -1,6 +1,4 @@
/* $NetBSD: boot.h,v 1.2 2001/06/17 15:57:13 nonaka Exp $ */
#define NELEMS(array) (sizeof(array)/sizeof(array[0]))
/* $NetBSD: boot.h,v 1.3 2001/06/19 11:56:28 nonaka Exp $ */
#define TICKS_PER_SEC (33000000 / 4) /* 33MHz */
#define NS_PER_TICK (1000000000 / TICKS_PER_SEC)
@ -8,84 +6,79 @@
/*
* srt0
*/
void run(void *, void *, void *, void *, void *);
void run __P((void *, void *, void *, void *, void *));
/*
* clock
*/
void delay(u_int);
void delay __P((u_int));
/*
* com
*/
int comspeed(long);
int comspeed __P((long));
/*
* console
*/
char *cninit(int *, int *);
int cngetc(void);
void cnputc(int);
int cnscan(void);
char *cninit __P((int *, int *));
int cngetc __P((void));
void cnputc __P((int));
int cnscan __P((void));
/*
* fd
*/
int fdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
int fdopen(struct open_file *, int, int, int);
int fdclose(struct open_file *);
/*
* ident
*/
int prep_identify(void *);
int fdstrategy __P((void *, int, daddr_t, size_t, void *, size_t *));
int fdopen __P((struct open_file *, int, int, int));
int fdclose __P((struct open_file *));
/*
* inkernel
*/
void init_in(void);
int instrategy(void *, int , daddr_t, size_t, void *, size_t *);
int inopen(struct open_file *);
int inclose(struct open_file *);
void init_in __P((void));
int instrategy __P((void *, int , daddr_t, size_t, void *, size_t *));
int inopen __P((struct open_file *));
int inclose __P((struct open_file *));
/*
* io
*/
void outb(int, char);
u_char inb(int);
u_long local_to_PCI(u_long);
void outb __P((int, char));
u_char inb __P((int));
u_long local_to_PCI __P((u_long));
/*
* kbd
*/
int kbd(int);
void kbdreset(void);
int kbd_getc(void);
int kbd __P((int));
void kbdreset __P((void));
int kbd_getc __P((void));
/*
* monitor
*/
int db_monitor(void);
int db_monitor __P((void));
/*
* tgets
*/
int tgets(char *);
int tgets __P((char *));
/*
* video
*/
void video_init(u_char *);
void video_putc(int);
void video_init __P((u_char *));
void video_putc __P((int));
/*
* vga
*/
void vga_init(u_char *);
void vga_putc(int);
void vga_puts(char *);
void vga_init __P((u_char *));
void vga_putc __P((int));
void vga_puts __P((char *));
/*
* vreset
*/
void vga_reset(u_char *);
void vga_reset __P((u_char *));

View File

@ -1,4 +1,4 @@
$NetBSD: version,v 1.4 2001/06/17 15:59:57 nonaka Exp $
$NetBSD: version,v 1.5 2001/06/19 11:56:28 nonaka Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
file is important - make sure the entries are appended on end, last item
@ -6,4 +6,3 @@ is taken as the current.
1.1: Boot program for IBM Power Serise 830; initial revision
1.2: Support verbose/quiet boot.
1.3: Identify PReP model.