Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6085468rdb; Mon, 18 Sep 2023 03:56:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhWUe5U10tpR4pq32vNb8UcDefxy47gAWI0BsRs3/NkWoIHnIg3lKCU2BDaixjeOVR2n2h X-Received: by 2002:a05:6a00:1596:b0:690:1720:aa92 with SMTP id u22-20020a056a00159600b006901720aa92mr8839414pfk.10.1695034564008; Mon, 18 Sep 2023 03:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695034563; cv=none; d=google.com; s=arc-20160816; b=TRCmi+8IdjzzLM8M5IiSZ6qVHPNtz98IvDlfM/VDGdhO8vWkVXADhzwRCY48u8gUUT tpa8roY/w4m0sAC/W5KH7fAn2LgLRT1rzPuD5C+8ze4kPH5xQgqKrEPaLo50OwciarSH C8xHHGODUOpfV0vkQfMx40cSDGpN49fgXbiFCx+GADsGdLXQNR45Lvf+AowcvlqG3Daa xeN/+72MfQexQa1TwqHnOpY7evwfMZ5oBxeKzVK4tsbr9tYV48aQqR1cK6rMv9vKFKH5 S4TjWTElaANG+fA0UUinvN07zWn+2EUkG+NArLv9/YmpbZyfZr5b5OPmIO/HWeqNaPQT 20qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lX9+mbtWLP7yVS59bGmWxF7PGQEXO4BU8xeOBRCUUFE=; fh=jtM6i4vQRLisu158KmlAkXDUGJjL/WanPJx7rdItVL8=; b=T8t5niy2EfzwLi3ngvq2R9jA/fRKgLrzUf6/kwNqZtzcKRbsbUCROM2Kv04m+U+4T7 FeGKNcmTqWUrAh9/TLr3M4GjJjuI8yL94nzapLUn1hGwrrd8ss622CpwNHlmlaLytUfS jcIpZwTMeDht+yZs55ptofyjK2HNGfdM9KU/bDuw/biKV1UPZQGFT69cLv6vdQscldTf OjjftD6JXjxAQ99m217NmBvSlsGH17TuCdEAA9aIRGpkOi4SZFwC29ibCGcqP43oBz2s FPkcpplFxF9x1TmLuocejJUMv/f1sk6TnXPqRrcsqJk9QPJtuLKi9LHb1XSfAcMHFHTN gauA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nathanrossi.com header.s=google header.b=OsXsmKhD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nathanrossi.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u18-20020a656712000000b005774a3b3efdsi7778824pgf.301.2023.09.18.03.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 03:56:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@nathanrossi.com header.s=google header.b=OsXsmKhD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nathanrossi.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id BCD3C801B889; Sun, 17 Sep 2023 19:22:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235705AbjIRCVE (ORCPT + 99 others); Sun, 17 Sep 2023 22:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235866AbjIRCUt (ORCPT ); Sun, 17 Sep 2023 22:20:49 -0400 Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6078F122 for ; Sun, 17 Sep 2023 19:20:43 -0700 (PDT) Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-44d4d997dcfso1933265137.0 for ; Sun, 17 Sep 2023 19:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; t=1695003642; x=1695608442; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lX9+mbtWLP7yVS59bGmWxF7PGQEXO4BU8xeOBRCUUFE=; b=OsXsmKhDkS90HOKLJdNUijTpzWRwTTlBxGc00Uus75Do1y3RUnX3o9ArJM2wSS0leg PolARbByEkfyVLQQlvyC6wCgOYgtkiQct2J0jCsTl439Hl6r7px6ucikNr2YqWscSiNt eD1rTpcQj0JxdiyQ2W75IglVrziIplRZDnH0nwbq0lttF8nJ+2Wgon8asYg1fSsENTTh 3C5QL2C4YThhqP8V7pHsEYWF1iWtKEKXxtBXFKt7GY0/xbfrAoJHEq1go5moPXU68Ir7 Vl1LLDF2eKrHo72pre8k7sV3Y4iXWzgQsF09JR68xcLsz7zA3HR57njo0P0eDKfyYx0b 12MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695003642; x=1695608442; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lX9+mbtWLP7yVS59bGmWxF7PGQEXO4BU8xeOBRCUUFE=; b=fo/436mkAY7YYcOT7VDRXAT9mxt/11aXOnL7mfj888fC34LhYOeQDO0xUeCVHQkbpD 6XpWbaGA1ERB/LbCSvgcTvFZeNYClDuOSQY/Y7EYNmofgRclCpAWDQSYxW+xrvpn0Htx XJtHv3uByJcYQQP18ZYtJWEGE389g/Zq7KAQHNQoYxT0WIFyZqYQJ05+B1qocjKRWJfy TXDYzqKCYPvqKYGq5LkC4cK9j7QVA9I8gaOzFOUmGDdJ65/x38iZPBhh6ybHCrS/sE2W fi+dC2Xd/XAIwT4XCyGR5UbjiY4iMq82O6Saxvj9rkTLyBNl9+qHUOXdLarDeeRcfz/H OIeg== X-Gm-Message-State: AOJu0YwhBM3yHVdqjk5J/djpDU9HHaRVwyFtgqJ3Gp4lzGPdqMLBYsGc s6p9ZcWWkDtEtsvq3jioO9qvcLfWYfr6j4RUWhST4Q== X-Received: by 2002:a05:6102:1588:b0:452:55f5:55e9 with SMTP id g8-20020a056102158800b0045255f555e9mr3608013vsv.14.1695003642473; Sun, 17 Sep 2023 19:20:42 -0700 (PDT) MIME-Version: 1.0 References: <20230814015700.70156-1-nathan@nathanrossi.com> In-Reply-To: <20230814015700.70156-1-nathan@nathanrossi.com> From: Nathan Rossi Date: Mon, 18 Sep 2023 12:20:31 +1000 Message-ID: Subject: Re: [PATCH] soc: imx8m: Enable OCOTP clock for imx8mm before reading registers To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Nathan Rossi , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 17 Sep 2023 19:22:01 -0700 (PDT) On Mon, 14 Aug 2023 at 11:57, Nathan Rossi wrote: > > From: Nathan Rossi > > Commit 836fb30949d9 ("soc: imx8m: Enable OCOTP clock before reading the > register") added configuration to enable the OCOTP clock before > attempting to read from the associated registers. > > This same kexec issue is present with the imx8m SoCs that use the > imx8mm_soc_uid function (e.g. imx8mp). This requires the imx8mm_soc_uid > function to configure the OCOTP clock before accessing the associated > registers. This change implements the same clock enable functionality > that is present in the imx8mq_soc_revision function for the > imx8mm_soc_uid function. Gentle ping. Are there any comments or feedback on this change? Thanks, Nathan > > Signed-off-by: Nathan Rossi > --- > drivers/soc/imx/soc-imx8m.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c > index 1dcd243df5..ec87d9d878 100644 > --- a/drivers/soc/imx/soc-imx8m.c > +++ b/drivers/soc/imx/soc-imx8m.c > @@ -100,6 +100,7 @@ static void __init imx8mm_soc_uid(void) > { > void __iomem *ocotp_base; > struct device_node *np; > + struct clk *clk; > u32 offset = of_machine_is_compatible("fsl,imx8mp") ? > IMX8MP_OCOTP_UID_OFFSET : 0; > > @@ -109,11 +110,20 @@ static void __init imx8mm_soc_uid(void) > > ocotp_base = of_iomap(np, 0); > WARN_ON(!ocotp_base); > + clk = of_clk_get_by_name(np, NULL); > + if (IS_ERR(clk)) { > + WARN_ON(IS_ERR(clk)); > + return; > + } > + > + clk_prepare_enable(clk); > > soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH + offset); > soc_uid <<= 32; > soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset); > > + clk_disable_unprepare(clk); > + clk_put(clk); > iounmap(ocotp_base); > of_node_put(np); > } > --- > 2.40.1