All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mpc83xx: retain POR values of non-configured ACR, SPCR, SCCR, and LCRR bitfields
Date: Sat, 26 Sep 2009 12:37:40 +0200	[thread overview]
Message-ID: <4ABDEEF4.8040109@denx.de> (raw)
In-Reply-To: <20090925181944.43f524e1.kim.phillips@freescale.com>

Hello Kim,

Kim Phillips wrote:
> On Tue, 15 Sep 2009 23:51:31 -0500
> Kumar Gala <galak@kernel.crashing.org> wrote:
> 
>> On Aug 27, 2009, at 3:53 PM, Kim Phillips wrote:
>>> Heiko - let's go with the SCCR approach of setting bits in the LCRR,
>>> and have board config files only specify values for fields they're
>>> modifying from the reset value for their processor (this can be
>>> extended to 85xx-world).
>> Did you guys ever come to resolution on this?  Realizing we have same  
>> issue on 85xx & 86xx (we dont actually set LCRR at all in cpu/ code  
>> for 85xx or 86xx.)
> 
> this should probably be extended to SICRH, SICRL, etc., but how's this:?
> 
>>From 15d01649e403ec7da20f5fdd25b8d2c1bccb6a8d Mon Sep 17 00:00:00 2001
> From: Kim Phillips <kim.phillips@freescale.com>
> Date: Fri, 25 Sep 2009 18:07:29 -0500
> Subject: [PATCH] mpc83xx: retain POR values of non-configured ACR, SPCR, SCCR, and LCRR bitfields
> 
> some LCRR bits are not documented throughout the 83xx family RMs.
> New board porters copying similar board configurations might omit
> setting e.g., DBYP since it was not documented in their SoC's RM.
> 
> Prevent them bricking their board by retaining power on reset values
> in bit fields that the board porter doesn't explicitly configure
> via CONFIG_SYS_<registername>_<bitfield> assignments in the board
> config file.
> 
> also start to use i/o accessors.
> 
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
>  cpu/mpc83xx/cpu_init.c        |  255 ++++++++++++++++++++++++-----------------
>  include/configs/MPC8313ERDB.h |    3 +-
>  include/configs/MPC8315ERDB.h |    3 +-
>  include/configs/MPC8323ERDB.h |    3 +-
>  include/configs/MPC832XEMDS.h |    3 +-
>  include/configs/MPC8349EMDS.h |    3 +-
>  include/configs/MPC8349ITX.h  |    3 +-
>  include/configs/MPC8360EMDS.h |    3 +-
>  include/configs/MPC8360ERDK.h |    3 +-
>  include/configs/MPC837XEMDS.h |    3 +-
>  include/configs/MPC837XERDB.h |    3 +-
>  include/configs/MVBLM7.h      |    3 +-
>  include/configs/SIMPC8313.h   |    4 +-
>  include/configs/TQM834x.h     |    3 +-
>  include/configs/kmeter1.h     |    4 +-
>  include/configs/sbc8349.h     |    3 +-
>  include/configs/vme8349.h     |    3 +-
>  17 files changed, 183 insertions(+), 122 deletions(-)
> 
> diff --git a/cpu/mpc83xx/cpu_init.c b/cpu/mpc83xx/cpu_init.c
> index 5c930d3..95dbc76 100644
> --- a/cpu/mpc83xx/cpu_init.c
> +++ b/cpu/mpc83xx/cpu_init.c
> @@ -23,8 +23,8 @@
>  #include <common.h>
>  #include <mpc83xx.h>
>  #include <ioports.h>
> -#ifdef CONFIG_USB_EHCI_FSL
>  #include <asm/io.h>
> +#ifdef CONFIG_USB_EHCI_FSL
>  #include <usb/ehci-fsl.h>
>  #endif
>  
> @@ -63,149 +63,192 @@ static void config_qe_ioports(void)
>   */
>  void cpu_init_f (volatile immap_t * im)
>  {
> -	/* Pointer is writable since we allocated a register for it */
[...]
>  
> -	/* LCRR - Clock Ratio Register (10.3.1.16) */
> -	im->lbus.lcrr = CONFIG_SYS_LCRR;
> +	/* LCRR - Clock Ratio Register (10.3.1.16)
> +	 * write, read, and isync per MPC8379ERM rev.1 CLKDEV field description
> +	 */
> +	clrsetbits_be32(&im->lbus.lcrr, lcrr_mask, lcrr_val);
> +	__raw_readl(&im->lbus.lcrr);
> +	isync();

Hmm.. shouldn;t this be done when running from RAM, as DaveLiu
suggested?

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2009-09-26 10:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25  9:05 [U-Boot] mpc83xx: update LCRR register handling Heiko Schocher
2009-08-25  9:14 ` Liu Dave-R63238
2009-08-25 11:31   ` [U-Boot] [PATCH v2] " Heiko Schocher
2009-08-25 12:19     ` Liu Dave-R63238
2009-08-25 15:39     ` Kim Phillips
2009-08-26  6:28       ` Heiko Schocher
2009-08-26 22:36         ` Kim Phillips
2009-08-27  6:20           ` [U-Boot] [PATCH v3] " Heiko Schocher
2009-08-27 11:41             ` Jerry Van Baren
2009-08-27 20:53             ` Kim Phillips
2009-09-16  4:51               ` Kumar Gala
2009-09-25 23:19                 ` [U-Boot] [PATCH] mpc83xx: retain POR values of non-configured ACR, SPCR, SCCR, and LCRR bitfields (was: Re: [PATCH v3] mpc83xx: update LCRR register handling) Kim Phillips
2009-09-26 10:37                   ` Heiko Schocher [this message]
2009-09-27  1:46                     ` [U-Boot] [PATCH] mpc83xx: retain POR values of non-configured ACR, SPCR, SCCR, and LCRR bitfields Kim Phillips
2009-09-27  1:54                       ` Kim Phillips
2009-08-27 11:11           ` [U-Boot] [PATCH v2] mpc83xx: update LCRR register handling Detlev Zundel
2009-08-27 20:49             ` Kim Phillips
2009-08-28 10:36               ` Detlev Zundel
2009-08-28 12:02                 ` Wolfgang Denk
2009-08-28 16:01                   ` Kim Phillips

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=4ABDEEF4.8040109@denx.de \
    --to=hs@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.