aboutsummaryrefslogtreecommitdiff
path: root/plat/rockchip
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2019-11-15 08:25:02 -0800
committerVasily Khoruzhick <anarsoul@gmail.com>2019-11-17 12:38:24 -0800
commitd52331d01e0efae36e837af90887a8aed33ff604 (patch)
tree651a462f9d78ed98a34f567a4f8bcca14733ca7b /plat/rockchip
parent1d2b41614c5675b144ae1f4517c1f8bf249a12d2 (diff)
downloadtrusted-firmware-a-d52331d01e0efae36e837af90887a8aed33ff604.tar.gz
plat/rockchip: initialize reset and poweroff GPIOs with known invalid value
And return NULL if we didn't get them in bl aux params otherwise reset and poweroff will be broken on platforms that do not have reset and poweroff GPIOs. Fixes: c1185ffde17c ("plat/rockchip: Switch to use new common BL aux parameter library") Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Change-Id: Ic6cf6383d8f05d745e2c5d5e1b1df38514ea8429
Diffstat (limited to 'plat/rockchip')
-rw-r--r--plat/rockchip/common/params_setup.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plat/rockchip/common/params_setup.c b/plat/rockchip/common/params_setup.c
index 8c2e5e911b..b2fd2011e4 100644
--- a/plat/rockchip/common/params_setup.c
+++ b/plat/rockchip/common/params_setup.c
@@ -6,6 +6,7 @@
#include <assert.h>
#include <errno.h>
+#include <limits.h>
#include <string.h>
#include <lib/bl_aux_params/bl_aux_params.h>
@@ -21,8 +22,8 @@
#include <plat_params.h>
#include <plat_private.h>
-static struct bl_aux_gpio_info rst_gpio;
-static struct bl_aux_gpio_info poweroff_gpio;
+static struct bl_aux_gpio_info rst_gpio = { .index = UINT_MAX } ;
+static struct bl_aux_gpio_info poweroff_gpio = { .index = UINT_MAX };
static struct bl_aux_gpio_info suspend_gpio[10];
uint32_t suspend_gpio_cnt;
static struct bl_aux_rk_apio_info suspend_apio;
@@ -174,11 +175,17 @@ uint32_t rockchip_get_uart_clock(void)
struct bl_aux_gpio_info *plat_get_rockchip_gpio_reset(void)
{
+ if (rst_gpio.index == UINT_MAX)
+ return NULL;
+
return &rst_gpio;
}
struct bl_aux_gpio_info *plat_get_rockchip_gpio_poweroff(void)
{
+ if (poweroff_gpio.index == UINT_MAX)
+ return NULL;
+
return &poweroff_gpio;
}