Squashed commit of the following:

arch/arm/src/tiva/hardware:  Completes the CC13x2 AUX SYSIF header file.

    arch/arm/src/tiva/hardware:  Progress on the CC13x2 AUX SYSIF header file.  Almost complete.

    arch/arm/src/tiva/hardware:  Port needs aux_sysif.h header file.

    arch/arm/src/tiva/cc13xx/cc13x0_rom.h:  Fix a typo

    arch/arm/src/tiva/cc13xx:  More changes to TI DriverLib ROM header files for NuttX coding standard.

    arch/arm/src/tiva/cc13xx:  Convert some (but not all) TI DriverLib ROM function names to NuttX coding standard.  More to be done.

    arm/src/tiva/cc13xx:  ROM header files: missed a couple of conversions of sructure field names to lower case (vs CamelCase).

    arm/src/tiva/cc13xx:  ROM header files: type'ed names must be lower case per coding standard (not upper case); structure field names must be lower case per coding standard (not CamelCase).

     arch/arm/src/tiva/cc13xx:  Trim logic needs to include matching ROM DriverLib interface header file.

    arch/arm/src/tiva/cc13xx:  Add ROM DriverLib header files.  Do not yet fully conform to the NuttX coding style.
This commit is contained in:
Gregory Nutt
2019-01-20 17:59:22 -06:00
parent 3a13d4a5f5
commit aa99e2d6da
12 changed files with 3654 additions and 3 deletions
+1
View File
@@ -107,6 +107,7 @@ else ifeq ($(CONFIG_ARCH_CHIP_CC13X0),y)
else ifeq ($(CONFIG_ARCH_CHIP_CC13X2),y)
CHIP_CSRCS += cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c cc13xx_gpio.c
CHIP_CSRCS += cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c
CHIP_CSRCS += cc13x2_aux_sysif.c
ifeq ($(CONFIG_ARCH_CHIP_CC13XX_V1),y)
CHIP_CSRCS += cc13x2_v1_trim.c
else
File diff suppressed because it is too large Load Diff
+2
View File
@@ -57,6 +57,8 @@
#include "hardware/tiva_prcm.h"
#include "hardware/tiva_vims.h"
#include "cc13xx/cc13x0_rom.h"
/******************************************************************************
* Private Functions
******************************************************************************/
+125
View File
@@ -0,0 +1,125 @@
/*****************************************************************************
* arch/arm/src/tiva/cc13xx/cc13x2_aux_sysif.c
* Driver for the AUX System Interface
*
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
*
* Technical content derives from a TI aux_sysif.c file that has a compatible BSD
* license:
*
* Copyright (c) 2015-2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
/*****************************************************************************
* Included Files
*****************************************************************************/
#include <stdint.h>
#include "up_arch.h"
#include "hardware/tiva_aux_sysif.h"
#include "cc13xx/cc13x2_aux_sysif.h"
/*****************************************************************************
* Private Data
*****************************************************************************/
/* Used in aux_sysif_opmode() to control the change of the operational mode. */
static const uint8_t g_opmode_to_order[4] =
{
1, 2, 0, 3
};
static const uint8_t g_order_to_opmode[4] =
{
2, 0, 1, 3
};
/*****************************************************************************
* Public Functions
*****************************************************************************/
/************************************************************************************
* Name: aux_sysif_opmode
*
* Description:
*
* This function controls the change of the AUX operational mode.
* The function controls the change of the current operational mode to the
* operational mode target by adhering to rules specified by HW.
*
* Input Parameters:
* - opmode: AUX operational mode. One of
* AUX_SYSIF_OPMODE_TARGET_PDLP: Power down operational mode with wakeup
* to low power mode)
* AUX_SYSIF_OPMODE_TARGET_PDA: Power down operational mode with wakeup
to active mode
* AUX_SYSIF_OPMODE_TARGET_LP: Low power operational mode)
* AUX_SYSIF_OPMODE_TARGET_A: Active operational mode
*
* Returned Value:
* None
*
************************************************************************************/
void aux_sysif_opmode(uint32_t opmode)
{
uint32_t currmode;
uint32_t currorder;
uint32_t nextmode;
do
{
currmode = getreg32(TIVA_AUX_SYSIF_OPMODEREQ);
while (currmode != getreg32(TIVA_AUX_SYSIF_OPMODEACK))
{
}
if (currmode != opmode)
{
currorder = g_opmode_to_order[currmode];
if (currorder < g_opmode_to_order[opmode])
{
nextmode = g_order_to_opmode[currorder + 1];
}
else
{
nextmode = g_order_to_opmode[currorder - 1];
}
putreg32(nextmode, TIVA_AUX_SYSIF_OPMODEREQ);
}
}
while (currmode != opmode);
}
@@ -0,0 +1,89 @@
/************************************************************************************
* arch/arm/src/tiva/cc13xx/cc13x2_aux_sysif.h
*
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* This is a port of TI's aux_sysif.h file which has a fully compatible BSD license:
*
* Copyright (c) 2015-2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_TIVA_CC13XX_CC13X2_AUX_SYSIF_H
#define __ARCH_ARM_SRC_TIVA_CC13XX_CC13X2_AUX_SYSIF_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <stdint.h>
#include "hardware/tiva_aux_sysif.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
#define AUX_SYSIF_OPMODE_TARGET_PDLP AUX_SYSIF_OPMODEREQ_REQ_PDLP
#define AUX_SYSIF_OPMODE_TARGET_PDA AUX_SYSIF_OPMODEREQ_REQ_PDA
#define AUX_SYSIF_OPMODE_TARGET_LP AUX_SYSIF_OPMODEREQ_REQ_LP
#define AUX_SYSIF_OPMODE_TARGET_A AUX_SYSIF_OPMODEREQ_REQ_A
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
/************************************************************************************
* Name: aux_sysif_opmode
*
* Description:
*
* This function controls the change of the AUX operational mode.
* The function controls the change of the current operational mode to the
* operational mode target by adhering to rules specified by HW.
*
* Input Parameters:
* - opmode: AUX operational mode. One of
* AUX_SYSIF_OPMODE_TARGET_PDLP: Power down operational mode with wakeup
* to low power mode)
* AUX_SYSIF_OPMODE_TARGET_PDA: Power down operational mode with wakeup
to active mode
* AUX_SYSIF_OPMODE_TARGET_LP: Low power operational mode)
* AUX_SYSIF_OPMODE_TARGET_A: Active operational mode
*
* Returned Value:
* None
*
************************************************************************************/
void aux_sysif_opmode(uint32_t opmode);
#endif /* __ARCH_ARM_SRC_TIVA_CC13XX_CC13X2_AUX_SYSIF_H */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -57,6 +57,9 @@
#include "hardware/tiva_prcm.h"
#include "hardware/tiva_vims.h"
#include "cc13xx/cc13x2_cc26x2_v1_rom.h"
#include "cc13xx/cc13x2_aux_sysif.h"
/******************************************************************************
* Pre-processor Definitions
******************************************************************************/
@@ -459,7 +462,7 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision)
/* Set AUX into power down active mode */
AUXSYSIFOpModeChange(AUX_SYSIF_OPMODE_TARGET_PDA);
aux_sysif_opmode(AUX_SYSIF_OPMODE_TARGET_PDA);
/* Disable EFUSE clock */
+4 -1
View File
@@ -55,6 +55,9 @@
#include "hardware/tiva_prcm.h"
#include "hardware/tiva_vims.h"
#include "cc13xx/cc13x2_cc26x2_v2_rom.h"
#include "cc13xx/cc13x2_aux_sysif.h"
/******************************************************************************
* Private Functions
******************************************************************************/
@@ -203,7 +206,7 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision)
/* Set AUX into power down active mode */
AUXSYSIFOpModeChange(AUX_SYSIF_OPMODE_TARGET_PDA);
aux_sysif_opmode(AUX_SYSIF_OPMODE_TARGET_PDA);
/* Disable EFUSE clock */
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
*
* Technical content derives from a TI header file that has a compatible BSD
* Technical content derives from a TI file that has a compatible BSD
* license:
*
* Copyright (c) 2015-2017, Texas Instruments Incorporated
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,72 @@
/************************************************************************************
* arch/arm/src/tiva/hardware/tiva_aux_sysif.h
*
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_TIVA_HARDWARE_TIVA_AUX_SYSIF_H
#define __ARCH_ARM_SRC_TIVA_HARDWARE_TIVA_AUX_SYSIF_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
/* Include the pin mapping file for the specific Tiva/Stellaris/SimpleLink chip */
#if defined(CONFIG_ARCH_CHIP_LM) || defined(CONFIG_ARCH_CHIP_TM4C) || \
defined(CONFIG_ARCH_CHIP_CC13X0)
/* These architectures do not support the AUX SYSIF block */
#elif defined(CONFIG_ARCH_CHIP_CC13X2)
# include "hardware/cc13x2_cc26x2/cc13x2_cc26x2_aux_sysif.h"
#else
# error "Unsupported Tiva/Stellaris/SimpleLink AUX SYSIF"
#endif
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************
* Public Types
************************************************************************************/
/************************************************************************************
* Public Data
************************************************************************************/
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#endif /* __ARCH_ARM_SRC_TIVA_HARDWARE_TIVA_AUX_SYSIF_H */