summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-03-31 17:40:30 +0300
committerTom Rini <trini@konsulko.com>2017-04-05 23:36:49 +0300
commit0f079eb51c402e6f3805fc0d35c7cc8db7275e97 (patch)
tree7d1d7eab60a661d0741c1a6bee105c79b02ec327 /common/board_f.c
parent80d4bcd3ec775ea69f832ecffcda3e7f49fba476 (diff)
downloadu-boot-0f079eb51c402e6f3805fc0d35c7cc8db7275e97.tar.xz
board_f: Put video memory reservation in one function
Move the ugly #ifdefs inside the reserve_video() function so we can collect all this init into one place. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 45d3235ad6..acefd65d13 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -400,9 +400,9 @@ static int reserve_mmu(void)
}
#endif
-#ifdef CONFIG_DM_VIDEO
static int reserve_video(void)
{
+#ifdef CONFIG_DM_VIDEO
ulong addr;
int ret;
@@ -411,14 +411,7 @@ static int reserve_video(void)
if (ret)
return ret;
gd->relocaddr = addr;
-
- return 0;
-}
-#else
-
-# ifdef CONFIG_LCD
-static int reserve_lcd(void)
-{
+#elif defined(CONFIG_LCD)
# ifdef CONFIG_FB_ADDR
gd->fb_base = CONFIG_FB_ADDR;
# else
@@ -426,24 +419,17 @@ static int reserve_lcd(void)
gd->relocaddr = lcd_setmem(gd->relocaddr);
gd->fb_base = gd->relocaddr;
# endif /* CONFIG_FB_ADDR */
-
- return 0;
-}
-# endif /* CONFIG_LCD */
-
-# if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
+#elif defined(CONFIG_VIDEO) && \
+ (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
!defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
!defined(CONFIG_M68K)
-static int reserve_legacy_video(void)
-{
/* reserve memory for video display (always full pages) */
gd->relocaddr = video_setmem(gd->relocaddr);
gd->fb_base = gd->relocaddr;
+#endif
return 0;
}
-# endif
-#endif /* !CONFIG_DM_VIDEO */
static int reserve_trace(void)
{
@@ -901,19 +887,7 @@ static const init_fnc_t init_sequence_f[] = {
#ifdef CONFIG_ARM
reserve_mmu,
#endif
-#ifdef CONFIG_DM_VIDEO
reserve_video,
-#else
-# ifdef CONFIG_LCD
- reserve_lcd,
-# endif
- /* TODO: Why the dependency on CONFIG_8xx? */
-# if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
- !defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
- !defined(CONFIG_M68K)
- reserve_legacy_video,
-# endif
-#endif /* CONFIG_DM_VIDEO */
reserve_trace,
reserve_uboot,
#ifndef CONFIG_SPL_BUILD