dgnd3700v2.c 668 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2018 Álvaro Fernández Rojas <noltari@gmail.com>
  4. */
  5. #include <common.h>
  6. #include <init.h>
  7. #include <asm/io.h>
  8. #include <linux/bitops.h>
  9. #define GPIO_BASE_6362 0x10000080
  10. #define GPIO_MODE_6362_REG 0x18
  11. #define GPIO_MODE_6362_SERIAL_LED_DATA BIT(2)
  12. #define GPIO_MODE_6362_SERIAL_LED_CLK BIT(3)
  13. #ifdef CONFIG_BOARD_EARLY_INIT_F
  14. int board_early_init_f(void)
  15. {
  16. void __iomem *gpio_regs = map_physmem(GPIO_BASE_6362, 0, MAP_NOCACHE);
  17. /* Enable Serial LEDs */
  18. setbits_be32(gpio_regs + GPIO_MODE_6362_REG,
  19. GPIO_MODE_6362_SERIAL_LED_DATA |
  20. GPIO_MODE_6362_SERIAL_LED_CLK);
  21. return 0;
  22. }
  23. #endif