Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-net
[oweals/u-boot.git] / arch / arm / include / asm / arch-mx6 / sys_proto.h
index 668e77af6ab09829b5c136e98740de858bc6f49b..1e5fa1a75ebc489e69dbbe7641675eecb374f4e0 100644 (file)
@@ -1,38 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * (C) Copyright 2009
  * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
  */
 
-#ifndef _SYS_PROTO_H_
-#define _SYS_PROTO_H_
+#ifndef __SYS_PROTO_IMX6_
+#define __SYS_PROTO_IMX6_
 
-#define is_soc_rev(rev)        ((get_cpu_rev() & 0xFF) - rev)
+#include <asm/mach-imx/sys_proto.h>
+#include <asm/arch/iomux.h>
 
-u32 get_cpu_rev(void);
+#define USBPHY_PWD             0x00000000
 
-/*
- * Initializes on-chip ethernet controllers.
- * to override, implement board_eth_init()
- */
+#define USBPHY_PWD_RXPWDRX     (1 << 20) /* receiver block power down */
 
-int fecmxc_initialize(bd_t *bis);
+#define is_usbotg_phy_active(void) (!(readl(USB_PHY0_BASE_ADDR + USBPHY_PWD) & \
+                                  USBPHY_PWD_RXPWDRX))
+
+int imx6_pcie_toggle_power(void);
+int imx6_pcie_toggle_reset(void);
+
+enum ldo_reg {
+       LDO_ARM,
+       LDO_SOC,
+       LDO_PU,
+};
+
+int set_ldo_voltage(enum ldo_reg ldo, u32 mv);
+
+/**
+ * iomuxc_set_rgmii_io_voltage - set voltage level of RGMII/USB pins
+ *
+ * @param io_vol - the voltage IO level of pins
+ */
+static inline void iomuxc_set_rgmii_io_voltage(int io_vol)
+{
+       __raw_writel(io_vol, IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE_RGMII);
+}
 
-#endif
+#endif /* __SYS_PROTO_IMX6_ */