1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
3 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
12 #include <env_internal.h>
13 #include <fdt_support.h>
15 #include <generic-phy.h>
27 #include <remoteproc.h>
34 #include <asm/arch/stm32.h>
35 #include <asm/arch/sys_proto.h>
36 #include <jffs2/load_kernel.h>
37 #include <linux/bitops.h>
38 #include <linux/delay.h>
39 #include <linux/err.h>
40 #include <linux/iopoll.h>
41 #include <power/regulator.h>
42 #include <usb/dwc2_udc.h>
44 #include "../../st/common/stusb160x.h"
46 /* SYSCFG registers */
47 #define SYSCFG_BOOTR 0x00
48 #define SYSCFG_PMCSETR 0x04
49 #define SYSCFG_IOCTRLSETR 0x18
50 #define SYSCFG_ICNR 0x1C
51 #define SYSCFG_CMPCR 0x20
52 #define SYSCFG_CMPENSETR 0x24
53 #define SYSCFG_PMCCLRR 0x44
55 #define SYSCFG_BOOTR_BOOT_MASK GENMASK(2, 0)
56 #define SYSCFG_BOOTR_BOOTPD_SHIFT 4
58 #define SYSCFG_IOCTRLSETR_HSLVEN_TRACE BIT(0)
59 #define SYSCFG_IOCTRLSETR_HSLVEN_QUADSPI BIT(1)
60 #define SYSCFG_IOCTRLSETR_HSLVEN_ETH BIT(2)
61 #define SYSCFG_IOCTRLSETR_HSLVEN_SDMMC BIT(3)
62 #define SYSCFG_IOCTRLSETR_HSLVEN_SPI BIT(4)
64 #define SYSCFG_CMPCR_SW_CTRL BIT(1)
65 #define SYSCFG_CMPCR_READY BIT(8)
67 #define SYSCFG_CMPENSETR_MPU_EN BIT(0)
69 #define SYSCFG_PMCSETR_ETH_CLK_SEL BIT(16)
70 #define SYSCFG_PMCSETR_ETH_REF_CLK_SEL BIT(17)
72 #define SYSCFG_PMCSETR_ETH_SELMII BIT(20)
74 #define SYSCFG_PMCSETR_ETH_SEL_MASK GENMASK(23, 21)
75 #define SYSCFG_PMCSETR_ETH_SEL_GMII_MII 0
76 #define SYSCFG_PMCSETR_ETH_SEL_RGMII BIT(21)
77 #define SYSCFG_PMCSETR_ETH_SEL_RMII BIT(23)
80 * Get a global data pointer
82 DECLARE_GLOBAL_DATA_PTR;
84 #define USB_LOW_THRESHOLD_UV 200000
85 #define USB_WARNING_LOW_THRESHOLD_UV 660000
86 #define USB_START_LOW_THRESHOLD_UV 1230000
87 #define USB_START_HIGH_THRESHOLD_UV 2150000
89 int board_early_init_f(void)
91 /* nothing to do, only used in SPL */
101 const char *fdt_compat;
104 if (IS_ENABLED(CONFIG_TFABOOT))
109 printf("Board: stm32mp1 in %s mode", mode);
110 fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
112 if (fdt_compat && fdt_compat_len)
113 printf(" (%s)", fdt_compat);
116 /* display the STMicroelectronics board identification */
117 if (CONFIG_IS_ENABLED(CMD_STBOARD)) {
118 ret = uclass_get_device_by_driver(UCLASS_MISC,
119 DM_GET_DRIVER(stm32mp_bsec),
122 ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
125 printf("Board: MB%04x Var%d.%d Rev.%c-%02d\n",
129 ((otp >> 8) & 0xF) - 1 + 'A',
136 static void board_key_check(void)
139 struct gpio_desc gpio;
140 enum forced_boot_mode boot_mode = BOOT_NORMAL;
142 if (!IS_ENABLED(CONFIG_FASTBOOT) && !IS_ENABLED(CONFIG_CMD_STM32PROG))
145 node = ofnode_path("/config");
146 if (!ofnode_valid(node)) {
147 debug("%s: no /config node?\n", __func__);
150 if (IS_ENABLED(CONFIG_FASTBOOT)) {
151 if (gpio_request_by_name_nodev(node, "st,fastboot-gpios", 0,
152 &gpio, GPIOD_IS_IN)) {
153 debug("%s: could not find a /config/st,fastboot-gpios\n",
156 if (dm_gpio_get_value(&gpio)) {
157 puts("Fastboot key pressed, ");
158 boot_mode = BOOT_FASTBOOT;
161 dm_gpio_free(NULL, &gpio);
164 if (IS_ENABLED(CONFIG_CMD_STM32PROG)) {
165 if (gpio_request_by_name_nodev(node, "st,stm32prog-gpios", 0,
166 &gpio, GPIOD_IS_IN)) {
167 debug("%s: could not find a /config/st,stm32prog-gpios\n",
170 if (dm_gpio_get_value(&gpio)) {
171 puts("STM32Programmer key pressed, ");
172 boot_mode = BOOT_STM32PROG;
174 dm_gpio_free(NULL, &gpio);
177 if (boot_mode != BOOT_NORMAL) {
178 puts("entering download mode...\n");
179 clrsetbits_le32(TAMP_BOOT_CONTEXT,
180 TAMP_BOOT_FORCED_MASK,
185 int g_dnl_board_usb_cable_connected(void)
187 struct udevice *dwc2_udc_otg;
190 if (!IS_ENABLED(CONFIG_USB_GADGET_DWC2_OTG))
193 /* if typec stusb160x is present, means DK1 or DK2 board */
194 ret = stusb160x_cable_connected();
198 ret = uclass_get_device_by_driver(UCLASS_USB_GADGET_GENERIC,
199 DM_GET_DRIVER(dwc2_udc_otg),
202 debug("dwc2_udc_otg init failed\n");
204 return dwc2_udc_B_session_valid(dwc2_udc_otg);
207 #ifdef CONFIG_USB_GADGET_DOWNLOAD
208 #define STM32MP1_G_DNL_DFU_PRODUCT_NUM 0xdf11
209 #define STM32MP1_G_DNL_FASTBOOT_PRODUCT_NUM 0x0afb
211 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
213 if (IS_ENABLED(CONFIG_DFU_OVER_USB) &&
214 !strcmp(name, "usb_dnl_dfu"))
215 put_unaligned(STM32MP1_G_DNL_DFU_PRODUCT_NUM, &dev->idProduct);
216 else if (IS_ENABLED(CONFIG_FASTBOOT) &&
217 !strcmp(name, "usb_dnl_fastboot"))
218 put_unaligned(STM32MP1_G_DNL_FASTBOOT_PRODUCT_NUM,
221 put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM, &dev->idProduct);
225 #endif /* CONFIG_USB_GADGET_DOWNLOAD */
227 static int get_led(struct udevice **dev, char *led_string)
232 led_name = fdtdec_get_config_string(gd->fdt_blob, led_string);
234 pr_debug("%s: could not find %s config string\n",
235 __func__, led_string);
238 ret = led_get_by_label(led_name, dev);
240 debug("%s: get=%d\n", __func__, ret);
247 static int setup_led(enum led_state_t cmd)
252 if (!CONFIG_IS_ENABLED(LED))
255 ret = get_led(&dev, "u-boot,boot-led");
259 ret = led_set_state(dev, cmd);
263 static void __maybe_unused led_error_blink(u32 nb_blink)
272 if (CONFIG_IS_ENABLED(LED)) {
273 ret = get_led(&led, "u-boot,error-led");
275 /* make u-boot,error-led blinking */
276 /* if U32_MAX and 125ms interval, for 17.02 years */
277 for (i = 0; i < 2 * nb_blink; i++) {
278 led_set_state(led, LEDST_TOGGLE);
282 led_set_state(led, LEDST_ON);
286 /* infinite: the boot process must be stopped */
287 if (nb_blink == U32_MAX)
291 static int board_check_usb_power(void)
293 struct ofnode_phandle_args adc_args;
298 int min_uV = USB_START_HIGH_THRESHOLD_UV;
299 int ret, uV, adc_count;
303 if (!IS_ENABLED(CONFIG_ADC))
306 node = ofnode_path("/config");
307 if (!ofnode_valid(node)) {
308 debug("%s: no /config node?\n", __func__);
313 * Retrieve the ADC channels devices and get measurement
316 adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd",
317 "#io-channel-cells");
319 if (adc_count == -ENOENT)
322 pr_err("%s: can't find adc channel (%d)\n", __func__,
328 for (i = 0; i < adc_count; i++) {
329 if (ofnode_parse_phandle_with_args(node, "st,adc_usb_pd",
330 "#io-channel-cells", 0, i,
332 pr_debug("%s: can't find /config/st,adc_usb_pd\n",
337 ret = uclass_get_device_by_ofnode(UCLASS_ADC, adc_args.node,
341 pr_err("%s: Can't get adc device(%d)\n", __func__,
346 ret = adc_channel_single_shot(adc->name, adc_args.args[0],
349 pr_err("%s: single shot failed for %s[%d]!\n",
350 __func__, adc->name, adc_args.args[0]);
354 if (!adc_raw_to_uV(adc, raw, &uV)) {
359 pr_debug("%s: %s[%02d] = %u, %d uV\n", __func__,
360 adc->name, adc_args.args[0], raw, uV);
362 pr_err("%s: Can't get uV value for %s[%d]\n",
363 __func__, adc->name, adc_args.args[0]);
368 * If highest value is inside 1.23 Volts and 2.10 Volts, that means
369 * board is plugged on an USB-C 3A power supply and boot process can
372 if (max_uV > USB_START_LOW_THRESHOLD_UV &&
373 max_uV <= USB_START_HIGH_THRESHOLD_UV &&
374 min_uV <= USB_LOW_THRESHOLD_UV)
377 pr_err("****************************************************\n");
380 * If highest and lowest value are either both below
381 * USB_LOW_THRESHOLD_UV or both above USB_LOW_THRESHOLD_UV, that
382 * means USB TYPE-C is in unattached mode, this is an issue, make
383 * u-boot,error-led blinking and stop boot process.
385 if ((max_uV > USB_LOW_THRESHOLD_UV &&
386 min_uV > USB_LOW_THRESHOLD_UV) ||
387 (max_uV <= USB_LOW_THRESHOLD_UV &&
388 min_uV <= USB_LOW_THRESHOLD_UV)) {
389 pr_err("* ERROR USB TYPE-C connection in unattached mode *\n");
390 pr_err("* Check that USB TYPE-C cable is correctly plugged *\n");
391 /* with 125ms interval, led will blink for 17.02 years ....*/
395 if (max_uV > USB_LOW_THRESHOLD_UV &&
396 max_uV <= USB_WARNING_LOW_THRESHOLD_UV &&
397 min_uV <= USB_LOW_THRESHOLD_UV) {
398 pr_err("* WARNING 500mA power supply detected *\n");
402 if (max_uV > USB_WARNING_LOW_THRESHOLD_UV &&
403 max_uV <= USB_START_LOW_THRESHOLD_UV &&
404 min_uV <= USB_LOW_THRESHOLD_UV) {
405 pr_err("* WARNING 1.5A power supply detected *\n");
410 * If highest value is above 2.15 Volts that means that the USB TypeC
411 * supplies more than 3 Amp, this is not compliant with TypeC specification
413 if (max_uV > USB_START_HIGH_THRESHOLD_UV) {
414 pr_err("* USB TYPE-C charger not compliant with *\n");
415 pr_err("* specification *\n");
416 pr_err("****************************************************\n\n");
417 /* with 125ms interval, led will blink for 17.02 years ....*/
420 pr_err("* Current too low, use a 3A power supply! *\n");
421 pr_err("****************************************************\n\n");
424 led_error_blink(nb_blink);
429 static void sysconf_init(void)
432 struct udevice *pwr_dev;
433 struct udevice *pwr_reg;
439 syscfg = (u8 *)syscon_get_first_range(STM32MP_SYSCON_SYSCFG);
441 /* interconnect update : select master using the port 1 */
444 /* today information is hardcoded in U-Boot */
445 writel(BIT(9), syscfg + SYSCFG_ICNR);
447 /* disable Pull-Down for boot pin connected to VDD */
448 bootr = readl(syscfg + SYSCFG_BOOTR);
449 bootr &= ~(SYSCFG_BOOTR_BOOT_MASK << SYSCFG_BOOTR_BOOTPD_SHIFT);
450 bootr |= (bootr & SYSCFG_BOOTR_BOOT_MASK) << SYSCFG_BOOTR_BOOTPD_SHIFT;
451 writel(bootr, syscfg + SYSCFG_BOOTR);
453 /* High Speed Low Voltage Pad mode Enable for SPI, SDMMC, ETH, QSPI
454 * and TRACE. Needed above ~50MHz and conditioned by AFMUX selection.
455 * The customer will have to disable this for low frequencies
456 * or if AFMUX is selected but the function not used, typically for
457 * TRACE. Otherwise, impact on power consumption.
460 * enabling High Speed mode while VDD>2.7V
461 * with the OTP product_below_2v5 (OTP 18, BIT 13)
462 * erroneously set to 1 can damage the IC!
463 * => U-Boot set the register only if VDD < 2.7V (in DT)
464 * but this value need to be consistent with board design
466 ret = uclass_get_device_by_driver(UCLASS_PMIC,
467 DM_GET_DRIVER(stm32mp_pwr_pmic),
469 if (!ret && IS_ENABLED(CONFIG_DM_REGULATOR)) {
470 ret = uclass_get_device_by_driver(UCLASS_MISC,
471 DM_GET_DRIVER(stm32mp_bsec),
474 pr_err("Can't find stm32mp_bsec driver\n");
478 ret = misc_read(dev, STM32_BSEC_SHADOW(18), &otp, 4);
482 /* get VDD = vdd-supply */
483 ret = device_get_supply_regulator(pwr_dev, "vdd-supply",
486 /* check if VDD is Low Voltage */
488 if (regulator_get_value(pwr_reg) < 2700000) {
489 writel(SYSCFG_IOCTRLSETR_HSLVEN_TRACE |
490 SYSCFG_IOCTRLSETR_HSLVEN_QUADSPI |
491 SYSCFG_IOCTRLSETR_HSLVEN_ETH |
492 SYSCFG_IOCTRLSETR_HSLVEN_SDMMC |
493 SYSCFG_IOCTRLSETR_HSLVEN_SPI,
494 syscfg + SYSCFG_IOCTRLSETR);
497 pr_err("product_below_2v5=0: HSLVEN protected by HW\n");
500 pr_err("product_below_2v5=1: HSLVEN update is destructive, no update as VDD>2.7V\n");
503 debug("VDD unknown");
507 /* activate automatic I/O compensation
508 * warning: need to ensure CSI enabled and ready in clock driver
510 writel(SYSCFG_CMPENSETR_MPU_EN, syscfg + SYSCFG_CMPENSETR);
512 /* poll until ready (1s timeout) */
513 ret = readl_poll_timeout(syscfg + SYSCFG_CMPCR, val,
514 val & SYSCFG_CMPCR_READY,
517 pr_err("SYSCFG: I/O compensation failed, timeout.\n");
521 clrbits_le32(syscfg + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL);
524 /* Fix to make I2C1 usable on DK2 for touchscreen usage in kernel */
525 static int dk2_i2c1_fix(void)
528 struct gpio_desc hdmi, audio;
531 if (!IS_ENABLED(CONFIG_DM_REGULATOR))
534 node = ofnode_path("/soc/i2c@40012000/hdmi-transmitter@39");
535 if (!ofnode_valid(node)) {
536 pr_debug("%s: no hdmi-transmitter@39 ?\n", __func__);
540 if (gpio_request_by_name_nodev(node, "reset-gpios", 0,
541 &hdmi, GPIOD_IS_OUT)) {
542 pr_debug("%s: could not find reset-gpios\n",
547 node = ofnode_path("/soc/i2c@40012000/cs42l51@4a");
548 if (!ofnode_valid(node)) {
549 pr_debug("%s: no cs42l51@4a ?\n", __func__);
553 if (gpio_request_by_name_nodev(node, "reset-gpios", 0,
554 &audio, GPIOD_IS_OUT)) {
555 pr_debug("%s: could not find reset-gpios\n",
560 /* before power up, insure that HDMI and AUDIO IC is under reset */
561 ret = dm_gpio_set_value(&hdmi, 1);
563 pr_err("%s: can't set_value for hdmi_nrst gpio", __func__);
566 ret = dm_gpio_set_value(&audio, 1);
568 pr_err("%s: can't set_value for audio_nrst gpio", __func__);
572 /* power-up audio IC */
573 regulator_autoset_by_name("v1v8_audio", NULL);
575 /* power-up HDMI IC */
576 regulator_autoset_by_name("v1v2_hdmi", NULL);
577 regulator_autoset_by_name("v3v3_hdmi", NULL);
583 static bool board_is_dk2(void)
585 if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
586 of_machine_is_compatible("st,stm32mp157c-dk2"))
592 static bool board_is_ev1(void)
594 if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
595 (of_machine_is_compatible("st,stm32mp157a-ev1") ||
596 of_machine_is_compatible("st,stm32mp157c-ev1") ||
597 of_machine_is_compatible("st,stm32mp157d-ev1") ||
598 of_machine_is_compatible("st,stm32mp157f-ev1")))
604 /* touchscreen driver: only used for pincontrol configuration */
605 static const struct udevice_id goodix_ids[] = {
606 { .compatible = "goodix,gt9147", },
610 U_BOOT_DRIVER(goodix) = {
613 .of_match = goodix_ids,
616 static void board_ev1_init(void)
620 /* configure IRQ line on EV1 for touchscreen before LCD reset */
621 uclass_get_device_by_driver(UCLASS_NOP, DM_GET_DRIVER(goodix), &dev);
624 /* board dependent setup after realloc */
627 /* address of boot parameters */
628 gd->bd->bi_boot_params = STM32_DDR_BASE + 0x100;
630 if (CONFIG_IS_ENABLED(DM_GPIO_HOG))
631 gpio_hog_probe_all();
641 if (IS_ENABLED(CONFIG_DM_REGULATOR))
642 regulators_enable_boot_on(_DEBUG);
644 if (!IS_ENABLED(CONFIG_TFABOOT))
647 if (CONFIG_IS_ENABLED(LED))
655 int board_late_init(void)
657 const void *fdt_compat;
666 if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) {
667 fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
669 if (fdt_compat && fdt_compat_len) {
670 if (strncmp(fdt_compat, "st,", 3) != 0) {
671 env_set("board_name", fdt_compat);
673 env_set("board_name", fdt_compat + 3);
675 buf_len = sizeof(dtb_name);
676 strncpy(dtb_name, fdt_compat + 3, buf_len);
677 buf_len -= strlen(fdt_compat + 3);
678 strncat(dtb_name, ".dtb", buf_len);
679 env_set("fdtfile", dtb_name);
682 ret = uclass_get_device_by_driver(UCLASS_MISC,
683 DM_GET_DRIVER(stm32mp_bsec),
687 ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
689 if (ret > 0 && otp) {
690 snprintf(buf, sizeof(buf), "0x%04x", otp >> 16);
691 env_set("board_id", buf);
693 snprintf(buf, sizeof(buf), "0x%04x",
694 ((otp >> 8) & 0xF) - 1 + 0xA);
695 env_set("board_rev", buf);
699 /* for DK1/DK2 boards */
700 board_check_usb_power();
705 void board_quiesce_devices(void)
707 setup_led(LEDST_OFF);
710 /* eth init function : weak called in eqos driver */
711 int board_interface_eth_init(struct udevice *dev,
712 phy_interface_t interface_type)
716 bool eth_clk_sel_reg = false;
717 bool eth_ref_clk_sel_reg = false;
719 /* Gigabit Ethernet 125MHz clock selection. */
720 eth_clk_sel_reg = dev_read_bool(dev, "st,eth_clk_sel");
722 /* Ethernet 50Mhz RMII clock selection */
723 eth_ref_clk_sel_reg =
724 dev_read_bool(dev, "st,eth_ref_clk_sel");
726 syscfg = (u8 *)syscon_get_first_range(STM32MP_SYSCON_SYSCFG);
731 switch (interface_type) {
732 case PHY_INTERFACE_MODE_MII:
733 value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII |
734 SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
735 debug("%s: PHY_INTERFACE_MODE_MII\n", __func__);
737 case PHY_INTERFACE_MODE_GMII:
739 value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII |
740 SYSCFG_PMCSETR_ETH_CLK_SEL;
742 value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII;
743 debug("%s: PHY_INTERFACE_MODE_GMII\n", __func__);
745 case PHY_INTERFACE_MODE_RMII:
746 if (eth_ref_clk_sel_reg)
747 value = SYSCFG_PMCSETR_ETH_SEL_RMII |
748 SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
750 value = SYSCFG_PMCSETR_ETH_SEL_RMII;
751 debug("%s: PHY_INTERFACE_MODE_RMII\n", __func__);
753 case PHY_INTERFACE_MODE_RGMII:
754 case PHY_INTERFACE_MODE_RGMII_ID:
755 case PHY_INTERFACE_MODE_RGMII_RXID:
756 case PHY_INTERFACE_MODE_RGMII_TXID:
758 value = SYSCFG_PMCSETR_ETH_SEL_RGMII |
759 SYSCFG_PMCSETR_ETH_CLK_SEL;
761 value = SYSCFG_PMCSETR_ETH_SEL_RGMII;
762 debug("%s: PHY_INTERFACE_MODE_RGMII\n", __func__);
765 debug("%s: Do not manage %d interface\n",
766 __func__, interface_type);
767 /* Do not manage others interfaces */
771 /* clear and set ETH configuration bits */
772 writel(SYSCFG_PMCSETR_ETH_SEL_MASK | SYSCFG_PMCSETR_ETH_SELMII |
773 SYSCFG_PMCSETR_ETH_REF_CLK_SEL | SYSCFG_PMCSETR_ETH_CLK_SEL,
774 syscfg + SYSCFG_PMCCLRR);
775 writel(value, syscfg + SYSCFG_PMCSETR);
780 enum env_location env_get_location(enum env_operation op, int prio)
782 u32 bootmode = get_bootmode();
787 switch (bootmode & TAMP_BOOT_DEVICE_MASK) {
789 case BOOT_FLASH_EMMC:
790 if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC))
792 else if (CONFIG_IS_ENABLED(ENV_IS_IN_EXT4))
797 case BOOT_FLASH_NAND:
798 case BOOT_FLASH_SPINAND:
799 if (CONFIG_IS_ENABLED(ENV_IS_IN_UBI))
805 if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH))
806 return ENVL_SPI_FLASH;
815 const char *env_ext4_get_intf(void)
817 u32 bootmode = get_bootmode();
819 switch (bootmode & TAMP_BOOT_DEVICE_MASK) {
821 case BOOT_FLASH_EMMC:
828 const char *env_ext4_get_dev_part(void)
830 static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
831 u32 bootmode = get_bootmode();
833 return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
835 int mmc_get_env_dev(void)
837 u32 bootmode = get_bootmode();
839 return (bootmode & TAMP_BOOT_INSTANCE_MASK) - 1;
842 #if defined(CONFIG_OF_BOARD_SETUP)
843 int ft_board_setup(void *blob, struct bd_info *bd)
845 struct node_info nodes[] = {
846 { "st,stm32f469-qspi", MTD_DEV_TYPE_NOR, },
847 { "st,stm32f469-qspi", MTD_DEV_TYPE_SPINAND},
848 { "st,stm32mp15-fmc2", MTD_DEV_TYPE_NAND, },
851 if (IS_ENABLED(CONFIG_FDT_FIXUP_PARTITIONS))
852 fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
858 static void board_copro_image_process(ulong fw_image, size_t fw_size)
860 int ret, id = 0; /* Copro id fixed to 0 as only one coproc on mp1 */
862 if (!rproc_is_initialized())
864 printf("Remote Processor %d initialization failed\n",
869 ret = rproc_load(id, fw_image, fw_size);
870 printf("Load Remote Processor %d with data@addr=0x%08lx %u bytes:%s\n",
871 id, fw_image, fw_size, ret ? " Failed!" : " Success!");
877 U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_COPRO, board_copro_image_process);