Skip to content

Commit

Permalink
hardware/allwinner: Fix build with environment outside mmc
Browse files Browse the repository at this point in the history
  • Loading branch information
samueldr committed Feb 24, 2022
1 parent 6fef621 commit b49b169
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 30da7f7745f15ead3a5bbc7e99a421bdb9009855 Mon Sep 17 00:00:00 2001
From: Samuel Dionne-Riel <[email protected]>
Date: Tue, 22 Feb 2022 10:51:33 -0500
Subject: [PATCH] sunxi: Use mmc_get_env_dev only if relevant

When build is made with environment elsewhere than on MMC, the reference
to `CONFIG_SYS_MMC_ENV_DEV` will not exist, and thus this fails.
---
board/sunxi/board.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 1a46100e408..689034355e8 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -637,6 +637,7 @@ int board_mmc_init(struct bd_info *bis)
return 0;
}

+#ifdef CONFIG_SYS_MMC_ENV_DEV
#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
int mmc_get_env_dev(void)
{
@@ -651,6 +652,7 @@ int mmc_get_env_dev(void)
}
#endif
#endif
+#endif

#ifdef CONFIG_SPL_BUILD

--
2.34.0

3 changes: 3 additions & 0 deletions modules/hardware/allwinner/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ in
mmc bootbus ${mmcBootIndex} 1 0 0
mmc partconf ${mmcBootIndex} 1 1 1
'';
patches = [
./0001-sunxi-Use-mmc_get_env_dev-only-if-relevant.patch
];
};
})
(mkIf (anyAllwinner64) {
Expand Down

0 comments on commit b49b169

Please sign in to comment.