From patchwork Sat Jul 13 08:45:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3208 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8FE6740F88 for ; Sat, 13 Jul 2024 10:45:35 +0200 (CEST) Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a77c6ea022fsf534620066b.1 for ; Sat, 13 Jul 2024 01:45:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720860335; cv=pass; d=google.com; s=arc-20160816; b=SevF/U3EtvZfh28GH/7AXQUXhI1MRxlVF0ZhFOQ+TO0GJwxTa5t67WARChVhMKI8Ql GJlJEepWkGeyNJ82WaykjrJoXeY7upugIPCor45C7CSuFCO4vn9ZZWbk4E35B+ztGrVM 2+QTMTW+Oz8YsUUKAid+R1lbj8NXnU3GeSDY4hY5bz5WMf74U88QOm1MGfg3Ddy9RMYr gIfbwG9Bq3CaH+AT5P0CTDCkk/BWYmlwGm5IwodpOCiFFtDbWSZ3WcjKNnAgtnK9ioen 8uDF4qJeFiigYhvIta1mVWMvJis5B+wlmkiOWeUiy/4XfJqG/ILooJlsXyUnGck353/N NkeQ== 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=b1Y+K5Ex1mSEkXlUihigzOG51HLIHJ5Yq+HppiLCgyM=; b=vNWxKLFj3gwcqOKXQm7XfpU1BJIm1JLJpCUwx/2h5VUJP/Sx6r9R2Z4Noera1IRP7+ 7Qv+pnzusMVO9ijOPOexm43QnIu7oLEb9yaos2AMajByJD9Ntsp4DiVNuoJIzJs/UvhP 9YQcqvbCGATnhTsvjizs7o9k2U9qgNLLHORbAOGWfwcN901zk7KrLno+nD5Xb4TgHnyA sp1ymdQIH4qmpebdV2XAjO2JuA6bpKAuH2DGpLwGyaWtiNjytRTBaWj7vR6eVsZEqTfz naICCD78uFMmvP6eY7Za6HH6N5QPTJ8Z21eHZQCkN2mPp6K/U5L1cuUtyoTREiF8j0Kp fXMg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XaufhEE0; 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=1720860335; x=1721465135; 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=m3s6BMcS2sYDj8BGOHymPrInvk3B8wOVv7l1+zZGVrE7eZwgUdd/gULyoEnizNQI86 dNIXvp4LmWJJnLN72usz8QT2QmrGT6wnJpNgfXzaoEaZgeAnUM+IRmgHM+KtMNPUGagw W1PrVDjwefVU3aw7ColpWVU3pXRYpD4EgSVK8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720860335; x=1721465135; 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=vdn3S3AV4F0gryxB49BfBevObabApysPgh0asxdql3fsTD/o3q5VySMMznMXQXcaY8 7CS5skL5YIpqLIbqpAScPo80zZXyn5ZFCAYIWdnSN1hrvK1EUXl1vKmEyg5+uvDOQBCL mepjwSIXrclLyaMMtSevitUdtOHrL1uVNX0zc40xjrGOAJBooLxZnZPBel1967V/6ano T0okY0c+uN+48vuJi6Ds0Jk71cfPhyBH321xD8IsJGuzvXcwxBmSAaisCCqwGtvEtIrr clWCQV3CtzN6ZUl8lDDLmFIinyYMNs2cyx7xW6cyK5c0pWiKrjFG+lj4B7PKFvRrYyLi Nd8g== X-Forwarded-Encrypted: i=2; AJvYcCXGwbY8p52s83OciRJfH1FclIN7IhoqBsjMRINjRnrBqbR6d4fS60Kr6XL79lbp97JSX+tt8spJ7D1x0p4Qdmkw4nvxDAPGnI4DnVqJ4Plt3/8+QC5moM+hDMzmsQ== X-Gm-Message-State: AOJu0YwyzuJVzHt70p2opAfMsUrW4OG1azJSVxnuUawWIN/8e7Ns/ZH7 cEFOBfPdAVNU1H4HU3cp7jnBgLnVBHIKCiKQskcLmU1v09THVBpUkZiSJHd+OCgTGQ== X-Google-Smtp-Source: AGHT+IGpS8kWuSrPo570q2HV87+JNXliGlUsBxsfj4S5HwRsj8PupOGOOFogg1q8ZcfzGvxFZqcTrQ== X-Received: by 2002:a50:f616:0:b0:57d:40e3:2a71 with SMTP id 4fb4d7f45d1cf-5995e7c9c2bmr4161938a12.6.1720860335145; Sat, 13 Jul 2024 01:45:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:c84e:0:b0:583:9e8e:cd8c with SMTP id 4fb4d7f45d1cf-5982622465cls238065a12.1.-pod-prod-00-eu; Sat, 13 Jul 2024 01:45:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUY9kwLA/NoErmAKNTclwguB0bkQkOBMXh9wgZD9faFQEZgYGT6qznwhYZDbAIDwuWXTKXITjPCldD5zz3hAqfdNfbF/eT14o56hYnq7s3JIbrB X-Received: by 2002:a17:906:5ad4:b0:a77:e031:bb86 with SMTP id a640c23a62f3a-a799cc278abmr311204166b.7.1720860333356; Sat, 13 Jul 2024 01:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720860333; cv=none; d=google.com; s=arc-20160816; b=i5n8h3C7iSUE0vooauPF/ciVbEx4e7L1MADxf4cqUPaI6nVuVbksHr3Y89NYdeNt+G tRG2KtADJ1ros+PR7XqlQRGgOAOD9KYRFKfS5ks3L5q7zJdLvU2haJStNu3lDJVecgX+ e46N4gwxQ2OU0yA5vEuq/kTeooGSrBaR+J/GU41XPuinOHQg/QuypWMNE6vfVHUGwsWE NcXbCpRosfRnAK8ZrKj9/Jh87BQKhbMu0TMZgUybIFuZFiuEOiI8dv6ZT/HqQJuR/fie bKjE1Q6nQahB7TwzyEvEYz7Y6gtVf1VeB3K325TU6D+X+0oyP0JGW/bnw/+QcU5pyjKC 5Tlg== 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=BwxKDAqbg6IsjJZPkKZuc7Mt8yFogFJVF8VpIUpJfDc=; b=mDUuBT5NAGz92CJDQFHpjGAxTTJI4FMkBTjApwD5KZuHw6P8jadzPdhkDBkGw5Ft2v US8EeJMore+CeTorqMPOcKWQv3bj8bkOKcIXcWvadV5oCFzAnPhm/P6MIls5uSaT2MVo M2OPHb0HGUaXDR7PMvjQXlrkOgy39+6grT5pKyULjtnKwTo5YHqyGVjBk14awNKFkNYV iA/76tZLkjKN3awYGJ/7yOKtcS0Vleqf6Gh2hPevg4ovrKCnc3O6dHxxUp1AzCSADICG 6p7+A9sgPjxnfcRhQUAFuYJzdsQYk+DOMu+z+q7TKOwv68MsGTIpkbbTY3xUy0TD/XSj QKBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XaufhEE0; 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-a79bb632e6csor25587066b.1.2024.07.13.01.45.33 for (Google Transport Security); Sat, 13 Jul 2024 01:45: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; AJvYcCVpba5KYp4wMMaiQVafMTvHJUEQs9Kr7QDWndjsW7RgStHZaxkHoFaYf9rsHvSGLsH8qKZGxIPo0ZMbiyXXOnSq2XFNGliN8erkaj6bnhOBBBZ+ X-Received: by 2002:a17:907:7d87:b0:a6f:6337:1ad5 with SMTP id a640c23a62f3a-a799d392e8amr454674866b.27.1720860332973; Sat, 13 Jul 2024 01:45:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 01:45:32 -0700 (PDT) From: Michael Trimarchi To: Michael Trimarchi Cc: Dario Binacchi , Patrick Barsanti , linux-amarula@amarulasolutions.com, Marek Vasut Subject: [PATCH 02/21] clk: imx: clk-imx8mn Fix nand and spi clock parent Date: Sat, 13 Jul 2024 10:45:07 +0200 Message-ID: <20240713084526.922537-2-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=XaufhEE0; 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;