diff options
author | Pali Rohár <pali@kernel.org> | 2020-12-21 11:09:10 +0100 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2021-01-27 07:29:43 +0100 |
commit | 9d716339fbb4d3e074aa6dfca795bafd9832a34d (patch) | |
tree | 4d51b2a812af3fe1fba550e6b9b2eab8c31f1678 /board/Marvell | |
parent | 9c690314dba9a2860a97f56e6e57f63c8513ddba (diff) | |
download | u-boot-9d716339fbb4d3e074aa6dfca795bafd9832a34d.zip u-boot-9d716339fbb4d3e074aa6dfca795bafd9832a34d.tar.gz u-boot-9d716339fbb4d3e074aa6dfca795bafd9832a34d.tar.bz2 |
arm: mvebu: Espressobin: Disable slot when emmc is not present
This change extends previous commit 061c6d1b238a ("arm: mvebu: Espressobin:
Detect presence of emmc at runtime") and when emmc is not present then emmc
is removed from U-Boot DM and corresponding slot is disabled. Therefore on
Espressobin board without soldered emmc, state of emmc hw should be same as
if emmc was disabled in DTS.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board/Marvell')
-rw-r--r-- | board/Marvell/mvebu_armada-37xx/board.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index f67b04b..1b9e752 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <dm/device-internal.h> #include <env.h> #include <i2c.h> #include <init.h> @@ -84,12 +85,10 @@ int board_init(void) #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { + struct udevice *dev; struct mmc *mmc_dev; bool ddr4, emmc; - if (env_get("fdtfile")) - return 0; - if (!of_machine_is_compatible("globalscale,espressobin")) return 0; @@ -101,6 +100,16 @@ int board_late_init(void) mmc_dev = find_mmc_device(1); emmc = (mmc_dev && mmc_init(mmc_dev) == 0); + /* if eMMC is not present then remove it from DM */ + if (!emmc && mmc_dev) { + dev = mmc_dev->dev; + device_remove(dev, DM_REMOVE_NORMAL); + device_unbind(dev); + } + + if (env_get("fdtfile")) + return 0; + if (ddr4 && emmc) env_set("fdtfile", "marvell/armada-3720-espressobin-v7-emmc.dtb"); else if (ddr4) |