plat/rockchip: Use new bl31_params_parse_helper()
authorJulius Werner <[email protected]>
Thu, 30 May 2019 23:57:15 +0000 (16:57 -0700)
committerJulius Werner <[email protected]>
Wed, 24 Jul 2019 18:04:03 +0000 (11:04 -0700)
The Rockchip platform is a prime candidate for switching to the new
bl31_params_parse_helper(), so switch it over. This will allow BL2
implementations on this platform to transparently switch over to the
version 2 parameter structure.

Change-Id: I540741d2425c93f66c8697ce749a351eb2b3a7e8
Signed-off-by: Julius Werner <[email protected]>
plat/rockchip/common/bl31_plat_setup.c
plat/rockchip/common/include/plat_private.h
plat/rockchip/common/sp_min_plat_setup.c
plat/rockchip/rk3288/platform.mk
plat/rockchip/rk3328/platform.mk
plat/rockchip/rk3368/platform.mk
plat/rockchip/rk3399/platform.mk

index e009b88e18a4435064ff0bc205e5fe5928febcbb..a13ee495a202b7987c56b77f55e6e2af54dca6e0 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common/bl_common.h>
 #include <common/debug.h>
+#include <common/desc_image_load.h>
 #include <drivers/console.h>
 #include <drivers/generic_delay_timer.h>
 #include <drivers/ti/uart/uart_16550.h>
@@ -32,6 +33,7 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
        entry_point_info_t *next_image_info;
 
        next_image_info = (type == NON_SECURE) ? &bl33_ep_info : &bl32_ep_info;
+       assert(next_image_info->h.type == PARAM_EP);
 
        /* None of the images on this platform can have 0x0 as the entrypoint */
        if (next_image_info->pc)
@@ -57,7 +59,6 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
                                u_register_t arg2, u_register_t arg3)
 {
        static console_16550_t console;
-       struct rockchip_bl31_params *arg_from_bl2 = (struct rockchip_bl31_params *) arg0;
 
        params_early_setup(arg1);
 
@@ -74,14 +75,7 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
 
        VERBOSE("bl31_setup\n");
 
-       /* Passing a NULL context is a critical programming error */
-       assert(arg_from_bl2);
-
-       assert(arg_from_bl2->h.type == PARAM_BL31);
-       assert(arg_from_bl2->h.version >= VERSION_1);
-
-       bl32_ep_info = *arg_from_bl2->bl32_ep_info;
-       bl33_ep_info = *arg_from_bl2->bl33_ep_info;
+       bl31_params_parse_helper(arg0, &bl32_ep_info, &bl33_ep_info);
 }
 
 /*******************************************************************************
index 242b528157687bac1dccd7d4038e32250d9e09f1..66b61850db4eab23e34def2dc0e9f1588b53336d 100644 (file)
@@ -31,15 +31,6 @@ extern uint32_t __bl31_sram_text_real_end, __bl31_sram_data_real_end;
 extern uint32_t __sram_incbin_start, __sram_incbin_end;
 extern uint32_t __sram_incbin_real_end;
 
-struct rockchip_bl31_params {
-       param_header_t h;
-       image_info_t *bl31_image_info;
-       entry_point_info_t *bl32_ep_info;
-       image_info_t *bl32_image_info;
-       entry_point_info_t *bl33_ep_info;
-       image_info_t *bl33_image_info;
-};
-
 /******************************************************************************
  * The register have write-mask bits, it is mean, if you want to set the bits,
  * you needs set the write-mask bits at the same time,
index cb28b7a615c8790c57dfe4a50a5220c8f3fcb1f8..7b1a0b58b73ccc342658aebdb98e3fb877e3188c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -11,6 +11,7 @@
 #include <arch_helpers.h>
 #include <common/bl_common.h>
 #include <common/debug.h>
+#include <common/desc_image_load.h>
 #include <drivers/console.h>
 #include <drivers/generic_delay_timer.h>
 #include <drivers/ti/uart/uart_16550.h>
@@ -53,7 +54,6 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
                                  u_register_t arg2, u_register_t arg3)
 {
        static console_16550_t console;
-       struct rockchip_bl31_params *arg_from_bl2 = (struct rockchip_bl31_params *) arg0;
 
        params_early_setup(arg1);
 
@@ -69,13 +69,7 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
 #endif
        VERBOSE("sp_min_setup\n");
 
-       /* Passing a NULL context is a critical programming error */
-       assert(arg_from_bl2);
-
-       assert(arg_from_bl2->h.type == PARAM_BL31);
-       assert(arg_from_bl2->h.version >= VERSION_1);
-
-       bl33_ep_info = *arg_from_bl2->bl33_ep_info;
+       bl31_params_parse_helper(arg0, NULL, &bl33_ep_info);
 }
 
 /*******************************************************************************
index 980fb6bf0046c15da8142a032cbfee7b2ea1dc41..faf7a15201fcbabab74372fdf5d9b541d1e48e9c 100644 (file)
@@ -30,7 +30,8 @@ RK_GIC_SOURCES         :=     drivers/arm/gic/common/gic_common.c             \
                                plat/common/plat_gicv2.c                        \
                                ${RK_PLAT}/common/rockchip_gicv2.c
 
-PLAT_BL_COMMON_SOURCES :=      lib/bl_aux_params/bl_aux_params.c               \
+PLAT_BL_COMMON_SOURCES :=      common/desc_image_load.c                        \
+                               lib/bl_aux_params/bl_aux_params.c               \
                                plat/common/aarch32/crash_console_helpers.S     \
                                plat/common/plat_psci_common.c
 
index 2be2be3da69cb45005c710f78e1ee482a5fef7bf..0da4f2dc469db383c662990618018303faa70141 100644 (file)
@@ -28,7 +28,8 @@ RK_GIC_SOURCES                :=      drivers/arm/gic/common/gic_common.c             \
                                plat/common/plat_gicv2.c                        \
                                ${RK_PLAT}/common/rockchip_gicv2.c
 
-PLAT_BL_COMMON_SOURCES :=      lib/bl_aux_params/bl_aux_params.c               \
+PLAT_BL_COMMON_SOURCES :=      common/desc_image_load.c                        \
+                               lib/bl_aux_params/bl_aux_params.c               \
                                lib/xlat_tables/aarch64/xlat_tables.c           \
                                lib/xlat_tables/xlat_tables_common.c            \
                                plat/common/aarch64/crash_console_helpers.S     \
index 8812378b19d94def267e473b4dbb02dee70fbdc4..cb0cb89625334d389ef96e546326b164cabc7f69 100644 (file)
@@ -26,7 +26,8 @@ RK_GIC_SOURCES         :=     drivers/arm/gic/common/gic_common.c             \
                                plat/common/plat_gicv2.c                        \
                                ${RK_PLAT}/common/rockchip_gicv2.c
 
-PLAT_BL_COMMON_SOURCES :=      lib/bl_aux_params/bl_aux_params.c               \
+PLAT_BL_COMMON_SOURCES :=      common/desc_image_load.c                        \
+                               lib/bl_aux_params/bl_aux_params.c               \
                                lib/xlat_tables/xlat_tables_common.c            \
                                lib/xlat_tables/aarch64/xlat_tables.c           \
                                plat/common/aarch64/crash_console_helpers.S     \
index 88fa8e9c0a6aa3d2dde6534bd2c7e02949600d85..cfc48e8f965558ea9e3e3e1dc99423e9f53dc621 100644 (file)
@@ -32,7 +32,8 @@ RK_GIC_SOURCES                :=      drivers/arm/gic/common/gic_common.c     \
                                plat/common/plat_gicv3.c                \
                                ${RK_PLAT}/common/rockchip_gicv3.c
 
-PLAT_BL_COMMON_SOURCES :=      lib/bl_aux_params/bl_aux_params.c       \
+PLAT_BL_COMMON_SOURCES :=      common/desc_image_load.c                        \
+                               lib/bl_aux_params/bl_aux_params.c               \
                                lib/xlat_tables/xlat_tables_common.c    \
                                lib/xlat_tables/aarch64/xlat_tables.c   \
                                plat/common/aarch64/crash_console_helpers.S \