From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Delaunay Date: Tue, 18 May 2021 15:12:09 +0200 Subject: [PATCH 06/10] stm32mp: stm32prog: correctly handle DM_PMIC In-Reply-To: <20210518131213.20343-1-patrick.delaunay@foss.st.com> References: <20210518131213.20343-1-patrick.delaunay@foss.st.com> Message-ID: <20210518151206.6.Id5ec1c084e307f296256a9764772f23492ee4766@changeid> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Correctly handle number of alternate when DM_PMIC is not activated. This patch remove the last UNKNOWN partition in this case. Signed-off-by: Patrick Delaunay --- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index ea69d5dd16..ab687c272d 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -1150,7 +1150,10 @@ static int dfu_init_entities(struct stm32prog_data *data) struct dfu_entity *dfu; int alt_nb; - alt_nb = 3; /* number of virtual = CMD, OTP, PMIC*/ + alt_nb = 2; /* number of virtual = CMD, OTP*/ + if (CONFIG_IS_ENABLED(DM_PMIC)) + alt_nb++; /* PMIC NVMEM*/ + if (data->part_nb == 0) alt_nb++; /* +1 for FlashLayout */ else -- 2.17.1