summaryrefslogtreecommitdiff
path: root/sys/dev/fdt
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-01-13 18:08:21 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-01-13 18:08:21 +0000
commit26b07e37d9312ab3ee04ca9d6c7475865eba730d (patch)
tree0aa584758186d65d2ad6e6f27a6a77faf63ca58e /sys/dev/fdt
parent170fc150958ef742bd706d39e05787096de83807 (diff)
Make things work when using the official device tree bindings used by the
Linux kernel.
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r--sys/dev/fdt/rkpcie.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/fdt/rkpcie.c b/sys/dev/fdt/rkpcie.c
index 7d8e7a7070b..c7ff5fcd43c 100644
--- a/sys/dev/fdt/rkpcie.c
+++ b/sys/dev/fdt/rkpcie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rkpcie.c,v 1.2 2018/01/06 20:31:03 kettenis Exp $ */
+/* $OpenBSD: rkpcie.c,v 1.3 2018/01/13 18:08:20 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
@@ -238,8 +238,10 @@ rkpcie_attach(struct device *parent, struct device *self, void *aux)
break;
delay(1000);
}
- if (timo == 0)
- printf("timeout\n");
+ if (timo == 0) {
+ printf("%s: link training timeout\n", sc->sc_dev.dv_xname);
+ return;
+ }
/* Initialize Root Complex registers. */
HWRITE4(sc, PCIE_LM_VENDOR_ID, PCI_VENDOR_ROCKCHIP);
@@ -571,13 +573,14 @@ rkpcie_intr_disestablish(void *v, void *cookie)
void
rkpcie_phy_init(struct rkpcie_softc *sc)
{
- uint32_t phy;
+ uint32_t phys[8];
+ int len;
- phy = OF_getpropint(sc->sc_node, "phys", 0);
- if (phy == 0)
+ len = OF_getpropintarray(sc->sc_node, "phys", phys, sizeof(phys));
+ if (len < sizeof(phys[0]))
return;
- sc->sc_phy_node = OF_getnodebyphandle(phy);
+ sc->sc_phy_node = OF_getnodebyphandle(phys[0]);
if (sc->sc_phy_node == 0)
return;