mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-08-05 15:48:43 +00:00
fusee-primary: move BCT0 buffer to dram to save on iram
Add dram section to link script, and also creates a framebuffer section so we can start to use the link script as a single source of truth for how fusee-primary uses dram.
This commit is contained in:
parent
4499c4392d
commit
c00c30c751
3 changed files with 18 additions and 4 deletions
|
@ -15,6 +15,7 @@ MEMORY
|
||||||
NULL : ORIGIN = 0x00000000, LENGTH = 0x1000
|
NULL : ORIGIN = 0x00000000, LENGTH = 0x1000
|
||||||
main : ORIGIN = 0x40010000, LENGTH = 0x20000
|
main : ORIGIN = 0x40010000, LENGTH = 0x20000
|
||||||
low_iram : ORIGIN = 0x40003000, LENGTH = 0x8000
|
low_iram : ORIGIN = 0x40003000, LENGTH = 0x8000
|
||||||
|
dram : ORIGIN = 0xC0000000, LENGTH = 0x40000000
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@ -150,6 +151,16 @@ SECTIONS
|
||||||
} >main :NONE
|
} >main :NONE
|
||||||
__end__ = ABSOLUTE(.) ;
|
__end__ = ABSOLUTE(.) ;
|
||||||
|
|
||||||
|
.dram (NOLOAD) :
|
||||||
|
{
|
||||||
|
. = ALIGN(32);
|
||||||
|
PROVIDE (__dram_start__ = ABSOLUTE(.));
|
||||||
|
*(.framebuffer)
|
||||||
|
*(.dram)
|
||||||
|
. = ALIGN(32);
|
||||||
|
PROVIDE (__dram_end__ = ABSOLUTE(.));
|
||||||
|
} >dram :NONE
|
||||||
|
|
||||||
/* ==================
|
/* ==================
|
||||||
==== Metadata ====
|
==== Metadata ====
|
||||||
================== */
|
================== */
|
||||||
|
|
|
@ -179,6 +179,8 @@ void config_se_brom()
|
||||||
pmc->reset_status = 0;
|
pmc->reset_status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern uint8_t __dram_start__[], __dram_end__[];
|
||||||
|
|
||||||
void nx_hwinit()
|
void nx_hwinit()
|
||||||
{
|
{
|
||||||
volatile tegra_pmc_t *pmc = pmc_get_regs();
|
volatile tegra_pmc_t *pmc = pmc_get_regs();
|
||||||
|
@ -291,6 +293,9 @@ void nx_hwinit()
|
||||||
|
|
||||||
/* Initialize SDRAM. */
|
/* Initialize SDRAM. */
|
||||||
sdram_init();
|
sdram_init();
|
||||||
|
|
||||||
|
/* Zero-fill the .dram section */
|
||||||
|
memset(__dram_start__, 0, __dram_end__ - __dram_start__);
|
||||||
|
|
||||||
/* Save SDRAM LP0 parameters. */
|
/* Save SDRAM LP0 parameters. */
|
||||||
sdram_lp0_save_params(sdram_get_params());
|
sdram_lp0_save_params(sdram_get_params());
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
|
|
||||||
extern void (*__program_exit_callback)(int rc);
|
extern void (*__program_exit_callback)(int rc);
|
||||||
|
|
||||||
static void *g_framebuffer;
|
static uint32_t g_framebuffer[1280*768] __attribute__((section(".framebuffer"))) = {0};
|
||||||
static char g_bct0_buffer[BCTO_MAX_SIZE];
|
static char g_bct0_buffer[BCTO_MAX_SIZE] __attribute__((section(".dram"))) = {0};
|
||||||
|
|
||||||
#define CONFIG_LOG_LEVEL_KEY "log_level"
|
#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) {
|
static void setup_display(void) {
|
||||||
g_framebuffer = (void *)0xC0000000;
|
|
||||||
|
|
||||||
/* Zero-fill the framebuffer and register it as printk provider. */
|
/* Zero-fill the framebuffer and register it as printk provider. */
|
||||||
video_init(g_framebuffer);
|
video_init(g_framebuffer);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue