doc: fix incorrect usage of DT node unit address
[oweals/u-boot.git] / arch / arm / cpu / u-boot.lds
index 002706ae635da668b11f675985f400367ccd2d2d..37d4c605aca3256032974302c2f6b916fb3731d0 100644 (file)
@@ -69,12 +69,18 @@ SECTIONS
                *(._secure.text)
        }
 
-       .secure_stack ALIGN(ADDR(.secure_text) + SIZEOF(.secure_text),
+       .secure_data : AT(LOADADDR(.secure_text) + SIZEOF(.secure_text))
+       {
+               *(._secure.data)
+       }
+
+#ifdef CONFIG_ARMV7_PSCI
+       .secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data),
                            CONSTANT(COMMONPAGESIZE)) (NOLOAD) :
 #ifdef __ARMV7_PSCI_STACK_IN_RAM
                AT(ADDR(.secure_stack))
 #else
-               AT(LOADADDR(.secure_text) + SIZEOF(.secure_text))
+               AT(LOADADDR(.secure_data) + SIZEOF(.secure_data))
 #endif
        {
                KEEP(*(.__secure_stack_start))
@@ -86,11 +92,24 @@ SECTIONS
                . = ALIGN(CONSTANT(COMMONPAGESIZE));
 
                KEEP(*(.__secure_stack_end))
+
+#ifdef CONFIG_ARMV7_SECURE_MAX_SIZE
+               /*
+                * We are not checking (__secure_end - __secure_start) here,
+                * as these are the load addresses, and do not include the
+                * stack section. Instead, use the end of the stack section
+                * and the start of the text section.
+                */
+               ASSERT((. - ADDR(.secure_text)) <= CONFIG_ARMV7_SECURE_MAX_SIZE,
+                      "Error: secure section exceeds secure memory size");
+#endif
        }
 
 #ifndef __ARMV7_PSCI_STACK_IN_RAM
        /* Reset VMA but don't allocate space if we have secure SRAM */
        . = LOADADDR(.secure_stack);
+#endif
+
 #endif
 
        .__secure_end : AT(ADDR(.__secure_end)) {