Stefan Roese | 88dc409 | 2018-08-16 15:27:31 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2018 Stefan Roese <sr@denx.de> |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Stefan Roese | b1f51fc | 2018-10-09 08:59:13 +0200 | [diff] [blame] | 7 | #include <led.h> |
Stefan Roese | 48f8e15 | 2018-10-09 08:59:11 +0200 | [diff] [blame] | 8 | #include <linux/io.h> |
| 9 | |
| 10 | #define MT76XX_AGPIO_CFG 0x1000003c |
Stefan Roese | 88dc409 | 2018-08-16 15:27:31 +0200 | [diff] [blame] | 11 | |
| 12 | int board_early_init_f(void) |
| 13 | { |
Stefan Roese | 48f8e15 | 2018-10-09 08:59:11 +0200 | [diff] [blame] | 14 | void __iomem *gpio_mode; |
| 15 | |
| 16 | /* Configure digital vs analog GPIOs */ |
| 17 | gpio_mode = ioremap_nocache(MT76XX_AGPIO_CFG, 0x100); |
| 18 | iowrite32(0x00fe01ff, gpio_mode); |
| 19 | |
Stefan Roese | 88dc409 | 2018-08-16 15:27:31 +0200 | [diff] [blame] | 20 | return 0; |
| 21 | } |
Stefan Roese | b1f51fc | 2018-10-09 08:59:13 +0200 | [diff] [blame] | 22 | |
| 23 | int board_late_init(void) |
| 24 | { |
| 25 | if (IS_ENABLED(CONFIG_LED)) |
| 26 | led_default_state(); |
| 27 | |
| 28 | return 0; |
| 29 | } |