From patchwork Sun Jul 14 11:32:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3288 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F045C40F88 for ; Sun, 14 Jul 2024 13:33:12 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-59c1314940csf429509a12.3 for ; Sun, 14 Jul 2024 04:33:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720956792; cv=pass; d=google.com; s=arc-20160816; b=ADNx/UPo5tPfBadSlz+PQ9L47GeAb1XxeZqgy2OM+bhYbvi0ZjUyjF4Lxof7aKknVf PiKXEqC6MOMp3LM9a9afM3ssP/ATbgiNudB67RsbZL4JcecBgHx0HWFIBy4p6d9OeN9J XDxpnhcM50emaHrBKN+FhkQm+CXtq12dqGdNlUS/aGzF/OevBcO/zvvtcKw/uC+AfOiQ T2LVxZSzUUf1s/SBNRfLoNfedzrT8yusOuCKNGUOVUzrIjpvS3VDSrMzRPVJ/j+rqUsD yRPOjv7eIH9L4zQTOR4MYxKeoV6kRBslOFmVy3fXBQmfDDKp98WqPxuTblumCCt/CGoc /49g== 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=gf2/GnNlbGMcc4b/R/VQ3P1paAia634YQVT5M+dKa0Q=; b=QyO0i9vRKifvSqOzHNvlGFD8ILBfnTQjH1ESmnSEm21k9p6Tn8mu5GGruN8LYq9+Sj 4HrWMDPI+GI6VOsqGlLuT8cwxt+RNKgu2POfRLVNNGPKMAntHLCUvfukbOJgjUwX6OiV ZtCT0Lx/iM4+rUEtgq0d3hMSgazNdMEtwfvvydY5sqy7crx9PEm9rFNhypmz1Xd1Gdxr Ph1xeVGxN0naBhPX9A+P247UgOxcA+1xbxJAfUxUSAGGjBi2viS2j4vBqki3+EQFSlXg TDGY8CwYsWIGkMS9Pi6u2XW1kNM7CKyrl+DDIBgQYZ4v65A+wLiRmUjf6yvv+q+etuvq klXQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Msfb5rcq; 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=1720956792; x=1721561592; 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=HoosvCWoZryUxBxs/fyrJ8NwmyN/Eld0s0nSfOOoNWUsLxtOXu3chRErUNBrEp+DyX XixGkiCWbVB7ysoPTo7KvTSRTRTTYmyLvVlecHyi+LyRnoTIB7QF+zzPTKfNhs/nULAo clFvf17/7ljlwsjuHvNzYmke3yOmrAISSItKM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720956792; x=1721561592; 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=Szhv8RH1xr4L71PsbzO6d8C6YOXkh8bi0y1CnLa4rkxEv588JoqSxaUzebobyHpe7l rFMEtg4vqTgeIwsW08OPEwB7pV2zzy1aXesH4uT1MBK7ULnC1gnRH+FGE1nZUIFl3cGN mMEE1skb9a+LMbxK4lgI5rGjIHFNKMeCyNS0nnpURzb/FnoaLbNSIB5DZo43rPE4ptwQ q163zIhM/EqRfzvrNP1tT8imu5s1/7WdKRYg95JQAKlsDHXjeq/2iSqE/adQjJLQVLDl wKEIricGXZmRRIQMZju2khmslsj8VxqqOqTGWSkxbOKmtidvvvFQkuwBiNEiYi7z6MVc gKQA== X-Forwarded-Encrypted: i=2; AJvYcCXm9KsLJfCv7lsJ7XMeWN6OpNjaLBRAIqMnxkdHMRiEyuS5NGbRptouFU81GKF+JVemh9xEnlg/gQzwhYFP2HmBql6mZKWJxSOvUzYC6GDMRFGVjQcyWgFhFJgx0w== X-Gm-Message-State: AOJu0Yz8jiHt5N7Gx3Yj5N3Cwn2smQV6keQN79Ud8IJXBvuE3O+9epMp mOlFYJPJLehKhaB+w9UyIgslHrryxAjfCXyRVHq31QOAHllZTQhSvdEcJAtmIc0czg== X-Google-Smtp-Source: AGHT+IFt/cT7Oda0dHpvzPU/uNzJLkVnArRmCY3aZf50eqxkwmMBErFQVx8TycWZbFu0KwilpBBTXw== X-Received: by 2002:a50:e711:0:b0:57c:61a3:546 with SMTP id 4fb4d7f45d1cf-594bb674a8dmr9601830a12.21.1720956792702; Sun, 14 Jul 2024 04:33:12 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:df14:0:b0:58b:30e8:e88e with SMTP id 4fb4d7f45d1cf-5982612f083ls198347a12.2.-pod-prod-03-eu; Sun, 14 Jul 2024 04:33:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXnY4ChRIZKvUcfno+7dbM3LbS+DC8PD/ZBXXsO0e/PwpQ47bXOOM1sLHnXdzwvNKvVQihviUBw7coxG+y9jAPrGbb3Pkl0LDggFnI6xTBb603O X-Received: by 2002:a17:906:2342:b0:a77:e1fb:7dec with SMTP id a640c23a62f3a-a780b6b316dmr1002948766b.17.1720956790978; Sun, 14 Jul 2024 04:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720956790; cv=none; d=google.com; s=arc-20160816; b=nf0BD3/OmEDZ2Otmvi/EMM3TFw+N24qxq0njE5vVR5FI2qj2BDn+YyVBVgi0W65XqX +F9ocC5FfaGJ1YaZNjkGy/i/+86buwDHQmtGxdoE0omMQZgBKQSP98By2MMM3LNop2mg RaKxBvkLx5f0wgczx8mIB11n+o4Cjv7B/g/8Rb7bIvOudwDpEefTrN3Mn7ZqOQl0sXL7 xPRbQUitxF7obcHgOiRUBRQkYNoRSZGoRNbd8QrdRwQk6P6k5k8cGfoGjc6uBayAF9Wz RL7RO1Gn+15pbi//lC6vlMsvspGttrDY/V4UIYae1MnSszHVUKtLTg3XGt4ph7yMwKjc C0Qw== 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=ZM6WpXIzTra4JCMOlF3IaLPGf1VxwH3at1qwgCPc5b8=; b=Y2H3sFA4eQE6qjuIkEOnDJ7fH1HAqGvpuT2AneV/kU0L5TgP8yLeq4TqgnE/zmq4LA vgEewwhZ7xM8a3QoHFmncXCKWlxYCaNIo1utvjy51szW947M568h/ff4WIpIEB9lrvAb kJkjNzFt+wUjHg88vmHOgtg7vztNpKNRdKZqjeXtcjQT1FotOaJy37efmXKAlq4Da+mA gSuxyFSgmAb4q5UAVJbHLAAeM+kTNFa8c/l0cebzWp9IMXL4CAMsWhWUQcC/hRAOOETx 0+/zd5eQVA+7ri8bln1G9ylynMCW0DktuWiSfFV/pQxObx2YduQjNfwqhSSzDEi6Gllq LhHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Msfb5rcq; 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-a79bc5b2be9sor37525666b.8.2024.07.14.04.33.10 for (Google Transport Security); Sun, 14 Jul 2024 04:33:10 -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; AJvYcCUHbBf2fv4I16VLD/LkbqmJq26Dw/zWCRVjJwmYJNjtTuqIix9d5z40pdAhZwMNQk2lAkzkhW4MUEuXFOJ0ceOD6mDMr20Yw7+EOhEolzfopD/R X-Received: by 2002:aa7:de01:0:b0:57d:4ca4:61ba with SMTP id 4fb4d7f45d1cf-594baf8775emr9662314a12.10.1720956790607; Sun, 14 Jul 2024 04:33:10 -0700 (PDT) Received: from panicking.. (mob-5-91-58-211.net.vodafone.it. [5.91.58.211]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-59b25528dc1sm1929469a12.52.2024.07.14.04.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 04:33:10 -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 13:32:43 +0200 Message-ID: <20240714113302.133399-6-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714113302.133399-1-michael@amarulasolutions.com> References: <20240714113302.133399-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=Msfb5rcq; 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));