summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs
diff options
context:
space:
mode:
authorRoland Hieber <r.hieber@pengutronix.de>2018-08-13 15:02:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-08-14 08:54:40 +0200
commitf726f184e4dedf06dd4d1d6071f3dd4b24e82cd5 (patch)
tree5179a472d35fbe7d86a36e3eeb08c4a64ed67bdc /arch/arm/mach-mxs
parente85280472f58496f451d75ad139aedba3793ab91 (diff)
downloadbarebox-f726f184e4dedf06dd4d1d6071f3dd4b24e82cd5.tar.gz
barebox-f726f184e4dedf06dd4d1d6071f3dd4b24e82cd5.tar.xz
ARM: MXS: allow starting from battery input without 4P2 source enabled
Some boards don't need the 4.2V power source at all, so allow them to keep it disabled for efficiency reasons. For backwards compatibility, don't disable the 4P2 power source on the existing boards which are supplied from battery input. The POWER_USE_5V code path however always enables it up as it is needed to supply the DC-DC converter. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r--arch/arm/mach-mxs/include/mach/init.h2
-rw-r--r--arch/arm/mach-mxs/power-init.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/mach-mxs/include/mach/init.h b/arch/arm/mach-mxs/include/mach/init.h
index 878cf4ad62..aa3c68facb 100644
--- a/arch/arm/mach-mxs/include/mach/init.h
+++ b/arch/arm/mach-mxs/include/mach/init.h
@@ -18,11 +18,13 @@ void mxs_early_delay(int delay);
* - POWER_USE_BATTERY: use battery input when the system is supplied by a battery
* - POWER_USE_BATTERY_INPUT: use battery input when the system is supplied by
* a DC source (instead of a real battery) on the battery input
+ * - POWER_ENABLE_4P2: power up the 4P2 regulator (implied for POWER_USE_5V)
*/
enum mxs_power_config {
POWER_USE_5V = 0b00000000,
POWER_USE_BATTERY = 0b00000001,
POWER_USE_BATTERY_INPUT = 0b00000010,
+ POWER_ENABLE_4P2 = 0b00000100,
};
extern int power_config;
static inline enum mxs_power_config mxs_power_config_get_use(void) {
diff --git a/arch/arm/mach-mxs/power-init.c b/arch/arm/mach-mxs/power-init.c
index 14f9b7cca7..60fa0cb022 100644
--- a/arch/arm/mach-mxs/power-init.c
+++ b/arch/arm/mach-mxs/power-init.c
@@ -717,7 +717,8 @@ static void mxs_enable_battery_input(void)
POWER_5VCTRL_CHARGE_4P2_ILIMIT_MASK,
0x8 << POWER_5VCTRL_CHARGE_4P2_ILIMIT_OFFSET);
- mxs_power_enable_4p2();
+ if (power_config & POWER_ENABLE_4P2)
+ mxs_power_enable_4p2();
}
/**