From nobody Wed Oct 18 14:34:28 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S9YJh6VsPz4x64p; Wed, 18 Oct 2023 14:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S9YJh5Ckbz3TfV; Wed, 18 Oct 2023 14:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697639668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fhvd4aYWEcLxjql0hGKC1BlwZ5XGtaIOt1LXzQi7trU=; b=mtgbg6GdImT3A4BBX+I5j5SSLT+ldEKq6eo2vvAbNgNz70oPJdRxUKnz228S8i2pizIr+7 Upw5jE4DY84x+fPxotSn7oKCeHITuW1jHO/K9fIZ8hnXcc3o8eD0Tq7q3/YXO1UXsJjsks kfddPzW/Dk/yOdjUhk4wt5S8WBeJSKyfGLHB+IFtq5aUoftX7bYncYKzEKm/0bhQ31667/ HtWQzwwu3gY2nnf3yLfu+MeHD/4JWttb+FXBq91oYtqy/MwZ45E4Uy09HUDiO8Dv1K2nj4 0ojNnzilOaEe6sEAUrTTX53FUJ7VXCAQAqnCbtwCwIuR2VeLBVUqkn4Yk4KLdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697639668; a=rsa-sha256; cv=none; b=mLcWwJpOpz22CyRdn7t6180QBJuEjGokuMYvho+ViY8mFv6zZ/sZQnQrx0YdgV714Au0CB lZzIwM4X27uF2iZK8sgiALngvaZQomj+MTU/bEnsjdJKvyqhwfljmqi4PvQdF5NqpjSBDp BzbEAuxlE8nrnWCamAvO3YLe/k54Y8WUDFH+ydWpjUTIIiZ3QtGkufYwyeuL4e4wresBcv 1StyuXXqEjhvFo6i7tRHnuEhWKinQJnpMZmFfifQc+MmoVpUCnjpg8rv9qmLnNOPoIxMzJ Xqt2w6rgLVOxSp6/3SMzvPZe4AOkIE4zJ4q3MXkuYSxIRzXkk/R46C8Yb3Tb3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697639668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fhvd4aYWEcLxjql0hGKC1BlwZ5XGtaIOt1LXzQi7trU=; b=qhHP2u9xhdVl9LG+HoyqcNEI43VnGdtP2Uj+MHUeuyW/3nUBHRpW28kmMigtm3dfd1DAF6 usdu9Xb9c6xAKbQ7c4F8z46Z5+lYMvAHQtYp0V0cN3xobsIk4pvfiK65f0Fb1+sEYkFAKI Xus7TNTQSu/Koy9MPQ35Mu55YSvDCoQkXOim9skzZca9x+JcXEqQ9A8BF7pf+6QUCGB/KA 1A1jYKHI3+d9dk0irTaMCdAsmspM6N9qgdaQdaUOKQH8cjOn0x3t0ldj+T6PgTsvGKKdOU u+5KYgfH4IDhBk06m7WYDFVcLzltMnXpBNJzhkOPafeZs0uhz8IfVA/PMD2lLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S9YJh4KCWz18xM; Wed, 18 Oct 2023 14:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39IEYSbR092699; Wed, 18 Oct 2023 14:34:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39IEYSou092696; Wed, 18 Oct 2023 14:34:28 GMT (envelope-from git) Date: Wed, 18 Oct 2023 14:34:28 GMT Message-Id: <202310181434.39IEYSou092696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: fd4760cbda85 - stable/14 - arm64: rockchip: rk_clk_composite: Remove gate code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fd4760cbda85016b1bc551458f09c5f51814e586 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=fd4760cbda85016b1bc551458f09c5f51814e586 commit fd4760cbda85016b1bc551458f09c5f51814e586 Author: Emmanuel Vadot AuthorDate: 2023-09-21 14:56:16 +0000 Commit: Emmanuel Vadot CommitDate: 2023-10-18 14:33:35 +0000 arm64: rockchip: rk_clk_composite: Remove gate code It was a bad idea to have composite clock directly managing gates. All clocks drivers have been rewrite to not use this functionality and directly export the gate. We can now remove this code. (cherry picked from commit db34f02028f30bbf099bf1bce7ce66184f51b332) --- sys/arm64/rockchip/clk/rk_clk_composite.c | 31 ------------------------------- sys/arm64/rockchip/clk/rk_clk_composite.h | 8 ++------ 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/sys/arm64/rockchip/clk/rk_clk_composite.c b/sys/arm64/rockchip/clk/rk_clk_composite.c index a04b3aa2193c..a30dadbaf811 100644 --- a/sys/arm64/rockchip/clk/rk_clk_composite.c +++ b/sys/arm64/rockchip/clk/rk_clk_composite.c @@ -48,9 +48,6 @@ struct rk_clk_composite_sc { uint32_t div_width; uint32_t div_mask; - uint32_t gate_offset; - uint32_t gate_shift; - uint32_t flags; struct syscon *grf; @@ -145,30 +142,6 @@ rk_clk_composite_init(struct clknode *clk, device_t dev) return (0); } -static int -rk_clk_composite_set_gate(struct clknode *clk, bool enable) -{ - struct rk_clk_composite_sc *sc; - uint32_t val = 0; - - sc = clknode_get_softc(clk); - - if ((sc->flags & RK_CLK_COMPOSITE_HAVE_GATE) == 0) - return (0); - - dprintf("%sabling gate\n", enable ? "En" : "Dis"); - if (!enable) - val |= 1 << sc->gate_shift; - dprintf("sc->gate_shift: %x\n", sc->gate_shift); - val |= (1 << sc->gate_shift) << RK_CLK_COMPOSITE_MASK_SHIFT; - dprintf("Write: gate_offset=%x, val=%x\n", sc->gate_offset, val); - DEVICE_LOCK(clk); - WRITE4(clk, sc->gate_offset, val); - DEVICE_UNLOCK(clk); - - return (0); -} - static int rk_clk_composite_set_mux(struct clknode *clk, int index) { @@ -320,7 +293,6 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, static clknode_method_t rk_clk_composite_clknode_methods[] = { /* Device interface */ CLKNODEMETHOD(clknode_init, rk_clk_composite_init), - CLKNODEMETHOD(clknode_set_gate, rk_clk_composite_set_gate), CLKNODEMETHOD(clknode_set_mux, rk_clk_composite_set_mux), CLKNODEMETHOD(clknode_recalc_freq, rk_clk_composite_recalc), CLKNODEMETHOD(clknode_set_freq, rk_clk_composite_set_freq), @@ -355,9 +327,6 @@ rk_clk_composite_register(struct clkdom *clkdom, sc->div_width = clkdef->div_width; sc->div_mask = ((1 << clkdef->div_width) - 1) << sc->div_shift; - sc->gate_offset = clkdef->gate_offset; - sc->gate_shift = clkdef->gate_shift; - sc->flags = clkdef->flags; clknode_register(clkdom, clk); diff --git a/sys/arm64/rockchip/clk/rk_clk_composite.h b/sys/arm64/rockchip/clk/rk_clk_composite.h index 79cd3777c84b..22a052da22c2 100644 --- a/sys/arm64/rockchip/clk/rk_clk_composite.h +++ b/sys/arm64/rockchip/clk/rk_clk_composite.h @@ -41,17 +41,13 @@ struct rk_clk_composite_def { uint32_t div_shift; uint32_t div_width; - uint32_t gate_offset; - uint32_t gate_shift; - uint32_t flags; }; #define RK_CLK_COMPOSITE_HAVE_MUX 0x0001 -#define RK_CLK_COMPOSITE_HAVE_GATE 0x0002 -#define RK_CLK_COMPOSITE_DIV_EXP 0x0004 /* Register 0, 1, 2, 2, ... */ +#define RK_CLK_COMPOSITE_DIV_EXP 0x0002 /* Register 0, 1, 2, 2, ... */ /* Divider 1, 2, 4, 8, ... */ -#define RK_CLK_COMPOSITE_GRF 0x0008 /* Use syscon registers instead of CRU's */ +#define RK_CLK_COMPOSITE_GRF 0x0004 /* Use syscon registers instead of CRU's */ int rk_clk_composite_register(struct clkdom *clkdom, struct rk_clk_composite_def *clkdef);