* [U-Boot] [PATCH] imx6: disable bandgap self-bias circuit after boot
@ 2015-01-15 3:11 Peng Fan
2015-01-15 6:55 ` Peng Fan
0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan @ 2015-01-15 3:11 UTC (permalink / raw)
To: u-boot
The self-bias circuit is used by the bandgap during startup.
Once the bandgap has stabilized, the self-bias circuit should
be disabled for best noise performance of analog blocks.
Also this bit should be disabled before the chip enters STOP mode or
when ever the regular bandgap is disabled.
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com>
---
arch/arm/cpu/armv7/mx6/soc.c | 24 ++++++++++++++++++++++++
arch/arm/include/asm/arch-mx6/crm_regs.h | 2 ++
2 files changed, 26 insertions(+)
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 5f5f497..36572c6 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -255,6 +255,23 @@ static void clear_mmdc_ch_mask(void)
writel(0, &mxc_ccm->ccdr);
}
+static void init_bandgap(void)
+{
+ struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+ /*
+ * Ensure the bandgap has stabilized.
+ */
+ while (!(readl(&mxc_ccm->ana_misc0) & 0x80))
+ ;
+ /*
+ * For best noise performance of the analog blocks using the
+ * outputs of the bandgap, the reftop_selfbiasoff bit should
+ * be set.
+ */
+ writel(BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF, &mxc_ccm->ana_misc0_set);
+}
+
+
#ifdef CONFIG_MX6SL
static void set_preclk_from_osc(void)
{
@@ -275,6 +292,13 @@ int arch_cpu_init(void)
clear_mmdc_ch_mask();
/*
+ * Disable self-bias circuit in the analog bandap.
+ * The self-bias circuit is used by the bandgap during startup.
+ * This bit should be set after the bandgap has initialized.
+ */
+ init_bandgap();
+
+ /*
* When low freq boot is enabled, ROM will not set AHB
* freq, so we need to ensure AHB freq is 132MHz in such
* scenario.
diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h b/arch/arm/include/asm/arch-mx6/crm_regs.h
index 39f3c07..0592ce0 100644
--- a/arch/arm/include/asm/arch-mx6/crm_regs.h
+++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
@@ -1063,4 +1063,6 @@ struct mxc_ccm_reg {
#define BF_ANADIG_PFD_528_PFD0_FRAC(v) \
(((v) << 0) & BM_ANADIG_PFD_528_PFD0_FRAC)
+#define BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF 0x00000008
+
#endif /*__ARCH_ARM_MACH_MX6_CCM_REGS_H__ */
--
1.8.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] imx6: disable bandgap self-bias circuit after boot
2015-01-15 3:11 [U-Boot] [PATCH] imx6: disable bandgap self-bias circuit after boot Peng Fan
@ 2015-01-15 6:55 ` Peng Fan
0 siblings, 0 replies; 2+ messages in thread
From: Peng Fan @ 2015-01-15 6:55 UTC (permalink / raw)
To: u-boot
Hi,
Please ignore this patch. Wrong patch version.
On 1/15/2015 11:11 AM, Peng Fan wrote:
> The self-bias circuit is used by the bandgap during startup.
> Once the bandgap has stabilized, the self-bias circuit should
> be disabled for best noise performance of analog blocks.
> Also this bit should be disabled before the chip enters STOP mode or
> when ever the regular bandgap is disabled.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com>
> ---
> arch/arm/cpu/armv7/mx6/soc.c | 24 ++++++++++++++++++++++++
> arch/arm/include/asm/arch-mx6/crm_regs.h | 2 ++
> 2 files changed, 26 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
> index 5f5f497..36572c6 100644
> --- a/arch/arm/cpu/armv7/mx6/soc.c
> +++ b/arch/arm/cpu/armv7/mx6/soc.c
> @@ -255,6 +255,23 @@ static void clear_mmdc_ch_mask(void)
> writel(0, &mxc_ccm->ccdr);
> }
>
> +static void init_bandgap(void)
> +{
> + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
> + /*
> + * Ensure the bandgap has stabilized.
> + */
> + while (!(readl(&mxc_ccm->ana_misc0) & 0x80))
> + ;
> + /*
> + * For best noise performance of the analog blocks using the
> + * outputs of the bandgap, the reftop_selfbiasoff bit should
> + * be set.
> + */
> + writel(BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF, &mxc_ccm->ana_misc0_set);
> +}
> +
> +
> #ifdef CONFIG_MX6SL
> static void set_preclk_from_osc(void)
> {
> @@ -275,6 +292,13 @@ int arch_cpu_init(void)
> clear_mmdc_ch_mask();
>
> /*
> + * Disable self-bias circuit in the analog bandap.
> + * The self-bias circuit is used by the bandgap during startup.
> + * This bit should be set after the bandgap has initialized.
> + */
> + init_bandgap();
> +
> + /*
> * When low freq boot is enabled, ROM will not set AHB
> * freq, so we need to ensure AHB freq is 132MHz in such
> * scenario.
> diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h b/arch/arm/include/asm/arch-mx6/crm_regs.h
> index 39f3c07..0592ce0 100644
> --- a/arch/arm/include/asm/arch-mx6/crm_regs.h
> +++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
> @@ -1063,4 +1063,6 @@ struct mxc_ccm_reg {
> #define BF_ANADIG_PFD_528_PFD0_FRAC(v) \
> (((v) << 0) & BM_ANADIG_PFD_528_PFD0_FRAC)
>
> +#define BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF 0x00000008
> +
> #endif /*__ARCH_ARM_MACH_MX6_CCM_REGS_H__ */
Regards,
Peng.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-15 6:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15 3:11 [U-Boot] [PATCH] imx6: disable bandgap self-bias circuit after boot Peng Fan
2015-01-15 6:55 ` Peng Fan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox