All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/14] powerpc, timer: Does 8xx specific actions in 8xx cpu_init
Date: Wed, 12 Jul 2017 11:43:22 +0200 (CEST)	[thread overview]
Message-ID: <6b0a0000351dbc49db9b84cbd91193472bd081c0.1499629706.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1499629706.git.christophe.leroy@c-s.fr>

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/cpu/mpc8xx/cpu_init.c |  5 ++++-
 arch/powerpc/lib/time.c            | 11 -----------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c b/arch/powerpc/cpu/mpc8xx/cpu_init.c
index 16e7bf5fd5..dc601a1297 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c
@@ -38,7 +38,10 @@ void cpu_init_f(immap_t __iomem *immr)
 	/* unlock TBSCRK */
 
 	out_be32(&immr->im_sitk.sitk_tbscrk, KAPWR_KEY);
-	out_be16(&immr->im_sit.sit_tbscr, CONFIG_SYS_TBSCR);
+	out_be16(&immr->im_sit.sit_tbscr, CONFIG_SYS_TBSCR | TBSCR_TBE);
+
+	/* Unlock timebase register */
+	out_be32(&immr->im_sitk.sitk_tbk, KAPWR_KEY);
 
 	/* initialize the PIT (11-31) */
 
diff --git a/arch/powerpc/lib/time.c b/arch/powerpc/lib/time.c
index 41a271a42d..ff9bb67e28 100644
--- a/arch/powerpc/lib/time.c
+++ b/arch/powerpc/lib/time.c
@@ -65,21 +65,10 @@ int timer_init(void)
 {
 	unsigned long temp;
 
-#if defined(CONFIG_8xx)
-	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
-
-	/* unlock */
-	out_be32(&immap->im_sitk.sitk_tbk, KAPWR_KEY);
-#endif
-
 	/* reset */
 	asm volatile("li %0,0 ; mttbu %0 ; mttbl %0;"
 	     : "=&r"(temp) );
 
-#if defined(CONFIG_8xx)
-	/* enable */
-	setbits_be16(&immap->im_sit.sit_tbscr, TBSCR_TBE);
-#endif
 	return (0);
 }
 /* ------------------------------------------------------------------------- */
-- 
2.12.0

  parent reply	other threads:[~2017-07-12  9:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12  9:43 [U-Boot] [PATCH 00/14] Cleanup for 8xx and other misc powerpc Christophe Leroy
2017-07-12  9:43 ` [U-Boot] [PATCH 01/14] powerpc, 8xx: Simplify brgclk calculation and remove get_brgclk() Christophe Leroy
2017-07-12 12:52   ` Wolfgang Denk
2017-07-13 13:12     ` Christophe LEROY
2017-07-12  9:43 ` [U-Boot] [PATCH 02/14] powerpc: get rid of addr_probe() Christophe Leroy
2017-07-12 12:56   ` Wolfgang Denk
2017-07-12  9:43 ` Christophe Leroy [this message]
2017-07-12  9:43 ` [U-Boot] [PATCH 04/14] power, timer: reset TBL before TBU Christophe Leroy
2017-07-12 13:00   ` Wolfgang Denk
2017-07-12  9:43 ` [U-Boot] [PATCH 05/14] powerpc: move set_msr() and get_msr() into .h Christophe Leroy
2017-07-12 13:03   ` Wolfgang Denk
2017-07-12  9:43 ` [U-Boot] [PATCH 06/14] powerpc: Remove unneccessary #ifdefs in reginfo Christophe Leroy
2017-07-12 13:07   ` Wolfgang Denk
2017-07-12 14:28     ` Christophe LEROY
2017-07-12 14:53       ` Wolfgang Denk
2017-07-12 19:56         ` Tom Rini
2017-07-13 13:15           ` Christophe LEROY
2017-07-12  9:43 ` [U-Boot] [PATCH 07/14] Convert CONFIG_CMD_REGINFO to Kconfig Christophe Leroy
2017-07-12 13:11   ` Wolfgang Denk
2017-07-12  9:43 ` [U-Boot] [PATCH 08/14] powerpc, 8xx: Simplifying check_CPU() Christophe Leroy
2017-07-12  9:43 ` [U-Boot] [PATCH 09/14] powerpc, 8xx: Move cache function into C files Christophe Leroy
2017-07-12  9:43 ` [U-Boot] [PATCH 10/14] powerpc, 8xx: move get_immr() into C Christophe Leroy
2017-07-12  9:43 ` [U-Boot] [PATCH 11/14] powerpc, 8xx: move cache helper " Christophe Leroy
2017-07-12  9:43 ` [U-Boot] [PATCH 12/14] powerpc: move get_pvr() and get_svr() " Christophe Leroy
2017-07-12  9:43 ` [U-Boot] [PATCH 13/14] powerpc, 8xx: fix missing function declarations Christophe Leroy
2017-07-12  9:43 ` [U-Boot] [PATCH 14/14] powerpc: Remove 8260 remainders Christophe Leroy
2017-07-12 19:56 ` [U-Boot] [PATCH 00/14] Cleanup for 8xx and other misc powerpc Tom Rini
2017-07-13 13:12   ` Christophe LEROY

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=6b0a0000351dbc49db9b84cbd91193472bd081c0.1499629706.git.christophe.leroy@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --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.