From 57af163c8e7ecdefbac00ab7354122c1225e2c70 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Thu, 20 May 2021 16:48:10 +0000 Subject: [PATCH] arm64/rk_pcie_phy: handle assigned-clock* Nanopi4 based SoCs (NanoPC-T4, NanoPi M4*, and NanoPi Neo4) have assigned-clock* in the pcie_phy node. Handle them but only fail in case clk_set_assigned() returns an error other than "no assigned-clock*" (as it would for all other SoCs). Reviewed by: manu MFC After: 2 weeks Differential Revision: https://reviews.freebsd.org/D30363 --- sys/arm64/rockchip/rk_pcie_phy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/arm64/rockchip/rk_pcie_phy.c b/sys/arm64/rockchip/rk_pcie_phy.c index 75bd213bfd23..eaa7619e15c3 100644 --- a/sys/arm64/rockchip/rk_pcie_phy.c +++ b/sys/arm64/rockchip/rk_pcie_phy.c @@ -297,6 +297,13 @@ static int goto fail; } + rv = clk_set_assigned(dev, ofw_bus_get_node(dev)); + if (rv != 0 && rv != ENOENT) { + device_printf(dev, "clk_set_assigned failed: %d\n", rv); + rv = ENXIO; + goto fail; + } + rv = clk_get_by_ofw_name(sc->dev, 0, "refclk", &sc->clk_ref); if (rv != 0) { device_printf(sc->dev, "Cannot get 'refclk' clock\n");