diff options
author | Tom Rini <trini@konsulko.com> | 2019-04-24 12:26:39 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-04-24 12:26:39 -0400 |
commit | c2bb9c5b9e333c200e3702d9ed5ac9b6095191b6 (patch) | |
tree | f3a017fe861211d45c8965aeac2f488f06c989d5 /board/st | |
parent | ceb6ddbc73607e9395bb5f0ad94159755f049e77 (diff) | |
parent | c406a474311c1ee3c4303a7e85db4a8e45966e31 (diff) | |
download | u-boot-c2bb9c5b9e333c200e3702d9ed5ac9b6095191b6.zip u-boot-c2bb9c5b9e333c200e3702d9ed5ac9b6095191b6.tar.gz u-boot-c2bb9c5b9e333c200e3702d9ed5ac9b6095191b6.tar.bz2 |
Merge tag 'u-boot-stm32-mcu-20190423' of https://github.com/pchotard/u-boot
STM32 MCUs update:
- DT rework and alignment with DT kernel v4.20
- mmc: arm_pl180_mmci: Synchronize compatible with kernel v4.20
- mmc: stm32_sdmmc2: Synchronize properties with kernel v4.20
- configs: update for F746/769 boards
Diffstat (limited to 'board/st')
-rw-r--r-- | board/st/stm32f746-disco/stm32f746-disco.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c index 7c9b1ad..e89ed21 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) |