mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
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>
This commit is contained in:
@@ -400,9 +400,9 @@ static int reserve_mmu(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DM_VIDEO
|
|
||||||
static int reserve_video(void)
|
static int reserve_video(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_DM_VIDEO
|
||||||
ulong addr;
|
ulong addr;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -411,14 +411,7 @@ static int reserve_video(void)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
gd->relocaddr = addr;
|
gd->relocaddr = addr;
|
||||||
|
#elif defined(CONFIG_LCD)
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
|
|
||||||
# ifdef CONFIG_LCD
|
|
||||||
static int reserve_lcd(void)
|
|
||||||
{
|
|
||||||
# ifdef CONFIG_FB_ADDR
|
# ifdef CONFIG_FB_ADDR
|
||||||
gd->fb_base = CONFIG_FB_ADDR;
|
gd->fb_base = CONFIG_FB_ADDR;
|
||||||
# else
|
# else
|
||||||
@@ -426,24 +419,17 @@ static int reserve_lcd(void)
|
|||||||
gd->relocaddr = lcd_setmem(gd->relocaddr);
|
gd->relocaddr = lcd_setmem(gd->relocaddr);
|
||||||
gd->fb_base = gd->relocaddr;
|
gd->fb_base = gd->relocaddr;
|
||||||
# endif /* CONFIG_FB_ADDR */
|
# endif /* CONFIG_FB_ADDR */
|
||||||
|
#elif defined(CONFIG_VIDEO) && \
|
||||||
return 0;
|
(!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
|
||||||
}
|
|
||||||
# endif /* CONFIG_LCD */
|
|
||||||
|
|
||||||
# if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) && \
|
|
||||||
!defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
|
!defined(CONFIG_ARM) && !defined(CONFIG_X86) && \
|
||||||
!defined(CONFIG_M68K)
|
!defined(CONFIG_M68K)
|
||||||
static int reserve_legacy_video(void)
|
|
||||||
{
|
|
||||||
/* reserve memory for video display (always full pages) */
|
/* reserve memory for video display (always full pages) */
|
||||||
gd->relocaddr = video_setmem(gd->relocaddr);
|
gd->relocaddr = video_setmem(gd->relocaddr);
|
||||||
gd->fb_base = gd->relocaddr;
|
gd->fb_base = gd->relocaddr;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
#endif /* !CONFIG_DM_VIDEO */
|
|
||||||
|
|
||||||
static int reserve_trace(void)
|
static int reserve_trace(void)
|
||||||
{
|
{
|
||||||
@@ -901,19 +887,7 @@ static const init_fnc_t init_sequence_f[] = {
|
|||||||
#ifdef CONFIG_ARM
|
#ifdef CONFIG_ARM
|
||||||
reserve_mmu,
|
reserve_mmu,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_DM_VIDEO
|
|
||||||
reserve_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_trace,
|
||||||
reserve_uboot,
|
reserve_uboot,
|
||||||
#ifndef CONFIG_SPL_BUILD
|
#ifndef CONFIG_SPL_BUILD
|
||||||
|
Reference in New Issue
Block a user