summaryrefslogtreecommitdiffstats
path: root/configs/platform-v7a/patches/barebox-2020.04.0/0002-ARM-stm32mp-lxa-mc1-break-reg_3v3-dependency-on-PMIC.patch
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-04-24 19:17:25 +0200
committerRobert Schwebel <r.schwebel@pengutronix.de>2020-04-27 09:39:47 +0200
commitf3b731600751a9a2859c1fd01805ee6324340bdb (patch)
tree0b22c8b10a77f6e5f9e87b66df173adbdfad4e26 /configs/platform-v7a/patches/barebox-2020.04.0/0002-ARM-stm32mp-lxa-mc1-break-reg_3v3-dependency-on-PMIC.patch
parenta479969b845a28613e637d8bec6aa658dabe6616 (diff)
downloadDistroKit-f3b731600751a9a2859c1fd01805ee6324340bdb.tar.gz
DistroKit-f3b731600751a9a2859c1fd01805ee6324340bdb.tar.xz
v7a: barebox: add support for Linux Automation MC-1
This adds barebox support for the Linux Automation GmbH MC-1 board built around the Octavo Systems OSD32MP157C-512M SiP. The patches have been posted[1] upstream, but are not yet accepted. It's however expected for them to be part of barebox v2020.06.0, at which time we can drop the patchset again. [1]: https://lists.infradead.org/pipermail/barebox/2020-April/041653.html Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Diffstat (limited to 'configs/platform-v7a/patches/barebox-2020.04.0/0002-ARM-stm32mp-lxa-mc1-break-reg_3v3-dependency-on-PMIC.patch')
-rw-r--r--configs/platform-v7a/patches/barebox-2020.04.0/0002-ARM-stm32mp-lxa-mc1-break-reg_3v3-dependency-on-PMIC.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/configs/platform-v7a/patches/barebox-2020.04.0/0002-ARM-stm32mp-lxa-mc1-break-reg_3v3-dependency-on-PMIC.patch b/configs/platform-v7a/patches/barebox-2020.04.0/0002-ARM-stm32mp-lxa-mc1-break-reg_3v3-dependency-on-PMIC.patch
new file mode 100644
index 0000000..451bb7b
--- /dev/null
+++ b/configs/platform-v7a/patches/barebox-2020.04.0/0002-ARM-stm32mp-lxa-mc1-break-reg_3v3-dependency-on-PMIC.patch
@@ -0,0 +1,60 @@
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Thu, 13 Feb 2020 11:10:44 +0100
+Subject: [PATCH] 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>
+---
+ arch/arm/boards/lxa-mc1/board.c | 29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boards/lxa-mc1/board.c b/arch/arm/boards/lxa-mc1/board.c
+index d36924fc2793..7f1f3ccd7e06 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);