view src/cs/drivers/drv_core/inth/sys_inth.c @ 303:f76436d19a7a default tip

!GPRS config: fix long-standing AT+COPS chance hanging bug There has been a long-standing bug in FreeCalypso going back years: sometimes in the AT command bring-up sequence of an ACI-only MS, the AT+COPS command would produce only a power scan followed by cessation of protocol stack activity (only L1 ADC traces), instead of the expected network search sequence. This behaviour was seen in different FC firmware versions going back to Citrine, and seemed to follow some law of chance, not reliably repeatable. This bug has been tracked down and found to be specific to !GPRS configuration, stemming from our TCS2/TCS3 hybrid and reconstruction of !GPRS support that was bitrotten in TCS3.2/LoCosto version. ACI module psa_mms.c, needed only for !GPRS, was missing in the TCS3 version and had to be pulled from TCS2 - but as it turns out, there is a new field in the MMR_REG_REQ primitive that needs to be set correctly, and that psa_mms.c module is the place where this initialization needed to be added.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 08 Jun 2023 08:23:37 +0000
parents 4e78acac3d88
children
line wrap: on
line source

/*                @(#) nom : sys_inth.c SID: 1.2 date : 05/23/03              */
/* Filename:      sys_inth.c                                                  */
/* Version:       1.2                                                         */
/******************************************************************************
 *                   WIRELESS COMMUNICATION SYSTEM DEVELOPMENT
 *
 *             (C) 2002 Texas Instruments France. All rights reserved
 *
 *                          Author : Francois AMAND
 *
 *
 *  Important Note
 *  --------------
 *
 *  This S/W is a preliminary version. It contains information on a product 
 *  under development and is issued for evaluation purposes only. Features 
 *  characteristics, data and other information are subject to change.
 *
 *  The S/W is furnished under Non Disclosure Agreement and may be used or
 *  copied only in accordance with the terms of the agreement. It is an offence
 *  to copy the software in any way except as specifically set out in the 
 *  agreement. No part of this document may be reproduced or transmitted in any
 *  form or by any means, electronic or mechanical, including photocopying and
 *  recording, for any purpose without the express written permission of Texas
 *  Instruments Inc.
 *
 ******************************************************************************
 *
 *  FILE NAME: sys_inth.c
 *
 *
 *  PURPOSE:  Interrupt Handler driver compiled in 32-bits mode.
 *
 *
 *  FILE REFERENCES:
 *
 *  Name                  IO      Description
 *  -------------         --      ---------------------------------------------
 *  
 *
 *
 *  EXTERNAL VARIABLES:
 *
 *  Source:
 *
 *  Name                  Type              IO   Description
 *  -------------         ---------------   --   ------------------------------
 *
 *
 *
 *  EXTERNAL REFERENCES:
 *
 *  Name                Description
 *  ------------------  -------------------------------------------------------
 *
 *
 *
 *  ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES:
 *  
 *
 *
 *  ASSUMPTION, CONSTRAINTS, RESTRICTIONS:
 *  
 *
 *
 *  NOTES:
 *  
 *
 *
 *  REQUIREMENTS/FUNCTIONAL SPECIFICATION REFERENCES:
 *
 *
 *
 *
 *  DEVELOPMENT HISTORY:
 *
 *  Date         Name(s)         Version  Description
 *  -----------  --------------  -------  -------------------------------------
 *  11-Oct-2002  Francois AMAND  0.0.1    First implementation
 *
 *  ALGORITHM: 
 *
 *
 *****************************************************************************/

#include "l1sw.cfg"
#include "chipset.cfg"

#if (CHIPSET == 12)

#if (OP_L1_STANDALONE == 0)
  #include "main/sys_types.h"
#else
  #include "sys_types.h"
#endif
#include "sys_inth.h"


  /******************************************************************************
   *
   *  FUNCTION NAME: f_inth_init
   *      Setup interrupt handler configuration.
   *
   *
   *  ARGUMENT LIST:
   *
   *  Argument       Type                   IO  Description
   *  ------------   -------------------    --  ---------------------------------
   *
   * RETURN VALUE: None
   *
   *****************************************************************************/

  static void f_inth_init(SYS_UWORD16 d_it_num, T_INTH_CONFIG  *p_config)
  {
    volatile SYS_UWORD16 *p_inth_level_reg;
    SYS_UWORD8 d_it_num_temp = d_it_num;

    /*
     *  Get interrupt handler main address between INTH and SEC_INTH
     */
    if (d_it_num < C_INTH_NUM_INT)
      p_inth_level_reg = (SYS_UWORD16 *) C_INTH_EXT_REG;
  
    else if (d_it_num < (C_INTH_NUM_INT + C_INTH_2ND_NUM_INT)) {
      p_inth_level_reg = (SYS_UWORD16 *) C_INTH2_EXT_REG;
      d_it_num_temp= d_it_num - C_INTH_NUM_INT;
    }
    else
      return;
  
    /*
     *  Set the configuration of the selected interrupt
     */
    p_inth_level_reg[d_it_num_temp] = p_config->d_fiq_nirq | 
                                     (p_config->d_edge_nlevel << 1) | 
                                     (p_config->d_priority << 2);
  
    /*
     *  Set indirect table
     */
    /* Is main interrupt handler? */
    if (d_it_num < C_INTH_NUM_INT)
      if (p_config->d_fiq_nirq == C_INTH_IRQ)
        a_inth_it_handlers[d_it_num_temp][C_INTH_IRQ] = p_config->d_it_handler;
      else
        a_inth_it_handlers[d_it_num_temp][C_INTH_FIQ] = p_config->d_it_handler;
    /* This is the 2nd level interrupt handler */
    else
      a_inth2_irq_handlers[d_it_num_temp] = p_config->d_it_handler;

  } /* f_inth_init() */



  /******************************************************************************
   *
   *  FUNCTION NAME: f_inth_setup
   *      Setup interrupt handler configuration.
   *
   *
   *  ARGUMENT LIST:
   *
   *  Argument        Type               IO  Description
   *  -------------   ----------------   --  ----------------------------------
   *  p_inth_config   T_INTH_CONFIG *    I   Interrupt handler configuration.
   *
   * RETURN VALUE: None
   *
   *****************************************************************************/

  void f_inth_setup(T_INTH_CONFIG *p_inth_config)
  {
     SYS_UWORD8 d_i;
  
     /* Setup all interrupts to IRQ or FIQ with different levels and priority */
     for (d_i = 0 ; d_i < (C_INTH_NUM_INT + C_INTH_2ND_NUM_INT) ; d_i++) {
        if (p_inth_config[d_i].d_priority != 0xFF) {
          f_inth_init(d_i, (T_INTH_CONFIG *)&p_inth_config[d_i]);
        }
        F_INTH_DISABLE_ONE_IT(d_i);
     }
  
  } /* f_inth_setup() */



  /******************************************************************************
   *
   *  FUNCTION NAME: f_inth_get_version
   *      Return the version of the interrupt handler driver.
   *
   *
   *  ARGUMENT LIST:
   *
   *  Argument       Type                   IO  Description
   *  ------------   -------------------    --  ---------------------------------
   *
   * RETURN VALUE: Version of the INTH driver
   *
   *****************************************************************************/

  SYS_UWORD16 f_inth_get_version(void) {
    return(C_INTH_DRIVER_VERSION);
  }


#endif /* (CHIPSET == 12) */