From patchwork Sat Jul 13 08:45:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3212 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4527740F45 for ; Sat, 13 Jul 2024 10:45:44 +0200 (CEST) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2ee87e69b53sf26565481fa.0 for ; Sat, 13 Jul 2024 01:45:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720860343; cv=pass; d=google.com; s=arc-20160816; b=Wke1aILSaN5WG3H+Keke83wKF9DYSpYvLnSIMcrz/a7RdfxmeYYGgJfsKbv4AU8lpi NhQmD69M+qJLT864vd2CAj9oGMz3yEy9+DLMSXyetKYDUr3J5Sg4Khajix0evGgZ4HAS 1UDplAmbYmm40Hi05IUVXaWTQZ4c+2563J5ue3HnnS7F1RChoUDa1dXpUYpp3HwMBYnV zmyPAy6CfZdv1pupSYPnHPH3mv2xJm4+2LhLNSApIB+bP4CapLd5IbjUuSIMWo+EQIGo GoMoskXB9N5ur4J1/xmtGKuEzIROJnAP2WoIMEInzZNNewlv3lihHEkYAVxraAdn5Q6s p5IA== 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=FgUx06f5TVMCyoRlgj5LEkFfn0QBmmkQZDV7oUjTNh8=; b=DU5d44HNEOFQ5hWs6IdaQHu2BzOX5MyxF1h4GbGOAXziqM1OL8inOjfAJaPpst9OkM uG+aYQ1gQCG7rZmTBtlFl+rZ+aeuPAunbHFG78D5yBfdkGjAu46BjNdFCIP0r2D4OhqN cEZ2q4rPOTNQybPPqqInTUHq52d4nWtZLljcQtg1rNmeuxbgney6tYvnNSi0zxH02I0I FveoMPdZ4/CQFa7OabXdvvupVPWcZ+k0dtVI4hAk8viBNBdm04+aeKTNMBrKs2jkyz0H q0RHpjItOQLk5nVV2CAlszLVx3qQ20eNLpNPDpwPM8NPn9/0bpT0d9oGsLyG8G3MF6lI MQiQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Rmm41dXe; 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=1720860343; x=1721465143; 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=MZuliUFAXnCLvJlxIN2OhzNlM6N6/UeYV5rBnifNsRT4eexOp3nZ+88zwEdsffPuc2 1MoJ9KL6HiFm3pPsEVG4iYWdAnsHdxElGrmsToQ3nBuRPexYLjSkC0Vo4uzRKkFqef8k Pw4U5tuiXOjzTR69aj4oFWJQjAJt6nYHRoFfg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720860343; x=1721465143; 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=kOpaXsvQBkH+rErp2WjNXjEcK0YubTra9iYoOuLgNY+YdXkUbHSWzKd/zE65wtGozM 6rZYr56Pdpno0sQWxPoLuytWJrjMuqG9DQmSFc4qwXsEft0yycicMNSfsq5sikFpv3GA LCFvrEkf5SdshByYL41+UHo4AE9kIQBDeSqhY2Hk8Kaxn8L1dPSaMch56hI0k8J4CXmV NmaxhuXHLXKgsilQ/Iv1Z+UDBD491vfsiKB3t4Qth0pOlm4RAvOKfrz/XYNpLQoZmFuS 52H8h+ixjHZMs8Rk4g3hpw7ErkU37I9JPMc67CGm7fIqJr/R0vWNQuvMovmf+rry/hmm DSSA== X-Forwarded-Encrypted: i=2; AJvYcCUclsGPIoroA0eCHJfeEi9aPQkzagS1PtEDZ3F2MhRVTDrxszPBe2CzF//cXaRwWsoFCgAI5mhMyDwD+k0OknOBluaO+sukajZad3xj61KAGoXGW7FbCvEpQx7vpw== X-Gm-Message-State: AOJu0YzNPVuzTkXrIW+0YypwhpnKrCvGa+R2sNJ4uyFzOCTQtw6666HU oFSLN2/63qbrZyfXzQ78DUcbNoRmonSiks5cwAjE7cIDxfKlL7IOUumCwfrjI6f/Ag== X-Google-Smtp-Source: AGHT+IG7XZKZh818aaI5yNOW1aEavRB+OsmMiX5/jsDgsDE0YieDprTpocAltQzfEBQP4vRy3O80SQ== X-Received: by 2002:a2e:99c8:0:b0:2ec:a022:880c with SMTP id 38308e7fff4ca-2eeb30e4669mr116220241fa.22.1720860343538; Sat, 13 Jul 2024 01:45:43 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a2e:b527:0:b0:2ec:4f80:327a with SMTP id 38308e7fff4ca-2eec8d9e150ls14370311fa.0.-pod-prod-05-eu; Sat, 13 Jul 2024 01:45:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU3xJX+/tEgRk8pN41SK6dUWtitMG51+5L50PqTPN1gfNJBF6Wokf9hk0fqXNDJe0ss7sKqjJIRyaOSwCyFdMRz5zdyhBsIpkL0JOu4UfM99ti7 X-Received: by 2002:a2e:830c:0:b0:2ea:e74c:40a2 with SMTP id 38308e7fff4ca-2eeb30e5025mr101121471fa.20.1720860341498; Sat, 13 Jul 2024 01:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720860341; cv=none; d=google.com; s=arc-20160816; b=h9zyetc+kZLjnftihPSf3m2NW9Now1DPkgeCZUu8Uo/aijtLtLZOyNnxSqqz4lyqGG 9RPfyAXYVw+Xaq5jbHx43SG+2LidabeuiWaZNsAVc4tdQh76OGlVmSS8qG+rJUFyn41C NgDVYmQJpwVeSSuc8ad7LuW4Kq4rOtN1AvV83MnndJINO35jUV8kCGIxkyHjC0rB4PIL thik5IZzzQNgtOmohW++E5+FbOBtd5czTZexu4+6mHFOlxbxojf0NjexFlNkmT/v/y1q WnldkAKw2kRq+qtA877rysDOmFFWhm6ma5jdkujgqmfDeKe+SYVmdhYKLoHdrqK3pOca xZ9g== 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=4xkDntNBOxLGVOGhnoIYpgaSX2OBvPePY18RRH4BIlI=; b=MXbB6s9dlWLjpw3w75aftUR7K0pq8hMnHwWNkbY7Uhpcmggrp48WlBhEADL00+fU1P V2uShkta1lNvz1J7dyAFJVKMS6Kh64wxM6yuXY3DfAq+Jjhbzkdnxhe0n+5QlTRm+U5H 0eOZZ7vc4NwhuJTsfB4AwZ+wwX0PhZzAKXDjsi72ioTxf7WxX9hWBAOTZuJyaVrpL4qM Cqhw9sohU/50jirGEIVnQvq2RmILs7avVz4mDOAyQLuUl+2Ffs/T/YIN2MROSns6xWXg z6OJ2oLKyzoyLttVZpNz4u9q3RY3F49wxELRvCcf6xb78lxZIu0/ePX4l24he4i/85J3 /m5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Rmm41dXe; 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 38308e7fff4ca-2eee179d7e4sor1520871fa.2.2024.07.13.01.45.41 for (Google Transport Security); Sat, 13 Jul 2024 01:45:41 -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; AJvYcCWLMw/PMN0+OtH95jvIR5GAiOuOOmp5OqnaFYOUhGZXKRCsbmtal3k3DlhL64jSem0MU2fnT48GlDI7sIU5Gu5ZrjYLO9FGZyp5YzEl7Gh2n1g8 X-Received: by 2002:a2e:97cb:0:b0:2ee:7a54:3b14 with SMTP id 38308e7fff4ca-2eeb30bb388mr115288891fa.7.1720860340953; Sat, 13 Jul 2024 01:45:40 -0700 (PDT) Received: from panicking.amarulasolutions.com (93-35-128-17.ip55.fastwebnet.it. [93.35.128.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc7f1e20sm31483966b.116.2024.07.13.01.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 01:45:40 -0700 (PDT) From: Michael Trimarchi To: Michael Trimarchi Cc: Dario Binacchi , Patrick Barsanti , linux-amarula@amarulasolutions.com Subject: [PATCH 06/21] clk: imx8mn: Prevent clock critical path from disabling during reparent and set_rate Date: Sat, 13 Jul 2024 10:45:11 +0200 Message-ID: <20240713084526.922537-6-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240713084526.922537-1-michael@amarulasolutions.com> References: <20240713084526.922537-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=Rmm41dXe; 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));