From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 13/15] ARM: MXS: Add regulator debug print
Date: Wed, 28 Jan 2015 08:32:17 +0100 [thread overview]
Message-ID: <1422430339-11969-14-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1422430339-11969-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-mxs/power-init.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm/mach-mxs/power-init.c b/arch/arm/mach-mxs/power-init.c
index 407b776..5d4d089 100644
--- a/arch/arm/mach-mxs/power-init.c
+++ b/arch/arm/mach-mxs/power-init.c
@@ -24,6 +24,40 @@
#include <mach/regs-rtc.h>
#include <mach/regs-lradc.h>
+static void mxs_power_status(void)
+{
+ struct mxs_power_regs *power_regs =
+ (struct mxs_power_regs *)IMX_POWER_BASE;
+ static int linregofs[] = { 0, 1, -1, -2 };
+
+ uint32_t vddio = readl(&power_regs->hw_power_vddioctrl);
+ uint32_t vdda = readl(&power_regs->hw_power_vddactrl);
+ uint32_t vddd = readl(&power_regs->hw_power_vdddctrl);
+ uint32_t vddmem = readl(&power_regs->hw_power_vddmemctrl);
+
+ printf("vddio: %dmV (BO -%dmV), Linreg enabled, Linreg offset: %d, FET %sabled\n",
+ (vddio & 0x1f) * 50 + 2800,
+ ((vddio >> 8) & 0x7) * 50,
+ linregofs[((vdda >> 12) & 0x3)],
+ (vddio & (1 << 16)) ? "dis" : "en");
+ printf("vdda: %dmV (BO -%dmV), Linreg %sabled, Linreg offset: %d, FET %sabled\n",
+ (vdda & 0x1f) * 25 + 1500,
+ ((vdda >> 8) & 0x7) * 25,
+ (vdda & (1 << 17)) ? "en" : "dis",
+ linregofs[((vdda >> 12) & 0x3)],
+ (vdda & (1 << 16)) ? "dis" : "en");
+ printf("vddd: %dmV (BO -%dmV), Linreg %sabled, Linreg offset: %d, FET %sabled\n",
+ (vddd & 0x1f) * 25 + 800,
+ ((vddd >> 8) & 0x7) * 25,
+ (vddd & (1 << 21)) ? "en" : "dis",
+ linregofs[((vdda >> 16) & 0x3)],
+ (vdda & (1 << 20)) ? "dis" : "en");
+ printf("vddmem: %dmV (BO -%dmV), Linreg %sabled\n",
+ (vddmem & 0x1f) * 25 + 1100,
+ ((vddmem >> 5) & 0x7) * 25,
+ (vddmem & (1 << 8)) ? "en" : "dis");
+}
+
/*
* This delay function is intended to be used only in early stage of boot, where
* clock are not set up yet. The timer used here is reset on every boot and
@@ -1197,6 +1231,7 @@ static void __mx28_power_init(int has_battery)
struct mxs_power_regs *power_regs =
(struct mxs_power_regs *)IMX_POWER_BASE;
+ mxs_power_status();
mxs_power_clock2xtal();
mxs_power_set_auto_restart();
mxs_power_set_linreg();
@@ -1231,6 +1266,8 @@ static void __mx28_power_init(int has_battery)
writel(POWER_5VCTRL_PWDN_5VBRNOUT, &power_regs->hw_power_5vctrl_set);
mxs_early_delay(1000);
+
+ mxs_power_status();
}
void mx28_power_init(void)
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-01-28 7:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 7:32 [PATCH] MXS: Add device tree support and duckbill board support Sascha Hauer
2015-01-28 7:32 ` [PATCH 01/15] ARM: MXS: Fix vddd brownout setting Sascha Hauer
2015-01-28 7:32 ` [PATCH 02/15] MXS: power-init: inline only once used functions Sascha Hauer
2015-01-28 7:32 ` [PATCH 03/15] ARM: MXS: Do not register devices with device tree support Sascha Hauer
2015-01-28 7:32 ` [PATCH 04/15] ARM: MXS: Make gpio a driver Sascha Hauer
2015-01-28 7:32 ` [PATCH 05/15] mci: mxs: Add devicetree support Sascha Hauer
2015-01-28 7:32 ` [PATCH 06/15] serial: stm_serial: " Sascha Hauer
2015-01-28 7:32 ` [PATCH 07/15] ARM: MXS: Create ocotp device in SoC code Sascha Hauer
2015-01-28 7:32 ` [PATCH 08/15] ARM: MXS: ocotp: Add devicetree support Sascha Hauer
2015-01-28 7:32 ` [PATCH 09/15] of: Create platform_device when creating AMBA device failed Sascha Hauer
2015-01-28 7:32 ` [PATCH 10/15] pbl: Add support for memory_display Sascha Hauer
2015-01-28 7:32 ` [PATCH 11/15] pinctrl: Add MXS pinctrl driver Sascha Hauer
2015-01-28 7:32 ` [PATCH 12/15] ARM: MXS: Setup vdda in power prep Sascha Hauer
2015-01-28 7:32 ` Sascha Hauer [this message]
2015-01-28 7:32 ` [PATCH 14/15] ARM: MXS: power-init: Add parameters to mx28_power_init() Sascha Hauer
2015-01-28 7:32 ` [PATCH 15/15] ARM: MXS: Add duckbill board support Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422430339-11969-14-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox