From: Ira Snyder <iws@ovro.caltech.edu>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Freescale MPC8349EMDS BCSR corruption
Date: Wed, 23 Jul 2008 10:25:28 -0700 [thread overview]
Message-ID: <20080723172527.GG8342@ovro.caltech.edu> (raw)
In-Reply-To: <1216793802.3656.8.camel@localhost.localdomain>
On Wed, Jul 23, 2008 at 02:16:42PM +0800, Dave Liu wrote:
>
> I believe it is timing issue.
> The BCSR read(#LOE) has not enough setup time.
> You may try the two solutions:
> (a) slow down local bus clock
> If you are using default configuration, the local bus clock is
> 66MHz. change the LCRR from div 4 to div 8 to make the local bus clock
> as 33MHz. you can find it in the MPC8349EMDS.h
>
> (b) Tuning the #CS1 timing, such as
> change the OR1 from 0xFFFFE8F0 to 0xFFFFE9F7
>
> Let us know the result.
>
I tried both changes, one at a time and both together. None of the
combinations helped.
I've attached a patch which demonstrates that the BCSR 0 value changes
with a write to the flash. The patch has Timur's i2c patch rolled in,
since it has not hit mainline yet. The modification to lib_ppc/board.c
writes the hard reset value back to BCSR 0, which makes the serial port
and ethernet start working again.
Here is the output of U-Boot head + the attached patch:
==========================================================================
U-Boot 1.3.4-rc1-00014-gcacee6b-dirty (Jul 23 2008 - 10:11:52) MPC83XX
Reset Status: Software Hard, External/Internal Soft, External/Internal
Hard
CPU: e300c1, MPC8349E, Rev: 1.1 at 528 MHz, CSB: 264 MHz
Board: Freescale MPC8349EMDS
I2C: ready
SPI: ready
DRAM: 256 MB (DDR1, 64-bit, ECC off, 264 MHz)
FLASH:
BCSR READ1 2f
BCSR READ2 f0
BCSR READ1 ff
BCSR READ2 f0
BCSR READ1 ff
BCSR READ2 00
8 MB
In: serial
Out: serial
Err: serial
Net: TSEC0, TSEC1
BCSR FIXUP: was 00 now 2f
Type "run flash_nfs" to mount root filesystem over NFS
Hit any key to stop autoboot: 0
Thanks for the help,
Ira
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 9f2c1ec..9d5df8a 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -143,12 +143,15 @@ void
i2c_init(int speed, int slaveadd)
{
struct fsl_i2c *dev;
+ unsigned int temp;
dev = (struct fsl_i2c *) (CFG_IMMR + CFG_I2C_OFFSET);
writeb(0, &dev->cr); /* stop I2C controller */
udelay(5); /* let it shutdown in peace */
- i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
+ temp = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
+ if (gd->flags & GD_FLG_RELOC)
+ i2c_bus_speed[0] = temp;
writeb(slaveadd << 1, &dev->adr); /* write slave address */
writeb(0x0, &dev->sr); /* clear status register */
writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
@@ -158,7 +161,9 @@ i2c_init(int speed, int slaveadd)
writeb(0, &dev->cr); /* stop I2C controller */
udelay(5); /* let it shutdown in peace */
- i2c_bus_speed[1] = set_i2c_bus_speed(dev, gd->i2c2_clk, speed);
+ temp = set_i2c_bus_speed(dev, gd->i2c2_clk, speed);
+ if (gd->flags & GD_FLG_RELOC)
+ i2c_bus_speed[1] = temp;
writeb(slaveadd << 1, &dev->adr); /* write slave address */
writeb(0x0, &dev->sr); /* clear status register */
writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 12647ef..12c794e 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1617,7 +1617,11 @@ static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry)
/* We do not yet know what kind of commandset to use, so we issue
the reset command in both Intel and AMD variants, in the hope
that AMD flash roms ignore the Intel command. */
+ printf("\nBCSR READ1 %.2x\n", readb(CFG_BCSR));
+ udelay(1000);
flash_write_cmd (info, 0, 0, AMD_CMD_RESET);
+ printf("BCSR READ2 %.2x\n", readb(CFG_BCSR));
+ udelay(1000);
flash_write_cmd (info, 0, 0, FLASH_CMD_RESET);
for (cfi_offset=0;
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 71a70db..1f10a0d 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -26,6 +26,7 @@
#include <command.h>
#include <malloc.h>
#include <devices.h>
+#include <asm/io.h>
#ifdef CONFIG_8xx
#include <mpc8xx.h>
#endif
@@ -1179,6 +1180,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
}
#endif
+ printf("BCSR FIXUP: was %.2x now 2f\n", readb(CFG_BCSR));
+ writeb(0x2f, CFG_BCSR);
+
/* Initialization complete - start the monitor */
/* main_loop() can return to retry autoboot, if so just run it again. */
next prev parent reply other threads:[~2008-07-23 17:25 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 22:28 [U-Boot-Users] Freescale MPC8349EMDS hang on boot Ira Snyder
2008-07-17 21:54 ` Kim Phillips
2008-07-17 22:50 ` Ira Snyder
2008-07-18 11:59 ` Jerry Van Baren
2008-07-18 17:28 ` Ira Snyder
2008-07-18 18:17 ` Jerry Van Baren
2008-07-18 19:24 ` Ira Snyder
2008-07-18 19:57 ` Jerry Van Baren
2008-07-19 1:52 ` David Hawkins
2008-07-19 5:32 ` Timur Tabi
2008-07-19 17:17 ` David Hawkins
2008-07-19 17:49 ` [U-Boot-Users] RFQ: disable flash writes until after relocation? David Hawkins
2008-07-20 20:07 ` Wolfgang Denk
2008-07-21 15:48 ` Timur Tabi
2008-07-21 17:46 ` David Hawkins
2008-07-21 18:43 ` Timur Tabi
2008-07-21 18:33 ` Wolfgang Denk
2008-07-21 17:22 ` David Hawkins
2008-07-21 11:58 ` Jerry Van Baren
2008-07-21 17:36 ` David Hawkins
2008-07-21 17:56 ` Jerry Van Baren
2008-07-21 18:45 ` David Hawkins
2008-07-22 23:14 ` [U-Boot-Users] Freescale MPC8349EMDS BCSR corruption David Hawkins
2008-07-23 6:16 ` Dave Liu
2008-07-23 6:34 ` Dave Liu
2008-07-23 17:25 ` Ira Snyder [this message]
2008-07-29 1:36 ` David Hawkins
2008-07-29 3:42 ` David Hawkins
2008-10-08 3:50 ` [U-Boot] " David Hawkins
2008-10-09 5:46 ` Liu Dave-R63238
2008-07-17 23:18 ` [U-Boot-Users] Freescale MPC8349EMDS hang on boot Ira Snyder
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=20080723172527.GG8342@ovro.caltech.edu \
--to=iws@ovro.caltech.edu \
--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