blob: 3a1838e44a9a48f2ca2c8d355266c685b2ff01f5 [file] [log] [blame]
Stefan Roese88dc4092018-08-16 15:27:31 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2018 Stefan Roese <sr@denx.de>
4 */
5
6#include <common.h>
Stefan Roeseb1f51fc2018-10-09 08:59:13 +02007#include <led.h>
Stefan Roese48f8e152018-10-09 08:59:11 +02008#include <linux/io.h>
9
10#define MT76XX_AGPIO_CFG 0x1000003c
Stefan Roese88dc4092018-08-16 15:27:31 +020011
12int board_early_init_f(void)
13{
Stefan Roese48f8e152018-10-09 08:59:11 +020014 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 Roese88dc4092018-08-16 15:27:31 +020020 return 0;
21}
Stefan Roeseb1f51fc2018-10-09 08:59:13 +020022
23int board_late_init(void)
24{
25 if (IS_ENABLED(CONFIG_LED))
26 led_default_state();
27
28 return 0;
29}