diff --git a/fusee/fusee-primary/linker.ld b/fusee/fusee-primary/linker.ld index b442fd3b6..dfbf30d42 100644 --- a/fusee/fusee-primary/linker.ld +++ b/fusee/fusee-primary/linker.ld @@ -15,6 +15,7 @@ MEMORY NULL : ORIGIN = 0x00000000, LENGTH = 0x1000 main : ORIGIN = 0x40010000, LENGTH = 0x20000 low_iram : ORIGIN = 0x40003000, LENGTH = 0x8000 + dram : ORIGIN = 0xC0000000, LENGTH = 0x40000000 } SECTIONS @@ -150,6 +151,16 @@ SECTIONS } >main :NONE __end__ = ABSOLUTE(.) ; + .dram (NOLOAD) : + { + . = ALIGN(32); + PROVIDE (__dram_start__ = ABSOLUTE(.)); + *(.framebuffer) + *(.dram) + . = ALIGN(32); + PROVIDE (__dram_end__ = ABSOLUTE(.)); + } >dram :NONE + /* ================== ==== Metadata ==== ================== */ diff --git a/fusee/fusee-primary/src/hwinit.c b/fusee/fusee-primary/src/hwinit.c index a0632647a..dfc299244 100644 --- a/fusee/fusee-primary/src/hwinit.c +++ b/fusee/fusee-primary/src/hwinit.c @@ -179,6 +179,8 @@ void config_se_brom() pmc->reset_status = 0; } +extern uint8_t __dram_start__[], __dram_end__[]; + void nx_hwinit() { volatile tegra_pmc_t *pmc = pmc_get_regs(); @@ -291,6 +293,9 @@ void nx_hwinit() /* Initialize SDRAM. */ sdram_init(); + + /* Zero-fill the .dram section */ + memset(__dram_start__, 0, __dram_end__ - __dram_start__); /* Save SDRAM LP0 parameters. */ sdram_lp0_save_params(sdram_get_params()); diff --git a/fusee/fusee-primary/src/main.c b/fusee/fusee-primary/src/main.c index 3e3808209..d204885d2 100644 --- a/fusee/fusee-primary/src/main.c +++ b/fusee/fusee-primary/src/main.c @@ -32,8 +32,8 @@ extern void (*__program_exit_callback)(int rc); -static void *g_framebuffer; -static char g_bct0_buffer[BCTO_MAX_SIZE]; +static uint32_t g_framebuffer[1280*768] __attribute__((section(".framebuffer"))) = {0}; +static char g_bct0_buffer[BCTO_MAX_SIZE] __attribute__((section(".dram"))) = {0}; #define CONFIG_LOG_LEVEL_KEY "log_level" @@ -91,8 +91,6 @@ static int config_ini_handler(void *user, const char *section, const char *name, } static void setup_display(void) { - g_framebuffer = (void *)0xC0000000; - /* Zero-fill the framebuffer and register it as printk provider. */ video_init(g_framebuffer);