Holger Brunck | 9562687 | 2020-01-10 12:47:42 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * (C) Copyright 2018 ABB |
Holger Brunck | 078e1b7 | 2020-07-09 17:31:23 +0200 | [diff] [blame] | 4 | * Valentin Longchamp <valentin.longchamp@hitachi-powergrids.com> |
Holger Brunck | 9562687 | 2020-01-10 12:47:42 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __QRIO_H |
| 8 | #define __QRIO_H |
| 9 | |
| 10 | /* QRIO GPIO ports */ |
| 11 | #define QRIO_GPIO_A 0x40 |
| 12 | #define QRIO_GPIO_B 0x60 |
| 13 | |
Aleksandar Gerasimovski | 69d5b7b | 2021-01-13 16:20:51 +0000 | [diff] [blame] | 14 | void show_qrio(void); |
Holger Brunck | 9562687 | 2020-01-10 12:47:42 +0100 | [diff] [blame] | 15 | int qrio_get_gpio(u8 port_off, u8 gpio_nr); |
| 16 | void qrio_set_opendrain_gpio(u8 port_off, u8 gpio_nr, u8 val); |
| 17 | void qrio_set_gpio(u8 port_off, u8 gpio_nr, bool value); |
| 18 | void qrio_gpio_direction_output(u8 port_off, u8 gpio_nr, bool value); |
| 19 | void qrio_gpio_direction_input(u8 port_off, u8 gpio_nr); |
| 20 | |
| 21 | /* QRIO Periphery reset configurations */ |
| 22 | #define PRSTCFG_POWUP_UNIT_CORE_RST 0x0 |
| 23 | #define PRSTCFG_POWUP_UNIT_RST 0x1 |
| 24 | #define PRSTCFG_POWUP_RST 0x3 |
| 25 | |
| 26 | void qrio_prst(u8 bit, bool en, bool wden); |
| 27 | void qrio_wdmask(u8 bit, bool wden); |
| 28 | void qrio_prstcfg(u8 bit, u8 mode); |
| 29 | void qrio_set_leds(void); |
| 30 | void qrio_enable_app_buffer(void); |
| 31 | void qrio_cpuwd_flag(bool flag); |
| 32 | bool qrio_reason_unitrst(void); |
| 33 | |
| 34 | /* QRIO uP reset request configurations */ |
| 35 | #define UPREQ_UNIT_RST 0x0 |
| 36 | #define UPREQ_CORE_RST 0x1 |
| 37 | |
| 38 | void qrio_uprstreq(u8 mode); |
| 39 | |
| 40 | void i2c_deblock_gpio_cfg(void); |
| 41 | #endif /* __QRIO_H */ |