From patchwork Sun Jul 14 07:10:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3234 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6E93840F59 for ; Sun, 14 Jul 2024 09:10:32 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-59c1314940csf326804a12.3 for ; Sun, 14 Jul 2024 00:10:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720941032; cv=pass; d=google.com; s=arc-20160816; b=A7wUpUQhmSRyJMCuwEMktNjEGEKCDjjfG5mUXzIbImtgbW46iCd5bMfFM5sfUCszA8 UN9gxt7vBy6jJySWI2YrR4WK/3z9J10Pxee0xDDYvFiuqyS47B/N9wbL1GHOAN0ojhnz OEVQw/Qx5NFKbTuMjOE+bz8Py1JfUUh05FTbn7i0D52sYvKeU2sFSayD5GnzN1ldX4F4 6JWHYJ62NKxrdmgZ2TT9FY014X+oWmz83Ew8mkXRvgRSpdc/P0xIeK94eNs1thT4F9bD Y7a3jc1mkcjRcW6lEBbJX9dN2CxPNDnLjb4Dtq69kOTS5o/fvce1QqeAz373O5g/nbKx 4eDw== 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=eN1899HDWnas0uLaO5NldEAakqVQwPC+O97I93AHQwU=; b=UXxlIHqialzKsP0gDBE6NZn4DkMSEkeyvtEyXZDB7U4FxCyzpQoUwy1HkyAz/1SjAh HcEifJQeNU9pTgtsjTKtRBNieO1ushKYAPvo72yfwAU0+MjdUKVpsBzXCIx69Wfc7kSR Xir978erYBgzZBvnkTuhDEpGMmtZzU0ZfBQbvPe/qYufATcvyRNgVyqoTSPa8cspvX3T H6UzCeDruR5rkatX5A6PvDXw0kx+bHTZA9OL5qU39xA9fJ7qNBqeP/JhmZ4V6tNXaarQ 49PjuHKA4l05O+dvR7E5B+fn6iDk8qea5blZQIDYJereYd4WOzhatszlEnFvsAVhh+wM yMmw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SG1Gz3iX; 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=1720941032; x=1721545832; 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=Z7ArH+cC9ZghJLLNxSgRwQrLfFIFmD4DJhx8oc2PK0jnlBygQZ4uKzcDWAmjp65c/n HOOTsC/iVFnEMkAubspUWYFeJ+TQwaxrZISUSbAY/CBo3tsHZoDSE8BKXzLOYh5p0I1d Zi3YCmU62wQEs+CIhWoHt22QN6RdrfZiXaNwg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720941032; x=1721545832; 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=xDyOaQdKYxd1kMkZhbCE4icPvTOSD7GkLrSp5nivi66vF/wvxm8Z0PCnDtFyJYP9Mp /MarB2A77OPEAUNHfq/TVBoXcTNu4rkKGsz+7X6Ym045HcZC3EeU7hWxpqLu+dC1oHja DV+CwSWn+pPzkDbLnMf4psMj3XeUV55sTOFzZ/N/DH/WL9L/4VOsNMGyVkizgar3hfxS 2j5VzR5VOE6bNd0bFxNIy5OoHyZsFG3momLx+mJB2Jghp+t1px7bC9mzRz6YKPYi7EGG qtGA9BnjtmNQkTBA7w7B1jKRHdhzQAPrbmgBaB7n3q/l7TgEfQAP8bgNFi85Jyuwf6w7 zmXw== X-Forwarded-Encrypted: i=2; AJvYcCU1CT/ZCmICLpYaGQxFbTKw4HqV5oEDa9iZsuXDy5JZdbibimLug1gY18b/U8CRNPnsBniTZoYGmuAz1Ez0TmTWHLD7gnRTggWJsufkGQqpWPwZhN4JH05xbt+UnQ== X-Gm-Message-State: AOJu0YyTCyvFEmu5mHWHvDbklA0dXAKPdB93bjONg9SiELOhcO5BalzW BOutXMCY67jOWs8DoRk/3vTy1CnJU+ckQR7O7Hy0jl/3kXKApwIXX5uTy8QaJGKn/A== X-Google-Smtp-Source: AGHT+IFDim/3cu5VE3Y06uRl041BEgcaR1MOc1VhJoY4GkURbtxU/7XCe1BDRMW9KVXn+Nq8zwjJpQ== X-Received: by 2002:a50:fa8c:0:b0:57c:70b0:d541 with SMTP id 4fb4d7f45d1cf-594bb674a9amr10157452a12.20.1720941032160; Sun, 14 Jul 2024 00:10:32 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:df14:0:b0:58b:30e8:e88e with SMTP id 4fb4d7f45d1cf-5982612f083ls160260a12.2.-pod-prod-03-eu; Sun, 14 Jul 2024 00:10:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX8RtVOrp7tOPIe+Q1jfszz40TwpCmQP+0FPb5pEg5KbUGFgDYJsMcBwNyp6TYgkOld2J+cpruI5KZMnKZZWqAbj16TLWQpPdihlbOZc2jssXhW X-Received: by 2002:a17:906:31c1:b0:a77:cc6f:e791 with SMTP id a640c23a62f3a-a780b705299mr888686666b.38.1720941028426; Sun, 14 Jul 2024 00:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720941028; cv=none; d=google.com; s=arc-20160816; b=LQ0uNoHeim/kXPfIJZR2XiNxnbXkr+H9izw2SFOOFVGvGsRqbWxyW7a6mPvuVDs5LZ +GQLl6+wUOo3PiW0HkaJeYhwJkjQSJ1HDGgWWPi67BUDIgHJBU6NKouoth8g8KA9Rrog UhWFEh4c9pW538VLe4pJ5WGAo6pGzdWnOgEcdOZR2eYYNh4inWhHAQrevz1Nde+WMX1b CVItIUo45NVT+4At8acMsdT/FcTDXNgmUxqmrv+111rND6jK1KLr3GtPU5tCvrK48TYX 0xtNmiElySVfLS/T5skxZfZ9Fk/R1YK1SYZ++TPWTNiCH4CmTZgQ7LSb2u7jDwskk3/Y T4qw== 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=HyMmLNgu2rgirGrEZU2Pkcv+LHgqkGCEXqry7kuRRE8=; b=PWeLyFw6tO/cDbVyoBju9mLbvDieRtf24HxaAwrWaWrNEpKa/Cr/6O2upCLlO4ZSI0 4R5/pbmoV8Y0Q4NjKfR9s08E362Xkr1pwSrxEagB8bUBl1FI9gfgEAEfrCZ+HCutAKHt FI8T8emArIqHgwdc5gvLr9k9TbLaufOmpGN8hac+gRgG8lAwis4HkmYAx4t9Eglq+JfV YAfRNHwIWeNaxiONdaMf9dRWboy29nzU5Oj5OpeiiBYoRQFPsehPkp+eEUlfWX0rlXni qfqQwzIV9WsVq7ZAeO2Yj8sKdD8iML02Cn80pliOqEiFdRWCzLcbB54Z5dpkoFlVwfbR ck7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SG1Gz3iX; 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-a79bc7cf083sor41167466b.13.2024.07.14.00.10.28 for (Google Transport Security); Sun, 14 Jul 2024 00:10:28 -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; AJvYcCWuVmMe3W7x0x02THypSDFIkj/IUoXMYsACwebqEidqMTFwo3+QcMySPPxyZEm+UEyQbaKwqM0ImCdYAw+EEvj6Tn1bi9PumCPUvw8adLoiKlji X-Received: by 2002:a17:906:50c:b0:a77:c6c4:2bb7 with SMTP id a640c23a62f3a-a780b68a8c6mr1059812166b.1.1720941027998; Sun, 14 Jul 2024 00:10:27 -0700 (PDT) Received: from panicking.. (93-35-128-17.ip55.fastwebnet.it. [93.35.128.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc820d52sm104950266b.214.2024.07.14.00.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 00:10:26 -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 09:10:00 +0200 Message-ID: <20240714071023.10417-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714071023.10417-1-michael@amarulasolutions.com> References: <20240714071023.10417-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=SG1Gz3iX; 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;