diff options
Diffstat (limited to 'sys')
91 files changed, 19 insertions, 6652 deletions
diff --git a/sys/Makefile b/sys/Makefile index 7b195ce4bfe..a518910e5a1 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.45 2016/05/11 21:52:49 deraadt Exp $ +# $OpenBSD: Makefile,v 1.46 2016/08/10 14:27:16 deraadt Exp $ # $NetBSD: Makefile,v 1.5 1995/09/15 21:05:21 pk Exp $ SUBDIR= dev/microcode \ - arch/alpha arch/amd64 arch/armish arch/armv7 \ + arch/alpha arch/amd64 arch/armv7 \ arch/hppa arch/i386 \ arch/landisk arch/loongson arch/luna88k \ arch/macppc arch/octeon \ diff --git a/sys/arch/armish/Makefile b/sys/arch/armish/Makefile deleted file mode 100644 index 54e374315f8..00000000000 --- a/sys/arch/armish/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# $OpenBSD: Makefile,v 1.7 2016/05/31 18:37:03 tedu Exp $ - -S= ${.CURDIR}/../.. -KFILE= GENERIC -.if exists(conf/GENERIC.MP) -KFILE= GENERIC.MP -.endif -TDIRS= ${_arch} include -TAGS= ${.CURDIR}/tags - -NOPROG= -NOMAN= -NOOBJ= -SUBDIR= stand - -# config the fattest kernel we can find into a temporary dir -# to create a Makefile. Then use make to pull some variables -# out and push them into the sub-shell to expand the paths, -# and finally run ctags. -tags:: - TDIR=`mktemp -d /tmp/_tagXXXXXXXXXX` || exit 1; \ - eval "S=${S}" && \ - config -s ${S} -b $${TDIR} ${.CURDIR}/conf/${KFILE} && \ - eval "_arch=\"`make -V _arch -f $${TDIR}/Makefile`\"" && \ - eval "_mach=\"`make -V _mach -f $${TDIR}/Makefile`\"" && \ - eval "_machdir=\$S/arch/$${_mach}" && \ - eval "_archdir=\$S/arch/$${_arch}" && \ - eval "HFILES=\"`find $S \( -path $S/arch -o -path $S/stand -o -path $S/lib/libsa -o -path $S/lib/libkern/arch \) -prune -o -name '*.h'; find $${_machdir} $${_archdir} $S/lib/libkern/arch/$${_arch} \( -name boot -o -name stand \) -prune -o -name '*.h'`\"" && \ - eval "SFILES=\"`make -V SFILES -f $${TDIR}/Makefile`\"" && \ - eval "CFILES=\"`make -V CFILES -f $${TDIR}/Makefile`\"" && \ - eval "AFILES=\"`make -V AFILES -f $${TDIR}/Makefile`\"" && \ - ctags -wd -f ${TAGS} $${CFILES} $${HFILES} && \ - egrep "^[_A-Z]*ENTRY[_A-Z]*\(.*\)" $${SFILES} $${AFILES} | \ - sed "s;\\([^:]*\\):\\([^(]*\\)(\\([^, )]*\\)\\(.*\\);\\3 \\1 /^\\2(\\3\\4$$/;" \ - >> ${TAGS} && \ - sort -o ${TAGS} ${TAGS} && \ - rm -rf $${TDIR} - -links: - -for i in conf ${TDIRS}; do \ - (cd $$i && rm -f tags; ln -s tags tags); done - -obj: _SUBDIRUSE - -.include <bsd.prog.mk> diff --git a/sys/arch/armish/armish/armish_machdep.c b/sys/arch/armish/armish/armish_machdep.c deleted file mode 100644 index a73b54e5caf..00000000000 --- a/sys/arch/armish/armish/armish_machdep.c +++ /dev/null @@ -1,889 +0,0 @@ -/* $OpenBSD: armish_machdep.c,v 1.40 2016/08/08 19:27:12 kettenis Exp $ */ -/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */ - -/* - * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -/* - * Copyright (c) 1997,1998 Mark Brinicombe. - * Copyright (c) 1997,1998 Causality Limited. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Mark Brinicombe - * for the NetBSD Project. - * 4. The name of the company nor the name of the author may 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 OR CONTRIBUTORS 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. - * - * Machine dependant functions for kernel setup for Intel IQ80321 evaluation - * boards using RedBoot firmware. - */ - -/* - * DIP switches: - * - * S19: no-dot: set RB_KDB. enter kgdb session. - * S20: no-dot: set RB_SINGLE. don't go multi user mode. - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/exec.h> -#include <sys/proc.h> -#include <sys/msgbuf.h> -#include <sys/reboot.h> -#include <sys/termios.h> -#include <sys/kcore.h> - -#include <uvm/uvm_extern.h> - -#include <sys/conf.h> -#include <sys/queue.h> -#include <dev/cons.h> -#include <sys/socket.h> - -#include <machine/db_machdep.h> -#include <ddb/db_sym.h> -#include <ddb/db_extern.h> - -#include <net/if.h> - -#include <machine/bootconfig.h> -#include <machine/bus.h> -#include <machine/cpu.h> -#include <machine/frame.h> -#include <arm/kcore.h> -#include <arm/undefined.h> -#include <arm/machdep.h> - -#include <arm/xscale/i80321reg.h> -#include <arm/xscale/i80321var.h> - -#include <armish/dev/iq80321reg.h> -#include <armish/dev/iq80321var.h> -#include <armish/dev/obiovar.h> - -/* Kernel text starts 2MB in from the bottom of the kernel address space. */ -#define KERNEL_TEXT_BASE (KERNEL_BASE + 0x00200000) -#define KERNEL_VM_BASE (KERNEL_BASE + 0x10000000) -#define KERNEL_VM_SIZE VM_KERNEL_SPACE_SIZE - -/* - * Address to call from cpu_reset() to reset the machine. - * This is machine architecture dependant as it varies depending - * on where the ROM appears when you turn the MMU off. - */ - -u_int cpu_reset_address = 0; - -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - -BootConfig bootconfig; /* Boot config storage */ -char *boot_args = NULL; -char *boot_file = NULL; - -paddr_t physical_start; -paddr_t physical_freestart; -paddr_t physical_freeend; -paddr_t physical_end; -u_int free_pages; -paddr_t pagetables_start; -int physmem = 0; - -/*int debug_flags;*/ -#ifndef PMAP_STATIC_L1S -int max_processes = 64; /* Default number */ -#endif /* !PMAP_STATIC_L1S */ - -/* Physical and virtual addresses for some global pages */ -pv_addr_t systempage; -pv_addr_t irqstack; -pv_addr_t undstack; -pv_addr_t abtstack; -extern pv_addr_t kernelstack; -pv_addr_t minidataclean; - -paddr_t msgbufphys; - -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - -#ifdef PMAP_DEBUG -extern int pmap_debug_level; -#endif - -#define KERNEL_PT_SYS 0 /* L2 table for mapping zero page */ - -#define KERNEL_PT_KERNEL 1 /* L2 table for mapping kernel */ -#define KERNEL_PT_KERNEL_NUM 32 - - /* L2 table for mapping i80312 */ -//#define KERNEL_PT_IOPXS (KERNEL_PT_KERNEL + KERNEL_PT_KERNEL_NUM) - - /* L2 tables for mapping kernel VM */ -//#define KERNEL_PT_VMDATA (KERNEL_PT_IOPXS + 1) -#define KERNEL_PT_VMDATA (KERNEL_PT_KERNEL + KERNEL_PT_KERNEL_NUM) -#define KERNEL_PT_VMDATA_NUM 8 /* start with 16MB of KVM */ -#define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM) - -pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; - -extern struct user *proc0paddr; - -/* - * safepri is a safe priority for sleep to set for a spin-wait - * during autoconfiguration or after a panic. - */ -int safepri = 0; - -/* Prototypes */ - -#define BOOT_STRING_MAGIC 0x4f425344 - -char bootargs[MAX_BOOT_STRING]; -void process_kernel_args(char *); - -void consinit(void); - -#include "com.h" -#if NCOM > 0 -#include <dev/ic/comreg.h> -#include <dev/ic/comvar.h> -#endif - -#ifndef CONSPEED -#define CONSPEED B115200 /* What RedBoot uses */ -#endif -#ifndef CONMODE -#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8 | CLOCAL) /* 8N1 */ -#endif - -int comcnspeed = CONSPEED; -int comcnmode = CONMODE; - - -/* - * void boot(int howto) - * - * Reboots the system - * - * Deal with any syncing, unmounting, dumping and shutdown hooks, - * then reset the CPU. - */ -void board_reset(void); -void board_powerdown(void); -__dead void -boot(int howto) -{ - if (cold) { - if ((howto & RB_USERREQ) == 0) - howto |= RB_HALT; - goto haltsys; - } - - /* - * If RB_NOSYNC was not specified sync the discs. - * Note: Unless cold is set to 1 here, syslogd will die during the - * unmount. It looks like syslogd is getting woken up only to find - * that it cannot page part of the binary in as the filesystem has - * been unmounted. - */ - if ((howto & RB_NOSYNC) == 0) - bootsync(howto); - - if_downall(); - - uvm_shutdown(); - splhigh(); - cold = 1; - - if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) - dumpsys(); - -haltsys: - config_suspend_all(DVACT_POWERDOWN); - - /* Make sure IRQ's are disabled */ - IRQdisable; - - if ((howto & RB_HALT) != 0) { - if ((howto & RB_POWERDOWN) != 0) { - board_powerdown(); - printf("WARNING: powerdown failed!\n"); - } - - printf("The operating system has halted.\n"); - printf("Please press any key to reboot.\n\n"); - cnpollc(1); - cngetc(); - cnpollc(0); - } - - printf("rebooting...\n"); - - board_reset(); - cpu_reset(); - printf("reboot failed; spinning\n"); - for (;;) ; - /* NOTREACHED */ -} - -/* - * Mapping table for core kernel memory. These areas are mapped in - * init time at fixed virtual address with section mappings. - */ -const struct pmap_devmap iq80321_devmap[] = { - /* - * Map the on-board devices VA == PA so that we can access them - * with the MMU on or off. - */ - { - IQ80321_OBIO_BASE, - IQ80321_OBIO_BASE, - 0x00100000 /* IQ80321_OBIO_SIZE, */, - PROT_READ | PROT_WRITE, - PTE_NOCACHE, - }, - {0, 0, 0, 0, 0} -}; - - -/* - * u_int initarm(...) - * - * Initial entry point on startup. This gets called before main() is - * entered. - * It should be responsible for setting up everything that must be - * in place when main is called. - * This includes - * Taking a copy of the boot configuration structure. - * Initialising the physical console so characters can be printed. - * Setting up page tables for the kernel - * Relocating the kernel to the bottom of physical memory - */ -u_int -initarm(void *arg0, void *arg1, void *arg2) -{ - extern vaddr_t xscale_cache_clean_addr; - extern cpu_kcore_hdr_t cpu_kcore_hdr; - int loop; - int loop1; - u_int l1pagetable; - pv_addr_t kernel_l1pt; - paddr_t memstart; - psize_t memsize; - extern u_int32_t esym; /* &_end if no symbols are loaded */ - -#ifdef DIAGNOSTIC - extern vsize_t xscale_minidata_clean_size; /* used in KASSERT */ -#endif - - /* setup a serial console for very early boot */ - consinit(); - - /* - * Heads up ... Setup the CPU / MMU / TLB functions - */ - if (set_cpufuncs()) - panic("cpu not recognized!"); - - /* - * Examine the boot args string for options we need to know about - * now. - */ - /* XXX should really be done after setting up the console, but we - * XXX need to parse the console selection flags right now. */ - process_kernel_args((char *)0xa0200000 - MAX_BOOT_STRING - 1); - - /* Calibrate the delay loop. */ -#if 1 - i80321_calibrate_delay(); -#endif - - /* Talk to the user */ - printf("\nOpenBSD/armish booting ...\n"); - - /* - * Reset the secondary PCI bus. RedBoot doesn't stop devices - * on the PCI bus before handing us control, so we have to - * do this. - * - * XXX This is arguably a bug in RedBoot, and doing this reset - * XXX could be problematic in the future if we encounter an - * XXX application where the PPB in the i80312 is used as a - * XXX PPB. - */ -//#define VERBOSE_INIT_ARM - - /* - * Fetch the SDRAM start/size from the i80312 SDRAM configuration - * registers. - */ - i80321_sdram_bounds(&obio_bs_tag, VERDE_PMMR_BASE + VERDE_MCU_BASE, - &memstart, &memsize); - -#define DEBUG -#ifdef DEBUG - printf("initarm: Configuring system ...\n"); -#endif - - /* Fake bootconfig structure for the benefit of pmap.c */ - /* XXX must make the memory description h/w independant */ - bootconfig.dramblocks = 1; - bootconfig.dram[0].address = memstart; - bootconfig.dram[0].pages = memsize / PAGE_SIZE; - - /* - * Set up the variables that define the availablilty of - * physical memory. For now, we're going to set - * physical_freestart to 0xa0200000 (where the kernel - * was loaded), and allocate the memory we need downwards. - * If we get too close to the page tables that RedBoot - * set up, we will panic. We will update physical_freestart - * and physical_freeend later to reflect what pmap_bootstrap() - * wants to see. - * - * XXX pmap_bootstrap() needs an enema. - */ - physical_start = bootconfig.dram[0].address; - physical_end = physical_start + (bootconfig.dram[0].pages * PAGE_SIZE); - - physical_freestart = 0xa0009000UL; - physical_freeend = 0xa0200000UL; - - physmem = (physical_end - physical_start) / PAGE_SIZE; - -#ifdef DEBUG - /* Tell the user about the memory */ - printf("physmemory: %d pages at 0x%08lx -> 0x%08lx\n", physmem, - physical_start, physical_end - 1); -#endif - - /* - * Okay, the kernel starts 2MB in from the bottom of physical - * memory. We are going to allocate our bootstrap pages downwards - * from there. - * - * We need to allocate some fixed page tables to get the kernel - * going. We allocate one page directory and a number of page - * tables and store the physical addresses in the kernel_pt_table - * array. - * - * The kernel page directory must be on a 16K boundary. The page - * tables must be on 4K boundaries. What we do is allocate the - * page directory on the first 16K boundary that we encounter, and - * the page tables on 4K boundaries otherwise. Since we allocate - * at least 3 L2 page tables, we are guaranteed to encounter at - * least one 16K aligned region. - */ - -#ifdef VERBOSE_INIT_ARM - printf("Allocating page tables\n"); -#endif - - free_pages = (physical_freeend - physical_freestart) / PAGE_SIZE; - -#ifdef VERBOSE_INIT_ARM - printf("freestart = 0x%08lx, free_pages = %d (0x%08x)\n", - physical_freestart, free_pages, free_pages); -#endif - - /* Define a macro to simplify memory allocation */ -#define valloc_pages(var, np) \ - alloc_pages((var).pv_pa, (np)); \ - (var).pv_va = KERNEL_BASE + (var).pv_pa - physical_start; - -#define alloc_pages(var, np) \ - physical_freeend -= ((np) * PAGE_SIZE); \ - if (physical_freeend < physical_freestart) \ - panic("initarm: out of memory"); \ - (var) = physical_freeend; \ - free_pages -= (np); \ - memset((char *)(var), 0, ((np) * PAGE_SIZE)); - - loop1 = 0; - kernel_l1pt.pv_pa = 0; - for (loop = 0; loop <= NUM_KERNEL_PTS; ++loop) { - /* Are we 16KB aligned for an L1 ? */ - if (((physical_freeend - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) == 0 - && kernel_l1pt.pv_pa == 0) { - valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); - } else { - valloc_pages(kernel_pt_table[loop1], - L2_TABLE_SIZE / PAGE_SIZE); - ++loop1; - } - } - - /* This should never be able to happen but better confirm that. */ - if (!kernel_l1pt.pv_pa || (kernel_l1pt.pv_pa & (L1_TABLE_SIZE-1)) != 0) - panic("initarm: Failed to align the kernel page directory"); - - /* - * Allocate a page for the system page mapped to V0x00000000 - * This page will just contain the system vectors and can be - * shared by all processes. - */ - alloc_pages(systempage.pv_pa, 1); - - /* Allocate stacks for all modes */ - valloc_pages(irqstack, IRQ_STACK_SIZE); - valloc_pages(abtstack, ABT_STACK_SIZE); - valloc_pages(undstack, UND_STACK_SIZE); - valloc_pages(kernelstack, UPAGES); - - /* Allocate enough pages for cleaning the Mini-Data cache. */ - KASSERT(xscale_minidata_clean_size <= PAGE_SIZE); - valloc_pages(minidataclean, 1); - -#ifdef VERBOSE_INIT_ARM - printf("IRQ stack: p0x%08lx v0x%08lx\n", irqstack.pv_pa, - irqstack.pv_va); - printf("ABT stack: p0x%08lx v0x%08lx\n", abtstack.pv_pa, - abtstack.pv_va); - printf("UND stack: p0x%08lx v0x%08lx\n", undstack.pv_pa, - undstack.pv_va); - printf("SVC stack: p0x%08lx v0x%08lx\n", kernelstack.pv_pa, - kernelstack.pv_va); -#endif - - /* - * XXX Defer this to later so that we can reclaim the memory - * XXX used by the RedBoot page tables. - */ - alloc_pages(msgbufphys, round_page(MSGBUFSIZE) / PAGE_SIZE); - - /* - * Ok we have allocated physical pages for the primary kernel - * page tables - */ - -#ifdef VERBOSE_INIT_ARM - printf("Creating L1 page table at 0x%08lx\n", kernel_l1pt.pv_pa); -#endif - - /* - * Now we start construction of the L1 page table - * We start by mapping the L2 page tables into the L1. - * This means that we can replace L1 mappings later on if necessary - */ - l1pagetable = kernel_l1pt.pv_pa; - -#ifdef HIGH_VECT - /* Map the L2 pages tables in the L1 page table */ - pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00400000 - 1), - &kernel_pt_table[KERNEL_PT_SYS]); -#else - /* Map the L2 pages tables in the L1 page table */ - pmap_link_l2pt(l1pagetable, 0x00000000, - &kernel_pt_table[KERNEL_PT_SYS]); -#endif - for (loop = 0; loop < KERNEL_PT_KERNEL_NUM; loop++) - pmap_link_l2pt(l1pagetable, KERNEL_BASE + loop * 0x00400000, - &kernel_pt_table[KERNEL_PT_KERNEL + loop]); - for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; loop++) - pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000, - &kernel_pt_table[KERNEL_PT_VMDATA + loop]); -#if 0 - pmap_link_l2pt(l1pagetable, IQ80321_IOPXS_VBASE, - &kernel_pt_table[KERNEL_PT_IOPXS]); -#endif - - /* update the top of the kernel VM */ - pmap_curmaxkvaddr = - KERNEL_VM_BASE + (KERNEL_PT_VMDATA_NUM * 0x00400000); - -#ifdef VERBOSE_INIT_ARM - printf("Mapping kernel\n"); -#endif - - /* Now we fill in the L2 pagetable for the kernel static code/data - * and the symbol table. */ - { - extern char etext[]; -#ifdef VERBOSE_INIT_ARM - extern char _end[]; -#endif - size_t textsize = (u_int32_t) etext - KERNEL_TEXT_BASE; - size_t totalsize = esym - KERNEL_TEXT_BASE; - u_int logical; - -#ifdef VERBOSE_INIT_ARM - printf("kernelsize text %x total %x end %xesym %x\n", - textsize, totalsize, _end, esym); -#endif - - textsize = round_page(textsize); - totalsize = round_page(totalsize); - - logical = 0x00200000; /* offset of kernel in RAM */ - - /* Update dump information */ - cpu_kcore_hdr.kernelbase = KERNEL_BASE; - cpu_kcore_hdr.kerneloffs = logical; - cpu_kcore_hdr.staticsize = totalsize; - - logical += pmap_map_chunk(l1pagetable, KERNEL_BASE + logical, - physical_start + logical, textsize, - PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, KERNEL_BASE + logical, - physical_start + logical, totalsize - textsize, - PROT_READ | PROT_WRITE, PTE_CACHE); - } - -#ifdef VERBOSE_INIT_ARM - printf("Constructing L2 page tables\n"); -#endif - - /* Map the stack pages */ - pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa, - IRQ_STACK_SIZE * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, abtstack.pv_va, abtstack.pv_pa, - ABT_STACK_SIZE * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, undstack.pv_va, undstack.pv_pa, - UND_STACK_SIZE * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, kernelstack.pv_va, kernelstack.pv_pa, - UPAGES * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - - pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, - L1_TABLE_SIZE, PROT_READ | PROT_WRITE, PTE_PAGETABLE); - - for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { - pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, - kernel_pt_table[loop].pv_pa, L2_TABLE_SIZE, - PROT_READ | PROT_WRITE, PTE_PAGETABLE); - } - - /* Map the Mini-Data cache clean area. */ - xscale_setup_minidata(l1pagetable, minidataclean.pv_va, - minidataclean.pv_pa); - - /* Map the vector page. */ -#ifdef HIGH_VECT - pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, - PROT_READ | PROT_WRITE, PTE_CACHE); -#else - pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa, - PROT_READ | PROT_WRITE, PTE_CACHE); -#endif - - pmap_devmap_bootstrap(l1pagetable, iq80321_devmap); - - /* - * Give the XScale global cache clean code an appropriately - * sized chunk of unmapped VA space starting at 0xff000000 - * (our device mappings end before this address). - */ - xscale_cache_clean_addr = 0xff000000U; - - /* - * Now we have the real page tables in place so we can switch to them. - * Once this is done we will be running with the REAL kernel page - * tables. - */ - - /* - * Update the physical_freestart/physical_freeend/free_pages - * variables. - */ - { - physical_freestart = physical_start - KERNEL_BASE + - round_page(esym); - physical_freeend = physical_end; - free_pages = - (physical_freeend - physical_freestart) / PAGE_SIZE; - } -#ifdef VERBOSE_INIT_ARM - printf("physical_freestart %x end %x\n", physical_freestart, - physical_freeend); -#endif - - /* be a client to all domains */ - cpu_domains(0x55555555); - /* Switch tables */ -#ifdef VERBOSE_INIT_ARM - printf("freestart = 0x%08lx, free_pages = %d (0x%x)\n", - physical_freestart, free_pages, free_pages); - printf("switching to new L1 page table @%#lx...", kernel_l1pt.pv_pa); -#endif - - - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); - setttb(kernel_l1pt.pv_pa); - cpu_tlb_flushID(); - cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); - - /* - * Moved from cpu_startup() as data_abort_handler() references - * this during uvm init - */ - proc0paddr = (struct user *)kernelstack.pv_va; - proc0.p_addr = proc0paddr; - -#ifdef VERBOSE_INIT_ARM - printf("bootstrap done.\n"); -#endif - -#ifdef HIGH_VECT - arm32_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); -#else - arm32_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); -#endif - - /* - * Pages were allocated during the secondary bootstrap for the - * stacks for different CPU modes. - * We must now set the r13 registers in the different CPU modes to - * point to these stacks. - * Since the ARM stacks use STMFD etc. we must set r13 to the top end - * of the stack memory. - */ -#ifdef VERBOSE_INIT_ARM - printf("init subsystems: stacks "); -#endif - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - /* - * Well we should set a data abort handler. - * Once things get going this will change as we will need a proper - * handler. - * Until then we will use a handler that just panics but tells us - * why. - * Initialisation of the vectors will just panic on a data abort. - * This just fills in a slightly better one. - */ -#ifdef VERBOSE_INIT_ARM - printf("vectors "); -#endif - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; - - /* Initialise the undefined instruction handlers */ -#ifdef VERBOSE_INIT_ARM - printf("undefined "); -#endif - undefined_init(); - - /* Load memory into UVM. */ -#ifdef VERBOSE_INIT_ARM - printf("page "); -#endif - uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ - uvm_page_physload(atop(physical_freestart), atop(physical_freeend), - atop(physical_freestart), atop(physical_freeend), 0); - - /* Boot strap pmap telling it where the kernel page table is */ -#ifdef VERBOSE_INIT_ARM - printf("pmap "); -#endif - pmap_bootstrap((pd_entry_t *)kernel_l1pt.pv_va, KERNEL_VM_BASE, - KERNEL_VM_BASE + KERNEL_VM_SIZE); - - /* Update dump information */ - cpu_kcore_hdr.pmap_kernel_l1 = (u_int32_t)pmap_kernel()->pm_l1; - cpu_kcore_hdr.pmap_kernel_l2 = (u_int32_t)&(pmap_kernel()->pm_l2); - - /* Setup the IRQ system */ -#ifdef VERBOSE_INIT_ARM - printf("irq "); -#endif - i80321intc_intr_init(); - -#ifdef VERBOSE_INIT_ARM - printf("done.\n"); -#endif - -#ifdef DDB - db_machine_init(); - - /* Firmware doesn't load symbols. */ - ddb_init(); - - if (boothowto & RB_KDB) - Debugger(); -#endif - - cpu_setup(); - - /* We return the new stack pointer address */ - return(kernelstack.pv_va + USPACE_SVC_STACK_TOP); -} - -void -process_kernel_args(char *args) -{ - char *cp = args; - - if (cp == NULL || *(int *)cp != BOOT_STRING_MAGIC) { - boothowto = RB_AUTOBOOT; - return; - } - - /* Eat the cookie */ - *(int *)cp = 0; - cp += sizeof(int); - - boothowto = 0; - - /* Make a local copy of the bootargs */ - strncpy(bootargs, cp, MAX_BOOT_STRING - sizeof(int)); - - cp = bootargs; - boot_file = bootargs; - - /* Skip the kernel image filename */ - while (*cp != ' ' && *cp != 0) - ++cp; - - if (*cp != 0) - *cp++ = 0; - - while (*cp == ' ') - ++cp; - - boot_args = cp; - -#if 0 - printf("bootfile: %s\n", boot_file); - printf("bootargs: %s\n", boot_args); -#endif - - /* Setup pointer to boot flags */ - while (*cp != '-') - if (*cp++ == '\0') - return; - - for (;*++cp;) { - int fl; - - fl = 0; - switch(*cp) { - case 'a': - fl |= RB_ASKNAME; - break; - case 'c': - fl |= RB_CONFIG; - break; - case 'd': - fl |= RB_KDB; - break; - case 's': - fl |= RB_SINGLE; - break; - default: - printf("unknown option `%c'\n", *cp); - break; - } - boothowto |= fl; - } -} - - -void -consinit(void) -{ - static const bus_addr_t comcnaddrs[] = { - IQ80321_UART1 /* com0 */ - }; - static int consinit_called; - - if (consinit_called != 0) - return; - - consinit_called = 1; - - /* - * Console devices are mapped VA==PA. Our devmap reflects - * this, so register it now so drivers can map the console - * device. - */ - pmap_devmap_register(iq80321_devmap); - -#if NCOM > 0 - if (comcnattach(&obio_bs_tag, comcnaddrs[0], comcnspeed, - COM_FREQ, comcnmode)) - panic("can't init serial console @%lx", comcnaddrs[0]); - comdefaultrate = comcnspeed; -#else - panic("serial console @%lx not configured", comcnaddrs[0]); -#endif -} - -void -board_startup(void) -{ - if (boothowto & RB_CONFIG) { -#ifdef BOOT_CONFIG - user_config(); -#else - printf("kernel does not support -c; continuing..\n"); -#endif - } -} diff --git a/sys/arch/armish/armish/armish_start.S b/sys/arch/armish/armish/armish_start.S deleted file mode 100644 index 91d72239c01..00000000000 --- a/sys/arch/armish/armish/armish_start.S +++ /dev/null @@ -1,152 +0,0 @@ -/* $OpenBSD: armish_start.S,v 1.3 2016/04/25 04:46:56 jsg Exp $ */ -/* $NetBSD: iq80321_start.S,v 1.4 2002/10/14 22:32:54 bjh21 Exp $ */ - -/* - * Copyright (c) 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#include <machine/asm.h> -#include <arm/sysreg.h> -#include <arm/armreg.h> -#include <arm/pte.h> - - .section .start,"ax",%progbits - - .global _C_LABEL(iq80321_start) -_C_LABEL(iq80321_start): - /* - * We will go ahead and disable the MMU here so that we don't - * have to worry about flushing caches, etc. - * - * Note that we may not currently be running VA==PA, which means - * we'll need to leap to the next insn after disabing the MMU. - */ - adr r8, Lunmapped - bic r8, r8, #0xff000000 /* clear upper 8 bits */ - orr r8, r8, #0xa0000000 /* OR in physical base address */ - - mrc CP15_SCTLR(r2) - bic r2, r2, #CPU_CONTROL_MMU_ENABLE - mcr CP15_SCTLR(r2) - - nop - nop - nop - - mov pc, r8 /* Heave-ho! */ - -Lunmapped: - /* - * We want to construct a memory map that maps us - * VA==PA (SDRAM at 0xa0000000) and also double-maps - * that space at 0xc0000000 (where the kernel address - * space starts). We create these mappings uncached - * and unbuffered to be safe. - * - * We also want to map the various devices we want to - * talk to VA==PA during bootstrap. - * - * We just use section mappings for all of this to make it easy. - * - * We will put the L1 table to do all this at 0xa0004000, which - * is also where RedBoot puts it. - */ - - /* - * Step 1: Map the entire address space VA==PA. - */ - adr r0, Ltable - ldr r0, [r0] /* r0 = &l1table */ - - mov r3, #(L1_S_AP(AP_KRW)) - orr r3, r3, #(L1_TYPE_S) - mov r2, #0x100000 /* advance by 1MB */ - mov r1, #0x1000 /* 4096MB */ -1: - str r3, [r0], #0x04 - add r3, r3, r2 - subs r1, r1, #1 - bgt 1b - - /* - * Step 2: Map VA 0xc0000000->0xc3ffffff to PA 0xa0000000->0xa3ffffff. - */ - adr r0, Ltable /* r0 = &l1table */ - ldr r0, [r0] - - mov r3, #(L1_S_AP(AP_KRW)) - orr r3, r3, #(L1_TYPE_S) - orr r3, r3, #0xa0000000 - add r0, r0, #(0xc00 * 4) /* offset to 0xc00xxxxx */ - mov r1, #0x40 /* 64MB */ -1: - str r3, [r0], #0x04 - add r3, r3, r2 - subs r1, r1, #1 - bgt 1b - - /* OK! Page table is set up. Give it to the CPU. */ - adr r0, Ltable - ldr r0, [r0] - mcr CP15_TTBR0(r0) - - /* Flush the old TLBs, just in case. */ - mcr CP15_TLBIALL(r0) - - /* Set the Domain Access register. Very important! */ - mov r0, #1 - mcr CP15_DACR(r0) - - /* Get ready to jump to the "real" kernel entry point... */ - ldr r0, Lstart - - /* OK, let's enable the MMU. */ - mrc CP15_SCTLR(r2) - orr r2, r2, #CPU_CONTROL_MMU_ENABLE - mcr CP15_SCTLR(r2) - - nop - nop - nop - - /* CPWAIT sequence to make sure the MMU is on... */ - mrc CP15_TTBR0(r2) /* arbitrary read of CP15 */ - mov r2, r2 /* force it to complete */ - mov pc, r0 /* leap to kernel entry point! */ - -Ltable: - .word 0xa0004000 - -Lstart: - .word start diff --git a/sys/arch/armish/armish/autoconf.c b/sys/arch/armish/armish/autoconf.c deleted file mode 100644 index 7436b95d46a..00000000000 --- a/sys/arch/armish/armish/autoconf.c +++ /dev/null @@ -1,148 +0,0 @@ -/* $OpenBSD: autoconf.c,v 1.13 2016/06/08 17:24:44 tedu Exp $ */ -/* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */ - -/* - * Copyright (c) 1994-1998 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Mark Brinicombe for - * the NetBSD project. - * 4. The name of the company nor the name of the author may 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 OR CONTRIBUTORS 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. - * - * RiscBSD kernel project - * - * autoconf.c - * - * Autoconfiguration functions - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/reboot.h> -#include <sys/disklabel.h> -#include <sys/device.h> -#include <sys/conf.h> -#include <sys/kernel.h> -#include <sys/malloc.h> - -#include <uvm/uvm_extern.h> - -#include <machine/bootconfig.h> -#include <machine/intr.h> -#include <dev/cons.h> - -struct device *bootdv = NULL; - -void dumpconf(void); - -void -device_register(struct device *dev, void *aux) -{ -} - -/* - * void cpu_configure() - * - * Configure all the root devices - * The root devices are expected to configure their own children - */ -void -cpu_configure(void) -{ - softintr_init(); - - /* - * Since various PCI interrupts could be routed via the ICU - * (for PCI devices in the bridge) we need to set up the ICU - * now so that these interrupts can be established correctly - * i.e. This is a hack. - */ - - config_rootfound("mainbus", NULL); - - /* - * We can not know which is our root disk, defer - * until we can checksum blocks to figure it out. - */ - cold = 0; - - /* Time to start taking interrupts so lets open the flood gates .... */ - (void)spl0(); - -} - -/* - * Now that we are fully operational, we can checksum the - * disks, and using some heuristics, hopefully are able to - * always determine the correct root disk. - */ -void -diskconf(void) -{ - dev_t tmpdev; - -#if 0 - /* - * Configure root, swap, and dump area. This is - * currently done by running the same checksum - * algorithm over all known disks, as was done in - * /boot. Then we basically fixup the *dev vars - * from the info we gleaned from this. - */ - dkcsumattach(); -#endif - - /* Lookup boot device from boot if not set by configuration */ - if (bootdv == NULL) { - int len; - char *p; - - /* boot_file is of the form wd0a:/bsd, we want 'wd0a' */ - if ((p = strchr(boot_file, ':')) != NULL) - len = p - boot_file; - else - len = strlen(boot_file); - - bootdv = parsedisk(boot_file, len, 0, &tmpdev); - } - if (bootdv == NULL) - printf("boot device: lookup '%s' failed.\n", boot_file); - else - printf("boot device: %s\n", bootdv->dv_xname); - setroot(bootdv, 0, RB_USERREQ); - dumpconf(); -} - -struct nam2blk nam2blk[] = { - { "wd", 16 }, - { "sd", 24 }, - { "cd", 26 }, - { "rd", 18 }, - { "vnd", 19 }, - { NULL, -1 } -}; diff --git a/sys/arch/armish/armish/genassym.cf b/sys/arch/armish/armish/genassym.cf deleted file mode 100644 index 679dcad021f..00000000000 --- a/sys/arch/armish/armish/genassym.cf +++ /dev/null @@ -1 +0,0 @@ -# $OpenBSD: genassym.cf,v 1.1 2010/04/26 22:11:38 deraadt Exp $ diff --git a/sys/arch/armish/conf/GENERIC b/sys/arch/armish/conf/GENERIC deleted file mode 100644 index 5317a80cd85..00000000000 --- a/sys/arch/armish/conf/GENERIC +++ /dev/null @@ -1,204 +0,0 @@ -# $OpenBSD: GENERIC,v 1.61 2016/06/28 04:41:37 jmatthew Exp $ -# -# For further information on compiling OpenBSD kernels, see the config(8) -# man page. -# -# For further information on hardware support for this architecture, see -# the intro(4) man page. For further information about kernel options -# for this architecture, see the options(4) man page. For an explanation -# of each device driver in this file see the section 4 man page for the -# device. - -machine armish arm -include "../../../conf/GENERIC" -maxusers 32 # estimated number of users - -options ARM32 - -makeoptions KERNEL_BASE_PHYS="0x00200000" -makeoptions KERNEL_BASE_VIRT="0xc0200000" - -options CPU_XSCALE_80321 # Support the XScale core -options XSCALE_CACHE_READ_WRITE_ALLOCATE -#makeoptions CPUFLAGS="-mcpu=xscale" - -#options PERFCTRS # performance counters - -option PCIVERBOSE -option USER_PCICONF # user-space PCI configuration - -config bsd swap generic - -# The main bus device -mainbus0 at root -cpu0 at mainbus? -obio0 at mainbus? - -# On-board 16550 UART -com0 at obio? addr 0xfe800000 xint 3 - -puc* at pci? # PCI "universal" communication device -com* at puc? -lpt* at puc? - -# i80321 I/O Processor peripheral support -iopxs0 at mainbus? -#gpio* at iopxs0 - -#iopaau* at iopxs? # Application Accelerator Unit -iopiic* at iopxs? # I2C Controller Unit(s) -iic0 at iopiic? -iic1 at iopiic? -ricohrtc0 at iic? addr 0x32 # Ricoh RTC -pcaled0 at iic? addr 0x60 # led controller -gpio* at pcaled0 -fintek0 at iic? flags 0x0001 # temp/fan controller -spdmem* at iic? # SPD memory eeproms -sdtemp* at iic? # SO-DIMM (JC-42.4) temperature - -#iopwdog* at iopxs? # Watchdog timer -pci0 at iopxs? bus ? # PCI/PCI-X support - - -siop* at pci? # NCR 538XX SCSI controllers(new) -em* at pci? -re* at pci? -ral* at pci? -bwi* at pci? -# IDE controllers -pciide* at pci? flags 0x0000 -wd* at pciide? flags 0x0000 - - -scsibus* at scsi? -sd* at scsibus? # SCSI disk drives -#st* at scsibus? # SCSI tape drives -cd* at scsibus? # SCSI CD-ROM drives -#ch* at scsibus? # SCSI autochangers -#uk* at scsibus? # unknown SCSI - -# USB Controllers -ohci* at pci? # Open Host Controller -uhci* at pci? # Universal Host Controller -ehci* at pci? # Enhanced Host Controller - -# USB bus support -usb* at ohci? -usb* at uhci? -usb* at ehci? - -# USB devices -uhub* at usb? # USB Hubs -uhub* at uhub? # USB Hubs -ualea* at uhub? # Araneus Alea II TRNG -uonerng* at uhub? # Moonbase Otago OneRNG -umodem* at uhub? # USB Modems/Serial -ucom* at umodem? -uvisor* at uhub? # Handspring Visor -ucom* at uvisor? -uvscom* at uhub? # SUNTAC Slipper U VS-10U serial -ucom* at uvscom? -ubsa* at uhub? # Belkin serial adapter -ucom* at ubsa? -uftdi* at uhub? # FTDI FT8U100AX serial adapter -ucom* at uftdi? -uplcom* at uhub? # I/O DATA USB-RSAQ2 serial adapter -ucom* at uplcom? -umct* at uhub? # MCT USB-RS232 serial adapter -ucom* at umct? -uslcom* at uhub? # Silicon Laboratories CP210x serial -ucom* at uslcom? -uark* at uhub? # Arkmicro ARK3116 serial -ucom* at uark? -uipaq* at uhub? # iPAQ serial adapter -ucom* at uipaq? -umsm* at uhub? # Qualcomm MSM EVDO -ucom* at umsm? -uchcom* at uhub? # WinChipHead CH341/340 serial -ucom* at uchcom? -uaudio* at uhub? # USB Audio -audio* at uaudio? -umidi* at uhub? # USB MIDI -midi* at umidi? -ulpt* at uhub? # USB Printers -umass* at uhub? # USB Mass Storage devices -uhidev* at uhub? # Human Interface Devices -ums* at uhidev? # USB mouse -wsmouse* at ums? mux 0 -ukbd* at uhidev? # USB keyboard -wskbd* at ukbd? mux 1 -udl* at uhub? # USB DisplayLink video -wsdisplay* at udl? -ucycom* at uhidev? # Cypress serial -ucom* at ucycom? -uslhcom* at uhidev? # Silicon Labs CP2110 USB HID UART -ucom* at uslhcom? -uhid* at uhidev? # USB generic HID support -upd* at uhidev? # USB Power Devices sensors -aue* at uhub? # ADMtek AN986 Pegasus Ethernet -atu* at uhub? # Atmel AT76c50x based 802.11b -axe* at uhub? # ASIX Electronics AX88172 USB Ethernet -axen* at uhub? # ASIX Electronics AX88179 USB Ethernet -cue* at uhub? # CATC USB-EL1201A based Ethernet -kue* at uhub? # Kawasaki KL5KUSB101B based Ethernet -smsc* at uhub? # SMSC LAN95xx Ethernet -cdce* at uhub? # CDC Ethernet -urndis* at uhub? # Remote NDIS Ethernet -upl* at uhub? # Prolific PL2301/PL2302 host-to-host `network' -ugl* at uhub? # Genesys Logic GL620USB-A host-to-host `network' -udav* at uhub? # Davicom DM9601 based Ethernet -url* at uhub? # Realtek RTL8150L based adapters -ure* at uhub? # Realtek RTL8152 based adapters -wi* at uhub? # WaveLAN IEEE 802.11DS -udsbr* at uhub? # D-Link DSB-R100 radio -radio* at udsbr? # USB radio -ugen* at uhub? # USB Generic driver -ural* at uhub? # Ralink RT2500USB -rum* at uhub? # Ralink RT2501USB/RT2601USB -run* at uhub? # Ralink RT2700U/RT2800U/RT3000U -rsu* at uhub? # Realtek RTL8188SU/RTL8191SU/RTL8192SU -urtwn* at uhub? # Realtek RTL8188CU/RTL8192CU -athn* at uhub? # Atheros AR9002U -#udcf* at uhub? # Gude Expert mouseCLOCK -uthum* at uhidev? # TEMPerHUM sensor -ugold* at uhidev? # gold TEMPer sensor -utwitch* at uhidev? # YUREX BBU sensor -uow* at uhub? # Maxim/Dallas DS2490 1-Wire adapter -onewire* at uow? - -amphy* at mii? # AMD 79C873 PHYs -dcphy* at mii? # Digital Clone PHYs -exphy* at mii? # 3Com internal PHYs -inphy* at mii? # Intel 82555 PHYs -iophy* at mii? # Intel 82553 PHYs -icsphy* at mii? # ICS1890 PHYs -lxtphy* at mii? # Level One LXT-970 PHYs -nsphy* at mii? # NS83840 PHYs -#nsphyter* at mii? # NS83843 PHYs -mtdphy* at mii? # Myson MTD972 PHYs -acphy* at mii? # Altima AC101 PHYs -qsphy* at mii? # Quality Semi QS6612 PHYs -luphy* at mii? # Lucent LU6612 PHY -sqphy* at mii? # Seeq 8022[013] PHYs -rlphy* at mii? # Realtek 8139 internal PHYs -#tlphy* at mii? # ThunderLAN PHYs -tqphy* at mii? # TDK Semiconductor PHYs -brgphy* at mii? # Broadcom 10/100/1000 PHYs -bmtphy* at mii? # Broadcom 10/100 PHYs -eephy* at mii? # Marvell 88E1000 Gigabit PHYs -urlphy* at mii? # Realtek RTL8150L internal PHY -rgephy* at mii? # Realtek 8169S/8110S PHY -rlphy* at mii? # Realtek 8139 internal PHYs -ciphy* at mii? # Cicada CS8201 10/100/1000 copper PHY -ukphy* at mii? # generic unknown PHYs - -# 1-Wire devices -option ONEWIREVERBOSE -owid* at onewire? # ID -owsbm* at onewire? # Smart Battery Monitor -owtemp* at onewire? # Temperature -owctr* at onewire? # Counter device - -# mouse & keyboard multiplexor pseudo-devices -pseudo-device wsmux 2 -pseudo-device hotplug 1 # devices hot plugging diff --git a/sys/arch/armish/conf/Makefile.armish b/sys/arch/armish/conf/Makefile.armish deleted file mode 100644 index 56bcd9a1118..00000000000 --- a/sys/arch/armish/conf/Makefile.armish +++ /dev/null @@ -1,178 +0,0 @@ -# $OpenBSD: Makefile.armish,v 1.52 2016/04/29 12:44:52 mpi Exp $ - -# For instructions on building kernels consult the config(8) and options(4) -# manual pages. -# -# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE -# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING -# DEBUG is set to -g by config if debugging is requested (config -g). -# PROF is set to -pg by config if profiling is requested (config -p). - -.include <bsd.own.mk> - -SIZE?= size -STRIP?= strip - -# source tree is located via $S relative to the compilation directory -.ifndef S -S!= cd ../../../..; pwd -.endif - -_machdir?= $S/arch/${_mach} -_archdir?= $S/arch/${_arch} - -INCLUDES= -nostdinc -I$S -I. -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP -CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \ - -Wno-main -Wno-uninitialized \ - -Wframe-larger-than=2047 - -CMACHFLAGS= -ffreestanding -msoft-float # -march=armv4 -mtune=strongarm -CMACHFLAGS+= -fno-builtin-printf -fno-builtin-snprintf \ - -fno-builtin-vsnprintf -fno-builtin-log \ - -fno-builtin-log2 -fno-builtin-malloc ${NOPIE_FLAGS} -.if ${IDENT:M-DNO_PROPOLICE} -CMACHFLAGS+= -fno-stack-protector -.endif - -COPTS?= -O2 -CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} -AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LINKFLAGS= -T ldscript --warn-common -nopie - -.if ${IDENT:M-DDDB_STRUCT} -DB_STRUCTINFO= db_structinfo.h -.else -DB_STRUCTINFO= -.endif - -HOSTCC?= ${CC} -HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} -HOSTED_CFLAGS= ${CFLAGS} -HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< - -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< -NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< - -%OBJS - -%CFILES - -%SFILES - -# load lines for config "xxx" will be emitted as: -# xxx: ${SYSTEM_DEP} swapxxx.o -# ${SYSTEM_LD_HEAD} -# ${SYSTEM_LD} swapxxx.o -# ${SYSTEM_LD_TAIL} -SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o -SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} -SYSTEM_LD_HEAD= @rm -f $@ -SYSTEM_LD_HEAD+=; \ - cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ - sed -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \ - -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' > ldscript - -SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ - ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} -SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ -SYSTEM_LD_TAIL+=; \ - dd if=/dev/zero of=bsd bs=1 count=1 seek=95 conv=notrunc 2>/dev/null; \ - dd if=/dev/zero of=bsd bs=1 count=1 seek=127 conv=notrunc 2>/dev/null; \ - dd if=/dev/zero of=bsd bs=1 count=1 seek=159 conv=notrunc 2>/dev/null - -DEBUG?= -.if ${DEBUG} == "-g" -STRIPFLAGS= -S -SYSTEM_LD_TAIL+=; \ - echo mv $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \ - echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ - ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb -.else -LINKFLAGS+= -S -.endif - -%LOAD - -# cc's -MD puts the source and output paths in the dependency file; -# since those are temp files here we need to fix it up. It also -# puts the file in /tmp, so we use -MF to put it in the current -# directory as assym.P and then generate assym.d from it with a -# good target name -assym.h: $S/kern/genassym.sh Makefile \ - ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp - sed '1s/.*/assym.h: \\/' assym.P > assym.d - sort -u assym.h.tmp > assym.h - -param.c: $S/conf/param.c - rm -f param.c - cp $S/conf/param.c . - -param.o: param.c Makefile - ${NORMAL_C} - -mcount.o: $S/lib/libkern/mcount.c Makefile - ${NORMAL_C_NOP} - -ioconf.o: ioconf.c - ${NORMAL_C} - -vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} - sh $S/conf/newvers.sh - ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c - -clean:: - rm -f eddep *bsd *bsd.gdb tags *.[dio] [a-z]*.s \ - [Ee]rrs linterrs assym.h ${DB_STRUCTINFO} - -lint: - @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ - ${CFILES} ioconf.c param.c | \ - grep -v 'static function .* unused' - -depend: - @touch $@ - -tags: - @echo "see $S/kern/Makefile for tags" - -db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl - ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c - objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@ - rm -f db_structinfo.o - -${_mach}_start.o: ${_machdir}/${_mach}/${_mach}_start.S -locore.o: ${_archdir}/${_arch}/locore.S assym.h -in_cksum_arm.o fiq_subr.o bcopyinout.o copystr.o sigcode.o: assym.h -vectors.o cpuswitch.o exception.o bcopy_page.o irq_dispatch.o: assym.h - -# The install target can be redefined by putting a -# install-kernel-${MACHINE_NAME} target into /etc/mk.conf -MACHINE_NAME!= uname -n -install: install-kernel-${MACHINE_NAME} -.if !target(install-kernel-${MACHINE_NAME}}) -install-kernel-${MACHINE_NAME}: - cmp -s bsd /bsd || ln -f /bsd /obsd - cp bsd /nbsd - mv /nbsd /bsd -.endif - -# pull in the dependency information -.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) - ${SYSTEM_OBJ}: ${DB_STRUCTINFO} -.endif -.ifnmake clean -. for o in ${SYSTEM_OBJ} assym.h ${DB_STRUCTINFO} -. if exists(${o:R}.d) -. include "${o:R}.d" -. elif exists($o) - .PHONY: $o -. endif -. endfor -.endif - -%RULES diff --git a/sys/arch/armish/conf/RAMDISK b/sys/arch/armish/conf/RAMDISK deleted file mode 100644 index daec072d0cb..00000000000 --- a/sys/arch/armish/conf/RAMDISK +++ /dev/null @@ -1,146 +0,0 @@ -# $OpenBSD: RAMDISK,v 1.35 2016/06/28 04:41:37 jmatthew Exp $ - -machine armish arm -maxusers 4 - -option TIMEZONE=0 -option DST=0 -option SMALL_KERNEL -option NO_PROPOLICE -option BOOT_CONFIG - -option MINIROOTSIZE=5120 -option RAMDISK_HOOKS - -option PCIVERBOSE - -option FFS -option FFS2 -option CD9660 -option MSDOSFS -option EXT2FS -option INET6 -option CRYPTO - -config bsd root on rd0a swap on rd0b - -option ARM32 -#makeoptions KERNEL_BASE_PHYS="0xa0200000" -makeoptions KERNEL_BASE_PHYS="0x00200000" -makeoptions KERNEL_BASE_VIRT="0xc0200000" -option CPU_XSCALE_80321 # Support the XScale core -option XSCALE_CACHE_READ_WRITE_ALLOCATE -#makeoptions CPUFLAGS="-mcpu=xscale" - -mainbus0 at root -cpu0 at mainbus? -obio0 at mainbus? - -com0 at obio? addr 0xfe800000 xint 3 - -iopxs0 at mainbus? - -iopiic* at iopxs? # I2C Controller Unit(s) -iic0 at iopiic? -iic1 at iopiic? -pcaled0 at iic? addr 0x60 # led controller -ricohrtc0 at iic? addr 0x32 # Ricoh RTC -fintek0 at iic? flags 0x0001 # temp/fan controller - -pci0 at iopxs? bus ? # PCI/PCI-X support - -siop* at pci? # NCR 538XX SCSI controllers(new) -em* at pci? -re* at pci? -ral* at pci? -bwi* at pci? - -pciide* at pci? flags 0x0000 -wd* at pciide? flags 0x0000 - -softraid0 at root - -scsibus* at scsi? -sd* at scsibus? # SCSI disk drives -cd* at scsibus? # SCSI CD-ROM drives - -ohci* at pci? -uhci* at pci? -ehci* at pci? -usb* at ohci? -usb* at uhci? -usb* at ehci? - -uhub* at usb? -uhub* at uhub? -umodem* at uhub? # USB Modems/Serial -ucom* at umodem? -uvisor* at uhub? # Handspring Visor -ucom* at uvisor? -uvscom* at uhub? # SUNTAC Slipper U VS-10U serial -ucom* at uvscom? -ubsa* at uhub? # Belkin serial adapter -ucom* at ubsa? -uftdi* at uhub? # FTDI FT8U100AX serial adapter -ucom* at uftdi? -uplcom* at uhub? # I/O DATA USB-RSAQ2 serial adapter -ucom* at uplcom? -umct* at uhub? # MCT USB-RS232 serial adapter -ucom* at umct? -uipaq* at uhub? # iPAQ serial adapter -ucom* at uipaq? -umsm* at uhub? # Qualcomm MSM EVDO -ucom* at umsm? -umass* at uhub? -uhidev* at uhub? # Human Interface Devices -ukbd* at uhidev? # USB keyboard -wskbd* at ukbd? mux 1 -uslhcom* at uhidev? # Silicon Labs CP2110 USB HID UART -ucom* at uslhcom? -uhid* at uhidev? # USB generic HID support -aue* at uhub? # ADMtek AN986 Pegasus Ethernet -atu* at uhub? # Atmel AT76c50x based 802.11b -axe* at uhub? # ASIX Electronics AX88172 USB Ethernet -axen* at uhub? # ASIX Electronics AX88179 USB Ethernet -cue* at uhub? # CATC USB-EL1201A based Ethernet -kue* at uhub? # Kawasaki KL5KUSB101B based Ethernet -smsc* at uhub? # SMSC LAN95xx Ethernet -cdce* at uhub? # CDC Ethernet -upl* at uhub? # Prolific PL2301/PL2302 host-to-host -ugl* at uhub? # Genesys Logic GL620USB-A host-to-host -udav* at uhub? # Davicom DM9601 based Ethernet -url* at uhub? # Realtek RTL8150L based adapters -ure* at uhub? # Realtek RTL8152 based adapters -wi* at uhub? # WaveLAN IEEE 802.11DS -ugen* at uhub? # USB Generic driver -ural* at uhub? # Ralink RT2500 - -amphy* at mii? # AMD 79C873 PHYs -dcphy* at mii? # Digital Clone PHYs -exphy* at mii? # 3Com internal PHYs -inphy* at mii? # Intel 82555 PHYs -iophy* at mii? # Intel 82553 PHYs -icsphy* at mii? # ICS1890 PHYs -lxtphy* at mii? # Level One LXT-970 PHYs -nsphy* at mii? # NS83840 PHYs -mtdphy* at mii? # Myson MTD972 PHYs -acphy* at mii? # Altima AC101 PHYs -qsphy* at mii? # Quality Semi QS6612 PHYs -luphy* at mii? # Lucent LU6612 PHY -sqphy* at mii? # Seeq 8022[013] PHYs -rlphy* at mii? # Realtek 8139 internal PHYs -tqphy* at mii? # TDK Semiconductor PHYs -brgphy* at mii? # Broadcom 10/100/1000 PHYs -bmtphy* at mii? # Broadcom 10/100 PHYs -eephy* at mii? # Marvell 88E1000 Gigabit PHYs -urlphy* at mii? # Realtek RTL8150L internal PHY -rgephy* at mii? # Realtek 8169S/8110S PHY -rlphy* at mii? # Realtek 8139 internal PHYs -ciphy* at mii? # Cicada CS8201 10/100/1000 copper PHY -ukphy* at mii? # generic unknown PHYs - -pseudo-device wsmux 2 -pseudo-device bio 1 -pseudo-device loop 1 -pseudo-device bpfilter 1 -pseudo-device rd 1 diff --git a/sys/arch/armish/conf/files.armish b/sys/arch/armish/conf/files.armish deleted file mode 100644 index 62a038a5bee..00000000000 --- a/sys/arch/armish/conf/files.armish +++ /dev/null @@ -1,82 +0,0 @@ -# $OpenBSD: files.armish,v 1.20 2016/05/02 08:15:55 patrick Exp $ - -maxpartitions 16 -maxusers 2 8 64 - -major {wd = 16} -major {sd = 24} -major {cd = 26} -major {rd = 18} - -file arch/arm/arm/conf.c -file arch/armish/armish/armish_machdep.c - -file arch/armish/armish/autoconf.c -file arch/arm/arm/disksubr.c disk - -include "scsi/files.scsi" - -# Use the generic ARM soft interrupt code. -file arch/arm/arm/softintr.c -file arch/arm/arm/irq_dispatch.S - -#file arch/armish/dev/iq80310_7seg.c -#file arch/armish/dev/iq80310_intr.c -#file arch/armish/dev/iq80310_timer.c - -# Machine-independent HID support -include "dev/hid/files.hid" - -include "dev/i2c/files.i2c" - -# ARM i80321 files -include "arch/arm/xscale/files.i80321" - -attach iopxs at fdt with iopxs_mainbus -file arch/armish/dev/i80321_mainbus.c iopxs_mainbus -file arch/armish/dev/pci_addr_fixup.c iopxs -file arch/armish/dev/iq80321_pci.c iopxs - -# IQ80310 on-board devices (including CPLD) -device obio {addr, [size = -1], [width = -1], [xint = -1]}: bus_space_generic -attach obio at fdt -file arch/armish/dev/obio.c obio -file arch/armish/dev/obio_space.c obio - -# on-board XR 16550 UARTs -attach com at obio with com_obio -file arch/armish/dev/com_obio.c com_obio - -# -# Machine-independent ATA drivers -# -include "dev/ata/files.ata" - -# Include WSCONS stuff -include "dev/wscons/files.wscons" -include "dev/wsfont/files.wsfont" -include "dev/rasops/files.rasops" - - -# Include USB stuff -include "dev/usb/files.usb" - -# Media Independent Interface (mii) -include "dev/mii/files.mii" - -# PCI -include "dev/pci/files.pci" -file arch/armish/dev/pciide_machdep.c pciide - -include "dev/atapiscsi/files.atapiscsi" - - -# -# Machine-independent GPIO drivers -# -include "dev/gpio/files.gpio" - -# -# Machine-independent 1-Wire drivers -# -include "dev/onewire/files.onewire" diff --git a/sys/arch/armish/dev/com_obio.c b/sys/arch/armish/dev/com_obio.c deleted file mode 100644 index 7ee71590d58..00000000000 --- a/sys/arch/armish/dev/com_obio.c +++ /dev/null @@ -1,105 +0,0 @@ -/* $OpenBSD: com_obio.c,v 1.5 2008/06/26 05:42:09 ray Exp $ */ -/* $NetBSD: com_obio.c,v 1.9 2005/12/11 12:17:09 christos Exp $ */ - -/*- - * Copyright (c) 2001 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Matt Thomas <matt@3am-software.com>. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/termios.h> - -#include <machine/bus.h> - -#include <arm/xscale/i80321var.h> -#include <armish/dev/obiovar.h> - -#include <dev/ic/comreg.h> -#include <dev/ic/comvar.h> - -struct com_obio_softc { - struct com_softc sc_com; - - void *sc_ih; -}; - -int com_obio_match(struct device *, void *, void *); -void com_obio_attach(struct device *, struct device *, void *); - -struct cfattach com_obio_ca = { - sizeof(struct com_obio_softc), com_obio_match, com_obio_attach -}; - -struct cfdriver com_obio_cd = { - NULL, "com_obio", DV_DULL -}; - -int com_irq_override = -1; - -int -com_obio_match(struct device *parent, void *cf, void *aux) -{ - struct obio_attach_args *oba = aux; - - /* if the irq does not match, do not attach */ - if (com_irq_override != -1) - oba->oba_irq = com_irq_override; - - /* We take it on faith that the device is there. */ - return (1); -} - - -void -com_obio_attach(struct device *parent, struct device *self, void *aux) -{ - struct obio_attach_args *oba = aux; - struct com_obio_softc *osc = (void *) self; - struct com_softc *sc = &osc->sc_com; - int error; - - sc->sc_iot = oba->oba_st; - sc->sc_iobase = oba->oba_addr; - sc->sc_frequency = COM_FREQ; -/* sc->sc_hwflags = COM_HW_NO_TXPRELOAD; */ - sc->sc_hwflags = 0; - error = bus_space_map(sc->sc_iot, oba->oba_addr, 8, 0, &sc->sc_ioh); - - if (error) { - printf(": failed to map registers: %d\n", error); - return; - } - - com_attach_subr(sc); - osc->sc_ih = i80321_intr_establish(oba->oba_irq, IPL_TTY, - comintr, sc, sc->sc_dev.dv_xname); - if (osc->sc_ih == NULL) - printf("%s: unable to establish interrupt at CPLD irq %d\n", - sc->sc_dev.dv_xname, oba->oba_irq); -} diff --git a/sys/arch/armish/dev/i80321_mainbus.c b/sys/arch/armish/dev/i80321_mainbus.c deleted file mode 100644 index 1004e79c96c..00000000000 --- a/sys/arch/armish/dev/i80321_mainbus.c +++ /dev/null @@ -1,481 +0,0 @@ -/* $OpenBSD: i80321_mainbus.c,v 1.11 2016/05/02 08:15:55 patrick Exp $ */ -/* $NetBSD: i80321_mainbus.c,v 1.16 2005/12/15 01:44:00 briggs Exp $ */ - -/* - * Copyright (c) 2001, 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -/* - * IQ80321 front-end for the i80321 I/O Processor. We take care - * of setting up the i80321 memory map, PCI interrupt routing, etc., - * which are all specific to the board the i80321 is wired up to. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/gpio.h> - -#include <machine/bus.h> - -#include <arm/mainbus/mainbus.h> -#include <armish/dev/iq80321reg.h> -#include <armish/dev/iq80321var.h> - -#include <arm/xscale/i80321reg.h> -#include <arm/xscale/i80321var.h> - -#include <dev/pci/pcireg.h> -#include <dev/pci/pcidevs.h> -#include <dev/gpio/gpiovar.h> - -#include "gpio.h" - -int i80321_mainbus_match(struct device *, void *, void *); -void i80321_mainbus_attach(struct device *, struct device *, void *); - -void i80321_gpio_init (struct i80321_softc *sc); -int i80321_gpio_pin_read (void *, int); -void i80321_gpio_pin_write (void *, int, int); -void i80321_gpio_pin_ctl (void *, int, int); - -/* XXX */ -#define I80219_REG_GPOE 0x7C4 -#define I80219_REG_GPID 0x7C8 -#define I80219_REG_GPOD 0x7CC - -struct cfattach iopxs_mainbus_ca = { - sizeof(struct i80321_softc), i80321_mainbus_match, - i80321_mainbus_attach -}; - -struct cfdriver iopxs_cd = { - NULL, "iopxs", DV_DULL -}; - - -/* There can be only one. */ -int i80321_mainbus_found; - -int -i80321_mainbus_match(struct device *parent, void *match, void *aux) -{ - union mainbus_attach_args *ma = aux; - struct cfdata *cf = match; - - if (i80321_mainbus_found) - return (0); - - if (strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0) - return (1); - - return (0); -} - -/* XXX */ -bus_space_handle_t sc_pld_sh; - -void -i80321_mainbus_attach(struct device *parent, struct device *self, void *aux) -{ - struct i80321_softc *sc = (void *) self; - struct gpiobus_attach_args gba; - pcireg_t b0u, b0l, b1u, b1l; - paddr_t memstart; - psize_t memsize; - pcireg_t atumembase; - pcireg_t atuiobase; - - i80321_mainbus_found = 1; - - /* - * Fill in the space tag for the i80321's own devices, - * and hand-craft the space handle for it (the device - * was mapped during early bootstrap). - */ - i80321_bs_init(&i80321_bs_tag, sc); - sc->sc_st = &i80321_bs_tag; - if (bus_space_map(sc->sc_st, VERDE_PMMR_BASE, VERDE_PMMR_SIZE, 0, - &sc->sc_sh)) - panic("%s: unable to map VERDE registers", sc->sc_dev.dv_xname); - - /* - * Slice off a subregion for the Memory Controller -- we need it - * here in order read the memory size. - */ - if (bus_space_subregion(sc->sc_st, sc->sc_sh, VERDE_MCU_BASE, - VERDE_MCU_SIZE, &sc->sc_mcu_sh)) - panic("%s: unable to subregion MCU registers", - sc->sc_dev.dv_xname); - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, VERDE_ATU_BASE, - VERDE_ATU_SIZE, &sc->sc_atu_sh)) - panic("%s: unable to subregion ATU registers", - sc->sc_dev.dv_xname); - - if(bus_space_map(sc->sc_st, VERDE_OUT_XLATE_IO_WIN0_BASE, - VERDE_OUT_XLATE_IO_WIN_SIZE, 0, &sc->sc_io_sh)) - panic("%s: unable to map IOW registers", sc->sc_dev.dv_xname); - -// printf ("PIRSR %x\n", bus_space_read_4(sc->sc_st, sc->sc_sh, ICU_PIRSR)); - -// printf("mapping bus io to %x - %x\n", sc->sc_io_sh, sc->sc_io_sh+VERDE_OUT_XLATE_IO_WIN_SIZE); - - /* - * Initialize the interrupt part of our PCI chipset tag. - */ - iq80321_pci_init(&sc->sc_pci_chipset, sc); - - /* Initialize the PCI chipset tag. */ - i80321_pci_init(&sc->sc_pci_chipset, sc); - - iq80321_pci_init2(&sc->sc_pci_chipset, sc); - - atumembase = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, - PCI_MAPREG_START + 0x08); - atuiobase = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, - ATU_OIOWTVR); - - sc->sc_membus_space.bus_base = PCI_MAPREG_MEM_ADDR(atumembase); - sc->sc_membus_space.bus_size = 0x04000000; - sc->sc_iobus_space.bus_base = PCI_MAPREG_IO_ADDR(atuiobase); - sc->sc_iobus_space.bus_size = 0x00010000; - pci_addr_fixup(sc, 2/*XXX*/); - - /* - * Check the configuration of the ATU to see if another BIOS - * has configured us. If a PC BIOS didn't configure us, then: - * IQ80321: BAR0 00000000.0000000c BAR1 is 00000000.8000000c. - * IQ31244: BAR0 00000000.00000004 BAR1 is 00000000.0000000c. - * If a BIOS has configured us, at least one of those should be - * different. This is pretty fragile, but it's not clear what - * would work better. - */ - b0l = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, PCI_MAPREG_START+0x0); - b0u = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, PCI_MAPREG_START+0x4); - b1l = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, PCI_MAPREG_START+0x8); - b1u = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, PCI_MAPREG_START+0xc); - b0l &= PCI_MAPREG_MEM_ADDR_MASK; - b0u &= PCI_MAPREG_MEM_ADDR_MASK; - b1l &= PCI_MAPREG_MEM_ADDR_MASK; - b1u &= PCI_MAPREG_MEM_ADDR_MASK; - - printf(": i80321 I/O Processor\n"); - - i80321_sdram_bounds(sc->sc_st, sc->sc_mcu_sh, &memstart, &memsize); - - /* - * We set up the Inbound Windows as follows: - * - * 0 Access to i80321 PMMRs - * - * 1 Reserve space for private devices - * - * 2 RAM access - * - * 3 Unused. - * - * This chunk needs to be customized for each IOP321 application. - */ - - atumembase = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, - PCI_MAPREG_START + 0x08); - - if (atumembase == 0x8000000c) { - /* iodata: intel std config */ - - /* map device registers */ - sc->sc_iwin[0].iwin_base_lo = 0x00000004; - sc->sc_iwin[0].iwin_base_hi = 0x00000000; - sc->sc_iwin[0].iwin_xlate = 0xff000000; - sc->sc_iwin[0].iwin_size = 0x01000000; - - /* Map PCI:Local 1:1. */ - sc->sc_iwin[1].iwin_base_lo = VERDE_OUT_XLATE_MEM_WIN0_BASE | - PCI_MAPREG_MEM_PREFETCHABLE_MASK | - PCI_MAPREG_MEM_TYPE_64BIT; - sc->sc_iwin[1].iwin_base_hi = 0; - - sc->sc_iwin[1].iwin_xlate = VERDE_OUT_XLATE_MEM_WIN0_BASE; - sc->sc_iwin[1].iwin_size = VERDE_OUT_XLATE_MEM_WIN_SIZE; - - - sc->sc_iwin[2].iwin_base_lo = memstart | - PCI_MAPREG_MEM_PREFETCHABLE_MASK | - PCI_MAPREG_MEM_TYPE_64BIT; - sc->sc_iwin[2].iwin_base_hi = 0; - - sc->sc_iwin[2].iwin_xlate = memstart; - sc->sc_iwin[2].iwin_size = memsize; - - sc->sc_iwin[3].iwin_base_lo = 0; -#if 0 - PCI_MAPREG_MEM_PREFETCHABLE_MASK | - PCI_MAPREG_MEM_TYPE_64BIT; -#endif - - sc->sc_iwin[3].iwin_base_hi = 0; - sc->sc_iwin[3].iwin_xlate = 0; - sc->sc_iwin[3].iwin_size = 0; - - /* - * We set up the Outbound Windows as follows: - * - * 0 Access to private PCI space. - * - * 1 Unused. - */ - sc->sc_owin[0].owin_xlate_lo = - PCI_MAPREG_MEM_ADDR(sc->sc_iwin[1].iwin_base_lo); - sc->sc_owin[0].owin_xlate_hi = sc->sc_iwin[1].iwin_base_hi; - - /* - * Set the Secondary Outbound I/O window to map - * to PCI address 0 for all 64K of the I/O space. - */ - sc->sc_ioout_xlate = 0x90000000; - sc->sc_ioout_xlate_offset = 0x1000; - } else if (atumembase == 0x40000004) { - /* thecus */ - - /* dont map device registers */ - sc->sc_iwin[0].iwin_base_lo = 0; - sc->sc_iwin[0].iwin_base_hi = 0; - sc->sc_iwin[0].iwin_xlate = 0; - sc->sc_iwin[0].iwin_size = 0; - - /* Map PCI:Local 1:1. */ - sc->sc_iwin[1].iwin_base_lo = 0x40000000 | - #if 0 - PCI_MAPREG_MEM_PREFETCHABLE_MASK | - PCI_MAPREG_MEM_TYPE_64BIT; - #else - 0; - #endif - sc->sc_iwin[1].iwin_base_hi = 0; - - sc->sc_iwin[1].iwin_xlate = 0; - sc->sc_iwin[1].iwin_size = 0x08000000; - - sc->sc_iwin[2].iwin_base_lo = 0 | - PCI_MAPREG_MEM_PREFETCHABLE_MASK | - PCI_MAPREG_MEM_TYPE_64BIT; - sc->sc_iwin[2].iwin_base_hi = 0; - - sc->sc_iwin[2].iwin_xlate = memstart; - sc->sc_iwin[2].iwin_size = memsize; - - sc->sc_iwin[3].iwin_base_lo = 0; - sc->sc_iwin[3].iwin_base_hi = 0; - sc->sc_iwin[3].iwin_xlate = 0; - sc->sc_iwin[3].iwin_size = 0; - - /* - * We set up the Outbound Windows as follows: - * - * 0 Access to private PCI space. - * - * 1 Unused. - */ - sc->sc_owin[0].owin_xlate_lo = - PCI_MAPREG_MEM_ADDR(sc->sc_iwin[1].iwin_base_lo); - sc->sc_owin[0].owin_xlate_hi = sc->sc_iwin[1].iwin_base_hi; - - /* - * Set the Secondary Outbound I/O window to map - * to PCI address 0 for all 64K of the I/O space. - */ - sc->sc_ioout_xlate = 0x90000000; - sc->sc_ioout_xlate_offset = 0x1000; - - } - - i80321_attach(sc); - - i80321_gpio_init (sc); - - /* if 80219 */ { - gba.gba_name = "gpio"; - gba.gba_gc = &sc->sc_gpio_gc; - gba.gba_pins = sc->sc_gpio_pins; - gba.gba_npins = I80219_GPIO_NPINS; -#if NGPIO > 0 - config_found(&sc->sc_dev, &gba, gpiobus_print); -#endif - } - { -#define I80321_PLD 0xfe8d0000UL -#define I80321_PLD_SIZE 0x1000 - -#define PLD_LED 0 -#define PLD_PLED 1 -#define PLD_BTN 2 -#define PLD_INTEN 3 -#define PLD_PWRMNG 4 - -#if 0 - uint8_t val; -#endif - - if (bus_space_map(sc->sc_st, I80321_PLD, I80321_PLD_SIZE, 0, - /* &sc->sc_pld_sh */ &sc_pld_sh)) - panic("%s: unable to map PLD registers", - sc->sc_dev.dv_xname); - -#if 0 - printf("dlectl %x\n", bus_space_read_1(sc->sc_st, sc_pld_sh, - PLD_LED)); - val = bus_space_read_1(sc->sc_st, sc_pld_sh, PLD_LED); - val |= 0x3; - bus_space_write_1(sc->sc_st, sc_pld_sh, PLD_LED, val); - printf("dlectl %x\n", bus_space_read_1(sc->sc_st, sc_pld_sh, - PLD_PLED)); - printf("dlectl %x\n", bus_space_read_1(sc->sc_st, sc_pld_sh, - PLD_BTN)); -#endif - } - { - extern struct cfdriver pcaled_cd; - void pcaled_gpio_pin_write(void *arg, int pin, int value); - if (pcaled_cd.cd_ndevs > 0 && pcaled_cd.cd_devs[0] != NULL) { - pcaled_gpio_pin_write(pcaled_cd.cd_devs[0], 13, 0); - pcaled_gpio_pin_write(pcaled_cd.cd_devs[0], 14, 0); - } - } -} - -void -i80321_gpio_init (struct i80321_softc *sc) -{ - int i; - for (i = 0; i < I80219_GPIO_NPINS; i++) { - sc->sc_gpio_pins[i].pin_num = i; - sc->sc_gpio_pins[i].pin_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; - - sc->sc_gpio_pins[i].pin_flags = - bus_space_read_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOE) & - (1 << i) ? GPIO_PIN_INPUT : GPIO_PIN_OUTPUT; - sc->sc_gpio_pins[i].pin_state = i80321_gpio_pin_read(sc, i) ? - GPIO_PIN_HIGH : GPIO_PIN_LOW; - } - sc->sc_gpio_gc.gp_cookie = sc; - sc->sc_gpio_gc.gp_pin_read = i80321_gpio_pin_read; - sc->sc_gpio_gc.gp_pin_write = i80321_gpio_pin_write; - sc->sc_gpio_gc.gp_pin_ctl = i80321_gpio_pin_ctl; -} - -int -i80321_gpio_pin_read (void *arg, int pin) -{ - struct i80321_softc *sc = arg; - u_int32_t regval; - int reg; - - if (bus_space_read_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOE) - & (1 << pin)) { - reg = I80219_REG_GPID; - } else { - reg = I80219_REG_GPOD; - } - regval = bus_space_read_4(sc->sc_st, sc->sc_sh, reg); -#if 0 - printf("read %x gpio %x\n", reg); - printf("gpio state %x %x %x\n", - bus_space_read_4(sc->sc_st, sc->sc_sh, I80219_REG_GPID), - bus_space_read_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOD), - bus_space_read_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOE)); -#endif - return ((regval >> pin) & 1); -} - -void -i80321_gpio_pin_write (void *arg, int pin, int value) -{ - struct i80321_softc *sc = arg; - u_int32_t regval; - - regval = bus_space_read_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOD); - regval = (regval & ~(1 << pin)) | ((value & 1) << pin); -#if 0 - printf("writing %x to gpioO %x\n", regval); -#endif - bus_space_write_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOD, regval); -} -void -i80321_gpio_pin_ctl (void *arg, int pin, int flags) -{ - struct i80321_softc *sc = arg; - u_int32_t regval; - int value = (flags == GPIO_PIN_INPUT) ? 1 : 0; - - regval = bus_space_read_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOE); - regval = (regval & ~(1 << pin)) | ((value & 1) << pin); -#if 0 - printf("writing %x to ctl %x\n", regval, value); -#endif - bus_space_write_4(sc->sc_st, sc->sc_sh, I80219_REG_GPOE, regval); -} - - -void board_reset(void); /* XXX */ -void -board_reset() -{ - struct i80321_softc *sc = i80321_softc; - uint32_t val; - - printf("attempting reset\n"); - val = bus_space_read_4(sc->sc_st, sc->sc_sh, 0x7CC); - val &= ~0x10; - bus_space_write_4(sc->sc_st, sc->sc_sh, 0x7CC, val); - val = bus_space_read_4(sc->sc_st, sc->sc_sh, 0x7C4); - val &= ~0x10; - bus_space_write_4(sc->sc_st, sc->sc_sh, 0x7C4, val); - - bus_space_write_1(sc->sc_st, sc_pld_sh, PLD_PWRMNG, 0x2); - -} - -void board_powerdown(void); /* XXX */ -void -board_powerdown(void) -{ - void pcaled_gpio_pin_write(void *arg, int pin, int value); - extern struct cfdriver pcaled_cd; - - if (pcaled_cd.cd_ndevs > 0 && pcaled_cd.cd_devs[0] != NULL) { - pcaled_gpio_pin_write(pcaled_cd.cd_devs[0], 8, 1); - delay(500000); - } -} diff --git a/sys/arch/armish/dev/iq80321_pci.c b/sys/arch/armish/dev/iq80321_pci.c deleted file mode 100644 index aa6bdecad72..00000000000 --- a/sys/arch/armish/dev/iq80321_pci.c +++ /dev/null @@ -1,282 +0,0 @@ -/* $OpenBSD: iq80321_pci.c,v 1.11 2014/05/08 21:17:01 miod Exp $ */ -/* $NetBSD: iq80321_pci.c,v 1.5 2005/12/11 12:17:09 christos Exp $ */ - -/* - * Copyright (c) 2001, 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -/* - * IQ80321 PCI interrupt support. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> - -#include <machine/bus.h> - -#include <armish/dev/iq80321reg.h> -#include <armish/dev/iq80321var.h> - -#include <arm/xscale/i80321reg.h> -#include <arm/xscale/i80321var.h> - -#include <dev/pci/pcidevs.h> -#include <dev/pci/ppbreg.h> - -int iq80321_pci_intr_map(struct pci_attach_args *, pci_intr_handle_t *); -const char *iq80321_pci_intr_string(void *, pci_intr_handle_t); -void *iq80321_pci_intr_establish(void *, pci_intr_handle_t, - int, int (*func)(void *), void *, const char *); -void iq80321_pci_intr_disestablish(void *, void *); - -struct irq_map { - uint8_t dev; - uint8_t intrpin; - uint8_t irq; -}; - - -struct pci_id_list { - uint8_t bus; - uint8_t dev; - pci_vendor_id_t vend; - pci_product_id_t prod; -}; - -struct board_id { - char *name; - struct irq_map *irq_map; - struct pci_id_list list[]; -}; - -struct irq_map *iq80321_irq_map; - -struct irq_map iq80321_thecus_irq_map[] = { - { 1, 1, ICU_INT_XINT(0) }, /* thecus re0 27 */ - { 2, 1, ICU_INT_XINT(3) }, /* thecus re1 30 */ - { 3, 1, ICU_INT_XINT(2) }, /* thecus sata 29 */ - { 4, 1, ICU_INT_XINT(0) }, /* thecus uhci0 27 ??? */ - { 4, 2, ICU_INT_XINT(0) }, /* thecus uhci1 27 */ - { 4, 3, ICU_INT_XINT(2) }, /* thecus ehci0 29 */ - { 5, 1, ICU_INT_XINT(3) }, /* thecus minipci slot */ - { 0, 0, 255} -}; - -struct irq_map iq80321_hdlg_irq_map[] = { - { 1, 1, ICU_INT_XINT(0) }, /* em0 27 */ - { 2, 1, ICU_INT_XINT(1) }, /* wdc0 28 */ - { 3, 1, ICU_INT_XINT(2) }, /* ochi0 29 */ - { 3, 2, ICU_INT_XINT(2) }, /* ochi0 29 */ - { 3, 3, ICU_INT_XINT(2) }, /* echi0 29 */ - { 0, 0, 255} -}; -struct irq_map certance_irq_map[] = { - { 0, 1, ICU_INT_XINT(0) }, /* em0 27 */ - { 0, 2, ICU_INT_XINT(0) }, /* em0 27 */ - { 1, 1, ICU_INT_XINT(1) }, /* sata 28 */ -#if 0 - { 2, 1, ICU_INT_XINT(0) }, /* scsi 29 */ -#endif - { 2, 2, ICU_INT_XINT(3) }, /* scsi 30 */ - { 0, 0, 255} -}; -struct board_id thecus = { - "Thecus Nx100", - iq80321_thecus_irq_map, - { - { 0, 1, PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169 }, - /* fill in the rest of the devices */ - { 0, 0, 0, 0 } - } -}; -struct board_id iodata = { - "I/O Data HDL-G", - iq80321_hdlg_irq_map, - { - { 0, 1, PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82541GI }, - /* fill in the rest of the devices */ - { 0, 0, 0, 0 } - } -}; -struct board_id certance = { - "Certance CP3100", - certance_irq_map, - { - { 0, 0, PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82546EB_COPPER }, - { 0, 1, PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_31244 }, - { 0, 2, PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_1010_2 }, - /* fill in the rest of the devices */ - { 0, 0, 0, 0 } - } -}; - -struct board_id *systems[] = { - &thecus, - &iodata, - &certance, - NULL -}; - -void -iq80321_pci_init(pci_chipset_tag_t pc, void *cookie) -{ - pc->pc_intr_v = cookie; /* the i80321 softc */ - pc->pc_intr_map = iq80321_pci_intr_map; - pc->pc_intr_string = iq80321_pci_intr_string; - pc->pc_intr_establish = iq80321_pci_intr_establish; - pc->pc_intr_disestablish = iq80321_pci_intr_disestablish; - -} -void -iq80321_pci_init2(pci_chipset_tag_t pc, void *cookie) -{ - pcitag_t tag; - int i, j; - struct board_id *sys; - u_int32_t reg; - - - for (i = 0; systems[i] != NULL; i++) { - sys = systems[i]; - for (j = 0; sys->list[j].vend != 0; j++) { - tag = pci_make_tag(pc, sys->list[j].bus, - sys->list[j].dev, 0); - reg = pci_conf_read(pc, tag, 0 /* ID */); -#ifdef PROBE_NEW_BOARD - printf("read %x expected %x\n", reg, - (sys->list[j].vend | sys->list[j].prod << 16)); -#endif - if ((sys->list[j].vend | sys->list[j].prod << 16) != - reg){ - sys = NULL; - break; - } - } - if (sys != NULL) - break; - } - if (sys == NULL) { - printf("board id failed\n"); -#ifdef PROBE_NEW_BOARD - for (i = 0; i < 16; i++) { - tag = pci_make_tag(pc, 0, i, 0); - printf("bus 0, dev %d: %x\n", i, - pci_conf_read(pc, tag, 0 /* ID */)); - } -#endif - } else - printf(": %s", sys->name); - iq80321_irq_map = sys->irq_map; - - /* XXX */ - if (sys == &thecus) { - /* - * thecus com irq appears to not be attached, override - * it's irq here, it is tied to the tick timer, irq9 - * - yes this is a hack. - */ - extern int com_irq_override; - com_irq_override = 28; - } -} - -int -iq80321_pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp) -{ - struct i80321_softc *sc = pa->pa_pc->pc_intr_v; - pci_chipset_tag_t pc = pa->pa_pc; - pcitag_t tag = pa->pa_intrtag; - int i; - - int b, d, f; - uint32_t busno; - uint32_t intr; - - busno = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, ATU_PCIXSR); - busno = PCIXSR_BUSNO(busno); - if (busno == 0xff) - busno = 0; - - pci_decompose_tag(pc, tag, &b, &d, &f); - - /* No mappings for devices not on our bus. */ - if (b != busno) - goto no_mapping; - - for (i = 0; iq80321_irq_map[i].irq != 255; i++) { - if (d == iq80321_irq_map[i].dev && - pa->pa_intrpin == iq80321_irq_map[i].intrpin) { - *ihp = iq80321_irq_map[i].irq; - intr = pci_conf_read(pa->pa_pc, pa->pa_intrtag, - PCI_INTERRUPT_REG); - intr = (intr & ~0xff) | iq80321_irq_map[i].irq; - pci_conf_write(pa->pa_pc, pa->pa_intrtag, - PCI_INTERRUPT_REG, intr); - return (0); - } - } - - no_mapping: - intr = pci_conf_read(pa->pa_pc, pa->pa_intrtag, - PCI_INTERRUPT_REG); - - printf("iq80321_pci_intr_map: no mapping for %d/%d/%d (%d, %d, %d)\n", - pa->pa_bus, pa->pa_device, pa->pa_function, d, pa->pa_intrpin, intr); - return (1); -} - -const char * -iq80321_pci_intr_string(void *v, pci_intr_handle_t ih) -{ - static char irqname[32]; - - snprintf(irqname, sizeof irqname, "irq %ld", ih); - return (irqname); -} - -void * -iq80321_pci_intr_establish(void *v, pci_intr_handle_t ih, int ipl, - int (*func)(void *), void *arg, const char *name) -{ - - return (i80321_intr_establish(ih, ipl, func, arg, name)); -} - -void -iq80321_pci_intr_disestablish(void *v, void *cookie) -{ - - i80321_intr_disestablish(cookie); -} diff --git a/sys/arch/armish/dev/iq80321reg.h b/sys/arch/armish/dev/iq80321reg.h deleted file mode 100644 index aa20409e3d8..00000000000 --- a/sys/arch/armish/dev/iq80321reg.h +++ /dev/null @@ -1,108 +0,0 @@ -/* $OpenBSD: iq80321reg.h,v 1.2 2006/05/29 17:30:26 drahn Exp $ */ -/* $NetBSD: iq80321reg.h,v 1.4 2003/05/14 19:46:39 thorpej Exp $ */ - -/* - * Copyright (c) 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _IQ80321REG_H_ -#define _IQ80321REG_H_ - -/* - * Memory map and register definitions for the Intel IQ80321 - * Evaluation Board. - */ - -/* - * The memory map of the IQ80321 looks like so: - * - * ------------------------------ - * Intel 80321 IOP Reserved - * FFFF E900 ------------------------------ - * Peripheral Memory Mapped - * Registers - * FFFF E000 ------------------------------ - * On-board devices - * FE80 0000 ------------------------------ - * SDRAM - * A000 0000 ------------------------------ - * Reserved - * 9100 0000 ------------------------------ - * Flash - * 9080 0000 ------------------------------ - * Reserved - * 9002 0000 ------------------------------ - * ATU Outbound Transaction - * Windows - * 8000 0000 ------------------------------ - * ATU Outbound Direct - * Addressing Windows - * 0000 1000 ------------------------------ - * Initialization Boot Code - * from Flash - * 0000 0000 ------------------------------ - */ - -/* - * We allocate a page table for VA 0xfe400000 (4MB) and map the - * PCI I/O space (64K) and i80321 memory-mapped registers (4K) there. - */ -#if 0 -#define IQ80321_IOPXS_VBASE 0xfe400000UL -#define IQ80321_IOW_VBASE IQ80321_IOPXS_VBASE -#define IQ80321_80321_VBASE (IQ80321_IOW_VBASE + \ - VERDE_OUT_XLATE_IO_WIN_SIZE) -#endif - -/* - * The IQ80321 on-board devices are mapped VA==PA during bootstrap. - * Conveniently, the size of the on-board register space is 1 section - * mapping. - */ -#define IQ80321_OBIO_BASE 0xfe800000UL -#define IQ80321_OBIO_SIZE 0x00100000UL /* 1MB */ - -#define IQ80321_UART1 0xfe800000UL /* TI 16550 */ - -#define IQ80321_7SEG_MSB 0xfe840000UL -#define IQ80321_7SEG_LSB 0xfe850000UL - -#define IQ80321_ROT_SWITCH 0xfe8d0000UL - -#define IQ80321_BATTERY_STAT 0xfe8f0000UL -#define BATTERY_STAT_PRES (1U << 0) -#define BATTERY_STAT_CHRG (1U << 1) -#define BATTERY_STAT_DISCHRG (1U << 2) - -#endif /* _IQ80321REG_H_ */ diff --git a/sys/arch/armish/dev/iq80321var.h b/sys/arch/armish/dev/iq80321var.h deleted file mode 100644 index a45ef56f40b..00000000000 --- a/sys/arch/armish/dev/iq80321var.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $OpenBSD: iq80321var.h,v 1.3 2006/05/31 05:49:54 drahn Exp $ */ -/* $NetBSD: iq80321var.h,v 1.1 2002/03/27 21:51:30 thorpej Exp $ */ - -/* - * Copyright (c) 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _IQ80321_IQ80321VAR_H_ -#define _IQ80321_IQ80321VAR_H_ - -#include <dev/pci/pcivar.h> - -void iq80321_7seg(char, char); -void iq80321_7seg_snake(void); - -void iq80321_pci_init(pci_chipset_tag_t, void *); -void iq80321_pci_init2(pci_chipset_tag_t, void *); -void save_ref(void); -void check_ref(void); - -void pci_addr_fixup(void *, int maxbus); - -#endif /* _IQ80321_IQ80321VAR_H_ */ diff --git a/sys/arch/armish/dev/obio.c b/sys/arch/armish/dev/obio.c deleted file mode 100644 index c5186aaab93..00000000000 --- a/sys/arch/armish/dev/obio.c +++ /dev/null @@ -1,138 +0,0 @@ -/* $OpenBSD: obio.c,v 1.4 2016/05/02 08:15:55 patrick Exp $ */ -/* $NetBSD: obio.c,v 1.14 2005/12/11 12:17:09 christos Exp $ */ - -/* - * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -/* - * On-board device autoconfiguration support for Intel IQ80321 - * evaluation boards. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> - -#include <machine/bus.h> - -#include <arm/mainbus/mainbus.h> -#include <arm/xscale/i80321reg.h> -#include <armish/dev/iq80321reg.h> -#include <armish/dev/iq80321var.h> -#include <armish/dev/obiovar.h> - -int obio_match(struct device *, void *, void *); -void obio_attach(struct device *, struct device *, void *); - -struct cfattach obio_ca = { - sizeof(struct device), obio_match, obio_attach -}; - -struct cfdriver obio_cd = { - NULL, "obio", DV_DULL -}; - -int obio_print(void *, const char *); -int obio_search(struct device *, void *, void *); - -/* there can be only one */ -int obio_found; - -int -obio_match(struct device *parent, void *match, void *aux) -{ - union mainbus_attach_args *ma = aux; - struct cfdata *cf = match; - - if (obio_found) - return (0); - - if (strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0) - return (1); - - return (0); -} - -void -obio_attach(struct device *parent, struct device *self, void *aux) -{ - struct device *sc = self; - - - obio_found = 1; - - printf("\n"); - - /* - * Attach all the on-board devices as described in the kernel - * configuration file. - */ - config_search(obio_search, self, sc); -} - -int -obio_print(void *aux, const char *pnp) -{ - struct obio_attach_args *oba = aux; - - printf(" addr 0x%08lx", oba->oba_addr); - - if (oba->oba_irq != -1) - printf(" intr %d", oba->oba_irq); - - - return (UNCONF); -} - -int -obio_search(struct device *parent, void *v, void *aux) -{ - struct obio_attach_args oba; - struct cfdata *cf = v; - - oba.oba_st = &obio_bs_tag; - oba.oba_addr = cf->cf_loc[0]; - oba.oba_size = cf->cf_loc[1]; - oba.oba_width = cf->cf_loc[2]; - if (cf->cf_loc[3] != -1) - oba.oba_irq = ICU_INT_XINT(cf->cf_loc[3]); - else - oba.oba_irq = -1; - - config_found(parent, &oba, obio_print); - - - return (0); -} diff --git a/sys/arch/armish/dev/obio_space.c b/sys/arch/armish/dev/obio_space.c deleted file mode 100644 index 8b5f5541516..00000000000 --- a/sys/arch/armish/dev/obio_space.c +++ /dev/null @@ -1,231 +0,0 @@ -/* $OpenBSD: obio_space.c,v 1.3 2014/11/16 12:30:56 deraadt Exp $ */ -/* $NetBSD: obio_space.c,v 1.9 2005/11/24 13:08:33 yamt Exp $ */ - - -/* - * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -/* - * bus_space functions for IQ80321 on-board devices - */ - -#include <sys/param.h> -#include <sys/systm.h> - -#include <uvm/uvm_extern.h> - -#include <machine/bus.h> - -/* Prototypes for all the bus_space structure functions */ -bs_protos(obio); -bs_protos(generic); -bs_protos(generic_armv4); -bs_protos(bs_notimpl); - -/* - * The obio bus space tag. This is constant for all instances, so - * we never have to explicitly "create" it. - */ -struct bus_space obio_bs_tag = { - /* cookie */ - (void *) 0, - - /* mapping/unmapping */ - obio_bs_map, - obio_bs_unmap, - obio_bs_subregion, - - /* allocation/deallocation */ - obio_bs_alloc, - obio_bs_free, - - /* get kernel virtual address */ - obio_bs_vaddr, - - /* mmap */ - bs_notimpl_bs_mmap, - - /* barrier */ - obio_bs_barrier, - - /* read (single) */ - generic_bs_r_1, - generic_armv4_bs_r_2, - generic_bs_r_4, - bs_notimpl_bs_r_8, - - /* read multiple */ - generic_bs_rm_1, - generic_armv4_bs_rm_2, - bs_notimpl_bs_rm_4, - bs_notimpl_bs_rm_8, - - /* read region */ - generic_bs_rr_1, - bs_notimpl_bs_rr_2, - bs_notimpl_bs_rr_4, - bs_notimpl_bs_rr_8, - - /* write (single) */ - generic_bs_w_1, - generic_armv4_bs_w_2, - generic_bs_w_4, - bs_notimpl_bs_w_8, - - /* write multiple */ - generic_bs_wm_1, - generic_armv4_bs_wm_2, - bs_notimpl_bs_wm_4, - bs_notimpl_bs_wm_8, - - /* write region */ - bs_notimpl_bs_wr_1, - bs_notimpl_bs_wr_2, - bs_notimpl_bs_wr_4, - bs_notimpl_bs_wr_8, - - /* set multiple */ - bs_notimpl_bs_sm_1, - bs_notimpl_bs_sm_2, - bs_notimpl_bs_sm_4, - bs_notimpl_bs_sm_8, - - /* set region */ - bs_notimpl_bs_sr_1, - bs_notimpl_bs_sr_2, - bs_notimpl_bs_sr_4, - bs_notimpl_bs_sr_8, - - /* copy */ - bs_notimpl_bs_c_1, - bs_notimpl_bs_c_2, - bs_notimpl_bs_c_4, - bs_notimpl_bs_c_8, -}; - -int -obio_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flag, - bus_space_handle_t *bshp) -{ - const struct pmap_devmap *pd; - paddr_t startpa, endpa, pa; - vaddr_t va; - pt_entry_t *pte; - - if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { - /* Device was statically mapped. */ - *bshp = pd->pd_va + (bpa - pd->pd_pa); - return (0); - } - - endpa = round_page(bpa + size); - startpa = trunc_page(bpa); - - va = uvm_km_valloc(kernel_map, endpa - startpa); - if (va == 0) - return(ENOMEM); - - *bshp = (bus_space_handle_t)(va + (bpa - startpa)); - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter_pa(va, pa, PROT_READ | PROT_WRITE); - if ((flag & BUS_SPACE_MAP_CACHEABLE) == 0) { - pte = vtopte(va); - *pte &= ~L2_S_CACHE_MASK; - PTE_SYNC(pte); - } - } - pmap_update(pmap_kernel()); - - return (0); -} - -int -obio_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, - bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *bpap, - bus_space_handle_t *bshp) -{ - - panic("obio_bs_alloc(): not implemented"); -} - - -void -obio_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - vaddr_t va, endva; - - if (pmap_devmap_find_va(bsh, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - endva = round_page(bsh + size); - va = trunc_page(bsh); - - pmap_kremove(va, endva - va); - uvm_km_free(kernel_map, va, endva - va); -} - -void -obio_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - - panic("obio_bs_free(): not implemented"); -} - -int -obio_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t size, bus_space_handle_t *nbshp) -{ - - *nbshp = bsh + offset; - return (0); -} - -void * -obio_bs_vaddr(void *t, bus_space_handle_t bsh) -{ - - return ((void *)bsh); -} - -void -obio_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - - /* Nothing to do. */ -} diff --git a/sys/arch/armish/dev/obiovar.h b/sys/arch/armish/dev/obiovar.h deleted file mode 100644 index 7308c225906..00000000000 --- a/sys/arch/armish/dev/obiovar.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: obiovar.h,v 1.2 2006/05/29 17:30:26 drahn Exp $ */ -/* $NetBSD: obiovar.h,v 1.4 2003/06/16 17:40:53 thorpej Exp $ */ - -/* - * Copyright (c) 2002, 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _IQ80321_OBIOVAR_H_ -#define _IQ80321_OBIOVAR_H_ - -struct obio_attach_args { - bus_space_tag_t oba_st; /* bus space tag */ - bus_addr_t oba_addr; /* address of device */ - bus_size_t oba_size; /* size of device */ - int oba_width; /* bus width */ - int oba_irq; /* XINT interrupt bit # */ -}; - -extern struct bus_space obio_bs_tag; - -#endif /* _IQ80321_OBIOVAR_H_ */ diff --git a/sys/arch/armish/dev/pci_addr_fixup.c b/sys/arch/armish/dev/pci_addr_fixup.c deleted file mode 100644 index 945e909f933..00000000000 --- a/sys/arch/armish/dev/pci_addr_fixup.c +++ /dev/null @@ -1,472 +0,0 @@ -/* $OpenBSD: pci_addr_fixup.c,v 1.5 2006/07/17 16:59:53 drahn Exp $ */ -/* $NetBSD: pci_addr_fixup.c,v 1.7 2000/08/03 20:10:45 nathanw Exp $ */ - -/*- - * Copyright (c) 2000 UCHIYAMA Yasushi. 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/malloc.h> -#include <sys/kernel.h> -#include <sys/device.h> -#include <sys/extent.h> - -#include <uvm/uvm_param.h> -#include <machine/bus.h> - -#include <dev/pci/pcireg.h> -#include <dev/pci/pcivar.h> -#include <dev/pci/pcidevs.h> - -#include <arm/xscale/i80321var.h> -#include <armish/dev/iq80321var.h> - -typedef int (*pciaddr_resource_manage_func_t)(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t, int, struct extent *, int, bus_addr_t *, - bus_size_t); -void pciaddr_resource_manage(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t, pciaddr_resource_manage_func_t); -void pciaddr_resource_reserve(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t); -void pciaddr_resource_reserve_disabled(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t); -int pciaddr_do_resource_reserve(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t, int, struct extent *, int, - bus_addr_t *, bus_size_t); -int pciaddr_do_resource_reserve_disabled(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t, int, struct extent *, int, - bus_addr_t *, bus_size_t); -void pciaddr_resource_allocate(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t); -int pciaddr_do_resource_allocate(struct i80321_softc *, - pci_chipset_tag_t, pcitag_t, int, struct extent *, int, bus_addr_t *, - bus_size_t); -bus_addr_t pciaddr_ioaddr(u_int32_t); -void pciaddr_print_devid(pci_chipset_tag_t, pcitag_t); - -int pciaddr_device_is_agp(pci_chipset_tag_t, pcitag_t); - -void pci_device_foreach(struct i80321_softc *sc, pci_chipset_tag_t pc, - int maxbus, - void (*func)(struct i80321_softc *, pci_chipset_tag_t, pcitag_t)); - -#define PCIADDR_MEM_START 0x0 -#define PCIADDR_MEM_END 0xffffffff -#define PCIADDR_PORT_START 0x0 -#define PCIADDR_PORT_END 0xffff - -int pcibr_flags = 0; -#define PCIBR_VERBOSE 1 -#define PCIBR_ADDR_FIXUP 2 - -#define PCIBIOS_PRINTV(x) if (pcibr_flags & PCIBR_VERBOSE) \ - printf x - -void -pci_addr_fixup(void *v, int maxbus) -{ - struct i80321_softc *sc = v; - - const char *verbose_header = - "[%s]-----------------------\n" - " device vendor product\n" - " register space address size\n" - "--------------------------------------------\n"; - const char *verbose_footer = - "--------------------------[%3d devices bogus]\n"; - - sc->extent_mem = extent_create("PCI I/O memory space", - sc->sc_membus_space.bus_base, - sc->sc_membus_space.bus_base + sc->sc_membus_space.bus_size, - M_DEVBUF, 0, 0, EX_NOWAIT); - KASSERT(sc->extent_mem); - sc->extent_port = extent_create("PCI I/O port space", - sc->sc_iobus_space.bus_base, - sc->sc_iobus_space.bus_base + sc->sc_iobus_space.bus_size, - M_DEVBUF, 0, 0, EX_NOWAIT); - KASSERT(sc->extent_port); - - /* - * 1. check & reserve system BIOS setting. - */ - PCIBIOS_PRINTV((verbose_header, "System BIOS Setting")); - pci_device_foreach(sc, &sc->sc_pci_chipset, maxbus, - pciaddr_resource_reserve); - pci_device_foreach(sc, &sc->sc_pci_chipset, maxbus, - pciaddr_resource_reserve_disabled); - PCIBIOS_PRINTV((verbose_footer, sc->nbogus)); - - { - struct extent_region *rp; - struct extent *ex = sc->extent_mem; - for (rp = LIST_FIRST(&ex->ex_regions); - rp; rp = LIST_NEXT(rp, er_link)) { - } - } - { - struct extent_region *rp; - struct extent *ex = sc->extent_port; - for (rp = LIST_FIRST(&ex->ex_regions); - rp; rp = LIST_NEXT(rp, er_link)) { - } - } - - /* - * 4. do fixup - */ - PCIBIOS_PRINTV((verbose_header, "PCIBIOS fixup stage")); - sc->nbogus = 0; - pci_device_foreach(sc, &sc->sc_pci_chipset, maxbus, - pciaddr_resource_allocate); - PCIBIOS_PRINTV((verbose_footer, sc->nbogus)); - -} - -void -pciaddr_resource_reserve(struct i80321_softc *sc, pci_chipset_tag_t pc, - pcitag_t tag) -{ - if (pcibr_flags & PCIBR_VERBOSE) - pciaddr_print_devid(pc, tag); - pciaddr_resource_manage(sc, pc, tag, pciaddr_do_resource_reserve); -} -void -pciaddr_resource_reserve_disabled(struct i80321_softc *sc, - pci_chipset_tag_t pc, pcitag_t tag) -{ - if (pcibr_flags & PCIBR_VERBOSE) - pciaddr_print_devid(pc, tag); - pciaddr_resource_manage(sc, pc, tag, - pciaddr_do_resource_reserve_disabled); -} - - -void -pciaddr_resource_allocate(struct i80321_softc *sc, pci_chipset_tag_t pc, - pcitag_t tag) -{ - if (pcibr_flags & PCIBR_VERBOSE) - pciaddr_print_devid(pc, tag); - pciaddr_resource_manage(sc, pc, tag, pciaddr_do_resource_allocate); -} - -void -pciaddr_resource_manage(struct i80321_softc *sc, pci_chipset_tag_t pc, - pcitag_t tag, pciaddr_resource_manage_func_t func) -{ - struct extent *ex; - pcireg_t val, mask; - bus_addr_t addr; - bus_size_t size; - int error, mapreg, type, reg_start, reg_end, width; - - val = pci_conf_read(pc, tag, PCI_BHLC_REG); - switch (PCI_HDRTYPE_TYPE(val)) { - default: - printf("WARNING: unknown PCI device header.\n"); - sc->nbogus++; - return; - case 0: - reg_start = PCI_MAPREG_START; - reg_end = PCI_MAPREG_END; - break; - case 1: /* PCI-PCI bridge */ - reg_start = PCI_MAPREG_START; - reg_end = PCI_MAPREG_PPB_END; - break; - case 2: /* PCI-CardBus bridge */ - reg_start = PCI_MAPREG_START; - reg_end = PCI_MAPREG_PCB_END; - break; - } - error = 0; - - for (mapreg = reg_start; mapreg < reg_end; mapreg += width) { - /* inquire PCI device bus space requirement */ - val = pci_conf_read(pc, tag, mapreg); - pci_conf_write(pc, tag, mapreg, ~0); - - mask = pci_conf_read(pc, tag, mapreg); - pci_conf_write(pc, tag, mapreg, val); - - type = PCI_MAPREG_TYPE(val); - width = 4; - if (type == PCI_MAPREG_TYPE_MEM) { - if (PCI_MAPREG_MEM_TYPE(val) == - PCI_MAPREG_MEM_TYPE_64BIT) { - /* XXX We could examine the upper 32 bits - * XXX of the BAR here, but we are totally - * XXX unprepared to handle a non-zero value, - * XXX either here or anywhere else in - * XXX i386-land. - * XXX So just arrange to not look at the - * XXX upper 32 bits, lest we misinterpret - * XXX it as a 32-bit BAR set to zero. - */ - width = 8; - } - addr = PCI_MAPREG_MEM_ADDR(val); - size = PCI_MAPREG_MEM_SIZE(mask); - ex = sc->extent_mem; - } else { - /* XXX some devices give 32bit value */ - if (sc->sc_iobus_space.bus_base != PCIADDR_PORT_START) { - /* - * if the bus base is not 0 skew all addresses - */ - val &= PCIADDR_PORT_END; - val |= sc->sc_iobus_space.bus_base; - pci_conf_write(pc, tag, mapreg, val); - } - addr = PCI_MAPREG_IO_ADDR(val); - size = PCI_MAPREG_IO_SIZE(mask); - ex = sc->extent_port; - } - - if (!size) /* unused register */ - continue; - - /* reservation/allocation phase */ - error += (*func) (sc, pc, tag, mapreg, ex, type, &addr, size); - - PCIBIOS_PRINTV(("\t%02xh %s 0x%08x 0x%08x\n", - mapreg, type ? "port" : "mem ", - (unsigned int)addr, (unsigned int)size)); - } - - if (error) - sc->nbogus++; - - PCIBIOS_PRINTV(("\t\t[%s]\n", error ? "NG" : "OK")); -} - -int -pciaddr_do_resource_allocate(struct i80321_softc *sc, pci_chipset_tag_t pc, - pcitag_t tag, int mapreg, struct extent *ex, int type, bus_addr_t *addr, - bus_size_t size) -{ - bus_addr_t start; - int error; - - if (type == PCI_MAPREG_TYPE_IO) { - if ((*addr & PCIADDR_PORT_END) != 0) - return (0); - } else if (*addr) /* no need to allocate */ - return (0); - - /* XXX Don't allocate if device is AGP device to avoid conflict. */ - if (pciaddr_device_is_agp(pc, tag)) - return (0); - - start = (type == PCI_MAPREG_TYPE_MEM ? sc->sc_membus_space.bus_base - : sc->sc_iobus_space.bus_base); - if (start < ex->ex_start || start + size - 1 >= ex->ex_end) { - PCIBIOS_PRINTV(("No available resources. fixup failed\n")); - return (1); - } - error = extent_alloc_subregion(ex, start, ex->ex_end, size, size, 0, 0, - EX_FAST|EX_NOWAIT|EX_MALLOCOK, addr); - if (error) { - PCIBIOS_PRINTV(("No available resources. fixup failed\n")); - return (1); - } - - /* write new address to PCI device configuration header */ - pci_conf_write(pc, tag, mapreg, *addr); - /* check */ - if (pcibr_flags & PCIBR_VERBOSE) { - printf("pci_addr_fixup: "); - pciaddr_print_devid(pc, tag); - } - - if (pciaddr_ioaddr(pci_conf_read(pc, tag, mapreg)) != *addr) { - pci_conf_write(pc, tag, mapreg, 0); /* clear */ - printf("fixup failed. (new address=%#lx)\n", *addr); - return (1); - } - if (pcibr_flags & PCIBR_VERBOSE) - printf("new address 0x%08lx\n", *addr); - - return (0); -} - -int -pciaddr_do_resource_reserve(struct i80321_softc *sc, pci_chipset_tag_t pc, - pcitag_t tag, int mapreg, struct extent *ex, int type, bus_addr_t *addr, - bus_size_t size) -{ - pcireg_t val; - int error; - - if ((type == PCI_MAPREG_TYPE_IO) && ((*addr & PCIADDR_PORT_END) == 0)) - return (0); - if (*addr == 0) - return (0); - - val = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); - if (type == PCI_MAPREG_TYPE_MEM && - (val & PCI_COMMAND_MEM_ENABLE) != PCI_COMMAND_MEM_ENABLE) - return (0); - if (type == PCI_MAPREG_TYPE_IO && - (val & PCI_COMMAND_IO_ENABLE) != PCI_COMMAND_IO_ENABLE) - return (0); - - error = extent_alloc_region(ex, *addr, size, EX_NOWAIT | EX_MALLOCOK); - if (error) { - PCIBIOS_PRINTV(("Resource conflict.\n")); - pci_conf_write(pc, tag, mapreg, 0); /* clear */ - return (1); - } - - return (0); -} - -int -pciaddr_do_resource_reserve_disabled(struct i80321_softc *sc, - pci_chipset_tag_t pc, pcitag_t tag, int mapreg, struct extent *ex, - int type, bus_addr_t *addr, bus_size_t size) -{ - pcireg_t val; - int error; - - if ((type == PCI_MAPREG_TYPE_IO) && ((*addr & PCIADDR_PORT_END) == 0)) - return (0); - if (*addr == 0) - return (0); - - val = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); - if (type == PCI_MAPREG_TYPE_MEM && - (val & PCI_COMMAND_MEM_ENABLE) == PCI_COMMAND_MEM_ENABLE) - return (0); - if (type == PCI_MAPREG_TYPE_IO && - (val & PCI_COMMAND_IO_ENABLE) == PCI_COMMAND_IO_ENABLE) - return (0); - - error = extent_alloc_region(ex, *addr, size, EX_NOWAIT | EX_MALLOCOK); - if (error) { - PCIBIOS_PRINTV(("Resource conflict.\n")); - pci_conf_write(pc, tag, mapreg, 0); /* clear */ - return (1); - } - - return (0); -} - -bus_addr_t -pciaddr_ioaddr(u_int32_t val) -{ - return ((PCI_MAPREG_TYPE(val) == PCI_MAPREG_TYPE_MEM) - ? PCI_MAPREG_MEM_ADDR(val) - : (PCI_MAPREG_IO_ADDR(val))); -} - -void -pciaddr_print_devid(pci_chipset_tag_t pc, pcitag_t tag) -{ - int bus, device, function; - pcireg_t id; - - id = pci_conf_read(pc, tag, PCI_ID_REG); - pci_decompose_tag(pc, tag, &bus, &device, &function); - printf("%03d:%02d:%d %04x:%04x\n", bus, device, function, - PCI_VENDOR(id), PCI_PRODUCT(id)); -} - -int -pciaddr_device_is_agp(pci_chipset_tag_t pc, pcitag_t tag) -{ - pcireg_t class, status, rval; - int off; - - /* Check AGP device. */ - class = pci_conf_read(pc, tag, PCI_CLASS_REG); - if (PCI_CLASS(class) == PCI_CLASS_DISPLAY) { - status = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); - if (status & PCI_STATUS_CAPLIST_SUPPORT) { - rval = pci_conf_read(pc, tag, PCI_CAPLISTPTR_REG); - for (off = PCI_CAPLIST_PTR(rval); - off != 0; - off = PCI_CAPLIST_NEXT(rval) ) { - rval = pci_conf_read(pc, tag, off); - if (PCI_CAPLIST_CAP(rval) == PCI_CAP_AGP) - return (1); - } - } - } - return (0); -} - -void -pci_device_foreach(struct i80321_softc *sc, pci_chipset_tag_t pc, int maxbus, - void (*func)(struct i80321_softc *, pci_chipset_tag_t, pcitag_t)) -{ - const struct pci_quirkdata *qd; - int bus, device, function, maxdevs, nfuncs; - pcireg_t id, bhlcr; - pcitag_t tag; - - for (bus = 0; bus <= maxbus; bus++) { - maxdevs = pci_bus_maxdevs(pc, bus); - for (device = 0; device < maxdevs; device++) { - tag = pci_make_tag(pc, bus, device, 0); - id = pci_conf_read(pc, tag, PCI_ID_REG); - - /* Invalid vendor ID value? */ - if (PCI_VENDOR(id) == PCI_VENDOR_INVALID) - continue; - /* XXX Not invalid, but we've done this ~forever. */ - if (PCI_VENDOR(id) == 0) - continue; - - qd = pci_lookup_quirkdata(PCI_VENDOR(id), - PCI_PRODUCT(id)); - - bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG); - if (PCI_HDRTYPE_MULTIFN(bhlcr) || - (qd != NULL && - (qd->quirks & PCI_QUIRK_MULTIFUNCTION) != 0)) - nfuncs = 8; - else - nfuncs = 1; - - for (function = 0; function < nfuncs; function++) { - tag = pci_make_tag(pc, bus, device, function); - id = pci_conf_read(pc, tag, PCI_ID_REG); - - /* Invalid vendor ID value? */ - if (PCI_VENDOR(id) == PCI_VENDOR_INVALID) - continue; - /* - * XXX Not invalid, but we've done this - * ~forever. - */ - if (PCI_VENDOR(id) == 0) - continue; - (*func)(sc, pc, tag); - } - } - } -} diff --git a/sys/arch/armish/dev/pciide_machdep.c b/sys/arch/armish/dev/pciide_machdep.c deleted file mode 100644 index 51975b17a41..00000000000 --- a/sys/arch/armish/dev/pciide_machdep.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $OpenBSD: pciide_machdep.c,v 1.2 2010/08/07 03:50:01 krw Exp $ */ -/* $NetBSD: pciide_machdep.c,v 1.2 1999/02/19 18:01:27 mycroft Exp $ */ - -/* - * Copyright (c) 1998 Christopher G. Demetriou. 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Christopher G. Demetriou - * for the NetBSD Project. - * 4. 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. - */ - -/* - * PCI IDE controller driver (i386 machine-dependent portion). - * - * Author: Christopher G. Demetriou, March 2, 1998 (derived from NetBSD - * sys/dev/pci/ppb.c, revision 1.16). - * - * See "PCI IDE Controller Specification, Revision 1.0 3/4/94" from the - * PCI SIG. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> - -#include <dev/pci/pcireg.h> -#include <dev/pci/pcivar.h> -#include <dev/pci/pciidereg.h> -#include <dev/pci/pciidevar.h> - -void * -pciide_machdep_compat_intr_establish(struct device *dev, - struct pci_attach_args *pa, int chan, int (*func)(void *), void *arg) -{ - panic("pciide_machdep_compat_intr_establish called"); - return (NULL); -} - -void -pciide_machdep_compat_intr_disestablish(pci_chipset_tag_t pc, void *cookie) -{ - panic("pciide_machdep_compat_intr_disestablish called"); -} diff --git a/sys/arch/armish/include/_float.h b/sys/arch/armish/include/_float.h deleted file mode 100644 index cb8e5c8109f..00000000000 --- a/sys/arch/armish/include/_float.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: _float.h,v 1.1 2012/06/26 16:12:43 deraadt Exp $ */ - -#include <arm/_float.h> diff --git a/sys/arch/armish/include/_types.h b/sys/arch/armish/include/_types.h deleted file mode 100644 index e422568e053..00000000000 --- a/sys/arch/armish/include/_types.h +++ /dev/null @@ -1,9 +0,0 @@ -/* $OpenBSD: _types.h,v 1.7 2012/11/05 19:39:34 miod Exp $ */ -/* $NetBSD: types.h,v 1.4 2002/02/28 03:17:26 simonb Exp $ */ - -#ifndef _MACHINE__TYPES_H_ -#define _MACHINE__TYPES_H_ - -#include <arm/_types.h> - -#endif /* _MACHINE__TYPES_H_ */ diff --git a/sys/arch/armish/include/apmvar.h b/sys/arch/armish/include/apmvar.h deleted file mode 100644 index e3abcfc4f32..00000000000 --- a/sys/arch/armish/include/apmvar.h +++ /dev/null @@ -1,2 +0,0 @@ -/* $OpenBSD: apmvar.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -#include <arm/apmvar.h> diff --git a/sys/arch/armish/include/armish_intr.h b/sys/arch/armish/include/armish_intr.h deleted file mode 100644 index aed25c169c1..00000000000 --- a/sys/arch/armish/include/armish_intr.h +++ /dev/null @@ -1,120 +0,0 @@ -/* $OpenBSD: armish_intr.h,v 1.8 2014/03/29 18:09:28 guenther Exp $ */ -/* $NetBSD: i80321_intr.h,v 1.4 2003/07/05 06:53:08 dogcow Exp $ */ - -/* - * Copyright (c) 2001, 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _MACHINE_ARMISH_INTR_H_ -#define _MACHINE_ARMISH_INTR_H_ - -#define ARM_IRQ_HANDLER _C_LABEL(i80321_irq_handler) - -#ifndef _LOCORE - -#include <arm/armreg.h> -#include <arm/cpufunc.h> -#include <arm/softintr.h> - -extern volatile int current_ipl_level; -extern volatile int softint_pending; -extern int i80321_imask[]; -void i80321_do_pending(void); - -void i80321_setipl(int new); -void i80321_splx(int new); -int i80321_splraise(int ipl); -int i80321_spllower(int ipl); -void i80321_setsoftintr(int si); - -/* - * An useful function for interrupt handlers. - * XXX: This shouldn't be here. - */ -static __inline int -find_first_bit( uint32_t bits ) -{ - int count; - - /* since CLZ is available only on ARMv5, this isn't portable - * to all ARM CPUs. This file is for I80321 processor. - */ - asm( "clz %0, %1" : "=r" (count) : "r" (bits) ); - return 31-count; -} - - -int _splraise(int); -int _spllower(int); -void splx(int); -void _setsoftintr(int); - -/* - * This function *MUST* be called very early on in a port's - * initarm() function, before ANY spl*() functions are called. - * - * The parameter is the virtual address of the I80321's Interrupt - * Controller registers. - */ -void i80321_intr_bootstrap(vaddr_t); - -void i80321_irq_handler(void *); -void *i80321_intr_establish(int irqno, int level, int (*func)(void *), - void *cookie, const char *name); -void i80321_intr_disestablish(void *cookie); -const char *i80321_intr_string(void *cookie); - -#ifdef DIAGNOSTIC -/* - * Although this function is implemented in MI code, it must be in this MD - * header because we don't want this header to include MI includes. - */ -void splassert_fail(int, int, const char *); -extern int splassert_ctl; -void i80321_splassert_check(int, const char *); -#define splassert(__wantipl) do { \ - if (splassert_ctl > 0) { \ - i80321_splassert_check(__wantipl, __func__); \ - } \ -} while (0) -#define splsoftassert(wantipl) splassert(wantipl) -#else -#define splassert(wantipl) do { /* nothing */ } while (0) -#define splsoftassert(wantipl) do { /* nothing */ } while (0) -#endif - -#endif /* ! _LOCORE */ - -#endif /* _MACHINE_ARMISH_INTR_H_ */ - diff --git a/sys/arch/armish/include/asm.h b/sys/arch/armish/include/asm.h deleted file mode 100644 index 72334e65815..00000000000 --- a/sys/arch/armish/include/asm.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: asm.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: asm.h,v 1.3 2001/11/25 15:55:54 thorpej Exp $ */ - -#include <arm/asm.h> diff --git a/sys/arch/armish/include/atomic.h b/sys/arch/armish/include/atomic.h deleted file mode 100644 index f4c6309bcf4..00000000000 --- a/sys/arch/armish/include/atomic.h +++ /dev/null @@ -1,10 +0,0 @@ -/* $OpenBSD: atomic.h,v 1.5 2011/03/23 16:54:34 pirofti Exp $ */ - -/* Public Domain */ - -#ifndef _MACHINE_ATOMIC_H_ -#define _MACHINE_ATOMIC_H_ - -#include <arm/atomic.h> - -#endif /* _MACHINE_ATOMIC_H_ */ diff --git a/sys/arch/armish/include/bootconfig.h b/sys/arch/armish/include/bootconfig.h deleted file mode 100644 index 0afef558e5c..00000000000 --- a/sys/arch/armish/include/bootconfig.h +++ /dev/null @@ -1,69 +0,0 @@ -/* $OpenBSD: bootconfig.h,v 1.3 2011/09/20 22:02:13 miod Exp $ */ -/* $NetBSD: bootconfig.h,v 1.2 2001/06/21 22:08:28 chris Exp $ */ - -/* - * Copyright (c) 1994 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * All rights reserved. - * - * This code is derived from software written for Brini by Mark Brinicombe - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Mark Brinicombe - * for the NetBSD Project. - * 4. The name of the company nor the name of the author may 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 OR CONTRIBUTORS 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. - * - * boot configuration structures - * - * Created : 12/09/94 - * - * Based on kate/boot/bootconfig.h - */ - -#if defined(_KERNEL) || defined(_STANDALONE) - -typedef struct _PhysMem { - u_int address; - u_int pages; -} PhysMem; - -#define DRAM_BLOCKS 1 - -typedef struct _BootConfig { - PhysMem dram[DRAM_BLOCKS]; - u_int dramblocks; -} BootConfig; - -extern BootConfig bootconfig; -#define MAX_BOOT_STRING 255 - -#endif /* _KERNEL || _STANDALONE */ -#if defined(_KERNEL) -extern char *boot_args; -extern char *boot_file; -#endif /* _KERNEL */ - -/* End of bootconfig.h */ diff --git a/sys/arch/armish/include/bus.h b/sys/arch/armish/include/bus.h deleted file mode 100644 index 99d450453a2..00000000000 --- a/sys/arch/armish/include/bus.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: bus.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: bus.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */ - -#include <arm/bus.h> diff --git a/sys/arch/armish/include/cdefs.h b/sys/arch/armish/include/cdefs.h deleted file mode 100644 index a6c16add4b2..00000000000 --- a/sys/arch/armish/include/cdefs.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: cdefs.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ - -#include <arm/cdefs.h> diff --git a/sys/arch/armish/include/conf.h b/sys/arch/armish/include/conf.h deleted file mode 100644 index 3eb8e907a1f..00000000000 --- a/sys/arch/armish/include/conf.h +++ /dev/null @@ -1,17 +0,0 @@ -/* $OpenBSD: conf.h,v 1.3 2011/03/23 16:54:34 pirofti Exp $ */ -/* $NetBSD: conf.h,v 1.8 2002/02/10 12:26:03 chris Exp $ */ - -#ifndef _MACHINE_CONF_H_ -#define _MACHINE_CONF_H_ - -#include <sys/conf.h> - -/* - * ARMISH specific device includes go in here - */ - -#define CONF_HAVE_GPIO - -#include <arm/conf.h> - -#endif /* _MACHINE_CONF_H_ */ diff --git a/sys/arch/armish/include/cpu.h b/sys/arch/armish/include/cpu.h deleted file mode 100644 index 1fd99e8e2b0..00000000000 --- a/sys/arch/armish/include/cpu.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: cpu.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: cpu.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */ - -#include <arm/cpu.h> diff --git a/sys/arch/armish/include/db_machdep.h b/sys/arch/armish/include/db_machdep.h deleted file mode 100644 index f8197f2a588..00000000000 --- a/sys/arch/armish/include/db_machdep.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: db_machdep.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: db_machdep.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */ - -#include <arm/db_machdep.h> diff --git a/sys/arch/armish/include/disklabel.h b/sys/arch/armish/include/disklabel.h deleted file mode 100644 index 1c9c62e6cce..00000000000 --- a/sys/arch/armish/include/disklabel.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: disklabel.h,v 1.2 2007/06/17 00:27:26 deraadt Exp $ */ - -#include <arm/disklabel.h> diff --git a/sys/arch/armish/include/endian.h b/sys/arch/armish/include/endian.h deleted file mode 100644 index ea87a8d604a..00000000000 --- a/sys/arch/armish/include/endian.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: endian.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: endian.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/endian.h> diff --git a/sys/arch/armish/include/exec.h b/sys/arch/armish/include/exec.h deleted file mode 100644 index d0fc20e447d..00000000000 --- a/sys/arch/armish/include/exec.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: exec.h,v 1.2 2006/10/02 17:45:33 miod Exp $ */ -/* public domain */ -#include <arm/exec.h> diff --git a/sys/arch/armish/include/fenv.h b/sys/arch/armish/include/fenv.h deleted file mode 100644 index 00c039216d2..00000000000 --- a/sys/arch/armish/include/fenv.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: fenv.h,v 1.2 2013/06/01 21:20:54 jasper Exp $ */ -/* public domain */ -#include <arm/fenv.h> diff --git a/sys/arch/armish/include/fp.h b/sys/arch/armish/include/fp.h deleted file mode 100644 index a106b0df984..00000000000 --- a/sys/arch/armish/include/fp.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: fp.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: fp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/fp.h> diff --git a/sys/arch/armish/include/frame.h b/sys/arch/armish/include/frame.h deleted file mode 100644 index 6de1f1ee1c9..00000000000 --- a/sys/arch/armish/include/frame.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: frame.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: frame.h,v 1.1 2001/06/08 22:23:00 chris Exp $ */ - -#include <arm/frame.h> diff --git a/sys/arch/armish/include/ieee.h b/sys/arch/armish/include/ieee.h deleted file mode 100644 index fff84b906a6..00000000000 --- a/sys/arch/armish/include/ieee.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: ieee.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: ieee.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/ieee.h> diff --git a/sys/arch/armish/include/ieeefp.h b/sys/arch/armish/include/ieeefp.h deleted file mode 100644 index fe16d9b8d63..00000000000 --- a/sys/arch/armish/include/ieeefp.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: ieeefp.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: ieeefp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/ieeefp.h> diff --git a/sys/arch/armish/include/intr.h b/sys/arch/armish/include/intr.h deleted file mode 100644 index a8ecdd0956d..00000000000 --- a/sys/arch/armish/include/intr.h +++ /dev/null @@ -1,108 +0,0 @@ -/* $OpenBSD: intr.h,v 1.9 2015/09/19 02:13:05 jsg Exp $ */ -/* $NetBSD: intr.h,v 1.12 2003/06/16 20:00:59 thorpej Exp $ */ - -/* - * Copyright (c) 2001, 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _MACHINE_INTR_H_ -#define _MACHINE_INTR_H_ - -#ifdef _KERNEL - -/* Interrupt priority "levels". */ -#define IPL_NONE 0 /* nothing */ -#define IPL_SOFT 1 /* generic software interrupts */ -#define IPL_SOFTCLOCK 2 /* software clock interrupt */ -#define IPL_SOFTNET 3 /* software network interrupt */ -#define IPL_BIO 4 /* block I/O */ -#define IPL_NET 5 /* network */ -#define IPL_SOFTTTY 6 /* software serial interrupt */ -#define IPL_TTY 7 /* terminals */ -#define IPL_VM 8 /* memory allocation */ -#define IPL_AUDIO 9 /* audio device */ -#define IPL_CLOCK 10 /* clock interrupt */ -#define IPL_STATCLOCK 11 /* statistics clock interrupt */ -#define IPL_SCHED 12 /* everything */ -#define IPL_HIGH 12 /* everything */ - -#define NIPL 13 - -/* Interrupt priority "flags". */ -#define IPL_MPSAFE 0 /* no "mpsafe" interrupts */ - -/* Interrupt sharing types. */ -#define IST_NONE 0 /* none */ -#define IST_PULSE 1 /* pulsed */ -#define IST_EDGE 2 /* edge-triggered */ -#define IST_LEVEL 3 /* level-triggered */ - -#define IST_LEVEL_LOW IST_LEVEL -#define IST_LEVEL_HIGH 4 -#define IST_EDGE_FALLING IST_EDGE -#define IST_EDGE_RISING 5 -#define IST_EDGE_BOTH 6 - -#ifndef _LOCORE - -#include <sys/device.h> -#include <sys/queue.h> - -#define splhigh() _splraise(IPL_HIGH) -#define splsoft() _splraise(IPL_SOFT) -#define splsoftclock() _splraise(IPL_SOFTCLOCK) -#define splsoftnet() _splraise(IPL_SOFTNET) -#define splbio() _splraise(IPL_BIO) -#define splnet() _splraise(IPL_NET) -#define spltty() _splraise(IPL_TTY) -#define splvm() _splraise(IPL_VM) -#define splaudio() _splraise(IPL_AUDIO) -#define splclock() _splraise(IPL_CLOCK) -#define splstatclock() _splraise(IPL_STATCLOCK) - -#define spl0() _spllower(IPL_NONE) - -#define splsched() splhigh() -#define spllock() splhigh() - -void intr_barrier(void *); - -#endif /* ! _LOCORE */ - -#include <machine/armish_intr.h> - -#endif /* _KERNEL */ - -#endif /* _MACHINE_INTR_H_ */ - diff --git a/sys/arch/armish/include/limits.h b/sys/arch/armish/include/limits.h deleted file mode 100644 index 2ec9d566ca6..00000000000 --- a/sys/arch/armish/include/limits.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: limits.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: limits.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/limits.h> diff --git a/sys/arch/armish/include/loadfile_machdep.h b/sys/arch/armish/include/loadfile_machdep.h deleted file mode 100644 index e95f7f84a31..00000000000 --- a/sys/arch/armish/include/loadfile_machdep.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: loadfile_machdep.h,v 1.4 2015/07/17 20:44:38 miod Exp $ */ -/* $NetBSD: loadfile_machdep.h,v 1.1 1999/04/29 03:17:12 tsubai Exp $ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#define BOOT_ELF -#define ELFSIZE 32 - -#define LOAD_KERNEL LOAD_ALL -#define COUNT_KERNEL COUNT_ALL - -#define LOADADDR(a) ((((u_long)(a)) + offset)&0xfffffff) -#define ALIGNENTRY(a) ((u_long)(a)) -#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c)) -#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c)) -#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c)) -#define WARN(a) (void)(printf a, \ - printf((errno ? ": %s\n" : "\n"), \ - strerror(errno))) -#define PROGRESS(a) (void) printf a -#define ALLOC(a) alloc(a) -#define FREE(a, b) free(a, b) - -void run_loadfile(u_long *, int); diff --git a/sys/arch/armish/include/lock.h b/sys/arch/armish/include/lock.h deleted file mode 100644 index 5c5d458ac90..00000000000 --- a/sys/arch/armish/include/lock.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: lock.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: lock.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/lock.h> diff --git a/sys/arch/armish/include/mutex.h b/sys/arch/armish/include/mutex.h deleted file mode 100644 index 8f734b03a83..00000000000 --- a/sys/arch/armish/include/mutex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mutex.h,v 1.2 2007/12/05 16:08:06 deraadt Exp $ */ -/* public domain */ -#include <arm/mutex.h> diff --git a/sys/arch/armish/include/param.h b/sys/arch/armish/include/param.h deleted file mode 100644 index c8ea882424d..00000000000 --- a/sys/arch/armish/include/param.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: param.h,v 1.3 2013/03/23 16:12:21 deraadt Exp $ */ - -/* - * Copyright (c) 1994,1995 Mark Brinicombe. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the RiscBSD team. - * 4. The name "RiscBSD" nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY RISCBSD ``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 RISCBSD OR CONTRIBUTORS 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. - */ - -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - -#include <arm/param.h> - -#define _MACHINE armish -#define MACHINE "armish" - -#ifndef MSGBUFSIZE -#define MSGBUFSIZE (1 * PAGE_SIZE) -#endif - -#endif /* _MACHINE_PARAM_H_ */ diff --git a/sys/arch/armish/include/pcb.h b/sys/arch/armish/include/pcb.h deleted file mode 100644 index a1db5e3897c..00000000000 --- a/sys/arch/armish/include/pcb.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: pcb.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: pcb.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/pcb.h> diff --git a/sys/arch/armish/include/pci_machdep.h b/sys/arch/armish/include/pci_machdep.h deleted file mode 100644 index e0f5a7ad2ab..00000000000 --- a/sys/arch/armish/include/pci_machdep.h +++ /dev/null @@ -1,2 +0,0 @@ -/* $OpenBSD: pci_machdep.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -#include <arm/pci_machdep.h> diff --git a/sys/arch/armish/include/pio.h b/sys/arch/armish/include/pio.h deleted file mode 100644 index bf3e961da25..00000000000 --- a/sys/arch/armish/include/pio.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: pio.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: pio.h,v 1.3 2001/12/07 23:09:33 chris Exp $ */ - -#include <arm/pio.h> diff --git a/sys/arch/armish/include/pmap.h b/sys/arch/armish/include/pmap.h deleted file mode 100644 index 01e8fc61bd9..00000000000 --- a/sys/arch/armish/include/pmap.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: pmap.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: pmap.h,v 1.2 2001/11/23 17:29:01 thorpej Exp $ */ - -#include <arm/pmap.h> diff --git a/sys/arch/armish/include/proc.h b/sys/arch/armish/include/proc.h deleted file mode 100644 index 827656aa0ad..00000000000 --- a/sys/arch/armish/include/proc.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: proc.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: proc.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/proc.h> diff --git a/sys/arch/armish/include/profile.h b/sys/arch/armish/include/profile.h deleted file mode 100644 index 063080728d1..00000000000 --- a/sys/arch/armish/include/profile.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: profile.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: profile.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/profile.h> diff --git a/sys/arch/armish/include/ptrace.h b/sys/arch/armish/include/ptrace.h deleted file mode 100644 index 0e1cc87d92c..00000000000 --- a/sys/arch/armish/include/ptrace.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: ptrace.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: ptrace.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/ptrace.h> diff --git a/sys/arch/armish/include/reg.h b/sys/arch/armish/include/reg.h deleted file mode 100644 index 7ae8527fe4b..00000000000 --- a/sys/arch/armish/include/reg.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: reg.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: reg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/reg.h> diff --git a/sys/arch/armish/include/reloc.h b/sys/arch/armish/include/reloc.h deleted file mode 100644 index 83e6db5a9bb..00000000000 --- a/sys/arch/armish/include/reloc.h +++ /dev/null @@ -1,2 +0,0 @@ -/* $OpenBSD: reloc.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -#include <arm/reloc.h> diff --git a/sys/arch/armish/include/setjmp.h b/sys/arch/armish/include/setjmp.h deleted file mode 100644 index 98bbfd140ad..00000000000 --- a/sys/arch/armish/include/setjmp.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: setjmp.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: setjmp.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/setjmp.h> diff --git a/sys/arch/armish/include/signal.h b/sys/arch/armish/include/signal.h deleted file mode 100644 index 6a47eaababc..00000000000 --- a/sys/arch/armish/include/signal.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: signal.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: signal.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/signal.h> diff --git a/sys/arch/armish/include/spinlock.h b/sys/arch/armish/include/spinlock.h deleted file mode 100644 index 7a07c2fe6dd..00000000000 --- a/sys/arch/armish/include/spinlock.h +++ /dev/null @@ -1,7 +0,0 @@ - -/* $OpenBSD: spinlock.h,v 1.2 2011/03/23 16:54:34 pirofti Exp $ */ -#ifndef _MACHINE_SPINLOCK_H_ -#define _MACHINE_SPINLOCK_H_ -#include <arm/spinlock.h> -#endif /* _MACHINE_SPINLOCK_H_ */ - diff --git a/sys/arch/armish/include/stdarg.h b/sys/arch/armish/include/stdarg.h deleted file mode 100644 index c6a37339531..00000000000 --- a/sys/arch/armish/include/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: stdarg.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: stdarg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/stdarg.h> diff --git a/sys/arch/armish/include/sysarch.h b/sys/arch/armish/include/sysarch.h deleted file mode 100644 index 5b73002433f..00000000000 --- a/sys/arch/armish/include/sysarch.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: sysarch.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: sysarch.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/sysarch.h> diff --git a/sys/arch/armish/include/tcb.h b/sys/arch/armish/include/tcb.h deleted file mode 100644 index 2f01dd6f598..00000000000 --- a/sys/arch/armish/include/tcb.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: tcb.h,v 1.2 2013/06/01 21:20:54 jasper Exp $ */ -/* public domain */ -#include <arm/tcb.h> diff --git a/sys/arch/armish/include/trap.h b/sys/arch/armish/include/trap.h deleted file mode 100644 index 5714cfc0e0c..00000000000 --- a/sys/arch/armish/include/trap.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: trap.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */ -/* $NetBSD: trap.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/trap.h> diff --git a/sys/arch/armish/include/vmparam.h b/sys/arch/armish/include/vmparam.h deleted file mode 100644 index d1c675c2dec..00000000000 --- a/sys/arch/armish/include/vmparam.h +++ /dev/null @@ -1,92 +0,0 @@ -/* $OpenBSD: vmparam.h,v 1.10 2015/06/24 21:35:00 miod Exp $ */ -/* $NetBSD: vmparam.h,v 1.23 2003/05/22 05:47:07 thorpej Exp $ */ - -/* - * Copyright (c) 1988 The Regents of the University of California. - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - */ - -#ifndef _MACHINE_VMPARAM_H_ -#define _MACHINE_VMPARAM_H_ - -#define ARM_KERNEL_BASE 0xc0000000U - -/* Allow armish to have bigger DSIZ than generic arm, allow user to override */ -#ifndef MAXDSIZ -#define MAXDSIZ (1024*1024*1024) /* max data size */ -#endif -#ifndef BRKSIZ -#define BRKSIZ MAXDSIZ /* heap gap size */ -#endif - -#include <arm/vmparam.h> - -#ifdef _KERNEL -/* - * Address space constants - */ - -/* - * The line between user space and kernel space - * Mappings >= KERNEL_BASE are constant across all processes - */ -#define KERNEL_BASE ARM_KERNEL_BASE - -#define VM_KERNEL_SPACE_SIZE 0x20000000 - -/* - * Override the default pager_map size, there's not enough KVA. - */ -#define PAGER_MAP_SIZE (4 * 1024 * 1024) - -/* - * Size of User Raw I/O map - */ - -#define USRIOSIZE 300 - -/* virtual sizes (bytes) for various kernel submaps */ - -#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) - -/* - * max number of non-contig chunks of physical RAM you can have - */ - -#define VM_PHYSSEG_MAX 1 -#define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM - -/* - * this indicates that we can't add RAM to the VM system after the - * vm system is init'd. - */ - -#define VM_PHYSSEG_NOADD - -#endif /* _KERNEL */ - -#endif /* _MACHINE_VMPARAM_H_ */ diff --git a/sys/arch/armish/stand/Makefile b/sys/arch/armish/stand/Makefile deleted file mode 100644 index b935da30e25..00000000000 --- a/sys/arch/armish/stand/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2006/07/28 17:18:38 deraadt Exp $ - -SUBDIR=boot - -.include <bsd.subdir.mk> diff --git a/sys/arch/armish/stand/Makefile.inc b/sys/arch/armish/stand/Makefile.inc deleted file mode 100644 index 43857d6f70b..00000000000 --- a/sys/arch/armish/stand/Makefile.inc +++ /dev/null @@ -1,7 +0,0 @@ -# $OpenBSD: Makefile.inc,v 1.4 2016/07/30 03:25:48 guenther Exp $ - -BINDIR=/usr/mdec -MANSUBDIR=armish - -CFLAGS+= -fno-pie -LDFLAGS+= -nopie -znorelro diff --git a/sys/arch/armish/stand/boot/Makefile b/sys/arch/armish/stand/boot/Makefile deleted file mode 100644 index 5083f0119a8..00000000000 --- a/sys/arch/armish/stand/boot/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# $OpenBSD: Makefile,v 1.13 2016/03/30 06:38:45 jmc Exp $ - -.include "${.CURDIR}/../Makefile.inc" - -MAN= boot.8 - -.if ${MACHINE} == "armish" -PROG= boot -S= ${.CURDIR}/../../../.. - -.PATH: ${S}/stand/boot -.PATH: ${S}/lib/libsa - -CPPFLAGS+= -D_STANDALONE -CPPFLAGS+= -nostdinc -I../.. -I. -I${.CURDIR} -I${S} -CPPFLAGS+= -DCONADDR=0xfe800000UL -DCONSPEED=115200 -fno-pie - -COPTS+= -ffreestanding -fno-stack-protector - -SRCS= start.S -SRCS+= boot.c cmd.c vars.c -SRCS+= conf.c devopen.c exec.c machdep.c dev_armish.c time.c -SRCS+= clock.c ns16550.c wd.c wdc.c pciide.c -SRCS+= ctime.c strtol.c getchar.c putchar.c - -.PATH: ${S}/lib/libkern/arch/arm ${S}/lib/libkern -SRCS+= divsi3.S divdi3.c moddi3.c qdivrem.c strlcpy.c strlen.c ashrdi3.c - -### find out what to use for libsa -SA_AS= library -SAREL= -USE_LOADFILE= yes -.include "${S}/lib/libsa/Makefile.inc" -LIBSA= ${SALIB} - -LDFLAGS= -T ${.CURDIR}/ldscript - -${PROG}: ${OBJS} ${LIBSA} - ${LD} ${LDFLAGS} -o boot ${OBJS} ${LIBSA} ${LIBSA} - -.if !make(obj) -.BEGIN: - @([ -h machine ] || ln -s ${.CURDIR}/../../../${MACHINE}/include machine) - @([ -h arm ] || ln -s ${.CURDIR}/../../../arm/include arm) -.NOPATH: machine arm -CLEANFILES+= machine arm -.endif - -.else -NOPROG= -.endif - -.include <bsd.prog.mk> diff --git a/sys/arch/armish/stand/boot/boot.8 b/sys/arch/armish/stand/boot/boot.8 deleted file mode 100644 index f116ca59f30..00000000000 --- a/sys/arch/armish/stand/boot/boot.8 +++ /dev/null @@ -1,288 +0,0 @@ -.\" $OpenBSD: boot.8,v 1.6 2015/09/10 15:16:43 schwarze Exp $ -.\" -.\" Copyright (c) 1997-2001 Michael Shalayeff -.\" 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. -.\" -.\" 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 OR HIS RELATIVES 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 MIND, 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. -.\" -.\" -.Dd $Mdocdate: September 10 2015 $ -.Dt BOOT 8 armish -.Os -.Sh NAME -.Nm boot , -.Nm boot.conf -.Nd armish-specific bootstrap -.Sh DESCRIPTION -The main purpose of this program is to load the system kernel. -.Pp -As described in -.Xr boot_armish 8 , -this program is loaded by the -firmware -and provides a convenient way to load the kernel. -This program acts as an enhanced boot monitor for armish systems, providing -a common interface for the kernel to start from. -.Pp -Basic operations include: -.Pp -.Bl -bullet -compact -.It -Loading kernels from hard disk. -.It -Loading kernels compressed by -.Xr gzip 1 . -.It -Providing an interactive command line. -.El -.Pp -The sequence of its operation is as follows: initialization, -parsing the configuration file, then an interactive command line. -While at the command line you have 5 seconds to type any commands, if needed. -If time expires, the kernel will be loaded according to -the current variable settings (see the -.Nm set -command). -Each time a kernel load fails, the timeout is increased by one second. -The sequence of -.Nm -operations is as follows: -.Bl -enum -.It -If the file -.Pa /etc/boot.conf -.\" XXX BEWARE! wd0 only, so text change... -.\" exists on the filesystem -.\" .Nm -.\" was loaded from, open and parse it. -exists on the filesystem in slice -.Sq a -on the first disk drive -.Pq wd0 , -open and parse it. -Lines beginning with the -.Sq # -character, -as well as whitespace at the beginning of lines, -are ignored. -The file may contain any commands -.Nm -accepts at the interactive prompt. -Though default settings usually suffice, they can be changed here. -.\" XXX CHECK_SKIP_CONF is not defined... -.\" .Pp -.\" .Pa boot.conf -.\" processing can be skipped by holding down either Control key as -.\" .Nm -.\" starts. -.It -The header line -.Pp -.Dl >> OpenBSD/armish BOOT [x.xx] -.Pp -is displayed to the active console, where -.Ar x.xx -is the version number of the -.Nm -program, followed by the -.Pp -.Dl boot> -.Pp -prompt, which means you are in interactive mode and may enter commands. -If you do not, -.Nm -will proceed to load the kernel with the current parameters after the -timeout period has expired. -.El -.Pp -By default, -.Nm -attempts to load the kernel executable -.Pa /bsd . -If it fails to find the kernel and no alternative kernel image has -been specified, the system will be unable to boot. -.Sh COMMANDS -The following commands are accepted at the -.Nm -prompt: -.Bl -tag -width shorten -.It boot Oo Oo Ar device : Oc Ns Ar image Oc Op Fl acds -Boots the specified kernel image -with any options given. -If -.Ar device -or -.Ar image -are omitted, values from -.Nm -variables will be used. -.Pp -The only bootable devices, at the moment, are IDE devices connected to -the internal controller; -they are detected as -.Sq wd -devices. -Therefore, to boot kernel -.Pa /bsd -from slice -.Sq a -on the first hard drive, -specify -.Dq boot wd0a:/bsd . -.Bl -tag -width _a_ -.It Fl a -Causes the kernel to ask for the -.Nm root -device to use. -.It Fl c -Causes the kernel to go into -.Xr boot_config 8 -before performing -.Xr autoconf 4 -procedures. -.It Fl d -Causes the kernel to drop into -.Xr ddb 4 -at the earliest convenient point. -.It Fl s -Causes the kernel to boot single-user. -.El -.It echo Op Ar args -Displays -.Ar args -on the console device. -.It help -Prints a list of available commands. -.It ls Op Ar directory -Prints contents of the specified -.Ar directory -in long format including: attributes and file type, owner, group, -size, filename. -.It reboot -Reboots the machine by initiating a warm boot procedure. -.It set Op Ar varname Op Ar value -If invoked without arguments, prints a list of variables and their values. -If only -.Ar varname -is specified, displays contents of that variable. -If -.Ar varname -and -.Ar value -are both specified, sets that variable to the given value. -Variables include: -.Pp -.Bl -tag -compact -width boothow -.It Nm addr -Address at which to load the kernel. -.It Nm debug -Debug flag if -.Nm -was compiled with DEBUG defined. -.It Nm device -Boot device name (e.g., -.Li wd0a , -.Li wd1a ) . -.It Nm howto -Options to pass to the loaded kernel. -.It Nm image -File name containing the kernel image. -.It Nm timeout -Number of seconds boot will wait for human intervention before -booting the default kernel image. -.\" .It Nm tty -.\" Active console device name (e.g., -.\" .Li com0 ) . -.\" Currently, only the first serial port -.\" .Pq Li com0 -.\" is supported for console on armish. -.El -.\" XXX ignored, so don't document it. -.\" .It stty Op Ar device Op Ar speed -.\" Displays or sets the -.\" .Ar speed -.\" for a console -.\" .Ar device . -.\" If changing the baudrate for the currently active console, -.\" .Nm -.\" offers you five seconds of grace time before committing the change -.\" to allow you to change your terminal's speed to match. -.\" If changing speed -.\" .Em not -.\" for the active console, the baudrate is set for the -.\" .Em next -.\" time you switch to a serial console. -.\" .Pp -.\" The default baudrate is 9600bps. -.It time -Displays system time and date. -.El -.Sh FILES -.Bl -tag -width /etc/boot.conf -compact -.It Pa /usr/mdec/boot -system bootstrap -.It Pa /etc/boot.conf -system bootstrap's startup file -.It Pa /bsd -kernel image -.It Pa /bsd.rd -kernel image for installation/recovery -.El -.Sh EXAMPLES -Boot the default kernel: -.Pp -.Dl boot> boot -.Pp -Remove the 5 second pause at boot-time permanently, causing -.Nm -to load the kernel immediately without prompting: -.Pp -.Dl # echo \&"boot\&" > /etc/boot.conf -.Pp -Boot the kernel named -.Pa /bsd -from the second hard disk in -.Dq User Kernel Configuration -mode (see -.Xr boot_config 8 ) . -This mechanism allows for the explicit enabling and disabling of devices -during the current boot sequence, as well as the modification -of device parameters. -Once booted, such changes can be made permanent by using -.Xr config 8 Ns 's -.Fl e -option. -.Pp -.Dl boot> boot wd1a:/bsd -c -.Sh SEE ALSO -.Xr gzip 1 , -.Xr autoconf 4 , -.Xr ddb 4 , -.Xr boot_armish 8 , -.Xr boot_config 8 , -.Xr fdisk 8 , -.Xr reboot 8 -.Sh HISTORY -This program was written by Michael Shalayeff for -.Ox 2.1 -on the i386 platform, and was later ported to the armish platform for -.Ox 4.0 . diff --git a/sys/arch/armish/stand/boot/clock.c b/sys/arch/armish/stand/boot/clock.c deleted file mode 100644 index 5444a4dd298..00000000000 --- a/sys/arch/armish/stand/boot/clock.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $OpenBSD: clock.c,v 1.3 2008/06/26 05:42:10 ray Exp $ */ -/* $NetBSD: clock.c,v 1.1 2003/06/25 17:24:22 cdi Exp $ */ - -/*- - * Copyright (c) 2003 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Manuel Bouyer. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include <sys/types.h> - -#include "libsa.h" - -#define DELAY_CALIBRATE 1000 - -void -delay(int ms) -{ - /* - * XXX need *real* clock calibration. - */ - volatile register int N = ms * DELAY_CALIBRATE; - for (; --N;) - ; -} diff --git a/sys/arch/armish/stand/boot/conf.c b/sys/arch/armish/stand/boot/conf.c deleted file mode 100644 index eefe987ce10..00000000000 --- a/sys/arch/armish/stand/boot/conf.c +++ /dev/null @@ -1,69 +0,0 @@ -/* $OpenBSD: conf.c,v 1.6 2013/12/28 02:53:03 deraadt Exp $ */ -/* $NetBSD: conf.c,v 1.4 2005/12/11 12:17:06 christos Exp $ */ - -/* - * Copyright (c) 1982, 1986, 1990, 1993 - * The Regents of the University of California. 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)conf.c 8.1 (Berkeley) 6/10/93 - */ - -#include <sys/param.h> - -#include <dev/cons.h> - -#include "libsa.h" -#include <lib/libsa/ufs.h> - -const char version[] = "1.2"; -int debug = 0; - -/* - * Device configuration - */ -struct devsw devsw[] = { - { "wd", wdstrategy, wdopen, wdclose, noioctl }, -}; -int ndevs = nitems(devsw); - -/* - * Filesystem configuration - */ -struct fs_ops file_system[] = { - { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, - ufs_stat, ufs_readdir } -}; -int nfsys = nitems(file_system); - -/* - * Console configuration - */ -struct consdev constab[] = { - { com_probe, com_init, com_getc, com_putc }, - { NULL } -}; -struct consdev *cn_tab; diff --git a/sys/arch/armish/stand/boot/dev_armish.c b/sys/arch/armish/stand/boot/dev_armish.c deleted file mode 100644 index 5cb7eb3c049..00000000000 --- a/sys/arch/armish/stand/boot/dev_armish.c +++ /dev/null @@ -1,67 +0,0 @@ -/* $OpenBSD: dev_armish.c,v 1.4 2014/07/13 09:26:08 jasper Exp $ */ - -/* - * Copyright (c) 2006 Mark Kettenis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/param.h> -#include <dev/cons.h> - -#include "libsa.h" - -const char cdevs[][4] = { - "cn", "", "", "", "", "", "", "", - "", "", "", "", "com" -}; -const int ncdevs = nitems(cdevs); - -void -devboot(dev_t dev, char *p) -{ - strlcpy(p, "wd0a", 5); -} - -int -cnspeed(dev_t dev, int sp) -{ - return CONSPEED; -} - -char ttyname_buf[8]; - -char * -ttyname(int fd) -{ - snprintf(ttyname_buf, sizeof ttyname_buf, "%s%d", - cdevs[major(cn_tab->cn_dev)], minor(cn_tab->cn_dev)); - - return ttyname_buf; -} - -dev_t -ttydev(char *name) -{ - int i, unit = -1; - char *no = name + strlen(name) - 1; - - while (no >= name && *no >= '0' && *no <= '9') - unit = (unit < 0 ? 0 : (unit * 10)) + *no-- - '0'; - if (no < name || unit < 0) - return NODEV; - for (i = 0; i < ncdevs; i++) - if (strncmp(name, cdevs[i], no - name + 1) == 0) - return (makedev(i, unit)); - return NODEV; -} diff --git a/sys/arch/armish/stand/boot/devopen.c b/sys/arch/armish/stand/boot/devopen.c deleted file mode 100644 index 8114a2934f6..00000000000 --- a/sys/arch/armish/stand/boot/devopen.c +++ /dev/null @@ -1,122 +0,0 @@ -/* $OpenBSD: devopen.c,v 1.4 2013/09/28 10:05:36 mlarkin Exp $ */ -/* $NetBSD: devopen.c,v 1.1 2003/06/25 17:24:22 cdi Exp $ */ - -/*- - * Copyright (c) 2003 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Rolf Grossmann. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include "libsa.h" - -#define MAXDEVNAME 16 - -/* - * Parse a device spec. - * - * [A-Za-z]*[0-9]*[A-Za-z]:file - * dev uint part - */ -int -devparse(const char *fname, int *dev, int *unit, int *part, const char **file) -{ - const char *s; - - *unit = 0; /* default to wd0a */ - *part = 0; - *dev = 0; - - s = strchr(fname, ':'); - if (s != NULL) { - int devlen; - int i, u, p = 0; - struct devsw *dp; - char devname[MAXDEVNAME]; - - devlen = s - fname; - if (devlen > MAXDEVNAME) - return (EINVAL); - - /* extract device name */ - for (i = 0; isalpha(fname[i]) && (i < devlen); i++) - devname[i] = fname[i]; - devname[i] = 0; - - if (!isdigit(fname[i])) - return (EUNIT); - - /* device number */ - for (u = 0; isdigit(fname[i]) && (i < devlen); i++) - u = u * 10 + (fname[i] - '0'); - - if (!isalpha(fname[i])) - return (EPART); - - /* partition number */ - if (i < devlen) - p = fname[i++] - 'a'; - - if (i != devlen) - return (ENXIO); - - /* check device name */ - for (dp = devsw, i = 0; i < ndevs; dp++, i++) { - if (dp->dv_name && !strcmp(devname, dp->dv_name)) - break; - } - - if (i >= ndevs) - return (ENXIO); - - *unit = u; - *part = p; - *dev = i; - fname = ++s; - } - - *file = fname; - - return (0); -} - -int -devopen(struct open_file *f, const char *fname, char **file) -{ - struct devsw *dp; - int dev, unit, part, error; - - error = devparse(fname, &dev, &unit, &part, (const char **)file); - if (error) - return (error); - - dp = &devsw[dev]; - if ((void *)dp->dv_open == (void *)nodev) - return (ENXIO); - - f->f_dev = dp; - - return (*dp->dv_open)(f, unit, part); -} diff --git a/sys/arch/armish/stand/boot/exec.c b/sys/arch/armish/stand/boot/exec.c deleted file mode 100644 index 7880e71754e..00000000000 --- a/sys/arch/armish/stand/boot/exec.c +++ /dev/null @@ -1,83 +0,0 @@ -/* $OpenBSD: exec.c,v 1.3 2006/07/30 21:38:12 drahn Exp $ */ - -/* - * Copyright (c) 2006 Mark Kettenis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/param.h> - -#include <lib/libsa/loadfile.h> - -#ifdef BOOT_ELF -#include <sys/exec_elf.h> -#endif - -#include <sys/reboot.h> -#include <stand/boot/cmd.h> -#include <machine/bootconfig.h> - -typedef void (*startfuncp)(void) __attribute__ ((noreturn)); - -void -run_loadfile(u_long *marks, int howto) -{ -#ifdef BOOT_ELF - Elf_Ehdr *elf = (Elf_Ehdr *)marks[MARK_SYM]; - Elf_Shdr *shp = (Elf_Shdr *)(marks[MARK_SYM] + elf->e_shoff); - u_long esym = marks[MARK_END]; - char *cp; - int i; - - /* - * Tell locore.S where the symbol table ends by setting - * 'esym', which should be the first word in the .data - * section. - */ - for (i = 0; i < elf->e_shnum; i++) { - /* XXX Assume .data is the first writable segment. */ - if (shp[i].sh_flags & SHF_WRITE) { - /* XXX We have to store the virtual address. */ - esym |= shp[i].sh_addr & 0xff000000; - *(u_long *)(shp[i].sh_addr & 0x00ffffff) = esym; - break; - } - } -#endif - cp = (char *)0x00200000 - MAX_BOOT_STRING - 1; - -#define BOOT_STRING_MAGIC 0x4f425344 - - *(int *)cp = BOOT_STRING_MAGIC; - - cp += sizeof(int); - snprintf(cp, MAX_BOOT_STRING, "%s:%s -", cmd.bootdev, cmd.image); - - while (*cp != '\0') - cp++; - if (howto & RB_ASKNAME) - *cp++ = 'a'; - if (howto & RB_CONFIG) - *cp++ = 'c'; - if (howto & RB_KDB) - *cp++ = 'd'; - if (howto & RB_SINGLE) - *cp++ = 's'; - - *cp = '\0'; - - (*(startfuncp)(marks[MARK_ENTRY]))(); - - /* NOTREACHED */ -} diff --git a/sys/arch/armish/stand/boot/ldscript b/sys/arch/armish/stand/boot/ldscript deleted file mode 100644 index fab694cfc57..00000000000 --- a/sys/arch/armish/stand/boot/ldscript +++ /dev/null @@ -1,84 +0,0 @@ -/* $OpenBSD: ldscript,v 1.1 2006/07/28 17:12:06 kettenis Exp $ */ -/* $NetBSD: ldscript,v 1.6 2005/12/11 12:17:10 christos Exp $ */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", - "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(FLASH) -MEMORY -{ - /* We will locate the .text section in flash, and will run directly - from there just long enough to relocate our .text and .data into - a small chunk of SDRAM starting at (SDRAM + 1M). */ - flash : o = 0xf0080000, l = 6M - sdram : o = 0x00100000, l = 1M /* kernel loads at 0xa0200000 */ -} -SECTIONS -{ - FLASH = 0x00100000; - - /* Read-only sections, merged into text segment: */ - __text_store = FLASH; - .text : - AT (FLASH) - { - *(.text) - *(.text.*) - *(.stub) - *(.glue_7t) *(.glue_7) - *(.rodata) *(.rodata.*) - } > sdram =0 - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - __data_store = FLASH + SIZEOF(.text); - .data : - AT (LOADADDR(.text) + SIZEOF(.text)) - { - __data_start = . ; - *(.data) - *(.data.*) - } > sdram - .sdata : - AT (LOADADDR(.data) + SIZEOF(.data)) - { - *(.sdata) - *(.sdata.*) - . = ALIGN(32 / 8); - } > sdram - _edata = .; - PROVIDE (edata = .); - __bss_start = .; - __bss_start__ = .; - .sbss : - { - PROVIDE (__sbss_start = .); - PROVIDE (___sbss_start = .); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.scommon) - PROVIDE (__sbss_end = .); - PROVIDE (___sbss_end = .); - } > sdram - .bss : - { - *(.dynbss) - *(.bss) - *(.bss.*) - *(COMMON) - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ - . = ALIGN(32 / 8); - } > sdram - . = ALIGN(32 / 8); - _end = .; - _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; - PROVIDE (end = .); - .image (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : - AT (LOADADDR(.sdata) + SIZEOF(.sdata)) - { - *(.image) - } -} diff --git a/sys/arch/armish/stand/boot/libsa.h b/sys/arch/armish/stand/boot/libsa.h deleted file mode 100644 index e0bd0e594fc..00000000000 --- a/sys/arch/armish/stand/boot/libsa.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: libsa.h,v 1.2 2011/03/13 00:13:52 deraadt Exp $ */ - -/* - * Copyright (c) 2006 Mark Kettenis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <lib/libsa/stand.h> - -#define DEFAULT_KERNEL_ADDRESS 0 - -#ifdef DEBUG -#define DPRINTF(x) printf x; -#else -#define DPRINTF(x) -#endif - -/* - * com - */ -void com_probe(struct consdev *); -void com_init(struct consdev *); -int com_getc(dev_t); -void com_putc(dev_t, int); - -/* - * wd - */ -int wdstrategy(void *, int, daddr32_t, size_t, void *, size_t *); -int wdopen(struct open_file *, ...); -int wdclose(struct open_file *); diff --git a/sys/arch/armish/stand/boot/machdep.c b/sys/arch/armish/stand/boot/machdep.c deleted file mode 100644 index b54cd7c6749..00000000000 --- a/sys/arch/armish/stand/boot/machdep.c +++ /dev/null @@ -1,125 +0,0 @@ -/* $OpenBSD: machdep.c,v 1.4 2007/11/24 12:59:28 jmc Exp $ */ - -/* - * Copyright (c) 2006 Mark Kettenis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <arm/pte.h> -#include <dev/pci/pcireg.h> - -#include "libsa.h" - -#define L1_IDX(va) (((uint32_t)(va)) >> L1_S_SHIFT) - -#define ATU_OIOWTVR 0xffffe15c -#define ATU_ATUCR 0xffffe180 -#define ATU_PCSR 0xffffe184 -#define ATU_OCCAR 0xffffe1a4 -#define ATU_OCCDR 0xffffe1ac - -#define ATUCR_OUT_EN (1U << 1) - -#define PCSR_RIB (1U << 5) -#define PCSR_RPB (1U << 4) - -void -machdep(void) -{ - uint32_t *pde; - uint32_t va; - - /* - * Clean up the mess that RedBoot left us in, amd make sure we - * can access the PCI bus. - */ - - *((volatile uint32_t *)(ATU_ATUCR)) = ATUCR_OUT_EN; - - __asm volatile ("mrc p15, 0, %0, c2, c0, 0" : "=r" (pde)); - pde = (uint32_t *)((uint32_t)pde & 0x0fffffff); - - va = *((volatile uint32_t *)(ATU_OIOWTVR)); - pde[L1_IDX(va)] = (va & L1_ADDR_BITS) | L1_S_AP(AP_KRWUR) | L1_TYPE_S; - - /* Start timer */ - __asm volatile ("mcr p6, 0, %0, c3, c1, 0" :: "r" (0xffffffff)); - __asm volatile ("mcr p6, 0, %0, c1, c1, 0" :: "r" (0x00000032)); - - cninit(); - -{ - /* - * this code does a device probe on pci space, - * It looks for a wd compatible controller. - * however when it reads the device register, it does - * not check if a bus fault occurs on the access. - * Since the bootloader doesn't handle faults, this - * crashes the bootloader if it reads a non-existent - * device. - * The tag computation comes from arm/xscale/i80321_pci.c - * i80321_pci_conf_setup() - */ - int device, bar; - for (device = 1; device < 4; device++) { - u_int32_t tag, result, size; - volatile u_int32_t *occar = (u_int32_t *)ATU_OCCAR; - volatile u_int32_t *occdr = (u_int32_t *)ATU_OCCDR; - - tag = 1 << (device + 16) | (device << 11); - *occar = tag; - result = *occdr; - if (result == ~0) - continue; - *occar = tag | PCI_CLASS_REG; - result = *occdr; - - if (PCI_CLASS(result) != PCI_CLASS_MASS_STORAGE) - continue; - if (PCI_SUBCLASS(result) != PCI_SUBCLASS_MASS_STORAGE_ATA && - PCI_SUBCLASS(result) != PCI_SUBCLASS_MASS_STORAGE_SATA && - PCI_SUBCLASS(result) != PCI_SUBCLASS_MASS_STORAGE_MISC) - continue; - - *occar = tag | PCI_MAPREG_START; - result = *occdr; - - /* verify result is an IO BAR */ - if (PCI_MAPREG_TYPE(result) == PCI_MAPREG_TYPE_IO) { - extern u_int32_t wdc_base_addr; - wdc_base_addr = PCI_MAPREG_MEM_ADDR(result); - DPRINTF(("setting wdc_base addr to %x\n", - wdc_base_addr)); - } - } -} - -} - -int -main(void) -{ - boot(0); - return 0; -} - -void -_rtt(void) -{ - *((volatile uint32_t *)(ATU_PCSR)) = PCSR_RIB | PCSR_RPB; - - printf("RESET FAILED\n"); - for (;;) ; -} diff --git a/sys/arch/armish/stand/boot/ns16550.c b/sys/arch/armish/stand/boot/ns16550.c deleted file mode 100644 index 36ba5602da9..00000000000 --- a/sys/arch/armish/stand/boot/ns16550.c +++ /dev/null @@ -1,137 +0,0 @@ -/* $OpenBSD: ns16550.c,v 1.3 2008/01/23 16:37:57 jsing Exp $ */ -/* $NetBSD: ns16550.c,v 1.3 2005/12/24 20:07:03 perry Exp $ */ - -/* - * Copyright (c) 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -/* - * This file provides console I/O routines for boards that use - * 16550-compatible UARTs. - */ - -#include <sys/types.h> - -#include <dev/cons.h> -#include <dev/ic/comreg.h> - -#include "libsa.h" - -#define INB(x) *((volatile uint8_t *) (CONADDR + (x))) -#define OUTB(x, v) *((volatile uint8_t *) (CONADDR + (x))) = (v) - -#define ISSET(t,f) ((t) & (f)) - -#ifndef NS16550_FREQ -#define NS16550_FREQ COM_FREQ -#endif - -static int -comspeed(int speed) -{ -#define divrnd(n, q) (((n)*2/(q)+1)/2) /* divide and round off */ - - int x, err; - - if (speed <= 0) - return (-1); - x = divrnd((NS16550_FREQ / 16), speed); - if (x <= 0) - return (-1); - err = divrnd((((quad_t)NS16550_FREQ) / 16) * 1000, speed * x) - 1000; - if (err < 0) - err = -err; - if (err > COM_TOLERANCE) - return (-1); - return (x); -#undef divrnd -} - -void -com_probe(struct consdev *cn) -{ - cn->cn_pri = CN_LOWPRI; - cn->cn_dev = makedev(12, 0); -} - -void -com_init(struct consdev *cn) -{ - int rate; - - OUTB(com_cfcr, LCR_DLAB); - rate = comspeed(CONSPEED); - OUTB(com_dlbl, rate); - OUTB(com_dlbh, rate >> 8); - OUTB(com_cfcr, LCR_8BITS); - OUTB(com_mcr, MCR_DTR | MCR_RTS); - OUTB(com_fifo, - FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1); - OUTB(com_ier, 0); -} - -int -com_getc(dev_t dev) -{ - uint8_t stat; - - if (dev & 0x80) - return ISSET(stat = INB(com_lsr), LSR_RXRDY); - - while (!ISSET(stat = INB(com_lsr), LSR_RXRDY)) - /* spin */ ; - return (INB(com_data)); -} - -void -com_putc(dev_t dev, int c) -{ - uint8_t stat; - int timo; - - /* Wait for any pending transmission to finish. */ - timo = 50000; - while (!ISSET(stat = INB(com_lsr), LSR_TXRDY) && --timo) - /* spin */ ; - - OUTB(com_data, c); - - /* Wait for this transmission to complete. */ - timo = 1500000; - while (!ISSET(stat = INB(com_lsr), LSR_TXRDY) && --timo) - /* spin */ ; - - /* Clear any interrupts generated by this transmission. */ - (void) INB(com_iir); -} diff --git a/sys/arch/armish/stand/boot/pciide.c b/sys/arch/armish/stand/boot/pciide.c deleted file mode 100644 index b4f6439729d..00000000000 --- a/sys/arch/armish/stand/boot/pciide.c +++ /dev/null @@ -1,70 +0,0 @@ -/* $OpenBSD: pciide.c,v 1.4 2008/06/26 05:42:10 ray Exp $ */ -/* $NetBSD: pciide.c,v 1.5 2005/12/11 12:17:06 christos Exp $ */ - -/*- - * Copyright (c) 2003 The NetBSD Foundation, Inc. - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include <sys/types.h> - -#include "libsa.h" -#include "wdvar.h" - -u_int32_t wdc_base_addr = 0; - -int -pciide_init(struct wdc_channel *chp, u_int chan) -{ - u_int32_t cmdreg, ctlreg; - int i; - - /* - * two channels per chip, one drive per channel - */ - if (chan >= PCIIDE_NUM_CHANNELS || wdc_base_addr == 0) - return (ENXIO); - chp->ndrives = 1; - - DPRINTF(("[pciide] channel: %d\n", chan)); - - /* - * XXX map? - */ - cmdreg = wdc_base_addr + chan * 0x10; - ctlreg = wdc_base_addr+0x8 + chan * 0x10; - - /* set up cmd regsiters */ - chp->c_cmdbase = (u_int8_t *)cmdreg; - chp->c_data = (u_int16_t *)(cmdreg + wd_data); - for (i = 0; i < WDC_NPORTS; i++) - chp->c_cmdreg[i] = chp->c_cmdbase + i; - /* set up shadow registers */ - chp->c_cmdreg[wd_status] = chp->c_cmdreg[wd_command]; - chp->c_cmdreg[wd_features] = chp->c_cmdreg[wd_precomp]; - /* set up ctl registers */ - chp->c_ctlbase = (u_int8_t *)ctlreg; - - return (0); -} diff --git a/sys/arch/armish/stand/boot/start.S b/sys/arch/armish/stand/boot/start.S deleted file mode 100644 index 03f3e10d2de..00000000000 --- a/sys/arch/armish/stand/boot/start.S +++ /dev/null @@ -1,83 +0,0 @@ -/* $OpenBSD: start.S,v 1.1 2006/07/28 17:12:06 kettenis Exp $ */ -/* $NetBSD: srtbegin.S,v 1.7 2005/12/11 12:17:10 christos Exp $ */ - -/* - * Copyright (c) 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#include <machine/asm.h> -#include <arm/armreg.h> - -#define STACKSIZE 8192 - -ENTRY(start) - /* - * We assume we've been loaded VA==PA, or that the MMU - * is disabled. Make sure the MMU is disabled so that - * we don't have to care about the caches. - */ - /* Clear the BSS. */ - adr r1, Lbss - ldmia r1, {r1, r2} - sub r2, r2, r1 - mov r3, #0 - -1: strb r3, [r1], #0x01 - subs r2, r2, #0x01 - bgt 1b - - /* Set the stack pointer */ - adr r1, Lstack - ldr r1, [r1] - add sp, r1, #STACKSIZE - - b _C_LABEL(main) - -Ltext: - .word _C_LABEL(__text_store) - .word _C_LABEL(start) - .word _C_LABEL(_etext) - -Ldata: - .word _C_LABEL(__data_store) - .word _C_LABEL(__data_start) - -Lbss: - .word _C_LABEL(_edata) - .word _C_LABEL(_end) - -Lstack: - .word Lstackspace - - .comm Lstackspace, STACKSIZE diff --git a/sys/arch/armish/stand/boot/time.c b/sys/arch/armish/stand/boot/time.c deleted file mode 100644 index 948072b9b10..00000000000 --- a/sys/arch/armish/stand/boot/time.c +++ /dev/null @@ -1,30 +0,0 @@ -/* $OpenBSD: time.c,v 1.2 2014/07/13 11:50:40 jasper Exp $ */ - -/* - * Copyright (c) 2006 Mark Kettenis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> - -#include "libsa.h" - -time_t -getsecs(void) -{ - uint32_t count; - - __asm volatile ("mrc p6, 0, %0, c3, c1, 0" : "=r" (count)); - return ((0xffffffff - count) / 12500000); -} diff --git a/sys/arch/armish/stand/boot/wd.c b/sys/arch/armish/stand/boot/wd.c deleted file mode 100644 index 1447582611f..00000000000 --- a/sys/arch/armish/stand/boot/wd.c +++ /dev/null @@ -1,293 +0,0 @@ -/* $OpenBSD: wd.c,v 1.13 2015/10/01 20:28:12 krw Exp $ */ -/* $NetBSD: wd.c,v 1.5 2005/12/11 12:17:06 christos Exp $ */ - -/*- - * Copyright (c) 2003 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Manuel Bouyer. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include <sys/param.h> -#include <sys/stdint.h> - -#include "libsa.h" -#include "wdvar.h" - -void wdprobe(void); -int wd_get_params(struct wd_softc *wd); -int wdgetdisklabel(struct wd_softc *wd); -void wdgetdefaultlabel(struct wd_softc *wd, struct disklabel *lp); - -struct wd_softc wd_devs[NUNITS]; -int wd_ndevs = -1; - -void -wdprobe(void) -{ - struct wd_softc *wd = wd_devs; - u_int chan, drive, unit = 0; - - for (chan = 0; chan < PCIIDE_NUM_CHANNELS; chan++) { - if (wdc_init(wd, chan) != 0) - continue; - for (drive = 0; drive < wd->sc_channel.ndrives; drive++) { - wd->sc_unit = unit; - wd->sc_drive = drive; - - if (wd_get_params(wd) != 0) - continue; - - DPRINTF(("wd%d: channel %d drive %d\n", - unit, chan, drive)); - unit++; - wd++; - } - } - - wd_ndevs = unit; -} - -/* - * Get drive parameters through 'device identify' command. - */ -int -wd_get_params(wd) - struct wd_softc *wd; -{ - int error; - unsigned char buf[DEV_BSIZE]; - - if ((error = wdc_exec_identify(wd, buf)) != 0) - return (error); - - wd->sc_params = *(struct ataparams *)buf; - - /* 48-bit LBA addressing */ - if ((wd->sc_params.atap_cmd2_en & ATAPI_CMD2_48AD) != 0) { - DPRINTF(("Drive supports LBA48.\n")); -#if defined(_ENABLE_LBA48) - wd->sc_flags |= WDF_LBA48; -#endif - } - - /* Prior to ATA-4, LBA was optional. */ - if ((wd->sc_params.atap_capabilities1 & WDC_CAP_LBA) != 0) { - DPRINTF(("Drive supports LBA.\n")); - wd->sc_flags |= WDF_LBA; - } - - return (0); -} - -/* - * Initialize disk label to the default value. - */ -void -wdgetdefaultlabel(wd, lp) - struct wd_softc *wd; - struct disklabel *lp; -{ - memset(lp, 0, sizeof(struct disklabel)); - - lp->d_secsize = DEV_BSIZE; - lp->d_ntracks = wd->sc_params.atap_heads; - lp->d_nsectors = wd->sc_params.atap_sectors; - lp->d_ncylinders = wd->sc_params.atap_cylinders; - lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors; - - if (strcmp(wd->sc_params.atap_model, "ST506") == 0) - lp->d_type = DTYPE_ST506; - else - lp->d_type = DTYPE_ESDI; - - strncpy(lp->d_typename, wd->sc_params.atap_model, 16); - strncpy(lp->d_packname, "fictitious", 16); - if (wd->sc_capacity > UINT32_MAX) - DL_SETDSIZE(lp, UINT32_MAX); - else - DL_SETDSIZE(lp, wd->sc_capacity); - lp->d_flags = 0; - - DL_SETPOFFSET(&lp->d_partitions[RAW_PART], 0); - DL_SETPSIZE(&lp->d_partitions[RAW_PART], DL_GETDSIZE(lp)); - lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED; - lp->d_npartitions = MAXPARTITIONS; - - lp->d_magic = DISKMAGIC; - lp->d_magic2 = DISKMAGIC; - lp->d_checksum = dkcksum(lp); -} - -/* - * Read disk label from the device. - */ -int -wdgetdisklabel(wd) - struct wd_softc *wd; -{ - char *msg; - int sector; - size_t rsize; - struct disklabel *lp; - unsigned char buf[DEV_BSIZE]; - - wdgetdefaultlabel(wd, &wd->sc_label); - - /* - * Find OpenBSD Partition in DOS partition table. - */ - sector = 0; - if (wdstrategy(wd, F_READ, DOSBBSECTOR, DEV_BSIZE, buf, &rsize)) - return EOFFSET; - - if (*(u_int16_t *)&buf[DOSMBR_SIGNATURE_OFF] == DOSMBR_SIGNATURE) { - int i; - struct dos_partition *dp = (struct dos_partition *)buf; - - /* - * Lookup OpenBSD slice. If there is none, go ahead - * and try to read the disklabel off sector #0. - */ - - memcpy(dp, &buf[DOSPARTOFF], NDOSPART * sizeof(*dp)); - for (i = 0; i < NDOSPART; i++) { - if (dp[i].dp_typ == DOSPTYP_OPENBSD) { - sector = letoh32(dp[i].dp_start); - break; - } - } - } - - if (wdstrategy(wd, F_READ, sector + DOS_LABELSECTOR, DEV_BSIZE, - buf, &rsize)) - return EOFFSET; - - if ((msg = getdisklabel(buf + LABELOFFSET, &wd->sc_label))) - printf("wd%d: getdisklabel: %s\n", wd->sc_unit, msg); - - lp = &wd->sc_label; - - /* check partition */ - if ((wd->sc_part >= lp->d_npartitions) || - (lp->d_partitions[wd->sc_part].p_fstype == FS_UNUSED)) { - DPRINTF(("illegal partition\n")); - return (EPART); - } - - DPRINTF(("label info: d_secsize %d, d_nsectors %d, d_ncylinders %d," - "d_ntracks %d, d_secpercyl %d\n", - wd->sc_label.d_secsize, - wd->sc_label.d_nsectors, - wd->sc_label.d_ncylinders, - wd->sc_label.d_ntracks, - wd->sc_label.d_secpercyl)); - - return (0); -} - -/* - * Open device (read drive parameters and disklabel) - */ -int -wdopen(struct open_file *f, ...) -{ - int error; - va_list ap; - u_int unit, part, drive; - struct wd_softc *wd; - - va_start(ap, f); - unit = va_arg(ap, u_int); - part = va_arg(ap, u_int); - va_end(ap); - - DPRINTF(("wdopen: wd%d%c\n", unit, 'a' + part)); - - if (unit < 0 || unit >= NUNITS) - return (ENXIO); - - if (wd_ndevs == -1) - wdprobe(); - - if (unit >= wd_ndevs) - return (ENXIO); - - wd = &wd_devs[unit]; - wd->sc_part = part; - - if ((error = wdgetdisklabel(wd)) != 0) - return (error); - - f->f_devdata = wd; - return (0); -} - -/* - * Close device. - */ -int -wdclose(struct open_file *f) -{ - return 0; -} - -/* - * Read some data. - */ -int -wdstrategy(f, rw, dblk, size, buf, rsize) - void *f; - int rw; - daddr32_t dblk; - size_t size; - void *buf; - size_t *rsize; -{ - int i, nsect; - daddr32_t blkno; - struct wd_softc *wd = f; - - if (size == 0) - return (0); - - if (rw != F_READ) - return EOPNOTSUPP; - - nsect = howmany(size, wd->sc_label.d_secsize); - blkno = dblk + wd->sc_label.d_partitions[wd->sc_part].p_offset; - - for (i = 0; i < nsect; i++, blkno++) { - int error; - - if ((error = wdc_exec_read(wd, WDCC_READ, blkno, buf)) != 0) - return (error); - - buf += wd->sc_label.d_secsize; - } - - *rsize = size; - return (0); -} diff --git a/sys/arch/armish/stand/boot/wdc.c b/sys/arch/armish/stand/boot/wdc.c deleted file mode 100644 index 2d2f39ff2df..00000000000 --- a/sys/arch/armish/stand/boot/wdc.c +++ /dev/null @@ -1,375 +0,0 @@ -/* $OpenBSD: wdc.c,v 1.5 2013/03/24 19:20:34 deraadt Exp $ */ -/* $NetBSD: wdc.c,v 1.7 2005/12/11 12:17:06 christos Exp $ */ - -/*- - * Copyright (c) 2003 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Manuel Bouyer. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include <sys/param.h> - -#include "libsa.h" -#include "wdvar.h" - -#define WDCDELAY 100 -#define WDCNDELAY_RST 31000 * 10 - -static int wdcprobe(struct wdc_channel *chp); -static int wdc_wait_for_ready(struct wdc_channel *chp); -static int wdc_read_block(struct wd_softc *sc, struct wdc_command *wd_c); -static int __wdcwait_reset(struct wdc_channel *chp, int drv_mask); - -/* - * Reset the controller. - */ -static int -__wdcwait_reset(chp, drv_mask) - struct wdc_channel *chp; - int drv_mask; -{ - int timeout; - u_int8_t st0, st1; - - /* wait for BSY to deassert */ - for (timeout = 0; timeout < WDCNDELAY_RST; timeout++) { - WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); /* master */ - delay(10); - st0 = WDC_READ_REG(chp, wd_status); - WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10); /* slave */ - delay(10); - st1 = WDC_READ_REG(chp, wd_status); - - if ((drv_mask & 0x01) == 0) { - /* no master */ - if ((drv_mask & 0x02) != 0 && (st1 & WDCS_BSY) == 0) { - /* No master, slave is ready, it's done */ - goto end; - } - } else if ((drv_mask & 0x02) == 0) { - /* no slave */ - if ((drv_mask & 0x01) != 0 && (st0 & WDCS_BSY) == 0) { - /* No slave, master is ready, it's done */ - goto end; - } - } else { - /* Wait for both master and slave to be ready */ - if ((st0 & WDCS_BSY) == 0 && (st1 & WDCS_BSY) == 0) { - goto end; - } - } - - delay(WDCDELAY); - } - - /* Reset timed out. Maybe it's because drv_mask was not right */ - if (st0 & WDCS_BSY) - drv_mask &= ~0x01; - if (st1 & WDCS_BSY) - drv_mask &= ~0x02; - -end: - return (drv_mask); -} - -/* Test to see controller with at last one attached drive is there. - * Returns a bit for each possible drive found (0x01 for drive 0, - * 0x02 for drive 1). - * Logic: - * - If a status register is at 0xff, assume there is no drive here - * (ISA has pull-up resistors). Similarly if the status register has - * the value we last wrote to the bus (for IDE interfaces without pullups). - * If no drive at all -> return. - * - reset the controller, wait for it to complete (may take up to 31s !). - * If timeout -> return. - */ -static int -wdcprobe(chp) - struct wdc_channel *chp; -{ - u_int8_t st0, st1, sc, sn, cl, ch; - u_int8_t ret_value = 0x03; - u_int8_t drive; - int found; - - /* - * Sanity check to see if the wdc channel responds at all. - */ - WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); - delay(10); - st0 = WDC_READ_REG(chp, wd_status); - WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10); - delay(10); - st1 = WDC_READ_REG(chp, wd_status); - - if (st0 == 0xff || st0 == WDSD_IBM) - ret_value &= ~0x01; - if (st1 == 0xff || st1 == (WDSD_IBM | 0x10)) - ret_value &= ~0x02; - if (ret_value == 0) - return (ENXIO); - - /* assert SRST, wait for reset to complete */ - WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); - delay(10); - WDC_WRITE_CTLREG(chp, wd_aux_ctlr, WDCTL_RST | WDCTL_IDS); - delay(1000); - WDC_WRITE_CTLREG(chp, wd_aux_ctlr, WDCTL_IDS); - delay(1000); - (void) WDC_READ_REG(chp, wd_error); - WDC_WRITE_CTLREG(chp, wd_aux_ctlr, WDCTL_4BIT); - delay(10); - - ret_value = __wdcwait_reset(chp, ret_value); - - /* if reset failed, there's nothing here */ - if (ret_value == 0) - return (ENXIO); - - /* - * Test presence of drives. First test register signatures looking for - * ATAPI devices. If it's not an ATAPI and reset said there may be - * something here assume it's ATA or OLD. Ghost will be killed later in - * attach routine. - */ - found = 0; - for (drive = 0; drive < 2; drive++) { - if ((ret_value & (0x01 << drive)) == 0) - continue; - return (0); - } - return (ENXIO); -} - -/* - * Initialize the device. - */ -int -wdc_init(sc, unit) - struct wd_softc *sc; - u_int unit; -{ - if (pciide_init(&sc->sc_channel, unit) != 0) - return (ENXIO); - if (wdcprobe(&sc->sc_channel) != 0) - return (ENXIO); - return (0); -} - -/* - * Wait until the device is ready. - */ -int -wdc_wait_for_ready(chp) - struct wdc_channel *chp; -{ - u_int timeout; - for (timeout = WDC_TIMEOUT; timeout > 0; --timeout) { - if ((WDC_READ_REG(chp, wd_status) & (WDCS_BSY | WDCS_DRDY)) - == WDCS_DRDY) - return (0); - } - return (ENXIO); -} - -/* - * Read one block off the device. - */ -int -wdc_read_block(sc, wd_c) - struct wd_softc *sc; - struct wdc_command *wd_c; -{ - int i; - struct wdc_channel *chp = &sc->sc_channel; - u_int16_t *ptr = (u_int16_t*)wd_c->data; - - if (ptr == NULL) - return (0); - - for (i = wd_c->bcount; i > 0; i -= sizeof(u_int16_t)) - *ptr++ = WDC_READ_DATA(chp); - - return (0); -} - -/* - * Send a command to the device (CHS and LBA addressing). - */ -int -wdccommand(wd, wd_c) - struct wd_softc *wd; - struct wdc_command *wd_c; -{ - u_int8_t err; - struct wdc_channel *chp = &wd->sc_channel; - -#if 0 - DPRINTF(("wdccommand(%d, %d, %d, %d, %d, %d, %d)\n", - wd_c->drive, wd_c->r_command, wd_c->r_cyl, - wd_c->r_head, wd_c->r_sector, wd_c->bcount, - wd_c->r_precomp)); -#endif - - WDC_WRITE_REG(chp, wd_precomp, wd_c->r_precomp); - WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count); - WDC_WRITE_REG(chp, wd_sector, wd_c->r_sector); - WDC_WRITE_REG(chp, wd_cyl_lo, wd_c->r_cyl); - WDC_WRITE_REG(chp, wd_cyl_hi, wd_c->r_cyl >> 8); - WDC_WRITE_REG(chp, wd_sdh, - WDSD_IBM | (wd_c->drive << 4) | wd_c->r_head); - WDC_WRITE_REG(chp, wd_command, wd_c->r_command); - - if (wdc_wait_for_ready(chp) != 0) - return (ENXIO); - - if (WDC_READ_REG(chp, wd_status) & WDCS_ERR) { - DPRINTF(("wd%d: error %x\n", wd->sc_unit, - WDC_READ_REG(chp, wd_error))); - return (ENXIO); - } - - return (0); -} - -/* - * Send a command to the device (LBA48 addressing). - */ -int -wdccommandext(wd, wd_c) - struct wd_softc *wd; - struct wdc_command *wd_c; -{ - u_int8_t err; - struct wdc_channel *chp = &wd->sc_channel; - - /* Select drive, head, and addressing mode. */ - WDC_WRITE_REG(chp, wd_sdh, (wd_c->drive << 4) | WDSD_LBA); - - /* previous */ - WDC_WRITE_REG(chp, wd_features, 0); - WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count >> 8); - WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 40); - WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 32); - WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno >> 24); - - /* current */ - WDC_WRITE_REG(chp, wd_features, 0); - WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count); - WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 16); - WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 8); - WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno); - - /* Send command. */ - WDC_WRITE_REG(chp, wd_command, wd_c->r_command); - - if (wdc_wait_for_ready(chp) != 0) - return (ENXIO); - - if (WDC_READ_REG(chp, wd_status) & WDCS_ERR) { - DPRINTF(("wd%d: error %x\n", wd->sc_unit, - WDC_READ_REG(chp, wd_error))); - return (ENXIO); - } - - return (0); -} - -/* - * Issue 'device identify' command. - */ -int -wdc_exec_identify(wd, data) - struct wd_softc *wd; - void *data; -{ - int error; - struct wdc_command wd_c; - - memset(&wd_c, 0, sizeof(wd_c)); - - wd_c.drive = wd->sc_drive; - wd_c.r_command = WDCC_IDENTIFY; - wd_c.bcount = DEV_BSIZE; - wd_c.data = data; - - if ((error = wdccommand(wd, &wd_c)) != 0) - return (error); - - return wdc_read_block(wd, &wd_c); -} - -/* - * Issue 'read' command. - */ -int -wdc_exec_read(wd, cmd, blkno, data) - struct wd_softc *wd; - u_int8_t cmd; - daddr32_t blkno; - void *data; -{ - int error; - struct wdc_command wd_c; - - memset(&wd_c, 0, sizeof(wd_c)); - - if (wd->sc_flags & WDF_LBA48) { - /* LBA48 */ - wd_c.r_blkno = blkno; - } else if (wd->sc_flags & WDF_LBA) { - /* LBA */ - wd_c.r_sector = (blkno >> 0) & 0xff; - wd_c.r_cyl = (blkno >> 8) & 0xffff; - wd_c.r_head = (blkno >> 24) & 0x0f; - wd_c.r_head |= WDSD_LBA; - } else { - /* LHS */ - wd_c.r_sector = blkno % wd->sc_label.d_nsectors; - wd_c.r_sector++; /* Sectors begin with 1, not 0. */ - blkno /= wd->sc_label.d_nsectors; - wd_c.r_head = blkno % wd->sc_label.d_ntracks; - blkno /= wd->sc_label.d_ntracks; - wd_c.r_cyl = blkno; - wd_c.r_head |= WDSD_CHS; - } - - wd_c.data = data; - wd_c.r_count = 1; - wd_c.drive = wd->sc_drive; - wd_c.r_command = cmd; - wd_c.bcount = wd->sc_label.d_secsize; - - if (wd->sc_flags & WDF_LBA48) - error = wdccommandext(wd, &wd_c); - else - error = wdccommand(wd, &wd_c); - - if (error != 0) - return (error); - - return wdc_read_block(wd, &wd_c); -} diff --git a/sys/arch/armish/stand/boot/wdvar.h b/sys/arch/armish/stand/boot/wdvar.h deleted file mode 100644 index 2718a445e02..00000000000 --- a/sys/arch/armish/stand/boot/wdvar.h +++ /dev/null @@ -1,134 +0,0 @@ -/* $OpenBSD: wdvar.h,v 1.3 2011/03/13 00:13:52 deraadt Exp $ */ -/* $NetBSD: wdvar.h,v 1.6 2005/12/11 12:17:06 christos Exp $ */ - -/*- - * Copyright (c) 2003 The NetBSD Foundation, Inc. - * Copyright (c) 2001 Dynarc AB, Sweden. All rights reserved. - * - * This code is derived from software written by Anders Magnusson, - * ragge@ludd.luth.se - * - * 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. - */ - -#ifndef _STAND_WDVAR_H -#define _STAND_WDVAR_H - -#include <sys/disklabel.h> - -#include <dev/ic/wdcreg.h> -#include <dev/ata/atareg.h> -#include <dev/pci/pciidereg.h> - -/* - * WD1003 / ATA Disk Controller register definitions. - */ - -/* offsets of registers in the 'regular' register region */ -#define wd_data 0 /* data register (R/W - 16 bits) */ -#define wd_error 1 /* error register (R) */ -#define wd_precomp 1 /* write precompensation (W) */ -#define wd_seccnt 2 /* sector count (R/W) */ -#define wd_ireason 2 /* interrupt reason (R/W) (for atapi) */ -#define wd_sector 3 /* first sector number (R/W) */ -#define wd_cyl_lo 4 /* cylinder address, low byte (R/W) */ -#define wd_cyl_hi 5 /* cylinder address, high byte (R/W) */ -#define wd_sdh 6 /* sector size/drive/head (R/W) */ -#define wd_command 7 /* command register (W) */ -#define wd_lba_lo 3 /* lba address, low byte (RW) */ -#define wd_lba_mi 4 /* lba address, middle byte (RW) */ -#define wd_lba_hi 5 /* lba address, high byte (RW) */ - -/* "shadow" registers; these may or may not overlap regular registers */ -#define wd_status 8 /* immediate status (R) */ -#define wd_features 9 /* features (W) */ - -/* offsets of registers in the auxiliary register region */ -#define wd_aux_altsts 0 /* alternate fixed disk status (R) */ -#define wd_aux_ctlr 0 /* fixed disk controller control (W) */ -#define WDCTL_4BIT 0x08 /* use four head bits (wd1003) */ -#define WDCTL_RST 0x04 /* reset the controller */ -#define WDCTL_IDS 0x02 /* disable controller interrupts */ - -#define WDC_TIMEOUT 2000000 -#define PCIIDE_CHANNEL_NDEV 2 -#define NUNITS (PCIIDE_CHANNEL_NDEV * PCIIDE_NUM_CHANNELS) -#define WDC_NPORTS 8 /* XXX */ -#define WDC_NSHADOWREG 2 /* XXX */ - -struct wdc_channel { - volatile u_int8_t *c_cmdbase; - volatile u_int8_t *c_ctlbase; - volatile u_int8_t *c_cmdreg[WDC_NPORTS + WDC_NSHADOWREG]; - volatile u_int16_t *c_data; - - u_int8_t ndrives; -}; - -#define WDC_READ_REG(chp, reg) *(chp)->c_cmdreg[(reg)] -#define WDC_WRITE_REG(chp, reg, val) *(chp)->c_cmdreg[(reg)] = (val) -#define WDC_READ_CTLREG(chp, reg) (chp)->c_ctlbase[(reg)] -#define WDC_WRITE_CTLREG(chp, reg, val) (chp)->c_ctlbase[(reg)] = (val) -#define WDC_READ_DATA(chp) *(chp)->c_data - -struct wd_softc { -#define WDF_LBA 0x0001 -#define WDF_LBA48 0x0002 - u_int16_t sc_flags; - - u_int sc_part; - u_int sc_unit; - - u_int64_t sc_capacity; - - struct ataparams sc_params; - struct disklabel sc_label; - struct wdc_channel sc_channel; - u_int sc_drive; -}; - -struct wdc_command { - u_int8_t drive; /* drive id */ - - u_int8_t r_command; /* Parameters to upload to registers */ - u_int8_t r_head; - u_int16_t r_cyl; - u_int8_t r_sector; - u_int8_t r_count; - u_int8_t r_precomp; - - u_int16_t bcount; - void *data; - - u_int64_t r_blkno; -}; - -int wdc_init (struct wd_softc*, u_int); -int wdccommand (struct wd_softc*, struct wdc_command*); -int wdccommandext (struct wd_softc*, struct wdc_command*); -int wdc_exec_read (struct wd_softc*, u_int8_t, daddr32_t, void*); -int wdc_exec_identify (struct wd_softc*, void*); - -int pciide_init (struct wdc_channel*, u_int); - -#endif /* _STAND_WDVAR_H */ diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 16512c695fd..13fbfa1dea1 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.192 2016/04/20 12:15:24 sthen Exp $ */ +/* $OpenBSD: re.c,v 1.193 2016/08/10 14:27:17 deraadt Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -644,18 +644,6 @@ re_reset(struct rl_softc *sc) CSR_WRITE_1(sc, RL_LDPS, 1); } -#ifdef __armish__ -/* - * Thecus N2100 doesn't store the full mac address in eeprom - * so we read the old mac address from the device before the reset - * in hopes that the proper mac address is already there. - */ -union { - u_int32_t eaddr_word[2]; - u_char eaddr[ETHER_ADDR_LEN]; -} boot_eaddr; -int boot_eaddr_valid; -#endif /* __armish__ */ /* * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. @@ -877,30 +865,6 @@ re_attach(struct rl_softc *sc, const char *intrstr) for (i = 0; i < ETHER_ADDR_LEN / 2; i++) as[i] = letoh16(as[i]); bcopy(as, eaddr, ETHER_ADDR_LEN); - -#ifdef __armish__ - /* - * On the Thecus N2100, the MAC address in the EEPROM is - * always 00:14:fd:10:00:00. The proper MAC address is - * stored in flash. Fortunately RedBoot configures the - * proper MAC address (for the first onboard interface) - * which we can read from the IDR. - */ - if (eaddr[0] == 0x00 && eaddr[1] == 0x14 && - eaddr[2] == 0xfd && eaddr[3] == 0x10 && - eaddr[4] == 0x00 && eaddr[5] == 0x00) { - if (boot_eaddr_valid == 0) { - boot_eaddr.eaddr_word[1] = - letoh32(CSR_READ_4(sc, RL_IDR4)); - boot_eaddr.eaddr_word[0] = - letoh32(CSR_READ_4(sc, RL_IDR0)); - boot_eaddr_valid = 1; - } - - bcopy(boot_eaddr.eaddr, eaddr, sizeof(eaddr)); - eaddr[5] += sc->sc_dev.dv_unit; - } -#endif } /* diff --git a/sys/dev/microcode/atmel/Makefile b/sys/dev/microcode/atmel/Makefile index 05753f83a3f..3288d05ee55 100644 --- a/sys/dev/microcode/atmel/Makefile +++ b/sys/dev/microcode/atmel/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.21 2016/07/10 15:16:15 visa Exp $ +# $OpenBSD: Makefile,v 1.22 2016/08/10 14:27:17 deraadt Exp $ NOPROG= NOMAN= @@ -7,7 +7,7 @@ CC=${HOSTCC} # USB capable systems only .if (${MACHINE_ARCH} == "powerpc" || \ ${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "armish" || ${MACHINE} == "armv7" || \ + ${MACHINE} == "armv7" || \ ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ diff --git a/sys/dev/microcode/kue/Makefile b/sys/dev/microcode/kue/Makefile index 4ccd4826651..f4525e26531 100644 --- a/sys/dev/microcode/kue/Makefile +++ b/sys/dev/microcode/kue/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2016/07/10 15:16:15 visa Exp $ +# $OpenBSD: Makefile,v 1.15 2016/08/10 14:27:17 deraadt Exp $ NOPROG= NOMAN= @@ -7,7 +7,7 @@ CC=${HOSTCC} # USB capable systems only .if (${MACHINE_ARCH} == "powerpc" || \ ${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "armish" || ${MACHINE} == "armv7" || \ + ${MACHINE} == "armv7" || \ ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ diff --git a/sys/dev/microcode/ral/Makefile b/sys/dev/microcode/ral/Makefile index 5fc6df631b2..3276fce6d8b 100644 --- a/sys/dev/microcode/ral/Makefile +++ b/sys/dev/microcode/ral/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.10 2016/07/10 15:16:15 visa Exp $ +# $OpenBSD: Makefile,v 1.11 2016/08/10 14:27:17 deraadt Exp $ NOPROG= NOMAN= @@ -6,7 +6,7 @@ CC=${HOSTCC} # PCI capable systems only .if (${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "armish" || ${MACHINE} == "hppa" || \ + ${MACHINE} == "hppa" || \ ${MACHINE} == "i386" || \ ${MACHINE} == "loongson" || ${MACHINE} == "octeon" || \ ${MACHINE_ARCH} == "powerpc" || \ diff --git a/sys/dev/microcode/rum/Makefile b/sys/dev/microcode/rum/Makefile index 00f044292c0..994274d4e27 100644 --- a/sys/dev/microcode/rum/Makefile +++ b/sys/dev/microcode/rum/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2016/07/10 15:16:15 visa Exp $ +# $OpenBSD: Makefile,v 1.15 2016/08/10 14:27:17 deraadt Exp $ NOPROG= NOMAN= @@ -7,7 +7,7 @@ CC=${HOSTCC} # USB capable systems only .if (${MACHINE_ARCH} == "powerpc" || \ ${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "armish" || ${MACHINE} == "armv7" || \ + ${MACHINE} == "armv7" || \ ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ diff --git a/sys/dev/microcode/tusb3410/Makefile b/sys/dev/microcode/tusb3410/Makefile index 0f4cd95d6a1..9909aa2cd89 100644 --- a/sys/dev/microcode/tusb3410/Makefile +++ b/sys/dev/microcode/tusb3410/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2016/07/10 15:16:15 visa Exp $ +# $OpenBSD: Makefile,v 1.9 2016/08/10 14:27:17 deraadt Exp $ NOPROG= NOMAN= @@ -7,7 +7,7 @@ CC=${HOSTCC} # USB capable systems only .if (${MACHINE_ARCH} == "powerpc" || \ ${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "armish" || ${MACHINE} == "armv7" || \ + ${MACHINE} == "armv7" || \ ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ diff --git a/sys/dev/microcode/udl/Makefile b/sys/dev/microcode/udl/Makefile index d2f24219590..67939419450 100644 --- a/sys/dev/microcode/udl/Makefile +++ b/sys/dev/microcode/udl/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2016/07/10 15:16:15 visa Exp $ +# $OpenBSD: Makefile,v 1.8 2016/08/10 14:27:17 deraadt Exp $ NOPROG= NOMAN= @@ -7,7 +7,7 @@ CC=${HOSTCC} # USB capable systems only .if (${MACHINE_ARCH} == "powerpc" || \ ${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "armish" || ${MACHINE} == "armv7" || \ + ${MACHINE} == "armv7" || \ ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ diff --git a/sys/dev/microcode/zydas/Makefile b/sys/dev/microcode/zydas/Makefile index 42b877bd381..7da7e298363 100644 --- a/sys/dev/microcode/zydas/Makefile +++ b/sys/dev/microcode/zydas/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2016/07/10 15:16:15 visa Exp $ +# $OpenBSD: Makefile,v 1.14 2016/08/10 14:27:17 deraadt Exp $ NOPROG= NOMAN= @@ -7,7 +7,7 @@ CC=${HOSTCC} # USB capable systems only .if (${MACHINE_ARCH} == "powerpc" || \ ${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "armish" || ${MACHINE} == "armv7" || \ + ${MACHINE} == "armv7" || \ ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ diff --git a/sys/kern/Makefile b/sys/kern/Makefile index f6ef2b490b4..ae4812a2bd5 100644 --- a/sys/kern/Makefile +++ b/sys/kern/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.44 2016/05/11 21:52:51 deraadt Exp $ +# $OpenBSD: Makefile,v 1.45 2016/08/10 14:27:17 deraadt Exp $ # Makefile for kernel tags files, init_sysent, etc. -ARCH= alpha amd64 armish armv7 \ +ARCH= alpha amd64 armv7 \ hppa i386 landisk loongson \ luna88k macppc octeon sgi socppc \ sparc sparc64 zaurus |