]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-omap2/sec-common.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / arch / arm / mach-omap2 / sec-common.c
index 2630e7d316a0d34af2368d928c7ff12e0e6ab282..600a31280c7af631f3b9aa2590232edf63159e46 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *
  * Common security related functions for OMAP devices
@@ -9,8 +10,6 @@
  * Andreas Dannenberg <dannenberg@ti.com>
  * Harinarayan Bhatta <harinarayan@ti.com>
  * Andrew F. Davis <afd@ti.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
  */
 
 #include <common.h>
@@ -56,7 +55,7 @@ struct ppa_tee_load_info {
        u32 tee_arg0;          /* argument to TEE jump function, in r0 */
 };
 
-static uint32_t secure_rom_call_args[5] __aligned(ARCH_DMA_MINALIGN);
+static uint32_t secure_rom_call_args[5] __aligned(ARCH_DMA_MINALIGN) __section(".data");
 
 u32 secure_rom_call(u32 service, u32 proc_id, u32 flag, ...)
 {
@@ -130,7 +129,7 @@ int secure_boot_verify_image(void **image, size_t *size)
        *size = sig_addr - cert_addr;   /* Subtract out the signature size */
        /* Subtract header if present */
        if (strncmp((char *)sig_addr, "CERT_ISW_", 9) == 0)
-               *size = ((u32 *)*image)[HEADER_SIZE_OFFSET];
+               *size -= ((u32 *)*image)[HEADER_SIZE_OFFSET];
        cert_size = *size;
 
        /* Check if image load address is 32-bit aligned */
@@ -168,16 +167,16 @@ auth_exit:
        }
 
        /*
-        * Output notification of successful authentication as well the name of
-        * the signing certificate used to re-assure the user that the secure
-        * code is being processed as expected. However suppress any such log
-        * output in case of building for SPL and booting via YMODEM. This is
-        * done to avoid disturbing the YMODEM serial protocol transactions.
+        * Output notification of successful authentication to re-assure the
+        * user that the secure code is being processed as expected. However
+        * suppress any such log output in case of building for SPL and booting
+        * via YMODEM. This is done to avoid disturbing the YMODEM serial
+        * protocol transactions.
         */
        if (!(IS_ENABLED(CONFIG_SPL_BUILD) &&
              IS_ENABLED(CONFIG_SPL_YMODEM_SUPPORT) &&
              spl_boot_device() == BOOT_DEVICE_UART))
-               printf("Authentication passed: %s\n", (char *)sig_addr);
+               printf("Authentication passed\n");
 
        return result;
 }