From eb366b01e32c71c1982b72dd0c5c7b098ddfa363 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 18 Feb 2021 00:04:13 +0000 Subject: [PATCH] handle "simple-pm-bus" in simplebus Enables a clock and/or power domain for a group of devices. Required to use linux 5.11 dtbs on am335x and omap4. ok kettenis@ --- sys/arch/arm/simplebus/simplebus.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sys/arch/arm/simplebus/simplebus.c b/sys/arch/arm/simplebus/simplebus.c index e1bad2687e2..846bec9e0df 100644 --- a/sys/arch/arm/simplebus/simplebus.c +++ b/sys/arch/arm/simplebus/simplebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebus.c,v 1.16 2020/04/29 15:25:07 kettenis Exp $ */ +/* $OpenBSD: simplebus.c,v 1.17 2021/02/18 00:04:13 jsg Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include @@ -54,10 +56,8 @@ simplebus_match(struct device *parent, void *cfdata, void *aux) if (fa->fa_node == 0) return (0); - if (!OF_is_compatible(fa->fa_node, "simple-bus")) - return (0); - - return (1); + return (OF_is_compatible(fa->fa_node, "simple-bus") || + OF_is_compatible(fa->fa_node, "simple-pm-bus")); } void @@ -110,6 +110,11 @@ simplebus_attach(struct device *parent, struct device *self, void *aux) sc->sc_dmaranges, sc->sc_dmarangeslen); } + if (OF_is_compatible(sc->sc_node, "simple-pm-bus")) { + power_domain_enable(sc->sc_node); + clock_enable_all(sc->sc_node); + } + /* Scan the whole tree. */ sc->sc_early = 1; for (node = OF_child(sc->sc_node); node; node = OF_peer(node)) -- 2.20.1