From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30FA030EF9B for ; Sun, 19 Jul 2026 21:13:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784495635; cv=none; b=P6S3ciWx6CxmhceJbgv7LnuVR1SMWA9HAasWwrcVABGUxfTWmnPmu9kxsnY03x1Itobk5jI31P6d84DBZ9sIZjj2ahz5VvXkq4LxcRvTO3cy0OmXLQDKohVoKGIQgFgr5BIqj+16rd1LKVJmVifFvJVX81P8VvZPnks02zjjKP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784495635; c=relaxed/simple; bh=DDsOXp+Z72kK9qdiLJoanRdwCGRm/6FA5U02/PGt8IU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RqUDWfPrREpWqMueMrgjnB79+2IBPYmYWgwoIOnPwRMS5kwuQEoszNFLVIno1uKPnvMGFioPUPH/0U5XRiBMNB4x8EV3nuxisvRQDMXxe3MtozdVLdC9xjtk/S/6iY9f69mDWyU8Aq1LRfeOwpo9Dx10M6HFg4i2PmyVA0c04Tc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=oIa9gVkV; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oIa9gVkV" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-493d92b7db3so46934945e9.2 for ; Sun, 19 Jul 2026 14:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784495629; x=1785100429; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=vxznu+hS8HH5ynomOmnxMZ5VSR6lMdMjMbTUGrneUgI=; b=oIa9gVkVF2xKl89QwfpcQQrPKVawR0oHZ07CaJK2gaWCEznKeLVAxMfVmun+MUZ+aO OLytHQfWCdqHRQTCTs9GnUS05Bly0MoZy8hhBq7pS5lnU3hU1raqAulP0Ix1Z9GGZIG5 uKBjeJiO/P2RuzR9vbsjBJgexO932ZKEqigZBv4dfXdJEH+ubjFnkotU9SfwzF7n+hbp /qN6+bkpWlcRXq+pbfzrYUiny6MOC/5KWujDE8kkT/zY5qmcRTlJVKuLH5i2iYxuXHgg zZfQ7PSVzGkGbUk2h58o3KUXctWZvpJ7hq+0GR7ycNH8bNnk/PTY3H10d60TdYvyCwdb WQOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784495629; x=1785100429; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=vxznu+hS8HH5ynomOmnxMZ5VSR6lMdMjMbTUGrneUgI=; b=mWCuSKoZILYdxYJ7oVxD5sf9g1Rr9TmkZ1Q6+I0qm3V2qGBaEZdiuR8BO20GDt2ppy Zv+R+uIxTNLYk52Xvg14zpMPfn5RHffi/zBJB/D40emL2G0hgsNR0FTjmWE/Ovks84GJ ydYsgrBxqKL9tLz827p6XkdtLEudLHG4nlQRwr/eGq8iMdj6LHX80XhF+0U7J9wP5p9N KsspOfFRxD0NYNnTvlKNKKRXEvDVGIHOlmym7eK2EmSagstywrMPJRM5CjZZ3zqw4x2J Bg0KtZMj8BoNIl9FUy0H7KweToN2VELdU0nchi44zGaq29WOxnMUDRXbAVBbfPZxa+p3 9ZIg== X-Forwarded-Encrypted: i=1; AHgh+RpBEw89tcOx/yvqoxMzh2wfq2l/WupbZIqShxBhunLupnwqJmalL7rW60DjHESvZZvcRhNZbAHwe3kiWk0=@vger.kernel.org X-Gm-Message-State: AOJu0YwxE2QOidwXf0NqwDdh1IPgUcXA1jOF1yAuAOWcmzT1JxvyXgST 6qZbFcpfASc/3FMkWe85U1BwIdxrJGc2LWB0eOjiXgQRN9JwrYQJIrYO X-Gm-Gg: AfdE7clKCSeMCz+KTZ4r2ZP5CB+P8RcKiS68Ml4WGurbvWo8bRAnY+6PBNNOVl8Krib r87fIyOTtdKbeGa9L7NHjVayIv6vE6rmBaVHonOksVCUqVzf7PgjJW64vwne8WkBZkdLyA5kFJk BLBZGsncxN2NrvGhm0rr3lSlY95z/vKMHGIwzb7jRt6YuWyEdUxCyXj6SRJZ9Eb8gcdlJou9c1j X6/b8GRpjaYHj6yOCmWS7253s0mM/xSF+DazpJSU2gmdnK2tpa6CM6AwyJEVDK6jgJoD/ZUYLsg EuRHtH6CtsLhE/XlulCeDcKGqjxqtxS9/eZ9HjQRiWef2hTecxb+G66YwdQZapYM4TFfzpQiaTQ wHVOiF/vbJ5QGojM/r1HnN4rsQ46txiaDuVu55hND5wsc3HmH9JCaTiNa0Rp7S6D2n7PeJ5sIly VuRWjOkNmzPIr1lHjFRAjMCn38wUJt9pM4Yp/O X-Received: by 2002:a05:600c:4703:b0:495:4e89:3f30 with SMTP id 5b1f17b1804b1-4954e893f8cmr104567935e9.15.1784495629064; Sun, 19 Jul 2026 14:13:49 -0700 (PDT) Received: from localhost.localdomain ([2a0d:3344:2841:7708:a101:2b8a:f76:a00f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49549a3e2a9sm224108815e9.4.2026.07.19.14.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2026 14:13:48 -0700 (PDT) From: =?UTF-8?q?Juan=20Manuel=20L=C3=B3pez=20Carrillo?= To: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Brian Masney , Andre Przywara , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-clk@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Juan=20Manuel=20L=C3=B3pez=20Carrillo?= Subject: [PATCH v1 3/4] clk: sunxi-ng: sun55i-a523: reparent GPU while pll-gpu changes rate Date: Sun, 19 Jul 2026 23:13:18 +0200 Message-ID: <20260719211319.982285-4-juanmanuellopezcarrillo@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260719211319.982285-1-juanmanuellopezcarrillo@gmail.com> References: <20260719211319.982285-1-juanmanuellopezcarrillo@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Register the existing sunxi-ng mux notifier on pll-gpu so the GPU mod clock is parked on the fixed pll-periph0-600M output while the PLL is being reprogrammed, and switched back once it has locked, following the cpux precedent of other sunxi SoCs. The mux switch is glitch-free per the T527 manual (GPU_CLK_REG, "The clock selection supports glitch-free switch"). Nothing retunes pll-gpu at runtime today (the mux does not propagate rate requests and all standard OPPs resolve to pll-periph0 outputs), but the higher speed-bin operating points (648-792 MHz) will need pll-gpu as a live parent, and any direct clk_set_rate() on the PLL is now safe. Signed-off-by: Juan Manuel López Carrillo --- drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c index 979e53e63..4341eb66c 100644 --- a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c +++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c @@ -1667,6 +1667,17 @@ static const u32 pll_regs[] = { SUN55I_A523_PLL_NPU_REG, }; +/* + * Park the GPU on the fixed pll-periph0-600M output while pll-gpu + * changes rate; the mux switch is glitch-free (T527 manual, GPU_CLK_REG). + */ +static struct ccu_mux_nb sun55i_a523_gpu_nb = { + .common = &gpu_clk.common, + .cm = &gpu_clk.mux, + .delay_us = 1, + .bypass_index = 1, /* pll-periph0-600M */ +}; + static int sun55i_a523_ccu_probe(struct platform_device *pdev) { void __iomem *reg; @@ -1698,6 +1709,10 @@ static int sun55i_a523_ccu_probe(struct platform_device *pdev) if (ret) return ret; + /* Reparent the GPU during pll-gpu rate changes */ + ccu_mux_notifier_register(pll_gpu_clk.common.hw.clk, + &sun55i_a523_gpu_nb); + return 0; } -- 2.47.3