changeset 889:846508c7777d

* 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 Mon, 31 Mar 2003 15:27:50 +0000
parents 237e9c388bd6
children 069fba224505
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-23  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/quicc_smc1.c: Use new baud rate generator allocation functions.
--- a/packages/hal/powerpc/quicc/current/src/cpm.c
+++ b/packages/hal/powerpc/quicc/current/src/cpm.c
@@ -58,6 +58,7 @@
 #include <cyg/infra/cyg_type.h>
 #include <cyg/infra/cyg_ass.h>
 #include <cyg/hal/hal_arch.h>
+#include <string.h>           // memset
 
 // eCos headers decribing PowerQUICC:
 #include <cyg/hal/quicc/ppc8xx.h>
@@ -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
@@ -71,6 +71,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
@@ -144,8 +145,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:
@@ -239,7 +238,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.
@@ -571,8 +570,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.
      */
@@ -703,8 +700,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