public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Kim Phillips <kim.phillips@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] MPC8308ERDB: minimal support for devboard from Freescale
Date: Mon, 19 Jul 2010 19:33:56 -0500	[thread overview]
Message-ID: <20100719193356.a02add7e.kim.phillips@freescale.com> (raw)
In-Reply-To: <20100624190054.847e4452.kim.phillips@freescale.com>

On Thu, 24 Jun 2010 19:00:54 -0500
Kim Phillips <kim.phillips@freescale.com> wrote:

> On Thu, 24 Jun 2010 23:36:49 +0400
> Ilya Yanok <yanok@emcraft.com> wrote:
> 
> > Hi Kim,
> > 
> > On 24.06.2010 22:00, Kim Phillips wrote:
> > >> I've enabled icache and now the board sometimes resets twice after
> > >> U-Boot 'reset' command:
> > >>      
> > >    
> > >> (It doesn't always stop at "DRAM:" line but that position is most frequent)
> > >> Maybe you have some ideas on this subject?
> > >>      
> > > hmm, if it's only on soft-resets, can you try adding
> > > HID0_ENABLE_INSTRUCTION_CACHE to CONFIG_SYS_HID0_INIT in addition to
> > > _FINAL?  Some cache state is preserved over a soft-reset...
> > >    
> > 
> > Thanks for your advice but this doesn't help...

turning icache on early causes a different pattern of bus accesses when
fetching code, and this might trigger bus accesses that interfere with
code that sets bus configuration registers, such as the acr.  Can you
test this patch please?:

diff --git a/arch/powerpc/cpu/mpc83xx/Makefile b/arch/powerpc/cpu/mpc83xx/Makefile
index 15e2c18..613625d 100644
--- a/arch/powerpc/cpu/mpc83xx/Makefile
+++ b/arch/powerpc/cpu/mpc83xx/Makefile
@@ -36,6 +36,7 @@ COBJS-y += speed.o
 COBJS-y += interrupts.o
 COBJS-y += spd_sdram.o
 COBJS-y += ecc.o
+COBJS-y += acr.o
 COBJS-$(CONFIG_QE) += qe_io.o
 COBJS-$(CONFIG_FSL_SERDES) += serdes.o
 COBJS-$(CONFIG_PCI) += pci.o
diff --git a/arch/powerpc/cpu/mpc83xx/acr.c b/arch/powerpc/cpu/mpc83xx/acr.c
new file mode 100644
index 0000000..20315fc
--- /dev/null
+++ b/arch/powerpc/cpu/mpc83xx/acr.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2010 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+
+void single_cline_write(volatile void *addr, __be32 val)
+{
+	out_be32(addr, val);
+}
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 83cba93..237fa48 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -30,6 +30,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+extern void single_cline_write(volatile void *addr, __be32 val);
+
 #ifdef CONFIG_QE
 extern qe_iop_conf_t qe_iop_conf_tab[];
 extern void qe_config_iopin(u8 port, u8 pin, int dir,
@@ -63,6 +65,7 @@ static void config_qe_ioports(void)
  */
 void cpu_init_f (volatile immap_t * im)
 {
+	__be32 val;
 	__be32 acr_mask =
 #ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
 		ACR_PIPE_DEP |
@@ -213,7 +216,8 @@ void cpu_init_f (volatile immap_t * im)
 	memset ((void *) gd, 0, sizeof (gd_t));
 
 	/* system performance tweaking */
-	clrsetbits_be32(&im->arbiter.acr, acr_mask, acr_val);
+	val = __raw_readl(&im->arbiter.acr);
+	single_cline_write(&im->arbiter.acr, acr_val & (val & ~acr_mask));
 
 	clrsetbits_be32(&im->sysconf.spcr, spcr_mask, spcr_val);
 
diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds b/arch/powerpc/cpu/mpc83xx/u-boot.lds
index 0b74a13..f01c462 100644
--- a/arch/powerpc/cpu/mpc83xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds
@@ -51,6 +51,8 @@ SECTIONS
   .text      :
   {
     arch/powerpc/cpu/mpc83xx/start.o	(.text)
+    . = ALIGN(32);
+    arch/powerpc/cpu/mpc83xx/acr.o 	(.text)
     *(.text)
     *(.got1)
     . = ALIGN(16);

Thanks,

Kim

  parent reply	other threads:[~2010-07-20  0:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-20 17:32 [U-Boot] [PATCH 0/2] Support for MPC8308ERDB board Ilya Yanok
2010-06-20 17:32 ` [U-Boot] [PATCH 1/2] mpc8308: support for Freescale MPC8308 cpu Ilya Yanok
2010-06-21  7:44   ` Wolfgang Denk
2010-06-21 11:41     ` Ilya Yanok
2010-06-22 16:11       ` Wolfgang Denk
2010-06-28 12:44         ` Ilya Yanok
2010-07-09 21:13           ` Kim Phillips
2010-06-20 17:32 ` [U-Boot] [PATCH 2/2] MPC8308ERDB: minimal support for devboard from Freescale Ilya Yanok
2010-06-21  7:44   ` Wolfgang Denk
2010-06-21 12:25     ` Ilya Yanok
2010-06-22 18:14       ` Wolfgang Denk
2010-06-22 19:10         ` Ben Warren
2010-06-23 12:01           ` Ilya Yanok
2010-06-23 11:57         ` Ilya Yanok
2010-06-23  0:17   ` Kim Phillips
2010-06-23 21:30     ` Ilya Yanok
2010-06-23 22:08       ` Wolfgang Denk
2010-06-24 15:59     ` Ilya Yanok
2010-06-24 18:00       ` Kim Phillips
2010-06-24 19:36         ` Ilya Yanok
2010-06-25  1:25           ` Aggrwal Poonam-B10812
     [not found]           ` <20100624190054.847e4452.kim.phillips@freescale.com>
2010-07-20  0:33             ` Kim Phillips [this message]
2010-07-20  5:46               ` Wolfgang Denk
2010-07-20 15:08               ` Ilya Yanok
2010-08-10 16:32               ` [U-Boot] [PATCH 2/2] MPC8308ERDB: minimal support for devboard from Freescale (ICache issue) Ilya Yanok
2010-06-28 12:45     ` [U-Boot] [PATCH 2/2] MPC8308ERDB: minimal support for devboard from Freescale Ilya Yanok
2010-07-01  0:30       ` Kim Phillips
2010-07-01  9:13         ` Ilya Yanok
2010-07-07 16:16           ` [U-Boot] [PATCH 2/2] MPC8308RDB: " Ilya Yanok
2010-07-09 21:14             ` 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=20100719193356.a02add7e.kim.phillips@freescale.com \
    --to=kim.phillips@freescale.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