summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-04-24 18:01:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-28 09:46:19 +0200
commit6d221f11055fdeeb2c5acbf67dff9d039a35fb37 (patch)
tree5cca92521cfef32da83d7697136eda50736e5c11
parent070db2f8886f859b58506bb48e0c6bb7f41fe9d2 (diff)
downloadbarebox-6d221f11055fdeeb2c5acbf67dff9d039a35fb37.tar.gz
barebox-6d221f11055fdeeb2c5acbf67dff9d039a35fb37.tar.xz
ARM: stm32mp: lxa-mc1: break reg_3v3 dependency on PMIC
While the regulator is indeed powered by the PMIC, basically the whole system is, and it's always on. Linux doesn't handle this specially however and will defer SDMMC probe till after the PMIC is probed costing us some valuable boot time. Fix this up. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/boards/lxa-mc1/board.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/arch/arm/boards/lxa-mc1/board.c b/arch/arm/boards/lxa-mc1/board.c
index d36924fc27..7f1f3ccd7e 100644
--- a/arch/arm/boards/lxa-mc1/board.c
+++ b/arch/arm/boards/lxa-mc1/board.c
@@ -5,6 +5,28 @@
#include <asm/memory.h>
#include <mach/bbu.h>
#include <bootsource.h>
+#include <of.h>
+
+static int of_fixup_regulator_supply_disable(struct device_node *root, void *path)
+{
+ struct device_node *node;
+ struct property *prop;
+
+ node = of_find_node_by_path_from(root, path);
+ if (!node) {
+ pr_warn("fixup for %s failed: not found\n", (const char *)path);
+ return -ENOENT;
+ }
+
+ if (!of_property_read_bool(node, "regulator-always-on"))
+ return 0;
+
+ prop = of_find_property(node, "vin-supply", NULL);
+ if (prop)
+ of_delete_property(prop);
+
+ return 0;
+}
static int mc1_device_init(void)
{
@@ -26,6 +48,11 @@ static int mc1_device_init(void)
barebox_set_hostname("lxa-mc1");
- return 0;
+ /* The regulator is powered by the PMIC, but is always on as far as
+ * software is concerned. Break the reference to the PMIC, so the OS
+ * doesn't need to defer SDMMC/Ethernet peripherals till after the PMIC
+ * is up.
+ */
+ return of_register_fixup(of_fixup_regulator_supply_disable, "/regulator_3v3");
}
device_initcall(mc1_device_init);