rockchip: only include libfdt in non-coreboot cases
authorHeiko Stuebner <heiko@sntech.de>
Wed, 24 Apr 2019 18:26:51 +0000 (20:26 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Fri, 26 Apr 2019 21:36:17 +0000 (23:36 +0200)
While mainline u-boot always expects to submit the devicetree
as platform param, coreboot always uses the existing parameter
structure. As libfdt is somewhat big, it makes sense to limit
its inclusion to where necessary and thus only to non-coreboot
builds.

libfdt itself will get build in all cases, but only the non-
coreboot build will actually reference and thus include it.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Change-Id: I4c5bc28405a14e6070917e48a526bfe77bab2fb7

plat/rockchip/common/params_setup.c
plat/rockchip/rk3288/platform.mk
plat/rockchip/rk3328/platform.mk
plat/rockchip/rk3368/platform.mk
plat/rockchip/rk3399/platform.mk

index dda98d962bb68e85293fd09e365b2c80fa3283bc..baf256330d0fa55707cfc08afe936ac1c8442aaa 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <assert.h>
+#include <errno.h>
 #include <string.h>
 
 #include <common/bl_common.h>
@@ -28,6 +29,12 @@ static struct gpio_info suspend_gpio[10];
 uint32_t suspend_gpio_cnt;
 static struct apio_info *suspend_apio;
 
+#if COREBOOT
+static int dt_process_fdt(void *blob)
+{
+       return -ENODEV;
+}
+#else
 static uint8_t fdt_buffer[0x10000];
 
 void *plat_get_fdt(void)
@@ -35,6 +42,19 @@ void *plat_get_fdt(void)
        return &fdt_buffer[0];
 }
 
+static int dt_process_fdt(void *blob)
+{
+       void *fdt = plat_get_fdt();
+       int ret;
+
+       ret = fdt_open_into(blob, fdt, 0x10000);
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
+#endif
+
 struct gpio_info *plat_get_rockchip_gpio_reset(void)
 {
        return rst_gpio;
@@ -57,18 +77,6 @@ struct apio_info *plat_get_rockchip_suspend_apio(void)
        return suspend_apio;
 }
 
-static int dt_process_fdt(void *blob)
-{
-       void *fdt = plat_get_fdt();
-       int ret;
-
-       ret = fdt_open_into(blob, fdt, 0x10000);
-       if (ret < 0)
-               return ret;
-
-       return 0;
-}
-
 void params_early_setup(void *plat_param_from_bl2)
 {
        struct bl31_plat_param *bl2_param;
index 1a0a617f63c92ad24aaf87b3e5047d556b1ee3ef..d203581509ce0802e1616da65e4bee4f6a9f3809 100644 (file)
@@ -11,8 +11,6 @@ RK_PLAT                       :=      plat/rockchip
 RK_PLAT_SOC            :=      ${RK_PLAT}/${PLAT}
 RK_PLAT_COMMON         :=      ${RK_PLAT}/common
 
-include lib/libfdt/libfdt.mk
-
 PLAT_INCLUDES          :=      -I${RK_PLAT_COMMON}/                            \
                                -I${RK_PLAT_COMMON}/include/                    \
                                -I${RK_PLAT_COMMON}/aarch32/                    \
@@ -42,7 +40,6 @@ BL32_SOURCES          +=      ${RK_GIC_SOURCES}                               \
                                drivers/delay_timer/delay_timer.c               \
                                drivers/delay_timer/generic_delay_timer.c       \
                                lib/cpus/aarch32/cortex_a12.S                   \
-                               $(LIBFDT_SRCS)                                  \
                                ${RK_PLAT_COMMON}/aarch32/plat_helpers.S        \
                                ${RK_PLAT_COMMON}/params_setup.c                \
                                ${RK_PLAT_COMMON}/aarch32/pmu_sram_cpus_on.S    \
@@ -58,6 +55,7 @@ BL32_SOURCES          +=      ${RK_GIC_SOURCES}                               \
 MULTI_CONSOLE_API      :=      1
 
 include lib/coreboot/coreboot.mk
+include lib/libfdt/libfdt.mk
 
 $(eval $(call add_define,PLAT_SP_MIN_EXTRA_LD_SCRIPT))
 
index ce8693a5cfd33dab49892319752db50602dc7d32..3caa1082f482cd8d5c8ef967fb2c0a484876b7f0 100644 (file)
@@ -8,8 +8,6 @@ RK_PLAT                 :=      plat/rockchip
 RK_PLAT_SOC            :=      ${RK_PLAT}/${PLAT}
 RK_PLAT_COMMON         :=      ${RK_PLAT}/common
 
-include lib/libfdt/libfdt.mk
-
 PLAT_INCLUDES          :=      -Idrivers/arm/gic/common/                       \
                                -Idrivers/arm/gic/v2/                   \
                                -I${RK_PLAT_COMMON}/                            \
@@ -40,7 +38,6 @@ BL31_SOURCES          +=      ${RK_GIC_SOURCES}                               \
                                drivers/delay_timer/generic_delay_timer.c       \
                                lib/cpus/aarch64/aem_generic.S                  \
                                lib/cpus/aarch64/cortex_a53.S                   \
-                               $(LIBFDT_SRCS)                                  \
                                ${RK_PLAT_COMMON}/drivers/parameter/ddr_parameter.c     \
                                ${RK_PLAT_COMMON}/aarch64/plat_helpers.S        \
                                ${RK_PLAT_COMMON}/bl31_plat_setup.c             \
@@ -54,6 +51,7 @@ BL31_SOURCES          +=      ${RK_GIC_SOURCES}                               \
 MULTI_CONSOLE_API      :=      1
 
 include lib/coreboot/coreboot.mk
+include lib/libfdt/libfdt.mk
 
 $(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
 $(eval $(call add_define,PLAT_SKIP_OPTEE_S_EL1_INT_REGISTER))
index 8988dc503553b3aef64f11d1acb4a8d47d5c56f1..0495a161970aa283c8674998d01d817e82db2cc6 100644 (file)
@@ -8,8 +8,6 @@ RK_PLAT                 :=      plat/rockchip
 RK_PLAT_SOC            :=      ${RK_PLAT}/${PLAT}
 RK_PLAT_COMMON         :=      ${RK_PLAT}/common
 
-include lib/libfdt/libfdt.mk
-
 PLAT_INCLUDES          :=      -I${RK_PLAT_COMMON}/                            \
                                -I${RK_PLAT_COMMON}/include/                    \
                                -I${RK_PLAT_COMMON}/aarch64/                    \
@@ -37,7 +35,6 @@ BL31_SOURCES          +=      ${RK_GIC_SOURCES}                               \
                                drivers/delay_timer/delay_timer.c               \
                                drivers/delay_timer/generic_delay_timer.c       \
                                lib/cpus/aarch64/cortex_a53.S                   \
-                               $(LIBFDT_SRCS)                                  \
                                ${RK_PLAT_COMMON}/aarch64/plat_helpers.S        \
                                ${RK_PLAT_COMMON}/bl31_plat_setup.c             \
                                ${RK_PLAT_COMMON}/params_setup.c                \
@@ -54,6 +51,7 @@ BL31_SOURCES          +=      ${RK_GIC_SOURCES}                               \
 MULTI_CONSOLE_API      :=      1
 
 include lib/coreboot/coreboot.mk
+include lib/libfdt/libfdt.mk
 
 $(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
 
index 3dfafc90b0d77558ec45ca8ddd7c7c6a4546589b..c73df6d767e3fcc1831391ef46cc723a4fc37d22 100644 (file)
@@ -8,8 +8,6 @@ RK_PLAT         :=      plat/rockchip
 RK_PLAT_SOC    :=      ${RK_PLAT}/${PLAT}
 RK_PLAT_COMMON :=      ${RK_PLAT}/common
 
-include lib/libfdt/libfdt.mk
-
 PLAT_INCLUDES          :=      -I${RK_PLAT_COMMON}/                    \
                                -I${RK_PLAT_COMMON}/include/            \
                                -I${RK_PLAT_COMMON}/aarch64/            \
@@ -45,7 +43,6 @@ BL31_SOURCES  +=      ${RK_GIC_SOURCES}                               \
                        drivers/gpio/gpio.c                             \
                        lib/cpus/aarch64/cortex_a53.S                   \
                        lib/cpus/aarch64/cortex_a72.S                   \
-                       $(LIBFDT_SRCS)                                  \
                        ${RK_PLAT_COMMON}/aarch64/plat_helpers.S        \
                        ${RK_PLAT_COMMON}/bl31_plat_setup.c             \
                        ${RK_PLAT_COMMON}/params_setup.c                \
@@ -71,6 +68,7 @@ BL31_SOURCES  +=      ${RK_GIC_SOURCES}                               \
 MULTI_CONSOLE_API      :=      1
 
 include lib/coreboot/coreboot.mk
+include lib/libfdt/libfdt.mk
 
 $(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))