2018-08-16 13:27:31 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Stefan Roese <sr@denx.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2018-10-09 06:59:13 +00:00
|
|
|
#include <led.h>
|
2018-10-09 06:59:11 +00:00
|
|
|
#include <linux/io.h>
|
|
|
|
|
|
|
|
#define MT76XX_AGPIO_CFG 0x1000003c
|
2018-08-16 13:27:31 +00:00
|
|
|
|
|
|
|
int board_early_init_f(void)
|
|
|
|
{
|
2018-10-09 06:59:11 +00:00
|
|
|
void __iomem *gpio_mode;
|
|
|
|
|
|
|
|
/* Configure digital vs analog GPIOs */
|
|
|
|
gpio_mode = ioremap_nocache(MT76XX_AGPIO_CFG, 0x100);
|
|
|
|
iowrite32(0x00fe01ff, gpio_mode);
|
|
|
|
|
2018-08-16 13:27:31 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2018-10-09 06:59:13 +00:00
|
|
|
|
|
|
|
int board_late_init(void)
|
|
|
|
{
|
|
|
|
if (IS_ENABLED(CONFIG_LED))
|
|
|
|
led_default_state();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|