board: atmel: Fix compiler warning 'board_usb_hw_init()' not used
[oweals/u-boot.git] / board / atmel / sama5d27_som1_ek / sama5d27_som1_ek.c
index 80d772518dfe9788a6130b230b89a7d9b71e8fd6..376562cd0e7d0f368313aa4b283813af2b1097b3 100644 (file)
@@ -1,12 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2017 Microchip Corporation
  *                   Wenyou.Yang <wenyou.yang@microchip.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <debug_uart.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/atmel_pio4.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/sama5d2.h>
 
+extern void at91_pda_detect(void);
+
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_CMD_USB
 static void board_usb_hw_init(void)
 {
-       atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 1);
+       atmel_pio4_set_pio_output(AT91_PIO_PORTA, 27, 1);
 }
+#endif
 
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
@@ -29,6 +33,7 @@ int board_late_init(void)
 #ifdef CONFIG_DM_VIDEO
        at91_video_show_board_info();
 #endif
+       at91_pda_detect();
        return 0;
 }
 #endif
@@ -36,7 +41,7 @@ int board_late_init(void)
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 static void board_uart1_hw_init(void)
 {
-       atmel_pio4_set_a_periph(AT91_PIO_PORTD, 2, 1);  /* URXD1 */
+       atmel_pio4_set_a_periph(AT91_PIO_PORTD, 2, ATMEL_PIO_PUEN_MASK);        /* URXD1 */
        atmel_pio4_set_a_periph(AT91_PIO_PORTD, 3, 0);  /* UTXD1 */
 
        at91_periph_clk_enable(ATMEL_ID_UART1);