summaryrefslogtreecommitdiff
path: root/board/netstal/hcu5/sdram.c
diff options
context:
space:
mode:
authorNiklaus Giger <niklaus.giger@netstal.com>2008-02-05 11:31:28 +0100
committerStefan Roese <sr@denx.de>2008-02-16 06:40:05 +0100
commit74973126d1be63ac75bdc192f46234dca3a7c421 (patch)
tree52e9b539ca6e6bb85d136c0cb2252e19b3306cd5 /board/netstal/hcu5/sdram.c
parent8cc10d06b833ed917a19ad358c8ebbed8bc19555 (diff)
downloadu-boot-imx-74973126d1be63ac75bdc192f46234dca3a7c421.zip
u-boot-imx-74973126d1be63ac75bdc192f46234dca3a7c421.tar.gz
u-boot-imx-74973126d1be63ac75bdc192f46234dca3a7c421.tar.bz2
ppc4xx: HCU4/5. Cleanups
- Fix some coding style violations. - Use in/out_u16/32 where appropriate. - Use register names from ppc405.h. - Fix trace useage for Lauterbach. - Remove obsolete generation HCU2. - Renamed fixed_hcu4_sdram to init_ppc405_sdram. Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
Diffstat (limited to 'board/netstal/hcu5/sdram.c')
-rw-r--r--board/netstal/hcu5/sdram.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/board/netstal/hcu5/sdram.c b/board/netstal/hcu5/sdram.c
index 5435de1..d3c2233 100644
--- a/board/netstal/hcu5/sdram.c
+++ b/board/netstal/hcu5/sdram.c
@@ -165,19 +165,25 @@ static void program_ecc(unsigned long start_address, unsigned long num_bytes)
u32 val;
char str[] = "ECC generation -";
#if defined(CONFIG_PRAM)
- u32 *magic;
-
- /* Check whether vxWorks is using EDR logging, if yes zero */
- /* also PostMortem and user reserved memory */
- magic = (u32 *)in_be32((u32 *)(start_address + num_bytes -
- (CONFIG_PRAM*1024) + sizeof(u32)));
-
- debug("\n%s: CONFIG_PRAM %d kB magic 0x%x 0x%p -> 0x%x\n", __FUNCTION__,
- CONFIG_PRAM,
- start_address + num_bytes - (CONFIG_PRAM*1024) + sizeof(u32),
- magic, in_be32(magic));
- if (in_be32(magic) == 0xbeefbabe)
- num_bytes -= (CONFIG_PRAM*1024) - PM_RESERVED_MEM;
+ u32 *magicPtr;
+ u32 magic;
+
+ if ((mfspr(dbcr0) & 0x80000000) == 0) {
+ /* only if no external debugger is alive!
+ * Check whether vxWorks is using EDR logging, if yes zero
+ * also PostMortem and user reserved memory
+ */
+ magicPtr = (u32 *)(start_address + num_bytes -
+ (CONFIG_PRAM*1024) + sizeof(u32));
+ magic = in_be32(magicPtr);
+ debug("%s: CONFIG_PRAM %d kB magic 0x%x 0x%p\n",
+ __FUNCTION__, CONFIG_PRAM,
+ magicPtr, magic);
+ if (magic == 0xbeefbabe) {
+ printf("%s: preserving at %p\n", __FUNCTION__, magicPtr);
+ num_bytes -= (CONFIG_PRAM*1024) - PM_RESERVED_MEM;
+ }
+ }
#endif
sync();