Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Álvaro Fernández Rojas | 5317fb9 | 2018-02-03 10:30:28 +0100 | [diff] [blame] | 2 | /* |
Álvaro Fernández Rojas | 094deda | 2019-08-30 12:00:42 +0200 | [diff] [blame] | 3 | * Copyright (C) 2018 Álvaro Fernández Rojas <noltari@gmail.com> |
Álvaro Fernández Rojas | 5317fb9 | 2018-02-03 10:30:28 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 7 | #include <init.h> |
Álvaro Fernández Rojas | 5317fb9 | 2018-02-03 10:30:28 +0100 | [diff] [blame] | 8 | #include <asm/io.h> |
Simon Glass | 4dcacfc | 2020-05-10 11:40:13 -0600 | [diff] [blame] | 9 | #include <linux/bitops.h> |
Álvaro Fernández Rojas | 5317fb9 | 2018-02-03 10:30:28 +0100 | [diff] [blame] | 10 | |
| 11 | #define GPIO_BASE_6362 0x10000080 |
| 12 | |
| 13 | #define GPIO_MODE_6362_REG 0x18 |
| 14 | #define GPIO_MODE_6362_SERIAL_LED_DATA BIT(2) |
| 15 | #define GPIO_MODE_6362_SERIAL_LED_CLK BIT(3) |
| 16 | |
| 17 | #ifdef CONFIG_BOARD_EARLY_INIT_F |
| 18 | int board_early_init_f(void) |
| 19 | { |
| 20 | void __iomem *gpio_regs = map_physmem(GPIO_BASE_6362, 0, MAP_NOCACHE); |
| 21 | |
| 22 | /* Enable Serial LEDs */ |
| 23 | setbits_be32(gpio_regs + GPIO_MODE_6362_REG, |
| 24 | GPIO_MODE_6362_SERIAL_LED_DATA | |
| 25 | GPIO_MODE_6362_SERIAL_LED_CLK); |
| 26 | |
| 27 | return 0; |
| 28 | } |
| 29 | #endif |