[U-Boot-Users] fb support for au1x000

Rodolfo Giometti giometti at linux.it
Tue Jul 4 12:31:21 CEST 2006


Hello,

I'm trying to add support for frame buffer to my au1100 based board
but I'm a bit confused where I can allocate the frame buffer memory.

Looking at "lib_mips/board.c" I see:

        /*
         * Now that we have DRAM mapped and working, we can
         * relocate the code and continue running from DRAM.
         */
        addr = CFG_SDRAM_BASE + gd->ram_size;

        /* We can reserve some RAM "on top" here.
         */

        /* round down to next 4 kB limit.
         */
        addr &= ~(4096 - 1);
        debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);

        /* Reserve memory for U-Boot code, data & bss
         * round down to next 16 kB limit
         */
        addr -= len;
        addr &= ~(16 * 1024 - 1);

        debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);

Where "len" is:

	len = (ulong)&uboot_end - CFG_MONITOR_BASE;

So I think I can redefine "len" as follow:

	len = (ulong)&uboot_end - CFG_MONITOR_BASE + LCD_MEMORY_SIZE + PAGE_SIZE;

and then adding the code:

        /* configure available FLASH banks */
        size = flash_init();
        display_flash_config (size);

#ifdef CONFIG_LCD
#       ifndef PAGE_SIZE
#         define PAGE_SIZE 4096
#       endif
        /*
         * reserve memory for LCD display (always full pages)
         */
        /* bss_end is defined in the board-specific linker script */
        addr = (uboot_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
        size = lcd_setmem (addr);
        gd->fb_base = addr;
#endif /* CONFIG_LCD */

        bd = gd->bd;
        bd->bi_flashstart = CFG_FLASH_BASE;
        bd->bi_flashsize = size;

to the function board_init_r().

Is that sane?

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127




More information about the U-Boot mailing list