rockchip: only include libfdt in non-coreboot cases
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
diff --git a/plat/rockchip/common/params_setup.c b/plat/rockchip/common/params_setup.c
index dda98d9..baf2563 100644
--- a/plat/rockchip/common/params_setup.c
+++ b/plat/rockchip/common/params_setup.c
@@ -5,6 +5,7 @@
*/
#include <assert.h>
+#include <errno.h>
#include <string.h>
#include <common/bl_common.h>
@@ -28,6 +29,12 @@
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 @@
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 @@
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;