summaryrefslogtreecommitdiffstats
path: root/configs/platform-v7a/patches/barebox-2019.12.0/0008-rpi-Enable-USB-Power-domain-during-startup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'configs/platform-v7a/patches/barebox-2019.12.0/0008-rpi-Enable-USB-Power-domain-during-startup.patch')
-rw-r--r--configs/platform-v7a/patches/barebox-2019.12.0/0008-rpi-Enable-USB-Power-domain-during-startup.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/configs/platform-v7a/patches/barebox-2019.12.0/0008-rpi-Enable-USB-Power-domain-during-startup.patch b/configs/platform-v7a/patches/barebox-2019.12.0/0008-rpi-Enable-USB-Power-domain-during-startup.patch
new file mode 100644
index 0000000..a30e632
--- /dev/null
+++ b/configs/platform-v7a/patches/barebox-2019.12.0/0008-rpi-Enable-USB-Power-domain-during-startup.patch
@@ -0,0 +1,47 @@
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Thu, 19 Dec 2019 19:28:36 +0100
+Subject: [PATCH] rpi: Enable USB Power domain during startup
+
+Enable the USB Power domain during startup. The power domain is
+abstracted as a regulator in barebox, but modelled as a power domain in
+the device tree. Until this is sorted out just enable the power domain
+or regulator in the board code.
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ arch/arm/boards/raspberry-pi/rpi-common.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
+index acb26f6a6491..45961b52eeaa 100644
+--- a/arch/arm/boards/raspberry-pi/rpi-common.c
++++ b/arch/arm/boards/raspberry-pi/rpi-common.c
+@@ -21,6 +21,7 @@
+ #include <linux/clk.h>
+ #include <linux/clkdev.h>
+ #include <envfs.h>
++#include <regulator.h>
+ #include <malloc.h>
+ #include <libfile.h>
+ #include <gpio.h>
+@@ -462,11 +463,20 @@ static void rpi_vc_fdt(void)
+
+ static int rpi_devices_init(void)
+ {
++ struct regulator *reg;
++
+ rpi_model_init();
+ bcm2835_register_fb();
+ armlinux_set_architecture(MACH_TYPE_BCM2708);
+ rpi_env_init();
+ rpi_vc_fdt();
++
++ reg = regulator_get_name("bcm2835_usb");
++ if (IS_ERR(reg))
++ return PTR_ERR(reg);
++
++ regulator_enable(reg);
++
+ return 0;
+ }
+ late_initcall(rpi_devices_init);