Merge remote-tracking branch 'remotes/tegra/android-tegra-2.6.36-honeycomb-mr1' into...
[firefly-linux-kernel-4.4.55.git] / arch / arm / kernel / vmlinux.lds.S
index b16c07914b55bb0215592a7727e0974b62108dd6..6ab5093711c6dab6dae1c44bc220302bfb72dd2f 100644 (file)
@@ -228,6 +228,62 @@ SECTIONS
                __tcm_end = .;
        }
 #endif
+#ifdef CONFIG_ARCH_RK29
+        /*
+        * We align everything to a page boundary so we can
+        * free it after init has commenced and SRAM contents have
+        * been copied to its destination.
+        */
+       .sram_start : {
+               . = ALIGN(PAGE_SIZE);
+               __sram_start = .;
+               __sram_code_start = .;
+       }
+
+       /*
+        * Link these to the ITCM RAM
+        * Put VMA to the TCM address and LMA to the common RAM
+        * and we'll upload the contents from RAM to TCM and free
+        * the used RAM after that.
+        */
+       .text_sram_code SRAM_CODE_OFFSET : AT(__sram_code_start)
+       {
+               __ssram_code_text = .;
+               *(.sram.text)
+               *(.sram.rodata)
+               . = ALIGN(4);
+               __esram_code_text = .;
+       }
+
+       /*
+        * Reset the dot pointer, this is needed to create the
+        * relative __dtcm_start below (to be used as extern in code).
+        */
+       . = ADDR(.sram_start) + SIZEOF(.sram_start) + SIZEOF(.text_sram_code);
+
+       .sram_data_start : {
+               __sram_data_start = .;
+       }
+
+       /* TODO: add remainder of ITCM as well, that can be used for data! */
+       .data_sram SRAM_DATA_OFFSET : AT(__sram_data_start)
+       {
+               . = ALIGN(4);
+               __ssram_data = .;
+               *(.sram.data)
+               . = ALIGN(4);
+               __esram_data = .;
+       }
+
+       /* Reset the dot pointer or the linker gets confused */
+       . = ADDR(.sram_data_start) + SIZEOF(.data_sram);
+
+       /* End marker for freeing TCM copy in linked object */
+       .sram_end : AT(ADDR(.sram_data_start) + SIZEOF(.data_sram)){
+               . = ALIGN(PAGE_SIZE);
+               __sram_end = .;
+       }
+#endif
 
        BSS_SECTION(0, 0, 0)
        _end = .;