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 | |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 6 | #include <init.h> |
Álvaro Fernández Rojas | 5317fb9 | 2018-02-03 10:30:28 +0100 | [diff] [blame] | 7 | #include <asm/io.h> |
Simon Glass | 4dcacfc | 2020-05-10 11:40:13 -0600 | [diff] [blame] | 8 | #include <linux/bitops.h> |
Álvaro Fernández Rojas | 5317fb9 | 2018-02-03 10:30:28 +0100 | [diff] [blame] | 9 | |
| 10 | #define GPIO_BASE_6362 0x10000080 |
| 11 | |
| 12 | #define GPIO_MODE_6362_REG 0x18 |
| 13 | #define GPIO_MODE_6362_SERIAL_LED_DATA BIT(2) |
| 14 | #define GPIO_MODE_6362_SERIAL_LED_CLK BIT(3) |
| 15 | |
| 16 | #ifdef CONFIG_BOARD_EARLY_INIT_F |
| 17 | int board_early_init_f(void) |
| 18 | { |
| 19 | void __iomem *gpio_regs = map_physmem(GPIO_BASE_6362, 0, MAP_NOCACHE); |
| 20 | |
| 21 | /* Enable Serial LEDs */ |
| 22 | setbits_be32(gpio_regs + GPIO_MODE_6362_REG, |
| 23 | GPIO_MODE_6362_SERIAL_LED_DATA | |
| 24 | GPIO_MODE_6362_SERIAL_LED_CLK); |
| 25 | |
| 26 | return 0; |
| 27 | } |
| 28 | #endif |