diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-01-23 10:47:54 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-01-23 10:47:54 +0000 |
commit | 3a9c6777105bfb98166e328518dc9f86a0c6d41a (patch) | |
tree | 3c9f4a7bda280758b0e96f7c99b4f86b9517ac8b /sys/arch | |
parent | 4033cd3f9b3bf91c6a747bb9ce30b1ad096f1c18 (diff) |
Add (temporary) workaround for the missing "dma-ranges" property in the
device tree provided by the current Raspberry Pi firmware.
ok jsg@
Diffstat (limited to 'sys/arch')
-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)) |