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