From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19409 invoked by alias); 31 Mar 2003 15:41:27 -0000 Mailing-List: contact ecos-maintainers-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: ecos-maintainers-owner@sources.redhat.com Received: (qmail 19381 invoked from network); 31 Mar 2003 15:41:26 -0000 Message-ID: <3E88619F.3050104@eCosCentric.com> Date: Mon, 31 Mar 2003 15:41:00 -0000 From: Jonathan Larmour User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.3) Gecko/20030314 X-Accept-Language: en-gb, en, en-us MIME-Version: 1.0 To: eCos Maintainers Subject: [Fwd: Re: [APPROVE?] Fix spurious interrupt on mpc8xx] Content-Type: multipart/mixed; boundary="------------090605010504080301060209" X-SW-Source: 2003-03/txt/msg00088.txt.bz2 This is a multi-part message in MIME format. --------------090605010504080301060209 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 762 a) A brief name by which we can all refer to the patch. quicc.pat b) A description of what the patch achieves or the problem which it addresses. No more than a few sentences. As discussed just now on ecos-patches as per attached, the attached patch fixes spurious interrupts with serial on all quicc based targets when debugging over serial via GDB. c) A rationale for including the patch in the 2.0 final release. quicc-based targets will otherwise not be able to debug over serial when asserts are enabled. It is limited to quiccs. Jifl -- eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts --[ "You can complain because roses have thorns, or you ]-- --[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine --------------090605010504080301060209 Content-Type: text/plain; name="quicc.pat" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="quicc.pat" Content-length: 3500 Index: src/cpm.c =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/powerpc/quicc/current/src/cpm.c,v retrieving revision 1.3.2.1 diff -u -5 -p -r1.3.2.1 cpm.c --- src/cpm.c 20 Mar 2003 18:49:10 -0000 1.3.2.1 +++ src/cpm.c 31 Mar 2003 15:33:01 -0000 @@ -55,10 +55,11 @@ #include #include #include #include +#include // memset #ifdef CYGPKG_HAL_POWERPC_MPC860 // eCos headers decribing PowerQUICC: #include @@ -73,19 +74,19 @@ static short *nextBd = (short *)(CYGHWR_ 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; } // Index: src/quicc_smc1.c =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/powerpc/quicc/current/src/quicc_smc1.c,v retrieving revision 1.23.2.1 diff -u -5 -p -r1.23.2.1 quicc_smc1.c --- src/quicc_smc1.c 20 Mar 2003 18:49:10 -0000 1.23.2.1 +++ src/quicc_smc1.c 31 Mar 2003 15:33:01 -0000 @@ -71,10 +71,11 @@ #include // target_register_t #include // HAL_INTERRUPT_UNMASK(...) #include // Calling interface definitions #include // Helper functions #include // CYG_ISR_HANDLED +#include // 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 // Note: buffers will be placed just after descriptors @@ -149,12 +150,10 @@ cyg_hal_smcx_init_channel(struct port_in struct cp_bufdesc *txbd, *rxbd; if (info->init) return; info->init = 1; - _mpc8xx_reset_cpm(); - switch (port) { #if CYGNUM_HAL_QUICC_SMC1 > 0 case QUICC_CPM_SMC1: /* * Set up the PortB pins for UART operation. @@ -253,11 +252,11 @@ cyg_hal_smcx_init_channel(struct port_in /* * Clear any previous events. Mask interrupts. * (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. * (Section 16.15.7.11) */ @@ -585,12 +584,10 @@ cyg_hal_sccx_init_channel(struct port_in struct cp_bufdesc *txbd, *rxbd; if (info->init) return; info->init = 1; - _mpc8xx_reset_cpm(); - /* * Set up the Port pins for UART operation. */ switch (port) { #if CYGNUM_HAL_QUICC_SCC1 > 0 @@ -732,12 +729,11 @@ cyg_hal_sccx_init_channel(struct port_in /* * Clear any previous events. Mask interrupts. * (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 */ regs->scc_psmr = (3<<12); --------------090605010504080301060209 Content-Type: message/rfc822; name="Re: [APPROVE?] Fix spurious interrupt on mpc8xx" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Re: [APPROVE?] Fix spurious interrupt on mpc8xx" Content-length: 3263 Return-Path: Delivered-To: jifl@ecoscentric.com Received: from hermes.chez-thomas.org (hermes.chez-thomas.org [63.225.98.241]) by jifvik.dyndns.org (Postfix) with ESMTP id 1B058387ED for ; Mon, 31 Mar 2003 16:03:11 +0100 (BST) Received: from localhost.localdomain (localhost [127.0.0.1]) by hermes.chez-thomas.org (Postfix) with ESMTP id 7517A50DA72; Mon, 31 Mar 2003 08:03:09 -0700 (MST) Subject: Re: [APPROVE?] Fix spurious interrupt on mpc8xx From: Gary Thomas To: Jonathan Larmour Cc: eCos Patches List In-Reply-To: <3E88555E.2000706@eCosCentric.com> References: <3E87DCD8.6000307@eCosCentric.com> <1049110036.16195.44.camel@hermes.chez-thomas.org> <3E88555E.2000706@eCosCentric.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 (1.0.3-4) Date: 31 Mar 2003 08:03:09 -0700 Message-Id: <1049122989.16212.661.camel@hermes.chez-thomas.org> Mime-Version: 1.0 X-Spam-Status: No, hits=-35.6 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_LONG_DENSE, USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Content-length: 1940 On Mon, 2003-03-31 at 07:49, Jonathan Larmour wrote: > Gary Thomas wrote: > > On Sun, 2003-03-30 at 23:14, Jonathan Larmour wrote: > > > >>The attached patch fixes a spurious interrupt with asserts enabled when > >>using the serial port on viper. It also does some very minor cleanups. > >> > >>I haven't checked it in to the trunk, just in case there's some other > >>reasoning for the way things was that I've missed (although I doubt it), > >>but if it's okay, I would also like approval for the 2.0 branch. > >> > > > > > > I think that these are fine, although the removal of the call to > > CPM_reset is a no-op (it should be done by the variant code and > > then only once, so it has no real effect except for documentation). > > But if someone does CLAIM_COMMS in a RAM loaded app, these channels will > then be included, and it will run again, and have side effects on things > other than the channels you're using. > > > BTW I've yet to see the spurious interrupt that you are chasing when > > using a newer RedBoot (probably even one built from the current branch). > > Yep, was still doing it from the trunk as well as branch as at the end of > last week. From what was needed to fix, AFAIK you should just need asserts > enabled and to load and run over serial explicitly. The serial TX of > talking to GDB is what makes it generate the TX interrupt, which the isr > in the driver will (rightly) return 0 for. > > Okay for 2.0 branch explicitly? Actually, I'm fine with those changes on the trunk as well. I was just bantering about them :-) -- ------------------------------------------------------------ Gary Thomas | MLB Associates | Consulting for the +1 (970) 229-1963 | Embedded world http://www.mlbassoc.com/ | email: | gpg: http://www.chez-thomas.org/gary/gpg_key.asc ------------------------------------------------------------ --------------090605010504080301060209--