diff options
author | 2017-01-23 10:47:53 +0000 | |
---|---|---|
committer | 2017-01-23 10:47:53 +0000 | |
commit | c46d2c7f381055e25df4fdfbc0731c960cc72e78 (patch) | |
tree | fb013f82a82524d077722b2e4948591fe45767d3 | |
parent | Parse and use "dma-ranges" property to do the appropriate dma address (diff) | |
download | wireguard-openbsd-c46d2c7f381055e25df4fdfbc0731c960cc72e78.tar.xz wireguard-openbsd-c46d2c7f381055e25df4fdfbc0731c960cc72e78.zip |
Add (temporary) workaround for the missing "dma-ranges" property in the
device tree provided by the current Raspberry Pi firmware.
ok jsg@
-rw-r--r-- | sys/arch/arm64/dev/simplebus.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/simplebus.c b/sys/arch/arm64/dev/simplebus.c index 8d0660176d1..55d53edeae9 100644 --- a/sys/arch/arm64/dev/simplebus.c +++ b/sys/arch/arm64/dev/simplebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebus.c,v 1.4 2017/01/23 10:46:02 kettenis Exp $ */ +/* $OpenBSD: simplebus.c,v 1.5 2017/01/23 10:47:53 kettenis Exp $ */ /* * Copyright (c) 2016 Patrick Wildt <patrick@blueri.se> * @@ -111,6 +111,23 @@ simplebus_attach(struct device *parent, struct device *self, void *aux) sc->sc_dmaranges, sc->sc_dmarangeslen); } + /* + * The device tree provided by the Raspberry Pi firmware lacks + * a "dma-ranges" option. So provide the information until + * that gets fixed. + */ + if (sc->sc_dmaranges == NULL) { + node = OF_parent(sc->sc_node); + if (OF_is_compatible(node, "brcm,bcm2709")) { + sc->sc_dmarangeslen = 3 * sizeof(uint32_t); + sc->sc_dmaranges = malloc(sc->sc_dmarangeslen, + M_TEMP, M_WAITOK); + sc->sc_dmaranges[0] = 0xc0000000; + sc->sc_dmaranges[1] = 0x00000000; + sc->sc_dmaranges[2] = 0x3f000000; + } + } + /* Scan the whole tree. */ sc->sc_early = 1; for (node = OF_child(sc->sc_node); node; node = OF_peer(node)) |