From 78972d8e56b11d9213cc896e78bc1d40cc0a97f7 Mon Sep 17 00:00:00 2001 From: kettenis Date: Thu, 9 Mar 2023 19:48:42 +0000 Subject: [PATCH] Check that a PCIe port isn't disabled in the device tree. ok patrick@ --- sys/arch/arm64/dev/aplpcie.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 * @@ -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; -- 2.20.1