Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Jason Liu | dec1112 | 2011-11-25 00:18:02 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2009 |
| 4 | * Stefano Babic, DENX Software Engineering, sbabic@denx.de. |
Jason Liu | dec1112 | 2011-11-25 00:18:02 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Lukasz Majewski | a6fc159 | 2017-11-07 11:34:15 +0100 | [diff] [blame] | 7 | #ifndef __SYS_PROTO_IMX6_ |
| 8 | #define __SYS_PROTO_IMX6_ |
| 9 | |
Tim Harvey | 7367b39 | 2021-07-06 10:19:09 -0700 | [diff] [blame] | 10 | #include <asm/gpio.h> |
Stefano Babic | 33731bc | 2017-06-29 10:16:06 +0200 | [diff] [blame] | 11 | #include <asm/mach-imx/sys_proto.h> |
Lukasz Majewski | ff7ae6f | 2017-10-31 13:26:24 +0100 | [diff] [blame] | 12 | #include <asm/arch/iomux.h> |
Stefan Agner | 6a6692f | 2017-09-13 14:29:44 -0700 | [diff] [blame] | 13 | |
| 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 Dorta | e2ff410 | 2017-10-05 09:15:58 -0300 | [diff] [blame] | 20 | |
Marek Vasut | 02fec41 | 2019-11-26 09:35:32 +0100 | [diff] [blame] | 21 | enum ldo_reg { |
| 22 | LDO_ARM, |
| 23 | LDO_SOC, |
| 24 | LDO_PU, |
| 25 | }; |
| 26 | |
| 27 | int set_ldo_voltage(enum ldo_reg ldo, u32 mv); |
| 28 | |
Lukasz Majewski | ff7ae6f | 2017-10-31 13:26:24 +0100 | [diff] [blame] | 29 | /** |
| 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 | */ |
| 34 | static 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 Majewski | a6fc159 | 2017-11-07 11:34:15 +0100 | [diff] [blame] | 38 | |
| 39 | #endif /* __SYS_PROTO_IMX6_ */ |