public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/6] mx7ulp: Print the LDO mode status
Date: Tue,  5 Nov 2019 09:47:50 -0300	[thread overview]
Message-ID: <20191105124755.15903-1-festevam@gmail.com> (raw)

As per the i.MX7ULP datasheet, it can boot in LDO enabled mode
or LDO bypass mode.

Print the LDO mode status in the U-Boot log for convenience.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v2:
- None

 arch/arm/mach-imx/mx7ulp/soc.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c
index 127fcfeea1..b9a108a514 100644
--- a/arch/arm/mach-imx/mx7ulp/soc.c
+++ b/arch/arm/mach-imx/mx7ulp/soc.c
@@ -131,6 +131,21 @@ const char *get_imx_type(u32 imxtype)
 	return "7ULP";
 }
 
+#define PMC0_BASE_ADDR		0x410a1000
+#define PMC0_CTRL		0x28
+#define PMC0_CTRL_LDOEN		BIT(31)
+
+static bool ldo_mode_is_enabled(void)
+{
+	unsigned int reg;
+
+	reg = readl(PMC0_BASE_ADDR + PMC0_CTRL);
+	if (reg & PMC0_CTRL_LDOEN)
+		return true;
+	else
+		return false;
+}
+
 int print_cpuinfo(void)
 {
 	u32 cpurev;
@@ -159,6 +174,11 @@ int print_cpuinfo(void)
 		break;
 	}
 
+	if (ldo_mode_is_enabled())
+		printf("PMC1:  LDO enabled mode\n");
+	else
+		printf("PMC1:  LDO bypass mode\n");
+
 	return 0;
 }
 #endif
-- 
2.17.1

             reply	other threads:[~2019-11-05 12:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 12:47 Fabio Estevam [this message]
2019-11-05 12:47 ` [U-Boot] [PATCH v3 2/6] mx7ulp: Introduce the CONFIG_LDO_ENABLED_MODE option Fabio Estevam
2019-11-05 12:47 ` [U-Boot] [PATCH v3 3/6] mx7ulp: Remove the _RUN notation from the PMC1 LDOVL definitions Fabio Estevam
2019-11-05 12:47 ` [U-Boot] [PATCH v3 4/6] mx7ulp: scg: Remove unnused scg_a7_apll_init() Fabio Estevam
2019-11-05 12:47 ` [U-Boot] [PATCH v3 5/6] mx7ulp: Sync the device tree related files Fabio Estevam
2019-11-05 12:47 ` [U-Boot] [PATCH v3 6/6] mx7ulp: Add support for Embedded Artists COM board Fabio Estevam
2019-11-12 11:30   ` Fabio Estevam
2019-11-13  4:59     ` Peng Fan
2019-11-19 19:33       ` Fabio Estevam
2019-11-21  1:37         ` Peng Fan
2019-11-21 16:56           ` Fabio Estevam

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=20191105124755.15903-1-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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