u-boot/board/gardena/smart-gateway-mt7688/board.c
Stefan Roese b1f51fc24f mips: mt76xx: gardena-smart-gateway: Add board_late_init() to set LED def state
This is needed to set the LEDs automatically to a default state, as
configured in the dts.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-11-18 16:02:23 +01:00

29 lines
488 B
C

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