diff options
author | Tom Rini <trini@konsulko.com> | 2018-06-04 08:55:00 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-06-04 08:55:00 -0400 |
commit | 809e0e398a91db7bf8b4d6259d9bfc6fbd6bce83 (patch) | |
tree | 7ae663a2a108d27eae7ce25f912d337282d94c66 /board/sunxi | |
parent | b5351a439088dfffd83bfaac81f604344ee2e3bd (diff) | |
parent | 2e8dbe14e766deae16c75f357f926f08b881dc66 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
Diffstat (limited to 'board/sunxi')
-rw-r--r-- | board/sunxi/MAINTAINERS | 6 | ||||
-rw-r--r-- | board/sunxi/board.c | 40 |
2 files changed, 38 insertions, 8 deletions
diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 1bb2fa8f518..e90c87b560e 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -116,6 +116,12 @@ M: Paul Kocialkowski <contact@paulk.fr> S: Maintained F: configs/Ainol_AW1_defconfig +AMARULA A64-RELIC +M: Jagan Teki <jagan@amarulasolutions.com> +S: Maintained +F: configs/amarula_a64_relic_defconfig +F: arch/arm/dts/sun50i-a64-amarula-relic.dts + AMPE A76 BOARD M: Paul Kocialkowski <contact@paulk.fr> S: Maintained diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 3d364c6db58..5ed1b8bae18 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -11,8 +11,11 @@ */ #include <common.h> +#include <dm.h> #include <mmc.h> #include <axp_pmic.h> +#include <generic-phy.h> +#include <phy-sun4i-usb.h> #include <asm/arch/clock.h> #include <asm/arch/cpu.h> #include <asm/arch/display.h> @@ -20,7 +23,6 @@ #include <asm/arch/gpio.h> #include <asm/arch/mmc.h> #include <asm/arch/spl.h> -#include <asm/arch/usb_phy.h> #ifndef CONFIG_ARM64 #include <asm/armv7.h> #endif @@ -595,7 +597,35 @@ void sunxi_board_init(void) #ifdef CONFIG_USB_GADGET int g_dnl_board_usb_cable_connected(void) { - return sunxi_usb_phy_vbus_detect(0); + struct udevice *dev; + struct phy phy; + int ret; + + ret = uclass_get_device(UCLASS_USB_DEV_GENERIC, 0, &dev); + if (ret) { + pr_err("%s: Cannot find USB device\n", __func__); + return ret; + } + + ret = generic_phy_get_by_name(dev, "usb", &phy); + if (ret) { + pr_err("failed to get %s USB PHY\n", dev->name); + return ret; + } + + ret = generic_phy_init(&phy); + if (ret) { + pr_err("failed to init %s USB PHY\n", dev->name); + return ret; + } + + ret = sun4i_usb_phy_vbus_detect(&phy); + if (ret == 1) { + pr_err("A charger is plugged into the OTG\n"); + return -ENODEV; + } + + return ret; } #endif @@ -743,12 +773,6 @@ int misc_init_r(void) setup_environment(gd->fdt_blob); -#ifndef CONFIG_MACH_SUN9I - ret = sunxi_usb_phy_probe(); - if (ret) - return ret; -#endif - #ifdef CONFIG_USB_ETHER usb_ether_init(); #endif |