2 * Copyright (c) 2009 Wind River Systems, Inc.
3 * Tom Rix <Tom.Rix@windriver.com>
5 * SPDX-License-Identifier: GPL-2.0+
8 #include <asm/arch/cpu.h>
10 #include <asm/arch/mux.h>
13 #define DEBUG_BOARD_CONNECTED 1
14 #define DEBUG_BOARD_NOT_CONNECTED 0
16 static int debug_board_connected
= DEBUG_BOARD_CONNECTED
;
18 static void zoom2_debug_board_detect (void)
22 if (!gpio_request(158, "")) {
24 * GPIO to query for debug board
27 gpio_direction_input(158);
28 val
= gpio_get_value(158);
32 debug_board_connected
= DEBUG_BOARD_NOT_CONNECTED
;
35 int zoom2_debug_board_connected (void)
37 static int first_time
= 1;
40 zoom2_debug_board_detect ();
43 return debug_board_connected
;