# HG changeset patch # User gthomas # Date 1047004497 0 # Node ID 515a36c8eb9d6b0ebdfae6fe22cb3b72f957b351 # Parent c16ef62116ec2c7a9a7e3c091989f425a410b4d0 Improve handling of CPM/DPRAM aloocation. diff --git a/packages/hal/powerpc/mpc8xx/current/ChangeLog b/packages/hal/powerpc/mpc8xx/current/ChangeLog --- a/packages/hal/powerpc/mpc8xx/current/ChangeLog +++ b/packages/hal/powerpc/mpc8xx/current/ChangeLog @@ -1,3 +1,7 @@ +2003-03-06 Gary Thomas + + * src/var_misc.c: Can only reset CPM if not relying on a ROM monitor. + 2003-03-05 Gary Thomas * src/var_misc.c (hal_variant_init): Reset CPM - always. diff --git a/packages/hal/powerpc/mpc8xx/current/src/var_misc.c b/packages/hal/powerpc/mpc8xx/current/src/var_misc.c --- a/packages/hal/powerpc/mpc8xx/current/src/var_misc.c +++ b/packages/hal/powerpc/mpc8xx/current/src/var_misc.c @@ -73,11 +73,10 @@ hal_variant_init(void) CYGARC_MTSPR (ICTRL, ictrl); } - // Note: it would be nice to only do this in the ROM/monitor. However, - // "new" programs which rely on that happening would break if the monitor - // environment does not handle this properly. +#ifndef CYGSEM_HAL_USE_ROM_MONITOR // Reset CPM _mpc8xx_reset_cpm(); +#endif } //-------------------------------------------------------------------------- diff --git a/packages/hal/powerpc/quicc/current/ChangeLog b/packages/hal/powerpc/quicc/current/ChangeLog --- a/packages/hal/powerpc/quicc/current/ChangeLog +++ b/packages/hal/powerpc/quicc/current/ChangeLog @@ -1,3 +1,9 @@ +2003-03-06 Gary Thomas + + * src/cpm.c: Handle case where DPRAM allocation is unknown. + + * include/ppc8xx.h: Define limits of CPM/DPRAM space. + 2003-03-05 Gary Thomas * src/quicc_smc1.c: Need to flush data cache because the serial diff --git a/packages/hal/powerpc/quicc/current/include/ppc8xx.h b/packages/hal/powerpc/quicc/current/include/ppc8xx.h --- a/packages/hal/powerpc/quicc/current/include/ppc8xx.h +++ b/packages/hal/powerpc/quicc/current/include/ppc8xx.h @@ -943,6 +943,7 @@ static inline EPPC *eppc_base(void) __externC unsigned short _mpc8xx_allocBd(int len); #define QUICC_BD_BASE 0x2000 // Start of shared memory +#define QUICC_BD_END 0x3000 // End of shared memory #endif /* __ASSEMBLER__ */ diff --git a/packages/hal/powerpc/quicc/current/src/cpm.c b/packages/hal/powerpc/quicc/current/src/cpm.c --- a/packages/hal/powerpc/quicc/current/src/cpm.c +++ b/packages/hal/powerpc/quicc/current/src/cpm.c @@ -96,8 +96,13 @@ void unsigned short _mpc8xx_allocBd(int len) { - unsigned short bd = *nextBd; + unsigned short bd; + bd = *nextBd; + if ((bd < QUICC_BD_BASE) || (bd > QUICC_BD_END)) { + // Most likely not set up :-( + bd = *nextBd = QUICC_BD_BASE; + } len = (len + 7) & ~7; // Multiple of 8 bytes *nextBd += len; return bd;