1*e1d3e1b0Sjdolecek /* $NetBSD: isa_machdep.h,v 1.10 2016/10/18 22:04:33 jdolecek Exp $ */ 2db2b0adeStakemura 3961880b5Such /*- 4961880b5Such * Copyright (c) 1999 The NetBSD Foundation, Inc. 5db2b0adeStakemura * All rights reserved. 6db2b0adeStakemura * 7961880b5Such * This code is derived from software contributed to The NetBSD Foundation 8961880b5Such * by UCHIYAMA Yasushi. 9961880b5Such * 10db2b0adeStakemura * Redistribution and use in source and binary forms, with or without 11db2b0adeStakemura * modification, are permitted provided that the following conditions 12db2b0adeStakemura * are met: 13db2b0adeStakemura * 1. Redistributions of source code must retain the above copyright 14db2b0adeStakemura * notice, this list of conditions and the following disclaimer. 15961880b5Such * 2. Redistributions in binary form must reproduce the above copyright 16961880b5Such * notice, this list of conditions and the following disclaimer in the 17961880b5Such * documentation and/or other materials provided with the distribution. 18db2b0adeStakemura * 19961880b5Such * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20961880b5Such * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21961880b5Such * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22961880b5Such * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23961880b5Such * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24961880b5Such * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25961880b5Such * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26961880b5Such * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27961880b5Such * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28961880b5Such * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29961880b5Such * POSSIBILITY OF SUCH DAMAGE. 30db2b0adeStakemura */ 31961880b5Such 322aad5afcStakemura #include <dev/isa/isadmavar.h> 332aad5afcStakemura 342aad5afcStakemura struct hpcmips_isa_chipset { 352aad5afcStakemura struct isa_dma_state ic_dmastate; 362aad5afcStakemura void *ic_sc; 372aad5afcStakemura }; 382aad5afcStakemura typedef struct hpcmips_isa_chipset *isa_chipset_tag_t; 392aad5afcStakemura 40db2b0adeStakemura #define VR_ISA_PORT_BASE 0x14000000 41db2b0adeStakemura #define VR_ISA_PORT_SIZE 0x4000000 42db2b0adeStakemura #define VR_ISA_MEM_BASE 0x10000000 43db2b0adeStakemura #define VR_ISA_MEM_SIZE 0x4000000 442aad5afcStakemura 45db2b0adeStakemura /* 46db2b0adeStakemura * Functions provided to machine-independent ISA code. 47db2b0adeStakemura */ 48cbab9cadSchs void isa_attach_hook(device_t, device_t, struct isabus_attach_args *); 49ab367b5fSdyoung void isa_detach_hook(isa_chipset_tag_t, device_t); 5047449a63Scgd int isa_intr_alloc(isa_chipset_tag_t, int, int, int *); 51cffb5808Scgd const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq); 5247449a63Scgd void *isa_intr_establish(isa_chipset_tag_t, int, int, int, int (*)(void *), void *); 53*e1d3e1b0Sjdolecek void *isa_intr_establish_xname(isa_chipset_tag_t, int, int, int, int (*)(void *), void *, const char *); 5447449a63Scgd void isa_intr_disestablish(isa_chipset_tag_t, void *); 552aad5afcStakemura 562aad5afcStakemura #define isa_dmainit(ic, bst, dmat, d) \ 572aad5afcStakemura _isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d)) 58ab367b5fSdyoung #define isa_dmadestroy(ic) \ 59ab367b5fSdyoung _isa_dmadestroy(&(ic)->ic_dmastate) 602aad5afcStakemura #define isa_dmacascade(ic, c) \ 612aad5afcStakemura _isa_dmacascade(&(ic)->ic_dmastate, (c)) 622aad5afcStakemura #define isa_dmamaxsize(ic, c) \ 632aad5afcStakemura _isa_dmamaxsize(&(ic)->ic_dmastate, (c)) 642aad5afcStakemura #define isa_dmamap_create(ic, c, s, f) \ 652aad5afcStakemura _isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f)) 662aad5afcStakemura #define isa_dmamap_destroy(ic, c) \ 672aad5afcStakemura _isa_dmamap_destroy(&(ic)->ic_dmastate, (c)) 682aad5afcStakemura #define isa_dmastart(ic, c, a, n, p, f, bf) \ 692aad5afcStakemura _isa_dmastart(&(ic)->ic_dmastate, (c), (a), (n), (p), (f), (bf)) 702aad5afcStakemura #define isa_dmaabort(ic, c) \ 712aad5afcStakemura _isa_dmaabort(&(ic)->ic_dmastate, (c)) 722aad5afcStakemura #define isa_dmacount(ic, c) \ 732aad5afcStakemura _isa_dmacount(&(ic)->ic_dmastate, (c)) 742aad5afcStakemura #define isa_dmafinished(ic, c) \ 752aad5afcStakemura _isa_dmafinished(&(ic)->ic_dmastate, (c)) 762aad5afcStakemura #define isa_dmadone(ic, c) \ 772aad5afcStakemura _isa_dmadone(&(ic)->ic_dmastate, (c)) 782aad5afcStakemura #define isa_dmafreeze(ic) \ 792aad5afcStakemura _isa_dmafreeze(&(ic)->ic_dmastate) 802aad5afcStakemura #define isa_dmathaw(ic) \ 812aad5afcStakemura _isa_dmathaw(&(ic)->ic_dmastate) 822aad5afcStakemura #define isa_dmamem_alloc(ic, c, s, ap, f) \ 832aad5afcStakemura _isa_dmamem_alloc(&(ic)->ic_dmastate, (c), (s), (ap), (f)) 842aad5afcStakemura #define isa_dmamem_free(ic, c, a, s) \ 852aad5afcStakemura _isa_dmamem_free(&(ic)->ic_dmastate, (c), (a), (s)) 862aad5afcStakemura #define isa_dmamem_map(ic, c, a, s, kp, f) \ 872aad5afcStakemura _isa_dmamem_map(&(ic)->ic_dmastate, (c), (a), (s), (kp), (f)) 882aad5afcStakemura #define isa_dmamem_unmap(ic, c, k, s) \ 892aad5afcStakemura _isa_dmamem_unmap(&(ic)->ic_dmastate, (c), (k), (s)) 902aad5afcStakemura #define isa_dmamem_mmap(ic, c, a, s, o, p, f) \ 912aad5afcStakemura _isa_dmamem_mmap(&(ic)->ic_dmastate, (c), (a), (s), (o), (p), (f)) 92d88cf589Sfvdl #define isa_drq_alloc(ic, c) \ 93d88cf589Sfvdl _isa_drq_alloc(&(ic)->ic_dmastate, c) 94d88cf589Sfvdl #define isa_drq_free(ic, c) \ 95d88cf589Sfvdl _isa_drq_free(&(ic)->ic_dmastate, c) 962aad5afcStakemura #define isa_drq_isfree(ic, c) \ 972aad5afcStakemura _isa_drq_isfree(&(ic)->ic_dmastate, (c)) 982aad5afcStakemura #define isa_malloc(ic, c, s, p, f) \ 992aad5afcStakemura _isa_malloc(&(ic)->ic_dmastate, (c), (s), (p), (f)) 1002aad5afcStakemura #define isa_free(a, p) \ 1012aad5afcStakemura _isa_free((a), (p)) 1022aad5afcStakemura #define isa_mappage(m, o, p) \ 1032aad5afcStakemura _isa_mappage((m), (o), (p)) 104