From mboxrd@z Thu Jan 1 00:00:00 1970 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 0FB0DC43334 for ; Sun, 19 Jun 2022 14:40:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 136FE84307; Sun, 19 Jun 2022 16:40:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="QHd+kpMR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D09D84307; Sun, 19 Jun 2022 16:40:50 +0200 (CEST) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 42BA8842FA for ; Sun, 19 Jun 2022 16:40:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@amarulasolutions.com Received: by mail-pl1-x62a.google.com with SMTP id a17so5696887pls.6 for ; Sun, 19 Jun 2022 07:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=N9959cc2vCMXjikknpLs64Pt5LkX63sY6IhobUMl3Cc=; b=QHd+kpMRMKX1ghvIzIvnvyBE3E5cjz6fvcZcP8474mvox1Zo4eE+A9XxYXVL48UslF /3mKDbL0tjkP2/b0OqbyHvDgf0gXfLmJG46biJ3jOEXdYjsCD38AX9lnXeQrdr6T9kyz OfKdBzTKgLthrYTRUx/BLnxAwlA9dkS1jx5hE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=N9959cc2vCMXjikknpLs64Pt5LkX63sY6IhobUMl3Cc=; b=spgUdcwJi0dNL6E6JxfWkwM8bjqqpI8GSWUD3d3DnN9f5eAo/rPhfqMF8JQMlWWAb2 hK+OoWwZE13ttFGbYBQYd0kCu+alUaxeC7umUrBnh4GmMc4RRnY+g3Xy8jQDqhml4KVT IbHAoU5jtHS5PlfDBnsQyzmZfmx+SwlelvbWs5kaTs0+Kt2awwL5Kvsw2QV5Jk+QfXmi JqKLP/bhR5eAQGusbKsVHUySOsMmdZ88aeRsmVj0xmrEfrMNeyzZd3p7cScThNp9+p6i 6G5LMbmQWLvhWfePoo5teHeleygAUD6vY/f17h5i98ucOJCwONrGuNfdfKe8L6xwyR8M E9dA== X-Gm-Message-State: AJIora92ahNQgr8nimmquDDhMj197bZYBW2qKwhfsA6LRE2ypYWYZPiX nBPNR33CMk7AU4wdV/4Bgiyy0bXbn4sY9K4nvhTRGA== X-Google-Smtp-Source: AGRyM1v0Lsp+kOIrvhWbL3RRNLIec5FVBwJ6y4HWBwCenYSkP4RMN1BCi7H/SR7Qqbj7MB1oOGq52LxVwgY5kmjzeDs= X-Received: by 2002:a17:90a:6803:b0:1ec:7c43:cf77 with SMTP id p3-20020a17090a680300b001ec7c43cf77mr12986665pjj.171.1655649645325; Sun, 19 Jun 2022 07:40:45 -0700 (PDT) MIME-Version: 1.0 References: <20220613211005.30871-1-heiko.thiery@gmail.com> In-Reply-To: From: Michael Nazzareno Trimarchi Date: Sun, 19 Jun 2022 16:40:33 +0200 Message-ID: Subject: Re: [PATCH v4] imx: add i.MX8MN DDR3L evk board support To: Heiko Thiery Cc: Marek Vasut , U-Boot-Denx , Ying-Chun Liu , Peng Fan , Fabio Estevam , Marcel Ziswiler , Tim Harvey , Sean Anderson , =?UTF-8?Q?Thomas_Sch=C3=A4fer?= , Stefano Babic , Fabio Estevam Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.5 at phobos.denx.de X-Virus-Status: Clean Hi Heiko On Sun, Jun 19, 2022 at 8:12 AM Heiko Thiery wrote= : > > Hi, > > Am So., 19. Juni 2022 um 07:59 Uhr schrieb Michael Nazzareno Trimarchi > : > > > > Hi > > > > Il sab 18 giu 2022, 23:56 Heiko Thiery ha scri= tto: > >> > >> Hi Michael, Hi Marek, > >> > >> Am Mi., 15. Juni 2022 um 08:43 Uhr schrieb Michael Nazzareno Trimarchi > >> : > >> > > >> > Hi Heiko > >> > > >> > On Wed, Jun 15, 2022 at 8:23 AM Heiko Thiery wrote: > >> > > > >> > > Hi Marek, > >> > > > >> > > [SNIP] > >> > > > >> > > > > diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescal= e/imx8mn_evk/spl.c > >> > > > > index 14cb51368f..0d9909a662 100644 > >> > > > > --- a/board/freescale/imx8mn_evk/spl.c > >> > > > > +++ b/board/freescale/imx8mn_evk/spl.c > >> > > > > @@ -83,6 +83,15 @@ int power_init_board(void) > >> > > > > #ifdef CONFIG_IMX8MN_LOW_DRIVE_MODE > >> > > > > /* Set VDD_SOC/VDD_DRAM to 0.8v for low drive mode */ > >> > > > > pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x10); > >> > > > > +#elif defined(CONFIG_TARGET_IMX8MN_DDR3L_EVK) > >> > > > > + /* Set VDD_SOC to 0.85v for DDR3L at 1600MTS */ > >> > > > > + pmic_reg_write(dev, PCA9450_BUCK1OUT_DVS0, 0x14); > >> > > > > + > >> > > > > + /* Disable the BUCK2 */ > >> > > > > + pmic_reg_write(dev, PCA9450_BUCK2CTRL, 0x48); > >> > > > > + > >> > > > > + /* Set NVCC_DRAM to 1.35v */ > >> > > > > + pmic_reg_write(dev, PCA9450_BUCK6OUT, 0x1E); > >> > > > > #else > >> > > > > >> > > > All this part is not done by the spl pmic driver? > >> > > > >> > > I saw that you added the PCA9450 driver. Do you know if this > >> > > initialization can be done by the driver when CONFIG_SPL_DM_REGULA= TOR > >> > > is enabled? If I see this correctly, it can't be done. Is that > >> > > correct? > >> > > >> > +&i2c1 { > >> > + u-boot,dm-spl; > >> > +}; > >> > + > >> > +&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} { > >> > + u-boot,dm-spl; > >> > +}; > >> > + > >> > +&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b/regulators} { > >> > + u-boot,dm-spl; > >> > +}; > >> > + > >> > +&pinctrl_i2c1 { > >> > + u-boot,dm-spl; > >> > +}; > >> > + > >> > +&pinctrl_pmic { > >> > + u-boot,dm-spl; > >> > +}; > >> > + > >> > > >> > Maybe something like this should work. Now question is about should = be > >> > done in pre-reloc or not > >> > >> It took me a little while to understand what was meant by this. In the > >> meantime I could > >> change the PMIC/Regulator initialization to DT/DM and can make the set= ting so. > >> What is not clear to me yet is at which point this should be done > >> (regulators_enable_boot_on()). Currently I do it in the board/spl > >> specific board_init_f(). > >> > >> Do any of you have any advice here? > > > > > > After having a discussion with you, i found that maybe i have some prob= lem and some of the setting should be done before ddr inizialization. I wil= l take a look on it on afternoon. I know marek was working on some way to p= robe driver during binding and we need even to be sure that this can happen= before memory training. > > > > Currently I added it in board_init_f() right before spl_dram_init() > [1] and it works. I also tried to put it in power_init_board() [2] but > this does not work. > > [1] https://elixir.bootlin.com/u-boot/v2022.04/source/board/freescale/imx= 8mn_evk/spl.c#L162 > [2] https://elixir.bootlin.com/u-boot/v2022.04/source/board/freescale/imx= 8mn_evk/spl.c#L62 Does it work if you mark pre-reoloc, pmic, i2c, and pinctrl? Michael > > -- > Heiko > > > Michael > >> > >> > >> Thanks > >> -- > >> Heiko > >> > >> > Michael > >> > > > >> > > -- > >> > > Heiko > >> > > >> > > >> > > >> > -- > >> > Michael Nazzareno Trimarchi > >> > Co-Founder & Chief Executive Officer > >> > M. +39 347 913 2170 > >> > michael@amarulasolutions.com > >> > __________________________________ > >> > > >> > Amarula Solutions BV > >> > Joop Geesinkweg 125, 1114 AB, Amsterdam, NL > >> > T. +31 (0)85 111 9172 > >> > info@amarulasolutions.com > >> > www.amarulasolutions.com --=20 Michael Nazzareno Trimarchi Co-Founder & Chief Executive Officer M. +39 347 913 2170 michael@amarulasolutions.com __________________________________ Amarula Solutions BV Joop Geesinkweg 125, 1114 AB, Amsterdam, NL T. +31 (0)85 111 9172 info@amarulasolutions.com www.amarulasolutions.com