Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87898C76196 for ; Fri, 31 Mar 2023 14:12:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4904C85DBD; Fri, 31 Mar 2023 16:12:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="GH9Y29zl"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bKGNnhkw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2DF4885F95; Fri, 31 Mar 2023 16:12:31 +0200 (CEST) Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EA49B85DBD for ; Fri, 31 Mar 2023 16:12:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bigeasy@linutronix.de Date: Fri, 31 Mar 2023 16:12:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680271947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S7/gax2o2Rd8CfVFG2G3RHwBZTkcLpubdsm+WGJ1r+M=; b=GH9Y29zlA+7pMTwZqnj1FOi6XS6T4UBNWp359z3JZFwZvkY55YvleQjMA9q6t/dfVVmg7Y /PIv9JUyvdAfbTj+Q/PA41AYWz0FKglc6k0N3/AmlKvHEXlGT8fpRHmGXmzF/oGXklgd+C Gky/ZBVP+qx/DFyXfxv7JLQZgkxyScAPem33sB5tYtDSksuW6o9NrqIxTYop5OEA/Mc4gc zgeV7y9S0mjuEwI8KUuPkszvVnZTMLpxKbf2MDzuI3bvmROioTfxSxRHRHt+ae9wHjTm8y zBii/O5VTzMzC7sW0u0jmQEEJ+ggxUPRnJozDgKrBmCgBYI6aLQSnfnsQm3vKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680271947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S7/gax2o2Rd8CfVFG2G3RHwBZTkcLpubdsm+WGJ1r+M=; b=bKGNnhkwpCUwCnzKYJ7++2dU9PnQmd4xHDMVOoXIafqEGes8k8tASHzqSXYFfO5Crf5UH0 RYsl0DFTS+eG8GBA== From: Sebastian Andrzej Siewior To: Frieder Schrempf Cc: u-boot@lists.denx.de, "NXP i.MX U-Boot Team" , Fabio Estevam , Manuel Traut , Stefano Babic Subject: Re: [PATCH] imx: imx8mm: Add suppoer for Mettler-Toledo snowflake board. Message-ID: <20230331141226.PIq7WbWK@linutronix.de> References: <20230310135021.kRabfq7r@linutronix.de> <95b3bb48-6dcf-6468-362a-f0609494afee@kontron.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <95b3bb48-6dcf-6468-362a-f0609494afee@kontron.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 2023-03-16 11:33:47 [+0100], Frieder Schrempf wrote: > > diff --git a/arch/arm/dts/imx8mm-mt-snowflake-v2.dts b/arch/arm/dts/imx= 8mm-mt-snowflake-v2.dts > > new file mode 100644 > > index 0000000000000..49761b22afcf0 > > --- /dev/null > > +++ b/arch/arm/dts/imx8mm-mt-snowflake-v2.dts > > @@ -0,0 +1,186 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Copyright (C) 2020 Mettler Toledo GmbH > > + */ > > + > > +/dts-v1/; > > + > > +#include "imx8mm-kontron-sl.dtsi" > > +#include "imx8mm-u-boot.dtsi" > > + > > +/ { > > + model =3D "Mettler Toledo i.MX8MM Snowflake V2"; > > + compatible =3D "mt,imx8mm-snowflake-v2", "fsl,imx8mm"; >=20 > I think the compatible would normally include the SoM: >=20 > compatible =3D "mt,imx8mm-snowflake-v2", "kontron,imx8mm-sl", "fsl,imx8mm= "; This might work. Let me add it. =E2=80=A6 > > + > > +&i2c1 { > > + clock-frequency =3D <400000>; > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&pinctrl_i2c1>; > > + status =3D "okay"; > > + > > + pca9450: pmic@25 { =E2=80=A6 > > +}; >=20 > The included SoM DTSI already contains the PMIC node. You can remove > that here. Or if you need to do adjustments for the board level you > should only overwrite what is needed instead of duplicating everything. They appear to identical except for the regulator-name but this does not matter. Dropping that then. =E2=80=A6 > > + pinctrl_i2c1: i2c1grp { > > + fsl,pins =3D < > > + MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x400001c3 > > + MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x400001c3 > > + >; > > + }; >=20 > Same here, this node is already available from the SoM DTSI. gone. =E2=80=A6 > > diff --git a/board/mt/snowflake_v2/spl.c b/board/mt/snowflake_v2/spl.c > > new file mode 100644 > > index 0000000000000..3e27256914b32 > > --- /dev/null > > +++ b/board/mt/snowflake_v2/spl.c =E2=80=A6 > > + dram_timing.fsp_msg[0].fsp_cfg[9].val =3D 0x110; > > + dram_timing.fsp_msg[0].fsp_cfg[21].val =3D 0x1; > > + dram_timing.fsp_msg[1].fsp_cfg[10].val =3D 0x110; > > + dram_timing.fsp_msg[1].fsp_cfg[22].val =3D 0x1; > > + dram_timing.fsp_msg[2].fsp_cfg[10].val =3D 0x110; > > + dram_timing.fsp_msg[2].fsp_cfg[22].val =3D 0x1; > > + dram_timing.fsp_msg[3].fsp_cfg[10].val =3D 0x110; > > + dram_timing.fsp_msg[3].fsp_cfg[22].val =3D 0x1; >=20 > As you only support the 1GB DDR on this board, you could integrate these > values directly in the tables in lpddr4_timing.c and remove them here. I'm not sure how much of the header file is auto-generated including these bits here. Let me merge this now and worry later. > > + > > + if (!ddr_init(&dram_timing) && check_ram_available(SZ_1G)) { > > + size =3D 1; > > + puts("1GB DDR RAM\n"); > > + } else { > > + puts("Init DDR RAM failed\n"); > > + size =3D 1; > > + } > > + > > + writel(size, M4_BOOTROM_BASE_ADDR); >=20 > You could also simplify this and improve the error handling for your case: >=20 > if (ddr_init(&dram_timing) || !check_ram_available(SZ_1G)) { > puts("Init DDR RAM failed\n"); > halt(); > } >=20 > puts("1GB DDR RAM\n"); > writel(1, M4_BOOTROM_BASE_ADDR); Why not. There is not "halt()" in tree so I'm going to substite that block with panic(). =E2=80=A6 > > diff --git a/include/configs/snowflake_v2.h b/include/configs/snowflake= _v2.h > > new file mode 100644 > > index 0000000000000..f038dc9e6d7d8 > > --- /dev/null > > +++ b/include/configs/snowflake_v2.h > > @@ -0,0 +1,54 @@ > > +/* SPDX-License-Identifier: GPL-2.0+ */ > > +/* > > + * Copyright (C) 2019 Kontron Electronics GmbH > > + * Copyright (C) 2020 Mettler Toledo GmbH > > + * > > + * Configuration settings for the MT Snowflake v2 Terminal, based on K= ontron N8000 i.MX8MM SMARC module. >=20 > It's not a SMARC module. And nowadays the proper product name is > "Kontron SL i.MX8M Mini". okay. That should have been all of your comments. Sebastian