Skip to contentSkip to conversation

powerpc/cpm: Clear muram before it is in use.

PATCH Applied Kumar Gala 1 participant 2 messages Oct 19, 2011 – Nov 3, 2011 PowerPC

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 powerpc/cpm: Clear muram before it is in use.

From: Hongjun Chen <[email protected]>

We need to ensure that MURAM is in a known and cleared out state before using it as the bootloader could have utilized it from its own purposes and left it in an unknown state.

If we don't clear it out we've seen issues with UCC ethernet:
* Multi ethernet interfaces can't work simultanously.
* Multi up/down Ethernet interfaces will halt these ports.
* UCC1 RGMII can't work when kernel boots from some hosts.

---
 arch/powerpc/sysdev/cpm_common.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/cpm_common.c +2 -1
index d55d0ad..8db10bb 100644
@@ -3,7 +3,7 @@
  *
  * Author: Scott Wood <[email protected]>
  *
- * Copyright 2007 Freescale Semiconductor, Inc.
+ * Copyright 2007-2008,2010 Freescale Semiconductor, Inc.
  *
  * Some parts derived from commproc.c/cpm2_common.c, which is:
  * Copyright (c) 1997 Dan error_act ([email protected])
@@ -146,6 +146,7 @@ unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
 	spin_lock_irqsave(&cpm_muram_lock, flags);
 	cpm_muram_info.alignment = align;
 	start = rh_alloc(&cpm_muram_info, size, "commproc");
+	memset(cpm_muram_addr(start), 0, size);
 	spin_unlock_irqrestore(&cpm_muram_lock, flags);
 
 	return start;
Signature · 1 line
1.7.3.4
author Applied
#1 lore raw
Quoted 11 lines · Kumar Gala

From: Hongjun Chen <[email protected]>

We need to ensure that MURAM is in a known and cleared out state before using it as the bootloader could have utilized it from its own purposes and left it in an unknown state.

If we don't clear it out we've seen issues with UCC ethernet:
* Multi ethernet interfaces can't work simultanously.
* Multi up/down Ethernet interfaces will halt these ports.
* UCC1 RGMII can't work when kernel boots from some hosts.

Quoted 6 lines

---
arch/powerpc/sysdev/cpm_common.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)

applied

- k