diff --git a/sys/arch/bebox/bebox/autoconf.c b/sys/arch/bebox/bebox/autoconf.c index 50e89f1a6763..52fcaec2c976 100644 --- a/sys/arch/bebox/bebox/autoconf.c +++ b/sys/arch/bebox/bebox/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.17 2007/12/05 12:31:25 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.18 2007/12/09 03:33:29 ober Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2007/12/05 12:31:25 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.18 2007/12/09 03:33:29 ober Exp $"); #include #include @@ -59,32 +59,20 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2007/12/05 12:31:25 tsutsui Exp $" #include #include -/* -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -*/ - void genppc_cpu_configure(void); static void findroot(void); /* * Determine i/o configuration for a machine. */ + void cpu_configure() { if (config_rootfound("mainbus", NULL) == NULL) panic("configure: mainbus not configured"); - + genppc_cpu_configure(); } @@ -114,23 +102,19 @@ findroot(void) char buf[32]; const char *name; -#if 0 - aprint_normal("howto %x bootdev %x ", boothowto, bootdev); -#endif - if ((bootdev & B_MAGICMASK) != (u_long)B_DEVMAGIC) return; - + name = devsw_blk2name((bootdev >> B_TYPESHIFT) & B_TYPEMASK); if (name == NULL) return; - + part = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK; unit = (bootdev >> B_UNITSHIFT) & B_UNITMASK; - + sprintf(buf, "%s%d", name, unit); for (dv = TAILQ_FIRST(&alldevs); dv != NULL; - dv = TAILQ_NEXT(dv, dv_list)) { + dv = TAILQ_NEXT(dv, dv_list)) { if (strcmp(buf, dv->dv_xname) == 0) { booted_device = dv; booted_partition = part; diff --git a/sys/arch/bebox/bebox/cpu.c b/sys/arch/bebox/bebox/cpu.c index 3b0e20b7e505..0997836cfd3b 100644 --- a/sys/arch/bebox/bebox/cpu.c +++ b/sys/arch/bebox/bebox/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.7 2007/10/17 19:53:57 garbled Exp $ */ +/* $NetBSD: cpu.c,v 1.8 2007/12/09 03:33:29 ober Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.7 2007/10/17 19:53:57 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.8 2007/12/09 03:33:29 ober Exp $"); #include #include @@ -51,20 +51,20 @@ int cpumatch(struct device *, struct cfdata *, void *); void cpuattach(struct device *, struct device *, void *); CFATTACH_DECL(cpu, sizeof(struct device), - cpumatch, cpuattach, NULL, NULL); + cpumatch, cpuattach, NULL, NULL); extern struct cfdriver cpu_cd; int cpumatch(struct device *parent, struct cfdata *cfdata, void *aux) { - struct confargs *ca = aux; + struct confargs *ca = aux; - if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) - return (0); - if (cpu_info[0].ci_dev != NULL) - return (0); - return (1); + if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) + return (0); + if (cpu_info[0].ci_dev != NULL) + return (0); + return (1); } void diff --git a/sys/arch/bebox/bebox/machdep.c b/sys/arch/bebox/bebox/machdep.c index 05c57271ddd7..7a7cb3fe1767 100644 --- a/sys/arch/bebox/bebox/machdep.c +++ b/sys/arch/bebox/bebox/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.90 2007/10/17 19:53:58 garbled Exp $ */ +/* $NetBSD: machdep.c,v 1.91 2007/12/09 03:33:29 ober Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.90 2007/10/17 19:53:58 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.91 2007/12/09 03:33:29 ober Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -130,7 +130,7 @@ initppc(u_long startkernel, u_long endkernel, void *btinfo) struct btinfo_memory *meminfo; meminfo = - (struct btinfo_memory *)lookup_bootinfo(BTINFO_MEMORY); + (struct btinfo_memory *)lookup_bootinfo(BTINFO_MEMORY); if (!meminfo) panic("not found memory information in bootinfo"); physmemr[0].start = 0; @@ -148,22 +148,14 @@ initppc(u_long startkernel, u_long endkernel, void *btinfo) extern u_long ticks_per_sec, ns_per_tick; clockinfo = - (struct btinfo_clock *)lookup_bootinfo(BTINFO_CLOCK); + (struct btinfo_clock *)lookup_bootinfo(BTINFO_CLOCK); if (!clockinfo) panic("not found clock information in bootinfo"); ticks_per_sec = clockinfo->ticks_per_sec; ns_per_tick = 1000000000 / ticks_per_sec; } - /* - * BeBox MotherBoard's Register - * Interrupt Mask Reset - */ -#if 0 - *(volatile u_int *)(MOTHER_BOARD_REG + CPU0_INT_MASK) = 0x0ffffffc; - *(volatile u_int *)(MOTHER_BOARD_REG + CPU0_INT_MASK) = 0x80000023; - *(volatile u_int *)(MOTHER_BOARD_REG + CPU1_INT_MASK) = 0x0ffffffc; -#endif + /* * boothowto */ @@ -181,30 +173,30 @@ cpu_startup() /* * BeBox Mother Board's Register Mapping */ - bebox_mb_reg = (vaddr_t) mapiodev(BEBOX_INTR_REG, PAGE_SIZE); - if (!bebox_mb_reg) - panic("cpu_startup: no room for interrupt register"); + bebox_mb_reg = (vaddr_t) mapiodev(BEBOX_INTR_REG, PAGE_SIZE); + if (!bebox_mb_reg) + panic("cpu_startup: no room for interrupt register"); - /* - * Do common VM initialization - */ - oea_startup(NULL); + /* + * Do common VM initialization + */ + oea_startup(NULL); - /* - * Now that we have VM, malloc's are OK in bus_space. - */ - bus_space_mallocok(); + /* + * Now that we have VM, malloc's are OK in bus_space. + */ + bus_space_mallocok(); - /* - * Now allow hardware interrupts. - */ - { - int msr; + /* + * Now allow hardware interrupts. + */ + { + int msr; - splhigh(); - __asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0" + splhigh(); + __asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0" : "=r"(msr) : "K"(PSL_EE)); - } + } } /* @@ -224,7 +216,7 @@ lookup_bootinfo(type) return (help); help = (struct btinfo_common *)((char*)help + bt->next); } while (bt->next && - (size_t)help < (size_t)bootinfo + sizeof (bootinfo)); + (size_t)help < (size_t)bootinfo + sizeof (bootinfo)); return (NULL); } @@ -247,25 +239,11 @@ consinit() if (!consinfo) panic("not found console information in bootinfo"); -#if 0 -#if (NPFB > 0) - if (!strcmp(consinfo->devname, "be")) { - pfb_cnattach(consinfo->addr); -#if (NPCKBC > 0) - pckbc_cnattach(&genppc_isa_io_space_tag, IO_KBD, KBCMDP, - PCKBC_KBD_SLOT); -#endif - - return; - } -#endif -#endif /* if 0 */ - #if (NPC > 0) || (NVGA > 0) if (!strcmp(consinfo->devname, "vga")) { #if (NVGA > 0) if (!vga_cnattach(&genppc_isa_io_space_tag, &genppc_isa_mem_space_tag, - -1, 1)) + -1, 1)) goto dokbd; #endif #if (NPC > 0) @@ -287,8 +265,8 @@ dokbd: bus_space_tag_t tag = &genppc_isa_io_space_tag; if(comcnattach(tag, consinfo->addr, consinfo->speed, - COM_FREQ, COM_TYPE_NORMAL, - ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8))) + COM_FREQ, COM_TYPE_NORMAL, + ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8))) panic("can't init serial console"); return; @@ -335,9 +313,7 @@ cpu_reboot(int howto, char *what) if (howto & RB_HALT) { doshutdownhooks(); printf("halted\n\n"); -#if 0 - ppc_exit(); -#endif + } if (!cold && (howto & RB_DUMP)) oea_dumpsys(); @@ -360,18 +336,5 @@ cpu_reboot(int howto, char *what) *ap++ = 0; if (ap[-2] == '-') *ap1 = 0; -#if 0 - ppc_boot(str); -#endif while (1); } - -#if 0 -void -mem_regions(struct mem_region **mem, struct mem_region **avail) -{ - - *mem = physmemr; - *avail = availmemr; -} -#endif diff --git a/sys/arch/bebox/bebox/mainbus.c b/sys/arch/bebox/bebox/mainbus.c index de78fa885058..4423239cbfdb 100644 --- a/sys/arch/bebox/bebox/mainbus.c +++ b/sys/arch/bebox/bebox/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.20 2007/10/17 19:53:58 garbled Exp $ */ +/* $NetBSD: mainbus.c,v 1.21 2007/12/09 03:33:29 ober Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.20 2007/10/17 19:53:58 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2007/12/09 03:33:29 ober Exp $"); #include #include @@ -60,7 +60,7 @@ int mainbus_print (void *, const char *); union mainbus_attach_args { const char *mba_busname; /* first elem of all */ struct pcibus_attach_args mba_pba; - /*struct pnpbus_attach_args mba_paa;*/ + /*struct pnpbus_attach_args mba_paa;*/ }; @@ -84,31 +84,31 @@ mainbus_match(struct device *parent, struct cfdata *match, void *aux) void mainbus_attach(struct device *parent, struct device *self, void *aux) { - union mainbus_attach_args mba; - struct confargs ca; + union mainbus_attach_args mba; + struct confargs ca; #if NPCI > 0 - struct genppc_pci_chipset_businfo *pbi; + struct genppc_pci_chipset_businfo *pbi; #ifdef PCI_NETBSD_CONFIGURE - struct extent *ioext, *memext; + struct extent *ioext, *memext; #endif #endif - mainbus_found = 1; + mainbus_found = 1; - aprint_normal("\n"); + aprint_normal("\n"); #if defined(RESIDUAL_DATA_DUMP) - print_residual_device_info(); + print_residual_device_info(); #endif /* * Always find the CPU */ - ca.ca_name = "cpu"; - ca.ca_node = 0; - config_found_ia(self, "mainbus", &ca, mainbus_print); + ca.ca_name = "cpu"; + ca.ca_node = 0; + config_found_ia(self, "mainbus", &ca, mainbus_print); /* * XXX Note also that the presence of a PCI bus should @@ -172,32 +172,9 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) #ifdef RESIDUAL_DATA_DUMP SIMPLEQ_FOREACH(pbi, &genppc_pct->pc_pbi, next) - printf("%s\n", prop_dictionary_externalize(pbi->pbi_properties)); + printf("%s\n", prop_dictionary_externalize(pbi->pbi_properties)); #endif - -#if 0 -#if NPCI > 0 -#if defined(PCI_NETBSD_CONFIGURE) - ioext = extent_create("pciio", 0x00008000, 0x0000ffff, M_DEVBUF, - NULL, 0, EX_NOWAIT); - memext = extent_create("pcimem", 0x00000000, 0x0fffffff, M_DEVBUF, - NULL, 0, EX_NOWAIT); - pci_configure_bus(0, ioext, memext, NULL, 0, 32); - extent_destroy(ioext); - extent_destroy(memext); -#endif - - mba.mba_pba.pba_iot = &genppc_isa_io_space_tag; - mba.mba_pba.pba_memt = &genppc_isa_mem_space_tag; - mba.mba_pba.pba_dmat = &pci_bus_dma_tag; - mba.mba_pba.pba_dmat64 = NULL; - mba.mba_pba.pba_bus = 0; - mba.mba_pba.pba_bridgetag = NULL; - mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; - config_found_ia(self, "pcibus", &mba, pcibusprint); -#endif -#endif } int