changeset 784:8bbe5c525052

* src/quicc_smc1.c (cyg_hal_smcx_init_channel): (cyg_hal_sccx_init_channel): * src/cpm.c: Include <string.h> for memset(). (_mpc8xx_reset_cpm): use CPM busy flag to check reset completion. * src/quicc_smc1.c: Include <string.h> for memset(). (cyg_hal_smcx_init_channel): Don't reset CPM here - let variant initialization do it. Only let through RX interrupts. (cyg_hal_sccx_init_channel): Ditto.
author jlarmour
date Thu, 03 Apr 2003 19:54:03 +0000
parents 33d416ad84a7
children a4d9abbbefff
files packages/hal/powerpc/quicc/current/ChangeLog packages/hal/powerpc/quicc/current/src/cpm.c packages/hal/powerpc/quicc/current/src/quicc_smc1.c
diffstat 3 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/powerpc/quicc/current/ChangeLog
+++ b/packages/hal/powerpc/quicc/current/ChangeLog
@@ -1,3 +1,15 @@
+2003-03-31  Jonathan Larmour  <jifl@eCosCentric.com>
+
+	* src/quicc_smc1.c (cyg_hal_smcx_init_channel): 
+	(cyg_hal_sccx_init_channel): 
+
+	* src/cpm.c: Include <string.h> for memset().
+	(_mpc8xx_reset_cpm): use CPM busy flag to check reset completion.
+	* src/quicc_smc1.c: Include <string.h> for memset().
+	(cyg_hal_smcx_init_channel): Don't reset CPM here - let variant
+	initialization do it. Only let through RX interrupts.
+	(cyg_hal_sccx_init_channel): Ditto.
+
 2003-03-06  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/cpm.c: Handle case where DPRAM allocation is unknown.
--- a/packages/hal/powerpc/quicc/current/src/cpm.c
+++ b/packages/hal/powerpc/quicc/current/src/cpm.c
@@ -57,6 +57,7 @@
 #include <pkgconf/hal_powerpc_quicc.h>
 #include <cyg/infra/cyg_type.h>
 #include <cyg/hal/hal_arch.h>
+#include <string.h>           // memset
 
 #ifdef CYGPKG_HAL_POWERPC_MPC860
 // eCos headers decribing PowerQUICC:
@@ -75,15 +76,15 @@ void
 _mpc8xx_reset_cpm(void)
 {
     EPPC *eppc = eppc_base();
-    int i;
     static int init_done = 0;
 
     if (init_done) return;
     init_done++;
 
     eppc->cp_cr = QUICC_CPM_CR_RESET | QUICC_CPM_CR_BUSY;
-    memset(eppc->pram, 0, 0x400);
-    for (i = 0; i < 100000; i++);
+    memset(eppc->pram, 0, sizeof(eppc->pram));
+    while (eppc->cp_cr & QUICC_CPM_CR_BUSY)
+        CYG_EMPTY_STATEMENT;
 
     *nextBd = QUICC_BD_BASE;
 }
--- a/packages/hal/powerpc/quicc/current/src/quicc_smc1.c
+++ b/packages/hal/powerpc/quicc/current/src/quicc_smc1.c
@@ -73,6 +73,7 @@
 #include <cyg/hal/hal_if.h>             // Calling interface definitions
 #include <cyg/hal/hal_misc.h>           // Helper functions
 #include <cyg/hal/drv_api.h>            // CYG_ISR_HANDLED
+#include <string.h>                     // memset
 
 #define UART_BIT_RATE(n) (((int)(CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/16)/n)
 #define UART_BAUD_RATE CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD
@@ -151,8 +152,6 @@ cyg_hal_smcx_init_channel(struct port_in
     if (info->init) return;
     info->init = 1;
 
-    _mpc8xx_reset_cpm();
-
     switch (port) {
 #if CYGNUM_HAL_QUICC_SMC1 > 0
     case QUICC_CPM_SMC1:
@@ -255,7 +254,7 @@ cyg_hal_smcx_init_channel(struct port_in
      *  (Section 16.15.7.14 and 16.15.7.15)
      */
     regs->smc_smce = 0xff;
-    regs->smc_smcm = 5;
+    regs->smc_smcm = 1; // RX interrupts only, for ctrl-c
 
     /*
      *  Set 8,n,1 characters, then also enable rx and tx.
@@ -587,8 +586,6 @@ cyg_hal_sccx_init_channel(struct port_in
     if (info->init) return;
     info->init = 1;
 
-    _mpc8xx_reset_cpm();
-
     /*
      *  Set up the Port pins for UART operation.
      */
@@ -734,8 +731,7 @@ cyg_hal_sccx_init_channel(struct port_in
      *  (Section 16.15.7.14 and 16.15.7.15)
      */
     regs->scc_scce = 0xffff;
-    regs->scc_sccm = 5;
-    regs->scc_sccm = 3;
+    regs->scc_sccm = 1; // RX interrupts only, for ctrl-c
 
     /*
      *  Set 8,n,1 characters