diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-05 17:13:00 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-05 17:13:00 +0000 |
commit | b9eeb48326130f1385b486699082f126d1da6ffe (patch) | |
tree | 2efeeec4b0de99f35abfd7244e7d32f656471532 /sys | |
parent | ba426f77868ab3947a57d1ecaf4a03802a716c97 (diff) |
We need to set the bypass bit for "raw" DMA memory as well.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/powerpc64/dev/phb.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/arch/powerpc64/dev/phb.c b/sys/arch/powerpc64/dev/phb.c index 439608448fa..872b78911d5 100644 --- a/sys/arch/powerpc64/dev/phb.c +++ b/sys/arch/powerpc64/dev/phb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: phb.c,v 1.10 2020/06/29 21:30:58 kettenis Exp $ */ +/* $OpenBSD: phb.c,v 1.11 2020/07/05 17:12:59 kettenis Exp $ */ /* * Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org> * @@ -103,6 +103,8 @@ int phb_bs_memmap(bus_space_tag_t, bus_addr_t, bus_size_t, int, bus_space_handle_t *); int phb_dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int, paddr_t *, int *, int); +int phb_dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t, + bus_dma_segment_t *, int, bus_size_t, int); int phb_match(struct device *parent, void *match, void *aux) @@ -336,6 +338,7 @@ phb_attach(struct device *parent, struct device *self, void *aux) memcpy(&sc->sc_bus_dmat, sc->sc_dmat, sizeof(sc->sc_bus_dmat)); sc->sc_bus_dmat._cookie = sc; sc->sc_bus_dmat._dmamap_load_buffer = phb_dmamap_load_buffer; + sc->sc_bus_dmat._dmamap_load_raw = phb_dmamap_load_raw; sc->sc_pc.pc_conf_v = sc; sc->sc_pc.pc_attach_hook = phb_attach_hook; @@ -599,3 +602,22 @@ phb_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, return 0; } + +int +phb_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, bus_size_t size, int flags) +{ + struct phb_softc *sc = t->_cookie; + int seg, error; + + error = sc->sc_dmat->_dmamap_load_raw(sc->sc_dmat, map, + segs, nsegs, size, flags); + if (error) + return error; + + /* For each segment. */ + for (seg = 0; seg < nsegs; seg++) + map->dm_segs[seg].ds_addr |= IODA_TVE_SELECT; + + return 0; +} |