stm32mp1: Update env_get_location for NOR support
authorPatrice Chotard <patrice.chotard@st.com>
Thu, 9 May 2019 12:25:36 +0000 (14:25 +0200)
committerPatrice Chotard <patrice.chotard@st.com>
Thu, 6 Jun 2019 15:40:15 +0000 (17:40 +0200)
Update env_get_location() to be able to save environment into
NOR (SPI_FLASH).

Series-cc: pde, cke, pch, uboot-stm32

Cover-letter:
Add saveenv support for STM32MP1

This series adds saveenv support for STM32MP1 on several boot
devices. STM32MP1 is able to boot on eMMC, sdcard and NOR
(NAND support is not fully supported).

On eMMC and sdcard, environment is saved in EXT4 partition
On NOR, environment is saved in a dedicated partition
On NAND, environment is saved in a UBI volume.

This series:
  - enables NAND and NOR support on ev1 board
  - enables ENV_IS_IN_SPI_FLASH, ENV_IS_IN_UBI, ENV_IS_IN_EXT4
    flags
  - fixes get_mtdparts()
  - allows to override interface, device and partition for ext4
    environment
  - updates rule to set ENV_IS_NOWHERE value
  - introduce ENV_IS_IN_DEVICE
END

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
board/st/stm32mp1/stm32mp1.c

index 4f7d24a..af607c5 100644 (file)
@@ -524,6 +524,10 @@ enum env_location env_get_location(enum env_operation op, int prio)
        case BOOT_FLASH_NAND:
                return ENVL_UBI;
 #endif
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
+       case BOOT_FLASH_NOR:
+               return ENVL_SPI_FLASH;
+#endif
        default:
                return ENVL_NOWHERE;
        }