Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Valentin Longchamp | c98bf29 | 2013-10-18 11:47:24 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2013 Keymile AG |
| 4 | * Valentin Longchamp <valentin.longchamp@keymile.com> |
Valentin Longchamp | c98bf29 | 2013-10-18 11:47:24 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
Valentin Longchamp | 42f3ed6 | 2014-01-27 11:49:05 +0100 | [diff] [blame] | 7 | /* QRIO GPIO ports */ |
| 8 | #define GPIO_A 0x40 |
| 9 | #define GPIO_B 0x60 |
| 10 | |
| 11 | int qrio_get_gpio(u8 port_off, u8 gpio_nr); |
| 12 | void qrio_set_opendrain_gpio(u8 port_off, u8 gpio_nr, u8 val); |
| 13 | void qrio_set_gpio(u8 port_off, u8 gpio_nr, bool value); |
| 14 | void qrio_gpio_direction_output(u8 port_off, u8 gpio_nr, bool value); |
| 15 | void qrio_gpio_direction_input(u8 port_off, u8 gpio_nr); |
| 16 | |
Valentin Longchamp | c98bf29 | 2013-10-18 11:47:24 +0200 | [diff] [blame] | 17 | #define PRSTCFG_POWUP_UNIT_CORE_RST 0x0 |
| 18 | #define PRSTCFG_POWUP_UNIT_RST 0x1 |
| 19 | #define PRSTCFG_POWUP_RST 0x3 |
| 20 | |
| 21 | void qrio_prst(u8 bit, bool en, bool wden); |
Valentin Longchamp | 5eb9dab | 2014-04-30 15:01:46 +0200 | [diff] [blame] | 22 | void qrio_wdmask(u8 bit, bool wden); |
Valentin Longchamp | c98bf29 | 2013-10-18 11:47:24 +0200 | [diff] [blame] | 23 | void qrio_prstcfg(u8 bit, u8 mode); |
Stefan Bigler | 8b6f6c3 | 2014-05-02 10:48:41 +0200 | [diff] [blame] | 24 | void qrio_set_leds(void); |
Stefan Bigler | dafc72d | 2014-05-02 10:49:27 +0200 | [diff] [blame] | 25 | void qrio_enable_app_buffer(void); |
Boschung, Rainer | cacb02b | 2014-06-03 09:05:17 +0200 | [diff] [blame] | 26 | void qrio_cpuwd_flag(bool flag); |
| 27 | int qrio_reset_reason(void); |
Valentin Longchamp | c98bf29 | 2013-10-18 11:47:24 +0200 | [diff] [blame] | 28 | |
Boschung, Rainer | e70e595 | 2014-06-03 09:05:19 +0200 | [diff] [blame] | 29 | #define UPREQ_UNIT_RST 0x0 |
| 30 | #define UPREQ_CORE_RST 0x1 |
| 31 | |
| 32 | void qrio_uprstreq(u8 mode); |
| 33 | |
Valentin Longchamp | c98bf29 | 2013-10-18 11:47:24 +0200 | [diff] [blame] | 34 | void pci_of_setup(void *blob, bd_t *bd); |