diff --git a/firmware/target/mips/ingenic_x1000/app.lds b/firmware/target/mips/ingenic_x1000/app.lds index 55a43af10a..2943329ba7 100644 --- a/firmware/target/mips/ingenic_x1000/app.lds +++ b/firmware/target/mips/ingenic_x1000/app.lds @@ -23,6 +23,7 @@ MEMORY { IRAM : ORIGIN = X1000_IRAM_BASE, LENGTH = X1000_IRAM_SIZE DRAM : ORIGIN = X1000_DRAM_BASE, LENGTH = X1000_DRAM_SIZE + TCSM : ORIGIN = X1000_TCSM_BASE, LENGTH = X1000_TCSM_SIZE } SECTIONS @@ -68,6 +69,14 @@ SECTIONS } > IRAM _iramcopy = LOADADDR(.iram); + .tcsm X1000_TCSM_BASE: AT (_bssbegin + SIZEOF(.iram)) + { + _tcsmstart = .; + KEEP(*(.tcsm*)); + _tcsmend = .; + } > TCSM + _tcsmcopy = LOADADDR(.tcsm); + . = ALIGN(4); .stack (NOLOAD) : { diff --git a/firmware/target/mips/ingenic_x1000/crt0.S b/firmware/target/mips/ingenic_x1000/crt0.S index 47c3c4f964..f7cb4686f1 100644 --- a/firmware/target/mips/ingenic_x1000/crt0.S +++ b/firmware/target/mips/ingenic_x1000/crt0.S @@ -79,6 +79,19 @@ _iram_loop: bne t1, t2, _iram_loop sw t3, -4(t1) +#if 0 + /* Copy TCSM from BSS */ + la t0, _tcsmcopy + la t1, _tcsmstart + la t2, _tcsmend +_tcsm_loop: + lw t3, 0(t0) + addiu t0, 4 + sw t3, 0(t1) + bne t1, t2, _tcsm_loop + addiu t1, 4 +#endif + /* Clear the BSS segment (needed to zero-initialize C static values) */ la t0, _bssbegin la t1, _bssend