board.c 545 B

1234567891011121314151617181920212223242526
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2018 Stefan Roese <sr@denx.de>
  4. */
  5. #include <common.h>
  6. #include <asm/io.h>
  7. #define MT76XX_GPIO1_MODE 0xb0000060
  8. void board_debug_uart_init(void)
  9. {
  10. /* Select UART2 mode instead of GPIO mode (default) */
  11. clrbits_le32((void __iomem *)MT76XX_GPIO1_MODE, GENMASK(27, 26));
  12. }
  13. int board_early_init_f(void)
  14. {
  15. /*
  16. * The pin muxing of UART2 also needs to be done, if debug uart
  17. * is not enabled. So we need to call this function here as well.
  18. */
  19. board_debug_uart_init();
  20. return 0;
  21. }