Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/patch/atf/atf-rk3399/fix-reset-in-v2.2.patch
Views: 3960
From f4707a3c40bfc752a24c427263f7cbe8d7adfcd6 Mon Sep 17 00:00:00 20011From: Vasily Khoruzhick <[email protected]>2Date: Fri, 15 Nov 2019 08:25:02 -08003Subject: [PATCH] plat/rockchip: initialize reset and poweroff GPIOs with known4invalid value56And return NULL if we didn't get them in bl aux params otherwise reset and poweroff7will be broken on platforms that do not have reset and poweroff GPIOs.89Fixes: c1185ffde17c ("plat/rockchip: Switch to use new common BL aux parameter library")10Signed-off-by: Vasily Khoruzhick <[email protected]>11---12plat/rockchip/common/params_setup.c | 11 +++++++++--131 file changed, 9 insertions(+), 2 deletions(-)1415diff --git a/plat/rockchip/common/params_setup.c b/plat/rockchip/common/params_setup.c16index 8c2e5e911b..b2fd2011e4 10064417--- a/plat/rockchip/common/params_setup.c18+++ b/plat/rockchip/common/params_setup.c19@@ -6,6 +6,7 @@2021#include <assert.h>22#include <errno.h>23+#include <limits.h>24#include <string.h>2526#include <lib/bl_aux_params/bl_aux_params.h>27@@ -21,8 +22,8 @@28#include <plat_params.h>29#include <plat_private.h>3031-static struct bl_aux_gpio_info rst_gpio;32-static struct bl_aux_gpio_info poweroff_gpio;33+static struct bl_aux_gpio_info rst_gpio = { .index = UINT_MAX } ;34+static struct bl_aux_gpio_info poweroff_gpio = { .index = UINT_MAX };35static struct bl_aux_gpio_info suspend_gpio[10];36uint32_t suspend_gpio_cnt;37static struct bl_aux_rk_apio_info suspend_apio;38@@ -174,11 +175,17 @@ uint32_t rockchip_get_uart_clock(void)3940struct bl_aux_gpio_info *plat_get_rockchip_gpio_reset(void)41{42+ if (rst_gpio.index == UINT_MAX)43+ return NULL;44+45return &rst_gpio;46}4748struct bl_aux_gpio_info *plat_get_rockchip_gpio_poweroff(void)49{50+ if (poweroff_gpio.index == UINT_MAX)51+ return NULL;52+53return &poweroff_gpio;54}55565758