Index: head/sys/arm/sa11x0/files.sa11x0 =================================================================== --- head/sys/arm/sa11x0/files.sa11x0 (revision 177886) +++ head/sys/arm/sa11x0/files.sa11x0 (revision 177887) @@ -1,13 +1,14 @@ # $FreeBSD$ +arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_sa1.S standard arm/arm/cpufunc_asm_sa11x0.S standard arm/sa11x0/assabet_machdep.c optional assabet arm/sa11x0/sa11x0.c optional saip arm/sa11x0/sa11x0_ost.c optional saip arm/sa11x0/sa11x0_io.c optional saip arm/sa11x0/sa11x0_io_asm.S optional saip arm/sa11x0/sa11x0_irq.S optional saip arm/sa11x0/sa11x0_irqhandler.c optional saip arm/sa11x0/uart_cpu_sa1110.c optional uart saip arm/sa11x0/uart_dev_sa1110.c optional uart saip arm/sa11x0/uart_bus_sa1110.c optional uart saip Index: head/sys/arm/sa11x0/sa11x0_io.c =================================================================== --- head/sys/arm/sa11x0/sa11x0_io.c (revision 177886) +++ head/sys/arm/sa11x0/sa11x0_io.c (revision 177887) @@ -1,249 +1,136 @@ /* $NetBSD: sa11x0_io.c,v 1.12 2003/07/15 00:24:51 lukem Exp $ */ /*- * Copyright (c) 1997 Mark Brinicombe. * Copyright (c) 1997 Causality Limited. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Ichiro FUKUHARA. * * 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. * 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. */ /* * bus_space I/O functions for sa11x0 */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include /* Proto types for all the bus_space structure functions */ +bs_protos(generic); bs_protos(sa11x0); /* Declare the sa11x0 bus space tag */ struct bus_space sa11x0_bs_tag = { /* cookie */ NULL, /* mapping/unmapping */ - sa11x0_bs_map, - sa11x0_bs_unmap, - sa11x0_bs_subregion, + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, /* allocation/deallocation */ - sa11x0_bs_alloc, - sa11x0_bs_free, + generic_bs_alloc, + generic_bs_free, /* barrier */ - sa11x0_bs_barrier, + generic_bs_barrier, /* read (single) */ sa11x0_bs_r_1, sa11x0_bs_r_2, sa11x0_bs_r_4, NULL, /* read multiple */ sa11x0_bs_rm_1, sa11x0_bs_rm_2, sa11x0_bs_rm_4, NULL, /* read region */ NULL, sa11x0_bs_rr_2, NULL, NULL, /* write (single) */ sa11x0_bs_w_1, sa11x0_bs_w_2, sa11x0_bs_w_4, NULL, /* write multiple */ sa11x0_bs_wm_1, sa11x0_bs_wm_2, sa11x0_bs_wm_4, NULL, /* write region */ NULL, sa11x0_bs_wr_2, NULL, NULL, /* set multiple */ NULL, NULL, NULL, NULL, /* set region */ NULL, sa11x0_bs_sr_2, NULL, NULL, /* copy */ NULL, sa11x0_bs_c_2, NULL, NULL, }; - -/* bus space functions */ - -int -sa11x0_bs_map(t, bpa, size, cacheable, bshp) - void *t; - bus_addr_t bpa; - bus_size_t size; - int cacheable; - bus_space_handle_t *bshp; -{ - u_long startpa, endpa, pa; - vm_offset_t va; - pt_entry_t *pte; - const struct pmap_devmap *pd; - - if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { - /* Device was statically mapped. */ - *bshp = pd->pd_va + (bpa - pd->pd_pa); - return 0; - } - - startpa = trunc_page(bpa); - endpa = round_page(bpa + size); - - /* XXX use extent manager to check duplicate mapping */ - - va = kmem_alloc(kernel_map, endpa - startpa); - if (! va) - return(ENOMEM); - - *bshp = (bus_space_handle_t)(va + (bpa - startpa)); - - for(pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter(va, pa); - pte = vtopte(va); - if (cacheable == 0) { - *pte &= ~L2_S_CACHE_MASK; - PTE_SYNC(pte); - } - } - return(0); -} - -int -sa11x0_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable, - bpap, bshp) - void *t; - bus_addr_t rstart, rend; - bus_size_t size, alignment, boundary; - int cacheable; - bus_addr_t *bpap; - bus_space_handle_t *bshp; -{ - panic("sa11x0_alloc(): Help!"); -} - - -void -sa11x0_bs_unmap(t, h, size) - void *t; - bus_space_handle_t h; - bus_size_t size; -{ - vm_offset_t va, endva; - - if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - va = trunc_page((vm_offset_t)t); - endva = round_page((vm_offset_t)t + size); - - while (va < endva) { - pmap_kremove(va); - va += PAGE_SIZE; - } - kmem_free(kernel_map, va, endva - va); -} - -void -sa11x0_bs_free(t, bsh, size) - void *t; - bus_space_handle_t bsh; - bus_size_t size; -{ - - panic("sa11x0_free(): Help!"); - /* sa11x0_unmap() does all that we need to do. */ -/* sa11x0_unmap(t, bsh, size);*/ -} - -int -sa11x0_bs_subregion(t, bsh, offset, size, nbshp) - void *t; - bus_space_handle_t bsh; - bus_size_t offset, size; - bus_space_handle_t *nbshp; -{ - - *nbshp = bsh + offset; - return (0); -} - -void -sa11x0_bs_barrier(t, bsh, offset, len, flags) - void *t; - bus_space_handle_t bsh; - bus_size_t offset, len; - int flags; -{ -/* NULL */ -} /* End of sa11x0_io.c */ Index: head/sys/arm/xscale/i80321/files.ep80219 =================================================================== --- head/sys/arm/xscale/i80321/files.ep80219 (revision 177886) +++ head/sys/arm/xscale/i80321/files.ep80219 (revision 177887) @@ -1,12 +1,13 @@ #$FreeBSD$ # # # EP80219 Board Specific # +arm/arm/bus_space_generic.c standard arm/xscale/i80321/iq80321.c standard arm/xscale/i80321/ep80219_machdep.c standard arm/xscale/i80321/obio.c standard arm/xscale/i80321/obio_space.c standard arm/xscale/i80321/uart_cpu_i80321.c optional uart arm/xscale/i80321/uart_bus_i80321.c optional uart dev/uart/uart_dev_ns8250.c optional uart Index: head/sys/arm/xscale/i80321/files.i80219 =================================================================== --- head/sys/arm/xscale/i80321/files.i80219 (revision 177886) +++ head/sys/arm/xscale/i80321/files.i80219 (revision 177887) @@ -1,13 +1,14 @@ #$FreeBSD$ # # IOP Specific # +arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/arm/irq_dispatch.S standard arm/xscale/i80321/i80321.c standard arm/xscale/i80321/i80321_dma.c optional dma arm/xscale/i80321/i80321_mcu.c standard arm/xscale/i80321/i80321_pci.c optional pci arm/xscale/i80321/i80321_space.c standard arm/xscale/i80321/i80321_timer.c standard arm/xscale/i80321/i80321_wdog.c optional iopwdog Index: head/sys/arm/xscale/i80321/files.i80321 =================================================================== --- head/sys/arm/xscale/i80321/files.i80321 (revision 177886) +++ head/sys/arm/xscale/i80321/files.i80321 (revision 177887) @@ -1,11 +1,12 @@ #$FreeBSD$ +arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/arm/irq_dispatch.S standard arm/xscale/i80321/i80321.c standard arm/xscale/i80321/i80321_aau.c optional aau arm/xscale/i80321/i80321_dma.c optional dma arm/xscale/i80321/i80321_mcu.c standard arm/xscale/i80321/i80321_pci.c optional pci arm/xscale/i80321/i80321_space.c standard arm/xscale/i80321/i80321_timer.c standard arm/xscale/i80321/i80321_wdog.c optional iopwdog Index: head/sys/arm/xscale/i80321/files.iq31244 =================================================================== --- head/sys/arm/xscale/i80321/files.iq31244 (revision 177886) +++ head/sys/arm/xscale/i80321/files.iq31244 (revision 177887) @@ -1,9 +1,10 @@ #$FreeBSD$ +arm/arm/bus_space_generic.c standard arm/xscale/i80321/iq80321.c standard arm/xscale/i80321/iq31244_machdep.c standard arm/xscale/i80321/iq31244_7seg.c optional iq31244_7seg arm/xscale/i80321/obio.c standard arm/xscale/i80321/obio_space.c standard arm/xscale/i80321/uart_cpu_i80321.c optional uart arm/xscale/i80321/uart_bus_i80321.c optional uart dev/uart/uart_dev_ns8250.c optional uart Index: head/sys/arm/xscale/i80321/obio_space.c =================================================================== --- head/sys/arm/xscale/i80321/obio_space.c (revision 177886) +++ head/sys/arm/xscale/i80321/obio_space.c (revision 177887) @@ -1,225 +1,128 @@ /* $NetBSD: obio_space.c,v 1.6 2003/07/15 00:25:05 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. */ /* * bus_space functions for IQ80321 on-board devices */ #include __FBSDID("$FreeBSD$"); #include #include #include -#include - -#include -#include -#include -#include - #include /* Prototypes for all the bus_space structure functions */ -bs_protos(obio); bs_protos(generic); bs_protos(generic_armv4); /* * 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, + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, /* allocation/deallocation */ - obio_bs_alloc, - obio_bs_free, + generic_bs_alloc, + generic_bs_free, /* barrier */ - obio_bs_barrier, + generic_bs_barrier, /* read (single) */ generic_bs_r_1, generic_armv4_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, NULL, NULL, NULL, /* read region */ generic_bs_rr_1, NULL, NULL, NULL, /* write (single) */ generic_bs_w_1, generic_armv4_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, NULL, NULL, NULL, /* write region */ NULL, NULL, NULL, NULL, /* set multiple */ NULL, NULL, NULL, NULL, /* set region */ NULL, NULL, NULL, NULL, /* copy */ NULL, NULL, NULL, NULL, }; - -int -obio_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, - bus_space_handle_t *bshp) -{ - const struct pmap_devmap *pd; - vm_paddr_t startpa, endpa, pa, offset; - vm_offset_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); - offset = bpa & PAGE_MASK; - startpa = trunc_page(bpa); - - va = kmem_alloc(kernel_map, endpa - startpa); - if (va == 0) - return (ENOMEM); - - *bshp = va + offset; - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter(va, pa); - pte = vtopte(va); - *pte &= ~L2_S_CACHE_MASK; - PTE_SYNC(pte); - } - - 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 h, bus_size_t size) -{ - vm_offset_t va, endva; - - if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - endva = round_page((vm_offset_t)t + size); - va = trunc_page((vm_offset_t)t); - - while (va < endva) { - pmap_kremove(va); - va += PAGE_SIZE; - } - kmem_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_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - - /* Nothing to do. */ -} Index: head/sys/arm/xscale/i8134x/obio_space.c =================================================================== --- head/sys/arm/xscale/i8134x/obio_space.c (revision 177886) +++ head/sys/arm/xscale/i8134x/obio_space.c (revision 177887) @@ -1,225 +1,128 @@ /* $NetBSD: obio_space.c,v 1.6 2003/07/15 00:25:05 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. */ /* * bus_space functions for IQ80321 on-board devices */ #include __FBSDID("$FreeBSD$"); #include #include #include -#include - -#include -#include -#include -#include - #include /* Prototypes for all the bus_space structure functions */ -bs_protos(obio); bs_protos(generic); bs_protos(generic_armv4); /* * 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, + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, /* allocation/deallocation */ - obio_bs_alloc, - obio_bs_free, + generic_bs_alloc, + generic_bs_free, /* barrier */ - obio_bs_barrier, + generic_bs_barrier, /* read (single) */ generic_bs_r_1, generic_armv4_bs_r_2, generic_bs_r_4, NULL, /* read multiple */ generic_bs_rm_1, NULL, NULL, NULL, /* read region */ generic_bs_rr_1, NULL, NULL, NULL, /* write (single) */ generic_bs_w_1, generic_armv4_bs_w_2, generic_bs_w_4, NULL, /* write multiple */ generic_bs_wm_1, NULL, NULL, NULL, /* write region */ NULL, NULL, NULL, NULL, /* set multiple */ NULL, NULL, NULL, NULL, /* set region */ NULL, NULL, NULL, NULL, /* copy */ NULL, NULL, NULL, NULL, }; - -int -obio_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, - bus_space_handle_t *bshp) -{ - const struct pmap_devmap *pd; - vm_paddr_t startpa, endpa, pa, offset; - vm_offset_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); - offset = bpa & PAGE_MASK; - startpa = trunc_page(bpa); - - va = kmem_alloc(kernel_map, endpa - startpa); - if (va == 0) - return (ENOMEM); - - *bshp = va + offset; - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter(va, pa); - pte = vtopte(va); - *pte &= ~L2_S_CACHE_MASK; - PTE_SYNC(pte); - } - - 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 h, bus_size_t size) -{ - vm_offset_t va, endva; - - if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - endva = round_page((vm_offset_t)t + size); - va = trunc_page((vm_offset_t)t); - - while (va < endva) { - pmap_kremove(va); - va += PAGE_SIZE; - } - kmem_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_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - - /* Nothing to do. */ -} Index: head/sys/arm/xscale/ixp425/files.avila =================================================================== --- head/sys/arm/xscale/ixp425/files.avila (revision 177886) +++ head/sys/arm/xscale/ixp425/files.avila (revision 177887) @@ -1,5 +1,6 @@ #$FreeBSD$ +arm/arm/bus_space_generic.c standard arm/xscale/ixp425/avila_machdep.c standard arm/xscale/ixp425/avila_ata.c optional avila_ata arm/xscale/ixp425/avila_led.c optional avila_led arm/xscale/ixp425/ixdp425_pci.c optional pci Index: head/sys/arm/xscale/ixp425/files.ixp425 =================================================================== --- head/sys/arm/xscale/ixp425/files.ixp425 (revision 177886) +++ head/sys/arm/xscale/ixp425/files.ixp425 (revision 177887) @@ -1,45 +1,46 @@ #$FreeBSD$ +arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/arm/irq_dispatch.S standard arm/xscale/ixp425/ixp425.c standard arm/xscale/ixp425/ixp425_mem.c standard arm/xscale/ixp425/ixp425_space.c standard arm/xscale/ixp425/ixp425_timer.c standard arm/xscale/ixp425/ixp425_wdog.c optional ixpwdog arm/xscale/ixp425/ixp425_iic.c optional ixpiic arm/xscale/ixp425/ixp425_pci.c optional pci arm/xscale/ixp425/ixp425_pci_asm.S optional pci arm/xscale/ixp425/ixp425_pci_space.c optional pci arm/xscale/ixp425/uart_cpu_ixp425.c optional uart arm/xscale/ixp425/uart_bus_ixp425.c optional uart arm/xscale/ixp425/ixp425_a4x_space.c optional uart arm/xscale/ixp425/ixp425_a4x_io.S optional uart dev/uart/uart_dev_ns8250.c optional uart # # NPE-based Ethernet support (requires qmgr also). # arm/xscale/ixp425/if_npe.c optional npe arm/xscale/ixp425/ixp425_npe.c optional npe ixp425_npe_fw.c optional npe_fw \ compile-with "${AWK} -f $S/tools/fw_stub.awk IxNpeMicrocode.dat:npe_fw -mnpe -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "ixp425_npe_fw.c" # # NB: ld encodes the path in the binary symbols generated for the # firmware image so link the file to the object directory to # get known values for reference in the _fw.c file. # IxNpeMicrocode.fwo optional npe_fw \ dependency "IxNpeMicrocode.dat" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} IxNpeMicrocode.dat" \ no-implicit-rule \ clean "IxNpeMicrocode.fwo" IxNpeMicrocode.dat optional npe_fw \ dependency ".PHONY" \ compile-with "uudecode < $S/contrib/dev/npe/IxNpeMicrocode.dat.uu" \ no-obj no-implicit-rule \ clean "IxNpeMicrocode.dat" # # Q-Manager support # arm/xscale/ixp425/ixp425_qmgr.c optional qmgr Index: head/sys/arm/xscale/ixp425/ixp425_a4x_space.c =================================================================== --- head/sys/arm/xscale/ixp425/ixp425_a4x_space.c (revision 177886) +++ head/sys/arm/xscale/ixp425/ixp425_a4x_space.c (revision 177887) @@ -1,116 +1,115 @@ /* $NetBSD: ixp425_a4x_space.c,v 1.2 2005/12/11 12:16:51 christos Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. * All rights reserved. * * Written by Steve C. Woodford 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 tag for 8/16-bit devices on 32-bit bus. * all registers are located at the address of multiple of 4. * * Based on pxa2x0_a4x_space.c */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include /* Prototypes for all the bus_space structure functions */ -bs_protos(ixp425); bs_protos(a4x); bs_protos(generic); bs_protos(generic_armv4); struct bus_space ixp425_a4x_bs_tag = { /* cookie */ .bs_cookie = (void *) 0, /* mapping/unmapping */ - .bs_map = ixp425_bs_map, - .bs_unmap = ixp425_bs_unmap, - .bs_subregion = ixp425_bs_subregion, + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, /* allocation/deallocation */ - .bs_alloc = ixp425_bs_alloc, /* XXX not implemented */ - .bs_free = ixp425_bs_free, /* XXX not implemented */ + .bs_alloc = generic_bs_alloc, /* XXX not implemented */ + .bs_free = generic_bs_free, /* XXX not implemented */ /* barrier */ - .bs_barrier = ixp425_bs_barrier, + .bs_barrier = generic_bs_barrier, /* read (single) */ .bs_r_1 = a4x_bs_r_1, .bs_r_2 = a4x_bs_r_2, .bs_r_4 = a4x_bs_r_4, /* read multiple */ .bs_rm_1 = a4x_bs_rm_1, .bs_rm_2 = a4x_bs_rm_2, /* read region */ /* XXX not implemented */ /* write (single) */ .bs_w_1 = a4x_bs_w_1, .bs_w_2 = a4x_bs_w_2, .bs_w_4 = a4x_bs_w_4, /* write multiple */ .bs_wm_1 = a4x_bs_wm_1, .bs_wm_2 = a4x_bs_wm_2, /* write region */ /* XXX not implemented */ /* set multiple */ /* XXX not implemented */ /* set region */ /* XXX not implemented */ /* copy */ /* XXX not implemented */ }; Index: head/sys/arm/xscale/ixp425/ixp425_space.c =================================================================== --- head/sys/arm/xscale/ixp425/ixp425_space.c (revision 177886) +++ head/sys/arm/xscale/ixp425/ixp425_space.c (revision 177887) @@ -1,215 +1,130 @@ /* $NetBSD: ixp425_space.c,v 1.6 2006/04/10 03:36:03 simonb Exp $ */ /* * Copyright (c) 2003 * Ichiro FUKUHARA . * 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 Ichiro FUKUHARA. * 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 ICHIRO FUKUHARA ``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 ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD 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 __FBSDID("$FreeBSD$"); /* * bus_space I/O functions for ixp425 */ #include #include #include #include #include #include #include #include #include #include #include #include /* Proto types for all the bus_space structure functions */ -bs_protos(ixp425); bs_protos(generic); bs_protos(generic_armv4); struct bus_space ixp425_bs_tag = { /* cookie */ .bs_cookie = (void *) 0, /* mapping/unmapping */ - .bs_map = ixp425_bs_map, - .bs_unmap = ixp425_bs_unmap, - .bs_subregion = ixp425_bs_subregion, + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, /* allocation/deallocation */ - .bs_alloc = ixp425_bs_alloc, - .bs_free = ixp425_bs_free, + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, /* barrier */ - .bs_barrier = ixp425_bs_barrier, + .bs_barrier = generic_bs_barrier, /* read (single) */ .bs_r_1 = generic_bs_r_1, .bs_r_2 = generic_armv4_bs_r_2, .bs_r_4 = generic_bs_r_4, .bs_r_8 = NULL, /* read multiple */ .bs_rm_1 = generic_bs_rm_1, .bs_rm_2 = generic_armv4_bs_rm_2, .bs_rm_4 = generic_bs_rm_4, .bs_rm_8 = NULL, /* read region */ .bs_rr_1 = generic_bs_rr_1, .bs_rr_2 = generic_armv4_bs_rr_2, .bs_rr_4 = generic_bs_rr_4, .bs_rr_8 = NULL, /* write (single) */ .bs_w_1 = generic_bs_w_1, .bs_w_2 = generic_armv4_bs_w_2, .bs_w_4 = generic_bs_w_4, .bs_w_8 = NULL, /* write multiple */ .bs_wm_1 = generic_bs_wm_1, .bs_wm_2 = generic_armv4_bs_wm_2, .bs_wm_4 = generic_bs_wm_4, .bs_wm_8 = NULL, /* write region */ .bs_wr_1 = generic_bs_wr_1, .bs_wr_2 = generic_armv4_bs_wr_2, .bs_wr_4 = generic_bs_wr_4, .bs_wr_8 = NULL, /* set multiple */ /* XXX not implemented */ /* set region */ .bs_sr_1 = NULL, .bs_sr_2 = generic_armv4_bs_sr_2, .bs_sr_4 = generic_bs_sr_4, .bs_sr_8 = NULL, /* copy */ .bs_c_1 = NULL, .bs_c_2 = generic_armv4_bs_c_2, .bs_c_4 = NULL, .bs_c_8 = NULL, }; - -int -ixp425_bs_map(void *t, bus_addr_t bpa, bus_size_t size, - int cacheable, bus_space_handle_t *bshp) -{ - const struct pmap_devmap *pd; - vm_paddr_t startpa, endpa, pa, offset; - vm_offset_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); - offset = bpa & PAGE_MASK; - startpa = trunc_page(bpa); - - va = kmem_alloc(kernel_map, endpa - startpa); - if (va == 0) - return (ENOMEM); - - *bshp = va + offset; - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter(va, pa); - pte = vtopte(va); - *pte &= ~L2_S_CACHE_MASK; - PTE_SYNC(pte); - } - - return (0); -} - -void -ixp425_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) -{ - vm_offset_t va, endva; - - if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - endva = round_page((vm_offset_t)t + size); - va = trunc_page((vm_offset_t)t); - - while (va < endva) { - pmap_kremove(va); - va += PAGE_SIZE; - } - kmem_free(kernel_map, va, endva - va); -} - -int -ixp425_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 cacheable, - bus_addr_t *bpap, bus_space_handle_t *bshp) -{ - panic("ixp425_bs_alloc(): not implemented"); -} - -void -ixp425_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - panic("ixp425_bs_free(): not implemented"); -} - -int -ixp425_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 -ixp425_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - /* Nothing to do. */ -}