From patchwork Sun Jul 14 07:10:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3238 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C7B3E41497 for ; Sun, 14 Jul 2024 09:10:35 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-58d24cad85asf2761834a12.2 for ; Sun, 14 Jul 2024 00:10:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720941035; cv=pass; d=google.com; s=arc-20160816; b=l+AZuMYmabLtV2Z3rCpgdC0dPVfWM7YrbCXhN/jRf5TqJeJK3mIfGqtDLHQfwF7Vrn 2fqoN7bVs74SKxUs5zRaKf5NQjS1DHb91VBCtnyRf7blJPdr947gpL13hAFVPE8ecnCm 10Ib3Ec3OlhQ0DiWcoJJXZHztmz6MaEhOWYChhE/7/vXao9eYVXmlKtYm/kqobxn6zPh cMH5ZAmbw2KUjIKPjxUtHwA7dCdPi65iYmkXR31VAROuGjJg4rz0qgCPcuN17c44HRDr Jr6S7l9t+8E8Cy7NU8WLN2gHRN8k7aQsDbpognq/bB6//8xgwGxwwGoBl99FYU2ehsOw opnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=8qdnLrivdNrFXhMAk0C0fqqSnCxd9xDXvPRaNC72H18=; fh=LcuJnwrGwlQv2flgE7GZcW16odJqL4yQvZN7X+b/FEg=; b=Qtq7EDbVle3zHhQ7kjLUCljNOxl7RmMfA41icjGf01SYw82sVJAhCxjDeEIIGvcshm /t+AAuZySqpUYzzJ4EcbMqcxqsnKHEdND0SDzrNPeousl7xZsgDGZ7oBrpVWVcAw89qO 8qyaj+tZ1sNWIurnhG+0zHTbLjgVZfWM9WRRgOe7xvtAww9CfjsK92g5V0rKeO+f+DvF 1H38omGrx2Q5Kbx3vDJ/q/JevugJU/vGxXFMAsmFgspE/IQWcDhBLdn81/ppAwnucGFP Uu3QzZj2DxHvUsrs2HlJpXtz2wRMiygdg9LJZHC7Ikqf2JmxJBzXBNRNYwlmAAaq3WsF UFgQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mZY9rjje; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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=1720941035; x=1721545835; 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:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=8qdnLrivdNrFXhMAk0C0fqqSnCxd9xDXvPRaNC72H18=; b=Ei2ArS9+QRagnvHdV319q29oSeg0UD5WLPETYGCZR/QFe+xQOYKNQVRkXfZ6calo3z H83QPR5gan4gePUzNgSJP8xD5t0OMWR6xl8uYGuIeg3jIR5Idu30RVOk1YX2Li1s8C2x NrPNbLGPzs/RGuPVXoq+Bsxe+YhDOjBVboIIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720941035; x=1721545835; 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:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8qdnLrivdNrFXhMAk0C0fqqSnCxd9xDXvPRaNC72H18=; b=vzz4E6XFGq6DMZvpnXyWBfhf6NLXsyPRIa0cVf1opf47xiNNDBM2kklQf096Qaaf/l rNKVJwYjXdOiQfL3xYPpcTqyIWCIKYthWB8QcAq89PNXy7zDNsFaYeeVhSFokv8y+Bzl 5Oe1bc1lYnoB53rsI93Lmu2keC23zafzamujf3I7j6EW3uBS5Dqye/pc8ZMNLuw6fFzl xYVmadDubgyc6wmYA0XxmuNLMXt7TMVRRiXKE2C27USAWgHsMZ9tS2ojkG30ccBqslZB 2m+RtVyNh6ePOF9A2N2NPHzU54fmz8IYiCZ0xnzV9I1/LsT8ZoJrmPKIglWXszY3dPUx 2NmQ== X-Forwarded-Encrypted: i=2; AJvYcCXVIFNWuzob6T8BBamGuUVDXBwdKD4+d9P3KQRZkUckaIfec4sziPHzwLbzEMGdkyz2bI6Sfn2t6tzUczLkPWAH5ziRMzmfjUFA4zQZFH7RtsOzqep74qAzCt3XYg== X-Gm-Message-State: AOJu0Yy+gEwzMvbG0Vwme6SMu8B7GvdY+Hs9ZXt3LUAlonTFxnLAck1T yA4QkTKV4CmhCHsUoKOM9xouNECE8MavtklhYbRC+l7pZqkgLsFC//9dSVxVGsEabQ== X-Google-Smtp-Source: AGHT+IFa4i/Agvk5QVTPQi9YbEczOiU5712Yv2YNh6eFVKxkvKCr97fSEN/AYW68JQdeosDyth3hzQ== X-Received: by 2002:a05:6402:5ce:b0:57c:6d89:eaf0 with SMTP id 4fb4d7f45d1cf-594baf912efmr12530155a12.14.1720941035469; Sun, 14 Jul 2024 00:10:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:cc91:0:b0:58c:3dc1:35c2 with SMTP id 4fb4d7f45d1cf-59821cb8e5cls1830718a12.0.-pod-prod-04-eu; Sun, 14 Jul 2024 00:10:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW30SLLGmNBFgxVPGxUt0Z1FNZQRrO+AEKL0a2b4LZxe+SZ1SKV36XQO89RjrfA/0wsdWWsVUIm/+m7kcpnuza3Sla5L5Jw5DIdpWdJ23+w0kF8 X-Received: by 2002:a17:907:7d8d:b0:a77:eaf7:a63 with SMTP id a640c23a62f3a-a780b688a35mr1399545066b.10.1720941033700; Sun, 14 Jul 2024 00:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720941033; cv=none; d=google.com; s=arc-20160816; b=f1j7SnwRPBxOqI6JLtgRXjZjChbuLM2h8Qa3Fpt7KqF7j8gZgKxfKRT9gxDuzfGkKp hD4PU+hR96Ym2eMWymDb3bik58mxAvI/w5Wh3eB1F0lht7+mVD1BTLM+dZRwxKVyoUyq MsxIC7o1hm9qfOz8YoIJLmFzo2S/5RZKp7Rc5br499l0realhxOJLCoMvsCkd5TbHxEJ AvUF2k3Wb52G29heUSysLJhw22aZJCRLfE9GAD8wx6LV3Q3motYaQyHbD1xqzMu1+iaz 4YQZ4PNJrAmCYGZCiUy/kdEWXjK7f8GxYPdHCXceW5KPkzAQvxMbYbwTCUvCfNOpKttO 7B0Q== 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:cc:to:from:dkim-signature; bh=VP9KqOTtJ/8Wr2y0b8PuGdr0YGsfHTaxYMfqijnhSv8=; fh=iVGD+lfmmT226tD58Ob0nPL4esaftr22Z3dFgeULo18=; b=imSIT7u7vBxAlFhIwnkhFLUc0E+3Ey48gzXISJpu5gz+R6PWz61JkFGgDK1s79EmO8 p4+lkWwdIp0kXFNVpep63XHr4G7/lssN18rsFKA9xW3bNUDCWNjvlxV6qOk+KQ589MkS jSSsbOma2VKNgATifX3AZ1k7SoNUs/tEU97TX1KAKcz66f1CcjXyoo+Uiz2XVtIVpJOO Mn0pStcrwMHhJfvHqJSCesX7Xhu8NSCwYEAY1/wVmnuVa4k1QbNC2Jcp8pNBSCXa/vU7 F2iBbRXP8dPM54nydq+BfR9OdlafDelhEgAlvNx8bPtsDjlqkc7DECaHfgQOLFoSwLmA aSYw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mZY9rjje; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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 a640c23a62f3a-a79bc5b3f5csor33755466b.9.2024.07.14.00.10.33 for (Google Transport Security); Sun, 14 Jul 2024 00:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCW9wvAB6g6dl0SeK+eBEUFnFN9cim02985IdFraB7p98Sf0bAfG2s/btQ0IJmlLZ4wAB/yAYtkTuqxbLh/SrO3B+778rtRnXkOxxwtc7T3SMWKB X-Received: by 2002:a17:907:720c:b0:a77:d880:2c91 with SMTP id a640c23a62f3a-a780b68873amr1358314666b.16.1720941033330; Sun, 14 Jul 2024 00:10:33 -0700 (PDT) Received: from panicking.. (93-35-128-17.ip55.fastwebnet.it. [93.35.128.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc820d52sm104950266b.214.2024.07.14.00.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 00:10:32 -0700 (PDT) From: Michael Trimarchi To: Michael Trimarchi Cc: Dario Binacchi , Patrick Barsanti , linux-amarula@amarulasolutions.com Subject: [PATCH 06/25] clk: imx8mn: Prevent clock critical path from disabling during reparent and set_rate Date: Sun, 14 Jul 2024 09:10:04 +0200 Message-ID: <20240714071023.10417-6-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714071023.10417-1-michael@amarulasolutions.com> References: <20240714071023.10417-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mZY9rjje; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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: , 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 8911e342f1..e089012477 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));