diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-03-09 19:48:43 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-03-09 19:48:43 +0000 |
commit | 112262f957fc9714f0da24a9ccd2497db9b66c4a (patch) | |
tree | 9a2389fd930975a26b4d29988e8e6d7da1e95859 | |
parent | ba957717c95539a17f79006fb20d5b0be319de29 (diff) |
Check that a PCIe port isn't disabled in the device tree.
ok patrick@
-rw-r--r-- | sys/arch/arm64/dev/aplpcie.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/aplpcie.c b/sys/arch/arm64/dev/aplpcie.c index 99bddf57235..125bd9fdf4a 100644 --- a/sys/arch/arm64/dev/aplpcie.c +++ b/sys/arch/arm64/dev/aplpcie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplpcie.c,v 1.14 2023/01/01 11:29:09 kettenis Exp $ */ +/* $OpenBSD: aplpcie.c,v 1.15 2023/03/09 19:48:42 kettenis Exp $ */ /* * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> * @@ -387,6 +387,7 @@ aplpcie_attach(struct device *parent, struct device *self, void *aux) void aplpcie_init_port(struct aplpcie_softc *sc, int node) { + char status[32]; uint32_t reg[5]; uint32_t *pwren_gpio; uint32_t *reset_gpio; @@ -394,6 +395,10 @@ aplpcie_init_port(struct aplpcie_softc *sc, int node) uint32_t stat; int port, timo; + if (OF_getprop(node, "status", status, sizeof(status)) > 0 && + strcmp(status, "disabled") == 0) + return; + if (OF_getpropintarray(node, "reg", reg, sizeof(reg)) != sizeof(reg)) return; |