blob: 838dfc205b3645c4add203c92e8e6257cc405af3 [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 Roese48f8e152018-10-09 08:59:11 +02007#include <linux/io.h>
8
9#define MT76XX_AGPIO_CFG 0x1000003c
Stefan Roese88dc4092018-08-16 15:27:31 +020010
11int board_early_init_f(void)
12{
Stefan Roese48f8e152018-10-09 08:59:11 +020013 void __iomem *gpio_mode;
14
15 /* Configure digital vs analog GPIOs */
16 gpio_mode = ioremap_nocache(MT76XX_AGPIO_CFG, 0x100);
17 iowrite32(0x00fe01ff, gpio_mode);
18
Stefan Roese88dc4092018-08-16 15:27:31 +020019 return 0;
20}