board.c 604 B

1234567891011121314151617181920212223242526272829
  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 0x10000060
  8. void board_debug_uart_init(void)
  9. {
  10. void __iomem *gpio_mode;
  11. /* Select UART2 mode instead of GPIO mode (default) */
  12. gpio_mode = ioremap_nocache(MT76XX_GPIO1_MODE, 0x100);
  13. clrbits_le32(gpio_mode, GENMASK(27, 26));
  14. }
  15. int board_early_init_f(void)
  16. {
  17. /*
  18. * The pin muxing of UART2 also needs to be done, if debug uart
  19. * is not enabled. So we need to call this function here as well.
  20. */
  21. board_debug_uart_init();
  22. return 0;
  23. }