From patchwork Tue Sep 3 15:30:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3374 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 244C83F1F3 for ; Tue, 3 Sep 2024 17:31:07 +0200 (CEST) Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-5334824e68dsf1141676e87.3 for ; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377466; cv=pass; d=google.com; s=arc-20240605; b=V+joKUecg/sIILrqq4oCzMrRU9fBQHTZ07KbTCl0Nn77UFFlGoFo0YOam7D43tk4fQ 3GJ1KGc5hPo6e13IUxQskLuaCndOCOypO00CVFoe2xuX9fMZRf37cQkNO/QaYM96sUZ/ 3kbgJotsOQFrGLP/OKjzDDR+ocr+ctz06gT3fiS6b9wXTovEV/GLg3VSbqMRaIPoBytM A3yqYdn0a032XHjBiLFpTbS4bWIPFOomLAsqwDgVjJpJTxQfvlQpfc3M3DQRZTmh6GGJ PnQ8UY+IXH2O09dcrhva3CoCVne+q03fOqGELETiEKF/gd+kiv6cKul+esNE6QpUiKEY gWkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=qD6MhRxhmPO8rTf7aAEqSp06zF31DIO3ajypcBua6gQ=; fh=yIQbi1EE53MXpSEh2XOfx+H4bofhj8Y7TSHREB9HBkg=; b=UFeCu3xpIYM3wqJuL7YnI4Dbr6iElAap1lF1fjPDUCgQcefvToWXEwdylq9simtXul 5tsy1txKKDkEG/8apl6lfTmFbJsYO6u0yrzcdkg6VT6X8uwSaigh0tM7/5BGWfOuPksW /Hw0y7izbib58phkwKDtLobAgU4OfETzcjmf2aQmYA8Xuv3xTDQrs3MFJVvztFSBMPcb fbokq+5aQW0hbe4uel/xU6mOUv1Ylhvab3kYf83O6m4ZivQL+gZdXKduk61+YqvQ8lLW 82dy1XsmT3K6TKR9ne3jUeJ3rq9IfIBAtkg808LTxbCPLvBjvTK1lw115eafJaevFg4A ZsWA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lSRbd+VZ; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377466; x=1725982266; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qD6MhRxhmPO8rTf7aAEqSp06zF31DIO3ajypcBua6gQ=; b=kL7aUcfC9sTd1iEkeYWJWt4PdljwW1OxiGUTTLBrK/BLwDqDYXj8xzbKinITFZ1cwY ufO1zvFq/8j31EFOQbait/j+xnftVsQLYKnfG11arxD09DUhjtlaYb6CxThCUbV1aiP9 /pWeD2LWsR0FSUMkJqJlQped0JvHWTKjRL9xc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377466; x=1725982266; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qD6MhRxhmPO8rTf7aAEqSp06zF31DIO3ajypcBua6gQ=; b=lSiLxE++Hl7Uy9WyoDA7CqKuOO5PcFaEO2Q8V38WjIDytkl3VIU88I3XC7PRHGCRCb rpkEWYRGhdz0jNWtU7GdCDG9m5KfEq2103Q3PbItGmA8cMbrb7BrS8LsBGVTTa5dpZu2 OJ4ewlnwBgybqHJS1TOB7In5C9/0o1qOKHa4R+yaIOHhKYh6no9RkHF+BJmdAZZyd8TK SgbYSgGoEuB5lSac3nkvIcC491/zyP8kamxa1QXScPRlBKu3HLi1QKtkL+09AlRky9Vn NTH5tz9JrMM2/8xQCzmhhzfjbmCPmmsTjDu+exFuUi0j/9/JmnDlsTZRsU62GvLj1nai YVTA== X-Forwarded-Encrypted: i=2; AJvYcCUsWF4xN6fPN4NuoQRjGqroaGeY7wAHxeuW7kILz6sgN0XBQNMghkmfbrRin2EHtgG146Moxim1w0SI/0LY@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yw3AimIu3DJ0PEY4k3tS4ok/OhHjY3LIol/OhUsbW9rXZ72X4+J Wrb+pcsqysZR4aZ0zB21iLgE3jmPSTzB2ZOoaaaxMPjw9LQamXtFiNyyrbd6l19Bjw== X-Google-Smtp-Source: AGHT+IHBhoaPCSH06qWxl6oKTtDnhEX+JdLjoFCEK0rIm/AUCbYX4RKS4BXGal2vKDDjtX8bfsRtdQ== X-Received: by 2002:ac2:4c41:0:b0:533:4191:fa47 with SMTP id 2adb3069b0e04-53546b69167mr8489268e87.47.1725377466222; Tue, 03 Sep 2024 08:31:06 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:2351:b0:533:48c9:754e with SMTP id 2adb3069b0e04-5353d814aa2ls186660e87.2.-pod-prod-06-eu; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) X-Received: by 2002:a05:6512:3d92:b0:52e:9762:2ba4 with SMTP id 2adb3069b0e04-53546b293eemr10901070e87.25.1725377464194; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377464; cv=none; d=google.com; s=arc-20160816; b=JABwTSK4EP5DlsBMGnnYFe7vagGzi12hOew76GV7eJ60ChjMrWSocfy1Oe9OHjBXDD sYbPjufFGWxpvhKGbXGvBL7ALm11uIRizSI83ioriXiyN5HgTuzfgnXxfiTI1ZL4t7qh WsQc8DuYER42rBhh6LhuwbuAqW2zX4rEjPda+wrcVJBq8aetGXekiI4Wl4cAMLo/KYzX mRlbC6v6R/h932546t8Z9R4nwNWyERcEOekVxQVW7GJSolXjGU5lLCDCWx7eviMe4K3M hM9dMj2mePAN9wolU5WY4Fqal6VqSR5i1K0M4IFiCzGQsLnU/T3U/gsJsc0Q+0HJ72bw lUVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=z+vH7JnBUdCxbHSNHeYAv/LSH/K9w1Cmau7Y6C7/Mx0=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=MPnBNiFueeMJOh/uImZRAZmiPhm0G2BzcP8zvhn0qx0ZNyoKpxkDc5tY9FEEEhXuDS GY//2zgMJluJHKkOZ1tjZda/BrHK+kKEggoqKNqcUlpLPw346TVl8wnY9tLeJFR3DSCY Sdvvi345r4DTEeAvw2JpqwKPRNOHYODWuVBuL5+/uwlx3uwRO8MLSJxKHiIzZ97w8mvz MhiUUGGE7jvigABYKTQFQb2+BAyclYIHYBW2BraOBVIYF4tEUPYilU+KoecIVS/0FG2m d9JdyqZM8TQt2mhupQIZ1D2Nea2pG1kghrrvsLpGpzsjM9Zu0k7O/ApSZtOqobk82an2 Qt8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lSRbd+VZ; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 2adb3069b0e04-535406e3f01sor3533652e87.0.2024.09.03.08.31.04 for (Google Transport Security); Tue, 03 Sep 2024 08:31:04 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6512:138e:b0:530:ea6a:de42 with SMTP id 2adb3069b0e04-53546b2a186mr8654993e87.26.1725377463199; Tue, 03 Sep 2024 08:31:03 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:02 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 02/29] clk: imx8mn: Prevent clock critical path from disabling during reparent and set_rate Date: Tue, 3 Sep 2024 17:30:33 +0200 Message-ID: <20240903153100.918077-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lSRbd+VZ; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Michael Trimarchi This commit ensures that critical clock paths are not disabled during reparent and set_rate operations within the clock framework, paving the way for the inclusion of new features. Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mn.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index 8911e342f18b..e089012477a6 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -27,10 +27,18 @@ static const char * const imx8mn_a53_sels[] = {"clock-osc-24m", "arm_pll_out", " "sys_pll2_1000m", "sys_pll1_800m", "sys_pll1_400m", "audio_pll1_out", "sys_pll3_out", }; +static const char * const imx8mn_noc_sels[] = {"osc_24m", "sys_pll1_800m", "sys_pll3_out", + "sys_pll2_1000m", "sys_pll2_500m", "audio_pll1_out", + "video_pll_out", "audio_pll2_out", }; + static const char * const imx8mn_ahb_sels[] = {"clock-osc-24m", "sys_pll1_133m", "sys_pll1_800m", "sys_pll1_400m", "sys_pll2_125m", "sys_pll3_out", "audio_pll1_out", "video_pll_out", }; +static const char * const imx8mn_main_axi_sels[] = {"osc_24m", "sys_pll2_333m", "sys_pll1_800m", + "sys_pll2_250m", "sys_pll2_1000m", "audio_pll1_out", + "video_pll_out", "sys_pll1_100m",}; + static const char * const imx8mn_enet_axi_sels[] = {"clock-osc-24m", "sys_pll1_266m", "sys_pll1_800m", "sys_pll2_250m", "sys_pll2_200m", "audio_pll1_out", "video_pll_out", "sys_pll3_out", }; @@ -65,6 +73,9 @@ static const char * const imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400 "sys_pll2_500m", "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; +static const char * const imx8mn_gic_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", + "sys_pll2_100m", "sys_pll1_800m", "clk_ext2", + "clk_ext4", "audio_pll2_out" }; #if CONFIG_IS_ENABLED(DM_SPI) static const char * const imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", @@ -284,15 +295,18 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_CLK_IPG_ROOT, imx_clk_divider2("ipg_root", "ahb", base + 0x9080, 0, 1)); + /* BUS */ + clk_dm(IMX8MN_CLK_MAIN_AXI, + imx8m_clk_composite_critical("main_axi", imx8mn_main_axi_sels, base + 0x8800)); clk_dm(IMX8MN_CLK_ENET_AXI, - imx8m_clk_composite("enet_axi", imx8mn_enet_axi_sels, - base + 0x8880)); + imx8m_clk_composite("enet_axi", imx8mn_enet_axi_sels, base + 0x8880)); clk_dm(IMX8MN_CLK_NAND_USDHC_BUS, - imx8m_clk_composite_critical("nand_usdhc_bus", - imx8mn_nand_usdhc_sels, + imx8m_clk_composite_critical("nand_usdhc_bus", imx8mn_nand_usdhc_sels, base + 0x8900)); clk_dm(IMX8MN_CLK_USB_BUS, imx8m_clk_composite("usb_bus", imx8mn_usb_bus_sels, base + 0x8b80)); + clk_dm(IMX8MN_CLK_NOC, + imx8m_clk_composite_critical("noc", imx8mn_noc_sels, base + 0x8d00)); /* IP */ clk_dm(IMX8MN_CLK_USDHC1, @@ -387,7 +401,8 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_CLK_PWM4_ROOT, imx_clk_gate4("pwm4_root_clk", "pwm4", base + 0x42b0, 0)); #endif - + clk_dm(IMX8MN_CLK_GIC, + imx8m_clk_composite_critical("gic", imx8mn_gic_sels, base + 0xb200)); #if CONFIG_IS_ENABLED(DM_SPI) clk_dm(IMX8MN_CLK_ECSPI1, imx8m_clk_composite("ecspi1", imx8mn_ecspi1_sels, base + 0xb280));