Unverified Commit 73050e69 authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by GitHub
Browse files

Merge pull request #1866 from mmind/rockchip-fdt-param

rockchip: add an fdt parsing stub for platform param
parents 1fbb682a 7029e806
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <common/debug.h> #include <common/debug.h>
#include <drivers/console.h> #include <drivers/console.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <libfdt.h>
#include <lib/coreboot.h> #include <lib/coreboot.h>
#include <lib/mmio.h> #include <lib/mmio.h>
#include <plat/common/platform.h> #include <plat/common/platform.h>
...@@ -27,6 +28,13 @@ static struct gpio_info suspend_gpio[10]; ...@@ -27,6 +28,13 @@ static struct gpio_info suspend_gpio[10];
uint32_t suspend_gpio_cnt; uint32_t suspend_gpio_cnt;
static struct apio_info *suspend_apio; static struct apio_info *suspend_apio;
static uint8_t fdt_buffer[0x10000];
void *plat_get_fdt(void)
{
return &fdt_buffer[0];
}
struct gpio_info *plat_get_rockchip_gpio_reset(void) struct gpio_info *plat_get_rockchip_gpio_reset(void)
{ {
return rst_gpio; return rst_gpio;
...@@ -49,11 +57,30 @@ struct apio_info *plat_get_rockchip_suspend_apio(void) ...@@ -49,11 +57,30 @@ struct apio_info *plat_get_rockchip_suspend_apio(void)
return suspend_apio; 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) void params_early_setup(void *plat_param_from_bl2)
{ {
struct bl31_plat_param *bl2_param; struct bl31_plat_param *bl2_param;
struct bl31_gpio_param *gpio_param; struct bl31_gpio_param *gpio_param;
/*
* Test if this is a FDT passed as a platform-specific parameter
* block.
*/
if (!dt_process_fdt(plat_param_from_bl2))
return;
/* keep plat parameters for later processing if need */ /* keep plat parameters for later processing if need */
bl2_param = (struct bl31_plat_param *)plat_param_from_bl2; bl2_param = (struct bl31_plat_param *)plat_param_from_bl2;
while (bl2_param) { while (bl2_param) {
......
...@@ -8,6 +8,8 @@ RK_PLAT := plat/rockchip ...@@ -8,6 +8,8 @@ RK_PLAT := plat/rockchip
RK_PLAT_SOC := ${RK_PLAT}/${PLAT} RK_PLAT_SOC := ${RK_PLAT}/${PLAT}
RK_PLAT_COMMON := ${RK_PLAT}/common RK_PLAT_COMMON := ${RK_PLAT}/common
include lib/libfdt/libfdt.mk
PLAT_INCLUDES := -Idrivers/arm/gic/common/ \ PLAT_INCLUDES := -Idrivers/arm/gic/common/ \
-Idrivers/arm/gic/v2/ \ -Idrivers/arm/gic/v2/ \
-I${RK_PLAT_COMMON}/ \ -I${RK_PLAT_COMMON}/ \
...@@ -38,6 +40,7 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ ...@@ -38,6 +40,7 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \
drivers/delay_timer/generic_delay_timer.c \ drivers/delay_timer/generic_delay_timer.c \
lib/cpus/aarch64/aem_generic.S \ lib/cpus/aarch64/aem_generic.S \
lib/cpus/aarch64/cortex_a53.S \ lib/cpus/aarch64/cortex_a53.S \
$(LIBFDT_SRCS) \
${RK_PLAT_COMMON}/drivers/parameter/ddr_parameter.c \ ${RK_PLAT_COMMON}/drivers/parameter/ddr_parameter.c \
${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
${RK_PLAT_COMMON}/bl31_plat_setup.c \ ${RK_PLAT_COMMON}/bl31_plat_setup.c \
......
...@@ -8,6 +8,8 @@ RK_PLAT := plat/rockchip ...@@ -8,6 +8,8 @@ RK_PLAT := plat/rockchip
RK_PLAT_SOC := ${RK_PLAT}/${PLAT} RK_PLAT_SOC := ${RK_PLAT}/${PLAT}
RK_PLAT_COMMON := ${RK_PLAT}/common RK_PLAT_COMMON := ${RK_PLAT}/common
include lib/libfdt/libfdt.mk
PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \ PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \
-I${RK_PLAT_COMMON}/include/ \ -I${RK_PLAT_COMMON}/include/ \
-I${RK_PLAT_COMMON}/pmusram \ -I${RK_PLAT_COMMON}/pmusram \
...@@ -35,6 +37,7 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ ...@@ -35,6 +37,7 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \
drivers/delay_timer/delay_timer.c \ drivers/delay_timer/delay_timer.c \
drivers/delay_timer/generic_delay_timer.c \ drivers/delay_timer/generic_delay_timer.c \
lib/cpus/aarch64/cortex_a53.S \ lib/cpus/aarch64/cortex_a53.S \
$(LIBFDT_SRCS) \
${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
${RK_PLAT_COMMON}/bl31_plat_setup.c \ ${RK_PLAT_COMMON}/bl31_plat_setup.c \
${RK_PLAT_COMMON}/params_setup.c \ ${RK_PLAT_COMMON}/params_setup.c \
......
...@@ -8,6 +8,8 @@ RK_PLAT := plat/rockchip ...@@ -8,6 +8,8 @@ RK_PLAT := plat/rockchip
RK_PLAT_SOC := ${RK_PLAT}/${PLAT} RK_PLAT_SOC := ${RK_PLAT}/${PLAT}
RK_PLAT_COMMON := ${RK_PLAT}/common RK_PLAT_COMMON := ${RK_PLAT}/common
include lib/libfdt/libfdt.mk
PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \ PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \
-I${RK_PLAT_COMMON}/include/ \ -I${RK_PLAT_COMMON}/include/ \
-I${RK_PLAT_COMMON}/pmusram \ -I${RK_PLAT_COMMON}/pmusram \
...@@ -43,6 +45,7 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ ...@@ -43,6 +45,7 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \
drivers/gpio/gpio.c \ drivers/gpio/gpio.c \
lib/cpus/aarch64/cortex_a53.S \ lib/cpus/aarch64/cortex_a53.S \
lib/cpus/aarch64/cortex_a72.S \ lib/cpus/aarch64/cortex_a72.S \
$(LIBFDT_SRCS) \
${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
${RK_PLAT_COMMON}/bl31_plat_setup.c \ ${RK_PLAT_COMMON}/bl31_plat_setup.c \
${RK_PLAT_COMMON}/params_setup.c \ ${RK_PLAT_COMMON}/params_setup.c \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment