
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);