[U-Boot] [PATCH 1/2] configs: stm32f746-disco: Enable SPI_FLASH_MACRONIX

This config file is shared between stm32f746-disco and stm32f769-disco. These 2 boards doesn't embed the same qspi flash (Micron n25q128a on f746-disco, Macronix mx66l51235l on f769-disco).
To be able to use Macronix mx66l51235l on F769-disco, flags SPI_FLASH_MACRONIX must be enabled.
Signed-off-by: Patrice Chotard patrice.chotard@st.com ---
configs/stm32f746-disco_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/stm32f746-disco_defconfig b/configs/stm32f746-disco_defconfig index 121e96280895..7f07c24aa414 100644 --- a/configs/stm32f746-disco_defconfig +++ b/configs/stm32f746-disco_defconfig @@ -49,6 +49,7 @@ CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_DM_ETH=y CONFIG_ETH_DESIGNWARE=y

This is needed to make ethernet work on stm32f746-eval which uses MII mode.
Signed-off-by: Patrice Chotard patrice.chotard@st.com ---
board/st/stm32f746-disco/stm32f746-disco.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c index 7c9b1ad82aa1..e89ed2153bc3 100644 --- a/board/st/stm32f746-disco/stm32f746-disco.c +++ b/board/st/stm32f746-disco/stm32f746-disco.c @@ -7,6 +7,8 @@ #include <common.h> #include <dm.h> #include <lcd.h> +#include <miiphy.h> +#include <phy_interface.h> #include <ram.h> #include <spl.h> #include <splash.h> @@ -123,8 +125,25 @@ int board_init(void) gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
#ifdef CONFIG_ETH_DESIGNWARE - /* Set >RMII mode */ - STM32_SYSCFG->pmc |= SYSCFG_PMC_MII_RMII_SEL; + const char *phy_mode; + int node; + + node = fdt_node_offset_by_compatible(gd->fdt_blob, 0, "st,stm32-dwmac"); + if (node < 0) + return -1; + + phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL); + + switch (phy_get_interface_by_name(phy_mode)) { + case PHY_INTERFACE_MODE_RMII: + STM32_SYSCFG->pmc |= SYSCFG_PMC_MII_RMII_SEL; + break; + case PHY_INTERFACE_MODE_MII: + STM32_SYSCFG->pmc &= ~SYSCFG_PMC_MII_RMII_SEL; + break; + default: + printf("PHY interface %s not supported !\n", phy_mode); + } #endif
#if defined(CONFIG_CMD_BMP)

On Fri, Feb 22, 2019 at 8:06 AM Patrice Chotard patrice.chotard@st.com wrote:
This is needed to make ethernet work on stm32f746-eval which uses MII mode.
Signed-off-by: Patrice Chotard patrice.chotard@st.com
Acked-by: Joe Hershberger joe.hershberger@ni.com
participants (2)
-
Joe Hershberger
-
Patrice Chotard