board.c 488 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 <led.h>
  7. #include <linux/io.h>
  8. #define MT76XX_AGPIO_CFG 0x1000003c
  9. int board_early_init_f(void)
  10. {
  11. void __iomem *gpio_mode;
  12. /* Configure digital vs analog GPIOs */
  13. gpio_mode = ioremap_nocache(MT76XX_AGPIO_CFG, 0x100);
  14. iowrite32(0x00fe01ff, gpio_mode);
  15. return 0;
  16. }
  17. int board_late_init(void)
  18. {
  19. if (IS_ENABLED(CONFIG_LED))
  20. led_default_state();
  21. return 0;
  22. }