From patchwork Sun Jul 14 10:53:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3263 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 95BB740F59 for ; Sun, 14 Jul 2024 12:53:42 +0200 (CEST) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2ee87069f27sf33619941fa.2 for ; Sun, 14 Jul 2024 03:53:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720954422; cv=pass; d=google.com; s=arc-20160816; b=Cq0yp3TiXbHkA8FsTjjiAIWlQI9Nzhc3/a4TBk3snHVe5Ac+AgwpNdJDwiMqSYhou3 dPTqs6SvubMtBNUkWLJAUAHX7x9YWyhiqGJDA8DEaRnTCjOXMpkTe8TQnfxcaGF9ayKo l57wjNZ90Lr8wk4CrSn4m7Fm0HybB1yEeRIyUVLqj0Qv0R56mO8/vUYAs6s0BTfS/QEh GSXV1FI1ZPEhd94EIixOS9Q7Tc5wH+fcZXdKY+qVy/uCBabTasrigrqKG1n+McCQTe1k ivwIlp9hp5yqs4ecDX9yZPr47BQbvY0PjZiLx3/mMk8bdI6D5b2542renBXrx1WzHtnO ynsA== 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=r0FKYOhiGfCl7V0FUcsn3q819KxHVtQXCZynAlo0mAc=; b=AelTqkbDt+IXXHegVLn4olXDmEeViPaAbC0F+q3nypKzm1r1U2SG1R7nhdZ04l3Tsw ciyUlG2HcRuCOZu2vfaUdmOtxZAyfp1ceE7w89Bgqg8Dm5ENjKQQ9jy7fKmrYHQtbErs kSJxbbKdfgsLowofaOgUF+q5YA6d3tS07FtP29EUEQOc8QGN9a4fHXqGvAOz6hZhz4OO UtEMVmi91CaOtlodtFrg7JPPvhrPKBLSTuRqzALgF6HZkgT8iKpba4LJ6n0yyfJ2XUAE vse0q3+lUVszZiRT+n8oOx/EbZ8Wp0ngGzy0dYBuUYK+5B2B1fUJhVqFyHkC/SSk/TI5 52uA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rYovPMQA; 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=1720954422; x=1721559222; 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=T5oTxCJGX1zrtiEkCSCx8TlXpqaif4pVxxRUS0nLV3N4u/5ShB5HQ15RviJmQQ3Vm3 J+uUjNUCAzbyFyEn2oMkXLrra8d5/UYYDq9ZOIwmWnX/X9GAQjzH7Dr1VD/pNjoD7aXn xh1/qRMsB2fQal3V3UMqixePb+M1fyscjKC+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720954422; x=1721559222; 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=UoHRG0NiS5PX9hLaeYdoS8j9Ici1TIPqdcZEOfiAH1zGKGfL8RkbBSiK6i4o6Nk0+2 QU4IK+nOjOBqQHHK98lSyRimIVYOVNUtjzXdjmtwycfRmlUZgPAn6P4qafEslGM7lad/ WhS1X9CIoYm/VNJ8wLC464MY4zdsCZKTyn+6qzfJ3NzvTXfsljVPOgDcSi2o0Amuhgqr r+n0vRHXaZ4theiyQt90USfHNqOyt1TxgulgId26ZsgQH+iNlylLjV+VMFuW15qAsGpr OOwubZBE1yqm/xvC8vRfZm1JNJIq4mfF8FtBTTQ/4QmkHeZ24SBq6Cs6NWxKwWxbTUaM pcAg== X-Forwarded-Encrypted: i=2; AJvYcCXj7JohK56h8ocKPNxX3mjmKuBo4DjvHjKKumd/9g9p2YqlYozjGbav5vDABnNdNIIqwkCzWn/5Kbxzz8LolEsq1GNZWX8l7s3r1qvD2MnrbMx1m3FayaCaQIngWQ== X-Gm-Message-State: AOJu0Yz3iUSp7NqEKbzTw/Fjs8dr6MWv4TCXcBg/Hg91+DJT0w6XWsy2 JVsZeQLJGCWfYjPbnboByqukiAAs9MMehSbxNM0ONrnAAwjD0ipA+cieukT+5svu5w== X-Google-Smtp-Source: AGHT+IGCbGpX5txvNnMz/5lbABUxGRkXcN+FTjd//jDD59PtTdXmnsV7I8n8slFoG4VJA55jDGy9yg== X-Received: by 2002:a2e:a582:0:b0:2ee:8b92:952f with SMTP id 38308e7fff4ca-2eeb304ea94mr145233721fa.0.1720954422004; Sun, 14 Jul 2024 03:53:42 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:c84e:0:b0:595:7fb0:945a with SMTP id 4fb4d7f45d1cf-5982622a74els1526537a12.1.-pod-prod-02-eu; Sun, 14 Jul 2024 03:53:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUmKIbyrB3N1NS068fplnTQlJu8TCL2axZr+oZmthBglqotpdVv/utfZJa/v4Fbwa5iWPDcFyEZUhE+4Q5DoirxXo0JWHEMna0LRQBZbuQp7gv0 X-Received: by 2002:a17:906:68c8:b0:a6f:f7c:5c7a with SMTP id a640c23a62f3a-a780b89c9dcmr967905366b.67.1720954420080; Sun, 14 Jul 2024 03:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720954420; cv=none; d=google.com; s=arc-20160816; b=eiHObpTq23sqk7MD0Qv9OfjI8mqTcsOcPCjcmWGB2aMOXeJ76eyNBOQxze+JrjNcvW 4quB4gRwpNW531pxkhMDdwxm5EOOF8JRfZctm0/eE9MvRNMcqvq7RikZggHKK0iM/yaH MBwSU26kM01adjhobBR9xPsI+Fmza8QlU60XyBOuB4XbLCxppocsC/hT/IYBFWwh4ubV vs+l79PwPUfFhj/W14hV8MvDDRZ4gPkpGtt905Ogfq7bAWL6+I+rIdCcJZSoGCTVxguB qlj7RMdBRHOiKDG+XnvP763BH/YRAucO8E835Y8oWr1zgcXTDUcQp2wV457igE1Jej9m 54bw== 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=9HUD9ZGX4+AYMp5WoCiYDJWVTUtK1D7lQDFnbzDRRkg=; b=c6t6Nyv+jr3r0p2tjycLBKL8va41vak7QmfTor7cnWFVGvCaVd3tPoFKMezTitWJW5 WX158tDvuOXmw7YYUOssFddfll5kAqwLX9nhFQh+tNOZ8YDxcW8nBzZc9V4ixc9PQKAR O7pEtBDQk6PPNaJNVtoWeZd0Q/0EhShJAFMulodeSzURBGWKygVCPeEKr1djFNovEGaG R58/uSovd3GgnXHf0GW6mYS6+sp6t8A4I4aigaMMIxac/0clOxFXXscCsi8OXjqTr7oH 68qETZ4BvVL4LyR61PXRNej3Pgv2RiSNMud5mJyoblx1fs7GBDweUgniOW1I8laiCtMp a43Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rYovPMQA; 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-a79bc863204sor41432866b.4.2024.07.14.03.53.40 for (Google Transport Security); Sun, 14 Jul 2024 03:53:40 -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; AJvYcCX/GtmWtN1FZbY6/WQzDM20uX8bAtKG6fNuG3T9tREqGe4KUnK4ef1x0mhNx/CC5FETBpOwLZlApIcTWGQ+qScSPio9lF0/vvMQRFjKX40gIjfd X-Received: by 2002:a17:906:c083:b0:a6f:49b1:dec5 with SMTP id a640c23a62f3a-a780b705231mr1017432666b.46.1720954419617; Sun, 14 Jul 2024 03:53:39 -0700 (PDT) Received: from panicking.. (mob-5-91-58-211.net.vodafone.it. [5.91.58.211]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc5a36c7sm119966166b.7.2024.07.14.03.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 03:53:39 -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 12:53:09 +0200 Message-ID: <20240714105328.35825-6-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714105328.35825-1-michael@amarulasolutions.com> References: <20240714105328.35825-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=rYovPMQA; 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));