From patchwork Sun Jul 14 10:53:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3259 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 461E7412C7 for ; Sun, 14 Jul 2024 12:53:34 +0200 (CEST) Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2ee87d500casf34531991fa.3 for ; Sun, 14 Jul 2024 03:53:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720954413; cv=pass; d=google.com; s=arc-20160816; b=SEsGhKjzkgRLeGbic7XalIUSeh4Z2RqW+AOjBtEEHCcl9QM3f8podb45hjzn9lBYpQ Ah2pCEbWFeH5gN3gOuE8dTJhYZkCZofj0SRV+/rXAKFXSwDVqTaw/bEvPtMMR3Twaih3 HJ1vH2P3w+UhHPJqqzgUsh7tW3gBAv898cZaiqM1FWw+eeW/NdZLYUAEsfTEDBpvCkUR Og1fQjXBBSwzeNoBw0mZOlebi4lyxOZlE/5sb2E4osFLiuqohBpxXw6PyibIwk7sj9Oc mT2bHGV6rnbmkxIobvd7kpr/AAawQ0mUOMwjfJj9PS+exSAWY6h3S4AGz1OYBmD/Lz2T 0q6A== 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=7/5J050ySnLHJQ7KDtfTRML36AUqcRoWHq6EjO2jgUo=; fh=ukIE92Glr28mHP0EWlKftOPHTbUFUIeWU3P8NGSc07U=; b=WL4E/xDk2BlS335dQHgU8wMNgJq3hCxjw/RmK3cyT7MBbQUstSCP53SBSiWh8+3O/S R9fWPay9iQmsOdDveXQJHwxt+EGGV9DiwW6VxnZZ4MLdz5npdVN3knhZili26N3tAfRq QtyJYWR/+/Ar98wb2OLqQuC/U7KoJVfcs5eO1kUpj714vDE56fHNG17JdMRwDdEmnoBE N6ERatChQynN99OSBVXLoOT08c9fFOquxs6zqaxoodw9qQwGliLuVZVh34l0RV4pM4My eH6ZIQ95S+Cydhzaiq03RXuhgOTj1D/KqglkLySDQpvfVZ3c5TPNsLpHxsSLqC1qk9tW n4uA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NF7fJvdR; 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=1720954413; x=1721559213; 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=7/5J050ySnLHJQ7KDtfTRML36AUqcRoWHq6EjO2jgUo=; b=rT6ZMYUKSHkPp+rEeDFrNgU5pL8vZfRs70ojmuAHj7jWaKzctEoI+8USwVXKIS53+o J4/gFRWW4CIqPsQHTGiQ57ruTdasWjtq/wRy7hl5Cf6g8/tW5k3M3tGvbMcrw5Edtxe2 fM3uqAlTmlcQniYgFnRpbwK1uuwyrAF42YOS4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720954413; x=1721559213; 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=7/5J050ySnLHJQ7KDtfTRML36AUqcRoWHq6EjO2jgUo=; b=v8bvORsj8xIX+hd65MGVAwnx/12Upip62ZcbUjAGpHskfsV2CWmcwuVezA9dWpCdzI s8biLfz82yXzBPDlrmKyZr+sSqXBKyzJNYeLmQ3yuGefqdyEAk67Mzg41NbIYYtO7Yq4 P6uhRUpoOlzg5XW9MXnUUa0GSq15IO1XQuMUZe9udlve83IC003jGEJMDoDo8b2OzvNH OqL/r85kQ4yxlOoh1tBOK6y1A2hLsllogT25TN5RuHErvqFw/6+2aKxECDhZ3HVq7V0j 0htDZerMGSgFKni3rZqdvj1Po461kYjnxA9EgiIwRYzx5Nd1fvRoM4kDIlyFrjTKaCeK SVJA== X-Forwarded-Encrypted: i=2; AJvYcCUe/aYrdmleWUja53sSOEPg9S7A0qjC39/kPBpXeoIxzlcHP76mPD7O4DpuKg/8NjgeaQpDZ7/gb+mp5csZci99hKU6wd40Y7bE2ucsGLKdlbLo6f+GFP1lK0B+TA== X-Gm-Message-State: AOJu0YxYnyznZYt8mGaDlJyt8zgGU3MyteVo28Pw+X1JBKg596qj6ZUP +w99sKansQ1vaedGvA4DOMnRhZzXoOEfg8vE0PYcF6hqSF71R+fxiGYQtAe+HiHceQ== X-Google-Smtp-Source: AGHT+IHViNCwG9Mi0IidPYOvBtbkBp9barVuJjg9/0FOtF2GquqJrNcvqRGjgwGA59u/cW95uI5npw== X-Received: by 2002:a2e:9d06:0:b0:2ec:4acf:97dc with SMTP id 38308e7fff4ca-2eeb30bc9eemr107921171fa.11.1720954413677; Sun, 14 Jul 2024 03:53:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:5249:b0:599:9c73:c397 with SMTP id 4fb4d7f45d1cf-5999c73c4fdls1077852a12.2.-pod-prod-09-eu; Sun, 14 Jul 2024 03:53:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXWEBzMIgih5Ynwt0DSSKDjEJBhyrAyUfnm0cs01kO9MsdkBaTFQwNftdl0sEn5acv9+OYxpUAOh/5EfR2hIj3dQ7Tj3juBPt/vmZOv7pvxhfWY X-Received: by 2002:a17:906:a89a:b0:a77:eb34:3b50 with SMTP id a640c23a62f3a-a780b6b1da2mr937445666b.20.1720954411856; Sun, 14 Jul 2024 03:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720954411; cv=none; d=google.com; s=arc-20160816; b=y+LVFy0oDU0hZFgG0gtEoBSwwxCmscw1ts7YjGnJKIqpEvzd7htu1WEKr25CDgmpF+ TV3cIvlBDBzbNi7lWYE9ufnO4yxt04/pjG69lNDK/teG7J43q7h995mt7/QWUNQuvCUH /IVkwLV75J6W4PK05PzpKZwOX9tEV20JT1K6QJ3adLsN2nHC/Cgu7BtIs1c21wW9kNN7 2Q1U3QI02bfbEw1Sh9vF1aBhx+UaXgU21lMZkhx47+2j4CqgVO7mfqopr4NmOK0QD6T7 ds0V8u55cPJBUYqaoPlsGx0tt+wvxkXdujSlYFaaxTlfRd8+y+EnAfHi5m9N1W9f4CL3 /LBw== 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=Yh4v3D3pWHHqrsVDjmkbDuP1IwQL+jZVx5ue+4JboHQ=; fh=ADnWMIVZvC9r3r0x1algWfSBx3Mlpp1QFNQa0sgVcSQ=; b=m9inX6B/knEM+0gI6wgejxrM1c/i9N4hdVzm3+EbCM7PTsCRRxGt4lDSF6F3URXjfl ge8HdhyvKb+Dknaxy55L4RcVq4MFrVNvP5IHbE6XUkFj5UOCJinFFJd++d4UW2H6/0vC 1+tS3a2dk9IbqZrkdym4DlXr2m7Fd92kFkfxN+Nq7Zu8jFPTcGrdXnm3ryxaQ3mcCaJp dled13HR6OFaPRaNxwZYAzets7ZG+eYQjbDILqSsOnO2LI+d31qtW4CAWS4uphpsW6D6 w2etlCl2duAp0wsL0Vi4xz9CyFFon9vAHaJ9fOqj0FJaCOR06S2qrSRIM9hMbZjOWguQ upUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NF7fJvdR; 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-a79bc7d8cbfsor41207466b.8.2024.07.14.03.53.31 for (Google Transport Security); Sun, 14 Jul 2024 03:53:31 -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; AJvYcCVi3NKnd3AkOwlHfEfEONGNzrXMQ7ZJ9r9nHtshCILcz9v2gPweAPNTEcH1F0AEENy59L1GGXVhsLgd8taNMESGkyZ4S8mXStCv7j9GkUp5CVNU X-Received: by 2002:a17:906:6d48:b0:a6f:e66a:1d3f with SMTP id a640c23a62f3a-a780b6b30cemr1058843866b.32.1720954411466; Sun, 14 Jul 2024 03:53:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 03:53:31 -0700 (PDT) From: Michael Trimarchi To: Michael Trimarchi Cc: Dario Binacchi , Patrick Barsanti , linux-amarula@amarulasolutions.com Subject: [PATCH 02/25] clk: imx: clk-imx8mn Fix nand and spi clock parent Date: Sun, 14 Jul 2024 12:53:05 +0200 Message-ID: <20240714105328.35825-2-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=NF7fJvdR; 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: , The osc_24m is the clock-output-name and not the one that is used as internal name reference from the strcmp. The clock that use osc_24m, will not be able to reparent it as they should. We need anyway register the osc_24m clock fixed factor in the clock tree. Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") Cc: Marek Vasut Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mn.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index ed9e16d7c1..bfd1677520 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -57,15 +57,15 @@ static const char *imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; #if CONFIG_IS_ENABLED(DM_SPI) -static const char *imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", +static const char *imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", }; -static const char *imx8mn_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", +static const char *imx8mn_ecspi2_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", }; -static const char *imx8mn_ecspi3_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", +static const char *imx8mn_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", }; #endif @@ -105,7 +105,7 @@ static const char *imx8mn_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sy static const char *imx8mn_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m", "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", }; -static const char * const imx8mn_nand_sels[] = {"osc_24m", "sys_pll2_500m", "audio_pll1_out", +static const char * const imx8mn_nand_sels[] = {"clock-osc-24m", "sys_pll2_500m", "audio_pll1_out", "sys_pll1_400m", "audio_pll2_out", "sys_pll3_out", "sys_pll2_250m", "video_pll_out", }; @@ -119,7 +119,9 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 static int imx8mn_clk_probe(struct udevice *dev) { + struct clk osc_24m_clk; void __iomem *base; + int ret; base = (void *)ANATOP_BASE_ADDR; @@ -238,6 +240,11 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_SYS_PLL2_1000M, imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1)); + ret = clk_get_by_name(dev, "osc_24m", &osc_24m_clk); + if (ret) + return ret; + clk_dm(IMX8MN_CLK_24M, dev_get_clk_ptr(osc_24m_clk.dev)); + base = dev_read_addr_ptr(dev); if (!base) return -EINVAL;