blob: 7845fa8e56932d91bad33ba9b5c2f99d2073087a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Jason Liudec11122011-11-25 00:18:02 +00002/*
3 * (C) Copyright 2009
4 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
Jason Liudec11122011-11-25 00:18:02 +00005 */
6
Lukasz Majewskia6fc1592017-11-07 11:34:15 +01007#ifndef __SYS_PROTO_IMX6_
8#define __SYS_PROTO_IMX6_
9
Tim Harvey7367b392021-07-06 10:19:09 -070010#include <asm/gpio.h>
Stefano Babic33731bc2017-06-29 10:16:06 +020011#include <asm/mach-imx/sys_proto.h>
Lukasz Majewskiff7ae6f2017-10-31 13:26:24 +010012#include <asm/arch/iomux.h>
Stefan Agner6a6692f2017-09-13 14:29:44 -070013
14#define USBPHY_PWD 0x00000000
15
16#define USBPHY_PWD_RXPWDRX (1 << 20) /* receiver block power down */
17
18#define is_usbotg_phy_active(void) (!(readl(USB_PHY0_BASE_ADDR + USBPHY_PWD) & \
19 USBPHY_PWD_RXPWDRX))
Diego Dortae2ff4102017-10-05 09:15:58 -030020
Marek Vasut02fec412019-11-26 09:35:32 +010021enum ldo_reg {
22 LDO_ARM,
23 LDO_SOC,
24 LDO_PU,
25};
26
27int set_ldo_voltage(enum ldo_reg ldo, u32 mv);
28
Lukasz Majewskiff7ae6f2017-10-31 13:26:24 +010029/**
30 * iomuxc_set_rgmii_io_voltage - set voltage level of RGMII/USB pins
31 *
32 * @param io_vol - the voltage IO level of pins
33 */
34static inline void iomuxc_set_rgmii_io_voltage(int io_vol)
35{
36 __raw_writel(io_vol, IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII);
37}
Lukasz Majewskia6fc1592017-11-07 11:34:15 +010038
39#endif /* __SYS_PROTO_IMX6_ */