From: Gary Jennejohn Date: Thu, 18 Sep 2008 13:52:24 +0200 Subject: [U-Boot] [PATCH V2] 8xx: prevent a machine check in scc_init(). In-Reply-To: <20080914114924.0090d95c@peedub.jennejohn.org> References: <20080914114924.0090d95c@peedub.jennejohn.org> Message-ID: <20080918135224.3ad21fd6@peedub.jennejohn.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Without this change DPRAM can be exhausted when CFG_ALLOC_DPRAM is defined, which eventually leads to a machine check. This change assures that DPRAM is allocated only once in that case. Signed-off-by: Gary Jennejohn --- cpu/mpc8xx/scc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/cpu/mpc8xx/scc.c b/cpu/mpc8xx/scc.c index 09a3db1..d91289a 100644 --- a/cpu/mpc8xx/scc.c +++ b/cpu/mpc8xx/scc.c @@ -216,7 +216,9 @@ static int scc_init (struct eth_device *dev, bd_t * bis) txIdx = 0; #ifdef CFG_ALLOC_DPRAM - rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + + /* Avoid exhausting DPRAM. */ + if (rtx == NULL) + rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + dpram_alloc_align (sizeof (RTXBD), 8)); #else rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + CPM_SCC_BASE); -- 1.5.4.3 --- Gary Jennejohn ********************************************************************* DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de *********************************************************************