rockchip: rk322x: Fix compile warning.

Change-Id: I52b94730e87bbefb8cccb371c7a246c0980345fc
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
(cherry picked from commit 4ed43066238174127e72758fbed3725eb95c6b97)
This commit is contained in:
Cody Xie 2017-11-20 12:50:18 +08:00 committed by Kever Yang
parent f337c9f715
commit f6762129ce
1 changed files with 17 additions and 13 deletions

View File

@ -12,6 +12,7 @@
#include <asm/gpio.h>
#include <asm/arch/clock.h>
#include <asm/arch/periph.h>
#include <asm/arch/timer.h>
#include <asm/arch/grf_rk322x.h>
#include <asm/arch/boot_mode.h>
@ -37,6 +38,19 @@ struct tos_parameter_t {
s64 reserve[8];
};
#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
int fb_set_reboot_flag(void)
{
struct rk322x_grf *grf;
printf("Setting reboot to fastboot flag ...\n");
grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
/* Set boot mode to fastboot */
writel(BOOT_FASTBOOT, &grf->os_reg[0]);
return 0;
}
#define FASTBOOT_KEY_GPIO 43 /* GPIO1_B3 */
static int fastboot_key_pressed(void)
{
@ -44,6 +58,7 @@ static int fastboot_key_pressed(void)
gpio_direction_input(FASTBOOT_KEY_GPIO);
return !gpio_get_value(FASTBOOT_KEY_GPIO);
}
#endif
__weak int rk_board_late_init(void)
{
@ -52,10 +67,12 @@ __weak int rk_board_late_init(void)
int board_late_init(void)
{
#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
if (fastboot_key_pressed()) {
printf("fastboot key pressed!\n");
fb_set_reboot_flag();
}
#endif
setup_boot_mode();
@ -171,16 +188,3 @@ int board_usb_cleanup(int index, enum usb_init_type init)
}
#endif
#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
int fb_set_reboot_flag(void)
{
struct rk322x_grf *grf;
printf("Setting reboot to fastboot flag ...\n");
grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
/* Set boot mode to fastboot */
writel(BOOT_FASTBOOT, &grf->os_reg[0]);
return 0;
}
#endif