From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 11 Jan 2023 11:27:40 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pFYKb-008jHZ-3Z for lore@lore.pengutronix.de; Wed, 11 Jan 2023 11:27:40 +0100 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFYKY-00073f-4P for lore@pengutronix.de; Wed, 11 Jan 2023 11:27:39 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:To:From:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a56ohvYoBMAy8Ru+l+Ohu+shRqKLWPQtJEDPvhpE1CE=; b=RIvzJ/tXNnyNKlYRLWWfnUxWe9 QgQsrBAVaMJLc6LxcGh+Hr+/6GcRTOvYladzJJptA1Ow7imBJn5G0oG1t6CJNyRO7HVeLsam+uby/ yGeKHbmbAakUYZSyE4quURWyL4V4CNk0Y736wNxQjsWWo3ofpAWuUQfCngPYCErsPMDiK+aRVxFYp NPxnw+7iBWx8vSyGOZxx/ibQ7G6JyReDycBRyVgHxfLPM/IuyCmGUNF7vISYgflWSAJvfetJjS3K0 nn/7BUy8SOdC7q/ydwB7fnYpj4bGhsiGp8zMRSnzF8qadGXM4zMsN+z8qe1+8+VnlKLlPgmfAerdC RHvnUGTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFYJL-00AmNO-GF; Wed, 11 Jan 2023 10:26:23 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFYJF-00AmLv-Hh for barebox@lists.infradead.org; Wed, 11 Jan 2023 10:26:19 +0000 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pFYJE-0006t4-31; Wed, 11 Jan 2023 11:26:16 +0100 Message-ID: <57b55532-c473-d4c7-c1f4-0a8aa32b5977@pengutronix.de> Date: Wed, 11 Jan 2023 11:26:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US From: Ahmad Fatoum To: Johannes Schneider , barebox@lists.infradead.org References: <20230111100111.677018-1-johannes.schneider@leica-geosystems.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230111_022617_628434_D40FA802 X-CRM114-Status: GOOD ( 30.05 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.7 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Re: [PATCH v2 1/1] ARM: i.MX8M: add PCA9450 PMIC on rev-b EVK X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) On 11.01.23 11:17, Ahmad Fatoum wrote: > Hi, > > How do you generate your patches? Easiest is: > > git config sendemail.to barebox@lists.infradead.org > git send-email -3 --annotate > > This will take care to number the patches correctly. > > On 11.01.23 11:01, Johannes Schneider wrote: >> Configure and setup the PMIC found on rev-b EVKs. >> The code is algiend with how imx8mn-evk handles both > > aligned* > >> PMIC variants: pca9450 vs bd71837 > > Please note which Boards you tested this on. Also be aware that while you now do correct PMIC setup in PBL, you still unconditionally use a DT with only Rohm PMIC. Given that you now have a kernel DT for evkb. Can you add it to arch/arm/dts, enable it in the Makefile and choose one or the other DT in PBL like i.MX8MN does? Don't forget to add fsl,imx8mm-evkb to the match list in the board.c file. >> Signed-off-by: Johannes Schneider >> --- >> arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 51 +++++++++++++++-------- >> 1 file changed, 34 insertions(+), 17 deletions(-) >> >> diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c >> index 6132df53ec..409554c2d5 100644 >> --- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c >> +++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c >> @@ -16,6 +16,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -38,6 +39,25 @@ static void setup_uart(void) >> putc_ll('>'); >> } >> >> +static struct pmic_config pca9450_cfg[] = { >> + /* BUCKxOUT_DVS0/1 control BUCK123 output */ >> + { PCA9450_BUCK123_DVS, 0x29 }, >> + /* >> + * increase VDD_SOC to typical value 0.95V before first >> + * DRAM access, set DVS1 to 0.85v for suspend. >> + * Enable DVS control through PMIC_STBY_REQ and >> + * set B1_ENMODE=1 (ON by PMIC_ON_REQ=H) >> + */ >> + { PCA9450_BUCK1OUT_DVS0, 0x1C }, >> + /* Set DVS1 to 0.85v for suspend */ >> + /* Enable DVS control through PMIC_STBY_REQ and set B1_ENMODE=1 (ON by PMIC_ON_REQ=H) */ >> + { PCA9450_BUCK1OUT_DVS1, 0x14 }, >> + { PCA9450_BUCK1CTRL, 0x59 }, >> + >> + /* set WDOG_B_CFG to cold reset */ >> + { PCA9450_RESET_CTRL, 0xA1 }, >> +}; >> + >> static struct pmic_config bd71837_cfg[] = { >> /* decrease RESET key long push time from the default 10s to 10ms */ >> { BD718XX_PWRONCONFIG1, 0x0 }, >> @@ -51,21 +71,6 @@ static struct pmic_config bd71837_cfg[] = { >> { BD718XX_REGLOCK, 0x11 }, >> }; >> >> -static void power_init_board(void) >> -{ > > Can you leave this function as-is? This will make the diff more > readable. > >> - struct pbl_i2c *i2c; >> - >> - imx8mm_setup_pad(IMX8MM_PAD_I2C1_SCL_I2C1_SCL); >> - imx8mm_setup_pad(IMX8MM_PAD_I2C1_SDA_I2C1_SDA); >> - >> - imx8mm_early_clock_init(); >> - imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1); >> - >> - i2c = imx8m_i2c_early_init(IOMEM(MX8MQ_I2C1_BASE_ADDR)); >> - >> - pmic_configure(i2c, 0x4b, bd71837_cfg, ARRAY_SIZE(bd71837_cfg)); >> -} >> - >> extern struct dram_timing_info imx8mm_evk_dram_timing; >> >> static void start_atf(void) >> @@ -78,8 +83,20 @@ static void start_atf(void) >> if (current_el() != 3) >> return; >> >> - power_init_board(); >> - imx8mm_ddr_init(&imx8mm_evk_dram_timing, DRAM_TYPE_LPDDR4); >> + imx8mm_setup_pad(IMX8MM_PAD_I2C1_SCL_I2C1_SCL); >> + imx8mm_setup_pad(IMX8MM_PAD_I2C1_SDA_I2C1_SDA); >> + >> + imx8mm_early_clock_init(); >> + imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1); >> + >> + i2c = imx8m_i2c_early_init(IOMEM(MX8MM_I2C1_BASE_ADDR)); >> + >> + imx8mm_ddr_init(&imx8mm_evk_lpddr4_timing, DRAM_TYPE_LPDDR4); >> + if (i2c_dev_probe(i2c, 0x25, true) == 0) { >> + pmic_configure(i2c, 0x25, pca9450_cfg, ARRAY_SIZE(pca9450_cfg)); >> + } else { >> + pmic_configure(i2c, 0x4b, bd71837_cfg, ARRAY_SIZE(bd71837_cfg)); >> + } > > Nitpick: You can drop the braces (Kernel coding style). > >> >> imx8mm_load_and_start_image_via_tfa(); >> } > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |