From f80b8ac69bbbd38636562e8d8f4123d2633aa448 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Tue, 15 Sep 2020 14:51:46 -0500 Subject: mmc: mmc_of_parse: Enable 52 MHz support with "cap-mmc-highspeed" "cap-mmc-highspeed" enables support for 26 MHz MMC, but there is no additional flag to enable 52 MHz MMC. In Linux. "cap-mmc-highspeed" is used for MMC HS at both 26MHz and 52MHz. Use the same approach and enable MMC_CAP(MMC_HS_52) host capability when "cap-mmc-highspeed" is found in the devicetree. In the event an MMC card doesn't support 52 MHz, it will be clocked at a speed based on its EXT CSD, even on 52 MHz host controllers Signed-off-by: Alexandru Gagniuc Reviewed-by: Patrick Delaunay Tested-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- drivers/mmc/mmc-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index ec59bcd8566..285ac480615 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -228,7 +228,7 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg) if (dev_read_bool(dev, "cap-sd-highspeed")) cfg->host_caps |= MMC_CAP(SD_HS); if (dev_read_bool(dev, "cap-mmc-highspeed")) - cfg->host_caps |= MMC_CAP(MMC_HS); + cfg->host_caps |= MMC_CAP(MMC_HS) | MMC_CAP(MMC_HS_52); if (dev_read_bool(dev, "sd-uhs-sdr12")) cfg->host_caps |= MMC_CAP(UHS_SDR12); if (dev_read_bool(dev, "sd-uhs-sdr25")) -- cgit v1.2.3 From c981d67a0444cf31e5a16fe4be79d785eb182385 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Wed, 9 Sep 2020 16:54:02 -0500 Subject: mmc: stm32_sdmmc2: Use mmc_of_parse() to read host capabilities mmc_of_parse() can populate the 'f_max' and 'host_caps' fields of struct mmc_config from devicetree. The same logic is duplicated in stm32_sdmmc2_probe(). Use mmc_of_parse(), which is more generic. Signed-off-by: Alexandru Gagniuc Reviewed-by: Patrice Chotard Reviewed-by: Jaehoon Chung --- drivers/mmc/stm32_sdmmc2.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c index 6d503562171..77871d5afc9 100644 --- a/drivers/mmc/stm32_sdmmc2.c +++ b/drivers/mmc/stm32_sdmmc2.c @@ -676,27 +676,13 @@ static int stm32_sdmmc2_probe(struct udevice *dev) GPIOD_IS_IN); cfg->f_min = 400000; - cfg->f_max = dev_read_u32_default(dev, "max-frequency", 52000000); cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; cfg->name = "STM32 SD/MMC"; cfg->host_caps = 0; - if (cfg->f_max > 25000000) - cfg->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS; - - switch (dev_read_u32_default(dev, "bus-width", 1)) { - case 8: - cfg->host_caps |= MMC_MODE_8BIT; - /* fall through */ - case 4: - cfg->host_caps |= MMC_MODE_4BIT; - break; - case 1: - break; - default: - pr_err("invalid \"bus-width\" property, force to 1\n"); - } + cfg->f_max = 52000000; + mmc_of_parse(dev, cfg); upriv->mmc = &plat->mmc; -- cgit v1.2.3 From 67f9f11f197ff39e4e85e56bca84206ef18ab296 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Fri, 4 Sep 2020 12:55:19 +0200 Subject: stm32mp: limit size of cacheable DDR in pre-reloc stage In pre-reloc stage, U-Boot marks cacheable the DDR limited by the new config CONFIG_DDR_CACHEABLE_SIZE. This patch allows to avoid any speculative access to DDR protected by firewall and used by OP-TEE; the "no-map" reserved memory node in DT are assumed after this limit: STM32_DDR_BASE + DDR_CACHEABLE_SIZE. Without security, in basic boot, the value is equal to STM32_DDR_SIZE. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/mach-stm32mp/Kconfig | 13 +++++++++++++ arch/arm/mach-stm32mp/cpu.c | 3 ++- arch/arm/mach-stm32mp/spl.c | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig index 478fd2f17d0..f538d7cb838 100644 --- a/arch/arm/mach-stm32mp/Kconfig +++ b/arch/arm/mach-stm32mp/Kconfig @@ -93,6 +93,19 @@ config SYS_TEXT_BASE config NR_DRAM_BANKS default 1 +config DDR_CACHEABLE_SIZE + hex "Size of the DDR marked cacheable in pre-reloc stage" + default 0x10000000 if TFABOOT + default 0x40000000 + help + Define the size of the DDR marked as cacheable in U-Boot + pre-reloc stage. + This option can be useful to avoid speculatif access + to secured area of DDR used by TF-A or OP-TEE before U-Boot + initialization. + The areas marked "no-map" in device tree should be located + before this limit: STM32_DDR_BASE + DDR_CACHEABLE_SIZE. + config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2 hex "Partition on MMC2 to use to load U-Boot from" depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c index f19e5c3f33a..6785ab6b582 100644 --- a/arch/arm/mach-stm32mp/cpu.c +++ b/arch/arm/mach-stm32mp/cpu.c @@ -230,7 +230,8 @@ static void early_enable_caches(void) round_up(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE), DCACHE_DEFAULT_OPTION); else - mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE, + mmu_set_region_dcache_behaviour(STM32_DDR_BASE, + CONFIG_DDR_CACHEABLE_SIZE, DCACHE_DEFAULT_OPTION); } diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c index e84bdad7bfc..b679b0a6454 100644 --- a/arch/arm/mach-stm32mp/spl.c +++ b/arch/arm/mach-stm32mp/spl.c @@ -138,7 +138,8 @@ void board_init_f(ulong dummy) * to avoid speculative access and issue in get_ram_size() */ if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) - mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE, + mmu_set_region_dcache_behaviour(STM32_DDR_BASE, + CONFIG_DDR_CACHEABLE_SIZE, DCACHE_DEFAULT_OPTION); } -- cgit v1.2.3 From e07f76b25debf224a0283671f0b9ab0912a7ac0a Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 8 Oct 2020 15:14:58 +0200 Subject: ARM: dts: stm32: Do not set eth1addr if KS8851 has EEPROM In case the KS8851 has external EEPROM attached to it, do not set eth1addr at all. The network stack will read the MAC out of the KS8851 and set eth1addr accordingly. Signed-off-by: Marek Vasut Cc: Patrice Chotard Cc: Patrick Delaunay Reviewed-by: Patrice Chotard Reviewed-by: Patrick Delaunay --- board/dhelectronics/dh_stm32mp1/board.c | 40 +++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index c9abe3cc6df..f42d395098b 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -81,6 +81,11 @@ */ DECLARE_GLOBAL_DATA_PTR; +#define KS_CCR 0x08 +#define KS_CCR_EEPROM BIT(9) +#define KS_BE0 BIT(12) +#define KS_BE1 BIT(13) + int setup_mac_address(void) { unsigned char enetaddr[6]; @@ -97,12 +102,39 @@ int setup_mac_address(void) if (off < 0) { /* ethernet1 is not present in the system */ skip_eth1 = true; - } else { - ret = eth_env_get_enetaddr("eth1addr", enetaddr); - if (ret) /* eth1addr is already set */ - skip_eth1 = true; + goto out_set_ethaddr; + } + + ret = eth_env_get_enetaddr("eth1addr", enetaddr); + if (ret) { + /* eth1addr is already set */ + skip_eth1 = true; + goto out_set_ethaddr; + } + + ret = fdt_node_check_compatible(gd->fdt_blob, off, "micrel,ks8851-mll"); + if (ret) + goto out_set_ethaddr; + + /* + * KS8851 with EEPROM may use custom MAC from EEPROM, read + * out the KS8851 CCR register to determine whether EEPROM + * is present. If EEPROM is present, it must contain valid + * MAC address. + */ + u32 reg, ccr; + reg = fdt_get_base_address(gd->fdt_blob, off); + if (!reg) + goto out_set_ethaddr; + + writew(KS_BE0 | KS_BE1 | KS_CCR, reg + 2); + ccr = readw(reg); + if (ccr & KS_CCR_EEPROM) { + skip_eth1 = true; + goto out_set_ethaddr; } +out_set_ethaddr: if (skip_eth0 && skip_eth1) return 0; -- cgit v1.2.3 From 6af78d03d394cb0b28716aaaf684ab99bdeb758d Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Fri, 2 Oct 2020 14:08:54 +0200 Subject: arm: stm32: cleanup arch gpio.h Cosmetic update of gpio.h: - remove enumerate: stm32_gpio_port, stm32_gpio_pin because STM32_GPIO_XXX values are unused - move STM32_GPIOS_PER_BANK in stm32_gpio.c as its value is IP dependent and not arch dependent No functional change as number of banks and number of gpio by banks is managed by device tree since since DM migration and commit 8f651ca60ba1 ("pinctrl: stm32: Add get_pins_count() ops"). Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/include/asm/arch-stm32/gpio.h | 37 ++----------------------------- arch/arm/mach-stm32mp/include/mach/gpio.h | 37 ++----------------------------- drivers/gpio/stm32_gpio.c | 2 ++ 3 files changed, 6 insertions(+), 70 deletions(-) diff --git a/arch/arm/include/asm/arch-stm32/gpio.h b/arch/arm/include/asm/arch-stm32/gpio.h index 570e80a6ba8..233ce278a77 100644 --- a/arch/arm/include/asm/arch-stm32/gpio.h +++ b/arch/arm/include/asm/arch-stm32/gpio.h @@ -7,39 +7,6 @@ #ifndef _GPIO_H_ #define _GPIO_H_ -#define STM32_GPIOS_PER_BANK 16 - -enum stm32_gpio_port { - STM32_GPIO_PORT_A = 0, - STM32_GPIO_PORT_B, - STM32_GPIO_PORT_C, - STM32_GPIO_PORT_D, - STM32_GPIO_PORT_E, - STM32_GPIO_PORT_F, - STM32_GPIO_PORT_G, - STM32_GPIO_PORT_H, - STM32_GPIO_PORT_I -}; - -enum stm32_gpio_pin { - STM32_GPIO_PIN_0 = 0, - STM32_GPIO_PIN_1, - STM32_GPIO_PIN_2, - STM32_GPIO_PIN_3, - STM32_GPIO_PIN_4, - STM32_GPIO_PIN_5, - STM32_GPIO_PIN_6, - STM32_GPIO_PIN_7, - STM32_GPIO_PIN_8, - STM32_GPIO_PIN_9, - STM32_GPIO_PIN_10, - STM32_GPIO_PIN_11, - STM32_GPIO_PIN_12, - STM32_GPIO_PIN_13, - STM32_GPIO_PIN_14, - STM32_GPIO_PIN_15 -}; - enum stm32_gpio_mode { STM32_GPIO_MODE_IN = 0, STM32_GPIO_MODE_OUT, @@ -85,8 +52,8 @@ enum stm32_gpio_af { }; struct stm32_gpio_dsc { - enum stm32_gpio_port port; - enum stm32_gpio_pin pin; + u8 port; + u8 pin; }; struct stm32_gpio_ctl { diff --git a/arch/arm/mach-stm32mp/include/mach/gpio.h b/arch/arm/mach-stm32mp/include/mach/gpio.h index 5ca76d21ff1..7a0f2935190 100644 --- a/arch/arm/mach-stm32mp/include/mach/gpio.h +++ b/arch/arm/mach-stm32mp/include/mach/gpio.h @@ -8,39 +8,6 @@ #define _STM32_GPIO_H_ #include -#define STM32_GPIOS_PER_BANK 16 - -enum stm32_gpio_port { - STM32_GPIO_PORT_A = 0, - STM32_GPIO_PORT_B, - STM32_GPIO_PORT_C, - STM32_GPIO_PORT_D, - STM32_GPIO_PORT_E, - STM32_GPIO_PORT_F, - STM32_GPIO_PORT_G, - STM32_GPIO_PORT_H, - STM32_GPIO_PORT_I -}; - -enum stm32_gpio_pin { - STM32_GPIO_PIN_0 = 0, - STM32_GPIO_PIN_1, - STM32_GPIO_PIN_2, - STM32_GPIO_PIN_3, - STM32_GPIO_PIN_4, - STM32_GPIO_PIN_5, - STM32_GPIO_PIN_6, - STM32_GPIO_PIN_7, - STM32_GPIO_PIN_8, - STM32_GPIO_PIN_9, - STM32_GPIO_PIN_10, - STM32_GPIO_PIN_11, - STM32_GPIO_PIN_12, - STM32_GPIO_PIN_13, - STM32_GPIO_PIN_14, - STM32_GPIO_PIN_15 -}; - enum stm32_gpio_mode { STM32_GPIO_MODE_IN = 0, STM32_GPIO_MODE_OUT, @@ -86,8 +53,8 @@ enum stm32_gpio_af { }; struct stm32_gpio_dsc { - enum stm32_gpio_port port; - enum stm32_gpio_pin pin; + u8 port; + u8 pin; }; struct stm32_gpio_ctl { diff --git a/drivers/gpio/stm32_gpio.c b/drivers/gpio/stm32_gpio.c index 473e364796f..b885cfb57e5 100644 --- a/drivers/gpio/stm32_gpio.c +++ b/drivers/gpio/stm32_gpio.c @@ -18,6 +18,8 @@ #include #include +#define STM32_GPIOS_PER_BANK 16 + #define MODE_BITS(gpio_pin) ((gpio_pin) * 2) #define MODE_BITS_MASK 3 #define BSRR_BIT(gpio_pin, value) BIT((gpio_pin) + (value ? 0 : 16)) -- cgit v1.2.3 From ce52023050a89744699c7203210f28c90b4d2977 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 6 Oct 2020 13:59:41 +0200 Subject: MAINTAINERS: Add stm32 and stm regexp for ARM STM STM32MP platform Add files and directories regex "stm32" and "stm" in "ARM STM STM32MP" platform to avoid missing files or drivers supported by the STMicroelectronics series STM32MP15x. This patch adds the rules already used in Linux kernel for ARM/STM32 ARCHITECTURE. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fb9ba379842..1e796cb9838 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -443,6 +443,8 @@ F: include/dt-bindings/pinctrl/stm32-pinfunc.h F: include/dt-bindings/reset/stm32mp1-resets.h F: include/stm32_rcc.h F: tools/stm32image.c +N: stm +N: stm32 ARM STM STV0991 -- cgit v1.2.3 From 2bf692d31778b2045899c40c578118f6f3fa5ea2 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Tue, 6 Oct 2020 13:52:26 +0200 Subject: MAINTAINERS: Add STM32MP1 RNG driver in stm32mp platform Add the STM32MP1 RNG driver in the list of drivers supported by the STMicroelectronics STM32MP15x series. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1e796cb9838..d89ffe12fa9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -430,6 +430,7 @@ F: drivers/power/regulator/stpmic1.c F: drivers/ram/stm32mp1/ F: drivers/remoteproc/stm32_copro.c F: drivers/reset/stm32-reset.c +F: drivers/rng/stm32mp1_rng.c F: drivers/rtc/stm32_rtc.c F: drivers/serial/serial_stm32.* F: drivers/spi/stm32_qspi.c -- cgit v1.2.3 From fba7b9508532e7a52819b62021fdfa82c0595f3e Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Thu, 15 Oct 2020 14:31:50 +0200 Subject: configs: stm32mp15: activate CMD_IMPORTENV Activate CONFIG_CMD_IMPORTENV to accept the command "env import". This command is useful in script to include some variable. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- configs/stm32mp15_basic_defconfig | 1 - configs/stm32mp15_trusted_defconfig | 1 - 2 files changed, 2 deletions(-) diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index ce7225cee11..b61f337db53 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -32,7 +32,6 @@ CONFIG_SYS_PROMPT="STM32MP> " CONFIG_CMD_ADTIMG=y # CONFIG_CMD_ELF is not set # CONFIG_CMD_EXPORTENV is not set -# CONFIG_CMD_IMPORTENV is not set CONFIG_CMD_ERASEENV=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMTEST=y diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index 50288fe8664..afc6cde60f1 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="STM32MP> " CONFIG_CMD_ADTIMG=y # CONFIG_CMD_ELF is not set # CONFIG_CMD_EXPORTENV is not set -# CONFIG_CMD_IMPORTENV is not set CONFIG_CMD_ERASEENV=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMTEST=y -- cgit v1.2.3 From d931186312fb4ab767fb50a754657b4d147191b9 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Thu, 15 Oct 2020 14:31:51 +0200 Subject: configs: stm32mp15: activate CMD_EXPORTENV Activate CONFIG_CMD_EXPORTENV to accept the command "env export". Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- configs/stm32mp15_basic_defconfig | 1 - configs/stm32mp15_trusted_defconfig | 1 - 2 files changed, 2 deletions(-) diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index b61f337db53..fea237e20eb 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -31,7 +31,6 @@ CONFIG_SPL_SPI_FLASH_MTD=y CONFIG_SYS_PROMPT="STM32MP> " CONFIG_CMD_ADTIMG=y # CONFIG_CMD_ELF is not set -# CONFIG_CMD_EXPORTENV is not set CONFIG_CMD_ERASEENV=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMTEST=y diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index afc6cde60f1..8d652da82e3 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -15,7 +15,6 @@ CONFIG_BOOTCOMMAND="run bootcmd_stm32mp" CONFIG_SYS_PROMPT="STM32MP> " CONFIG_CMD_ADTIMG=y # CONFIG_CMD_ELF is not set -# CONFIG_CMD_EXPORTENV is not set CONFIG_CMD_ERASEENV=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMTEST=y -- cgit v1.2.3 From 33f5000ee8ed7e7f6d8e81d2d5724e773e9e852d Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Thu, 15 Oct 2020 14:46:34 +0200 Subject: configs: stm32mp15: activate CMD_ELF Activate CONFIG_CMD_ELF to accept the command "bootelf". This patch simplifies the file stm32mp defconfig, as we have no reason to deactivate this command. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- configs/stm32mp15_basic_defconfig | 1 - configs/stm32mp15_trusted_defconfig | 1 - 2 files changed, 2 deletions(-) diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index fea237e20eb..d1dbe1a92d1 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -30,7 +30,6 @@ CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_SPI_FLASH_MTD=y CONFIG_SYS_PROMPT="STM32MP> " CONFIG_CMD_ADTIMG=y -# CONFIG_CMD_ELF is not set CONFIG_CMD_ERASEENV=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMTEST=y diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index 8d652da82e3..9ff2ee70f01 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -14,7 +14,6 @@ CONFIG_FIT=y CONFIG_BOOTCOMMAND="run bootcmd_stm32mp" CONFIG_SYS_PROMPT="STM32MP> " CONFIG_CMD_ADTIMG=y -# CONFIG_CMD_ELF is not set CONFIG_CMD_ERASEENV=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMTEST=y -- cgit v1.2.3 From 53de79fecc53338b544b4d2c2d88daba9d82b007 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Thu, 15 Oct 2020 14:28:17 +0200 Subject: stm32mp: stm32prog: accept device without partition When partitions are not available on a device the command stm32prog raises an error but a device can have no partition to check in init_device() and the command need to continue to the next part_id. This patch correct an issue for ram0 target, when block_dev and mtd are NULL. For example with the simple flashlayout file: Opt Part Name Type Device Offset Binary - 0x01 fsbl Binary none 0x0 tf-a-serialboot.stm32 - 0x03 ssbl Binary none 0x0 u-boot.stm32 P 0x10 kernel System ram0 0xC2000000 uImage.bin P 0x11 dtb FileSytem ram0 0xC4000000 stm32mp157f-ev1.dtb Fixes: ffc405e63b94 ("stm32mp: stm32prog: add upport of partial update") Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index ec3355d8160..a777827c55e 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -768,9 +768,8 @@ static int init_device(struct stm32prog_data *data, part_found = true; } + /* no partition for this device */ if (!part_found) { - stm32prog_err("%s (0x%x): Invalid partition", - part->name, part->id); pr_debug("\n"); continue; } -- cgit v1.2.3