All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/8] mpc512x: optionally configure DIU, LPC and NFC deviders
Date: Fri,  8 Feb 2013 11:03:46 +0100	[thread overview]
Message-ID: <1360317830-28525-5-git-send-email-agust@denx.de> (raw)
In-Reply-To: <1360317830-28525-1-git-send-email-agust@denx.de>

If a board config file defines DIU, LPC and NFC deviders,
configure them in the SCFR1 register.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 arch/powerpc/cpu/mpc512x/cpu_init.c   |   15 +++++++++++++++
 arch/powerpc/include/asm/immap_512x.h |    6 ++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/cpu/mpc512x/cpu_init.c b/arch/powerpc/cpu/mpc512x/cpu_init.c
index 3b29ee1..0df2888 100644
--- a/arch/powerpc/cpu/mpc512x/cpu_init.c
+++ b/arch/powerpc/cpu/mpc512x/cpu_init.c
@@ -172,6 +172,21 @@ void cpu_init_f (volatile immap_t * im)
 	ips_div |= SCFR1_IPS_DIV << SCFR1_IPS_DIV_SHIFT;
 	out_be32(&im->clk.scfr[0], ips_div);
 
+#ifdef SCFR1_LPC_DIV
+	clrsetbits_be32(&im->clk.scfr[0], SCFR1_LPC_DIV_MASK,
+			SCFR1_LPC_DIV << SCFR1_LPC_DIV_SHIFT);
+#endif
+
+#ifdef SCFR1_NFC_DIV
+	clrsetbits_be32(&im->clk.scfr[0], SCFR1_NFC_DIV_MASK,
+			SCFR1_NFC_DIV << SCFR1_NFC_DIV_SHIFT);
+#endif
+
+#ifdef SCFR1_DIU_DIV
+	clrsetbits_be32(&im->clk.scfr[0], SCFR1_DIU_DIV_MASK,
+			SCFR1_DIU_DIV << SCFR1_DIU_DIV_SHIFT);
+#endif
+
 	/*
 	 * Enable Time Base/Decrementer
 	 *
diff --git a/arch/powerpc/include/asm/immap_512x.h b/arch/powerpc/include/asm/immap_512x.h
index f763a54..157e6b8 100644
--- a/arch/powerpc/include/asm/immap_512x.h
+++ b/arch/powerpc/include/asm/immap_512x.h
@@ -238,6 +238,12 @@ typedef struct clk512x {
 #define SCFR1_LPC_DIV_MASK	0x00003800
 #define SCFR1_LPC_DIV_SHIFT	11
 
+#define SCFR1_NFC_DIV_MASK	0x00000700
+#define SCFR1_NFC_DIV_SHIFT	8
+
+#define SCFR1_DIU_DIV_MASK	0x000000FF
+#define SCFR1_DIU_DIV_SHIFT	0
+
 /* SCFR2 System Clock Frequency Register 2 */
 #define SCFR2_SYS_DIV		0xFC000000
 #define SCFR2_SYS_DIV_SHIFT	26
-- 
1.7.5.4

  parent reply	other threads:[~2013-02-08 10:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 10:03 [U-Boot] [PATCH 0/8] mpc512x updates for current merge window Anatolij Gustschin
2013-02-08 10:03 ` [U-Boot] [PATCH 1/8] mpc512x: add common LAW and Chip Select configuration Anatolij Gustschin
2013-03-09 13:45   ` Wolfgang Denk
2013-02-08 10:03 ` [U-Boot] [PATCH 2/8] mpc512x: use common code for CSx configuration Anatolij Gustschin
2013-03-09 13:45   ` Wolfgang Denk
2013-02-08 10:03 ` [U-Boot] [PATCH 3/8] mpc512x: use common code for clock setting for all mpc512x boards Anatolij Gustschin
2013-03-09 13:46   ` Wolfgang Denk
2013-02-08 10:03 ` Anatolij Gustschin [this message]
2013-03-09 13:46   ` [U-Boot] [PATCH 4/8] mpc512x: optionally configure DIU, LPC and NFC deviders Wolfgang Denk
2013-02-08 10:03 ` [U-Boot] [PATCH 5/8] mpc512x: allow configuring board specific IPS divider Anatolij Gustschin
2013-03-09 13:46   ` Wolfgang Denk
2013-02-08 10:03 ` [U-Boot] [PATCH 6/8] mpc512x: add ifm ac14xx board Anatolij Gustschin
2013-03-09 13:46   ` Wolfgang Denk
2013-02-08 10:03 ` [U-Boot] [PATCH 7/8] mpc512x: Adjust the DRAM init sequence to the datasheet spec Anatolij Gustschin
2013-03-09 13:46   ` Wolfgang Denk
2013-02-08 10:03 ` [U-Boot] [PATCH 8/8] mpc512x: pdm360ng: drop not needed memory node fixup Anatolij Gustschin
2013-03-09 13:46   ` Wolfgang Denk

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=1360317830-28525-5-git-send-email-agust@denx.de \
    --to=agust@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.