From: Gary Jennejohn <garyj@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2] 8xx: prevent a machine check in scc_init().
Date: Thu, 18 Sep 2008 13:52:24 +0200 [thread overview]
Message-ID: <20080918135224.3ad21fd6@peedub.jennejohn.org> (raw)
In-Reply-To: <20080914114924.0090d95c@peedub.jennejohn.org>
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 <garyj@denx.de>
---
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
*********************************************************************
next prev parent reply other threads:[~2008-09-18 11:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-14 9:49 [U-Boot] [PATCH] 8xx: prevent a machine check in scc_init() Gary Jennejohn
2008-09-14 17:07 ` Wolfgang Denk
2008-09-15 8:59 ` Gary Jennejohn
2008-09-15 10:58 ` Wolfgang Denk
2008-09-18 11:52 ` Gary Jennejohn [this message]
2008-09-22 20:26 ` [U-Boot] [PATCH V2] " Wolfgang Denk
2008-09-26 5:29 ` Ben Warren
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=20080918135224.3ad21fd6@peedub.jennejohn.org \
--to=garyj@denx.de \
--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