From patchwork Sun Jul 14 11:32:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3284 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 EFE8E412C7 for ; Sun, 14 Jul 2024 13:33:07 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-57d3eca4bb7sf5127514a12.1 for ; Sun, 14 Jul 2024 04:33:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720956787; cv=pass; d=google.com; s=arc-20160816; b=vrlVAp+w28NFfT1ufkuJcv1urRQkEg1QDoX/IpW8C5zbFEdxJsdc2MVWgu7s3iH/JI xmgY2LORLCw3NDsY8wtwO8NzKxlgxUOq6JgWxZKaVVkA59QlL4BfuP0ZyiZNPuiL77yB RtuFPRqHrT52Y/ieOLlkWvw7E9lHe+8Q1Pf2IdQxMCsOUKMECjhAvOdzqkbKElYVt5l8 pKovGdWQfT+1fOaSqT8wqogLGL+QvdkaLmLmdLDfMlV/urtbsghwDDpgDNMu7p+qBqkO r/YgeVolmtdNWnKd4yzm5Q/6/inlD+VNCb0FxPRinbOWxnu7o33ON+XAqUCaK2hV/9t6 WvnQ== 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=ky3EHJu26GMzO12uzFG1gcmbdsMZYAI11KBrD3XJte4=; b=X8b2BD72bQK6M6xEvPOXPNRJ07CIYbUVPryp+tnMbIDunBw3D1mHurM6hlR4L4KA2s kXI5IZ3E7no8uK3Qq5tf56VogHvdmyskvXhye3o3TEZ93VdgrApfyJtCzMmOlMT1uTQG fwOImY4spYOD3M1LiH06RxNuZJDMaueSaki3pPtEDdKmkdB1JzRvcMr18nnobmN0ykH7 Zg1vtwF/1CxHKR6qzuUZBWVkLsGzbMVslekaXQ1nc1zGlX16lGGhrIN3QJrvZu6Dw+sf mLiskb1zINCkMLqMOBZWgpTeZ4Qo7VjuLYtlWuRFharjxcPMqe6Q4N3Bl2jRH2llZP9i ZYPQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AZ06Fhpe; 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=1720956787; x=1721561587; 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=d35guPQAmT6/93F02ux6Agbf88drh38cKb2VJpcBREa25moQPU2kmc85WOEcmAkSrT kgVsNIuEWWHZgfXWiE9kcFZcKGOwihXPROWfko6pd5EDDs9wJaZ4AwYPhOoHThAT6vP5 uDBucxneQjrGz4SjB3mGjJIq//ZBIq65VXMsI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720956787; x=1721561587; 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=pcMvT9IUuBnk2dtXbGlylDZAi9528BUkEvu/X8qioSRtrWrmITJBZ9LhzXOH1hS7bq /KvtwP0ETHg3rSyWhlgzV4MSe3H2H5dG+53b6Wc7lMPT+KWD6WrNdp2H7TH6Ka1dShYm nwhRA7NXzEP7nLzORHZPMKltjcyUNeploDid2dVYqvgFXoV3xfBPT6I00HvNRrhYI41v B7uwHq9crnIdSh2ARJ90EvMzT1/07W/oWLqytB55OMq1ZUBKlHPKJ6TeXDB8SVF0l/5C YbCCvLLQwfalu+KtPWT2ntwvDxZBO6Cb+HjVdFQT80l7UBfrVzLK2URaUPbZRBdx4uNK Tnpw== X-Forwarded-Encrypted: i=2; AJvYcCVKqh/qPTEz3oBNzyxDaNYq22fLx6zElSLg/YZ5QqpxdYO7XK+kA5Yg0odxq1Gh2rN9aDb/fvyKkcgRtmhQwKZf63dlD0kfVWH8VEXBl9IYv5UfOX2aSL86IggD7A== X-Gm-Message-State: AOJu0YygfyKPmcZMjxX+N2gnd08UOOCPz7ZWN5TAaqPcK4hYKAjcTgRy LBLI5sjK8YEvhR4Q9iIuh+bMwuGhrITmCNm65IggqFjVA4r6obyl9iwBsrxbehr1M998yE73eQ= = X-Google-Smtp-Source: AGHT+IFyMy1BU0oZx/6JwXsp/4vsJrRNkMmG+C8Ka71bQJkoqXE1dmzJL/wVQAJWAN6pdiYpRVKcbQ== X-Received: by 2002:a50:954d:0:b0:585:412f:ff8f with SMTP id 4fb4d7f45d1cf-5995e1fc866mr5825619a12.4.1720956787625; Sun, 14 Jul 2024 04:33:07 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:cc94:0:b0:58b:d414:30d1 with SMTP id 4fb4d7f45d1cf-59821cb83bbls85678a12.0.-pod-prod-00-eu; Sun, 14 Jul 2024 04:33:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVqVILcGYVZn4K6w8weTPx8CmkvBTIYjMNgd4q+LOhCdzZkQ86+CIEFprLFPP3aqH2ql2w0MHstUws2VR8vuwRVHLpaEL/CZLatww6GQVejQCoK X-Received: by 2002:a17:906:e099:b0:a72:8c53:1798 with SMTP id a640c23a62f3a-a799cd36c58mr478806866b.30.1720956785929; Sun, 14 Jul 2024 04:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720956785; cv=none; d=google.com; s=arc-20160816; b=BCVQPIEm8wXWfO0xc7yZG/Z87HXC0LJY3vvEniNsIM75NPrpYQnkvG2YYytz41Xlvm dHxXMIa32z1Q3qyomQ5KK6xafLkBkkQRMSKpJ47FOHdtOQzUNbS9pRIvwol/YNWpR+Zq uzHqYErfZfTqI7iNIXfvY77k9KtAxi2K9QMt4IfMx3iox89uvQF2YZyb2nWoZC2ECmos 8XzzmCfga+0Lu1gJiU66xUVWxRLghjcvBMWjO9A7Ta8ElGRNhwQXEEbmIH8GiWqb9Kor tAJLYsTjHIw4nDfYkE/34iZ4zs6yyHFMEJp8Cr5s6eAnjMES1H+Jk15KkZL3fAk3grBp f3pg== 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=sZizVj9XqXIrdVswG+e6J7vgQNUAS3XB9GXccsq1VLk=; b=Uuy4NPtuM03CmBH4Mqw2Q+/2Vn4l0wQoQTrQEfNwYz45Fl+hfn9pnjfGa0WjvEqY5y qc5sbNzii3pua++MVVAhD/9LsgZ+w3k5lmHnZ5EXm3xNSTszaLZgHJC4mDi169sFMM5q SMYWW491rtabgPEX/d5Ahrlgv/YzsrCXyB2Qa8mzREeP++439JqtjRpX5C3s7eyyCm8Y 63+d3RD/eabgXoQby3pO3U5p2zEBqlAy8lo5cJyyzChdf0lL8whLn1BVppvYbWmtdhwm kk3BC2q4ayMuMKlVz3LJkGHNas6HAClyVhQMJzd3/NjniUhw1gxsRXmEq8dHysfOIE5f 43+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AZ06Fhpe; 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-a79a0f75210sor161822066b.5.2024.07.14.04.33.05 for (Google Transport Security); Sun, 14 Jul 2024 04:33:05 -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; AJvYcCVPcPeYHetxHGeIPTVOPHnEsR8yGoBBOCULLKNDQ3vvim1f1P18j5sAS5K5EOM9SM/XucWat12xVvNa+wEl6c5VNr97+RC0/tGb9KSGkIq5AUo9 X-Received: by 2002:a05:6402:3489:b0:58b:bb69:763e with SMTP id 4fb4d7f45d1cf-599642c3317mr6205902a12.7.1720956785513; Sun, 14 Jul 2024 04:33:05 -0700 (PDT) Received: from panicking.. (mob-5-91-58-211.net.vodafone.it. [5.91.58.211]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-59b25528dc1sm1929469a12.52.2024.07.14.04.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 04:33:05 -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 13:32:39 +0200 Message-ID: <20240714113302.133399-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714113302.133399-1-michael@amarulasolutions.com> References: <20240714113302.133399-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=AZ06Fhpe; 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;