blob: 4d14c446173bd30a10e901bcdb8c16ee425331be [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Valentin Longchampc98bf292013-10-18 11:47:24 +02002/*
3 * (C) Copyright 2013 Keymile AG
4 * Valentin Longchamp <valentin.longchamp@keymile.com>
Valentin Longchampc98bf292013-10-18 11:47:24 +02005 */
6
Valentin Longchamp42f3ed62014-01-27 11:49:05 +01007/* QRIO GPIO ports */
8#define GPIO_A 0x40
9#define GPIO_B 0x60
10
11int qrio_get_gpio(u8 port_off, u8 gpio_nr);
12void qrio_set_opendrain_gpio(u8 port_off, u8 gpio_nr, u8 val);
13void qrio_set_gpio(u8 port_off, u8 gpio_nr, bool value);
14void qrio_gpio_direction_output(u8 port_off, u8 gpio_nr, bool value);
15void qrio_gpio_direction_input(u8 port_off, u8 gpio_nr);
16
Valentin Longchampc98bf292013-10-18 11:47:24 +020017#define PRSTCFG_POWUP_UNIT_CORE_RST 0x0
18#define PRSTCFG_POWUP_UNIT_RST 0x1
19#define PRSTCFG_POWUP_RST 0x3
20
21void qrio_prst(u8 bit, bool en, bool wden);
Valentin Longchamp5eb9dab2014-04-30 15:01:46 +020022void qrio_wdmask(u8 bit, bool wden);
Valentin Longchampc98bf292013-10-18 11:47:24 +020023void qrio_prstcfg(u8 bit, u8 mode);
Stefan Bigler8b6f6c32014-05-02 10:48:41 +020024void qrio_set_leds(void);
Stefan Biglerdafc72d2014-05-02 10:49:27 +020025void qrio_enable_app_buffer(void);
Boschung, Rainercacb02b2014-06-03 09:05:17 +020026void qrio_cpuwd_flag(bool flag);
27int qrio_reset_reason(void);
Valentin Longchampc98bf292013-10-18 11:47:24 +020028
Boschung, Rainere70e5952014-06-03 09:05:19 +020029#define UPREQ_UNIT_RST 0x0
30#define UPREQ_CORE_RST 0x1
31
32void qrio_uprstreq(u8 mode);
33
Valentin Longchampc98bf292013-10-18 11:47:24 +020034void pci_of_setup(void *blob, bd_t *bd);