arch/arm/src/tiva/cc13xx: Fixes to get a clean build of the configs/launchxl-cc1312r1 configuration. Still untested.

This commit is contained in:
Gregory Nutt
2019-01-23 09:04:19 -06:00
parent 69b28ef4ba
commit 6d2b832ccc
9 changed files with 318 additions and 236 deletions
+8
View File
@@ -288,6 +288,9 @@ config ARCH_CHIP_CC13X2
select TIVA_HAVE_TIMER3 select TIVA_HAVE_TIMER3
select TIVA_HAVE_UART1 select TIVA_HAVE_UART1
config ARCH_CHIP_CC26X2
bool
config LM_REVA2 config LM_REVA2
bool "Rev A2" bool "Rev A2"
default n default n
@@ -539,6 +542,11 @@ config TIVA_UART0_HCIUART
endchoice # UART0 Driver Configuration endchoice # UART0 Driver Configuration
config TIVA_CC26X2_POWERLIB
bool "CC26x2 Power Library"
default n
depends on ARCH_CHIP_CC26X2
if TIVA_UART0_HCIUART if TIVA_UART0_HCIUART
config TIVA_HCIUART0_RXBUFSIZE config TIVA_HCIUART0_RXBUFSIZE
int "HCI UART0 Rx buffer size" int "HCI UART0 Rx buffer size"
File diff suppressed because it is too large Load Diff
+15 -14
View File
@@ -176,6 +176,7 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision)
mp1rev = ((getreg32(TIVA_FCFG1_TRIM_CAL_REVISION) & mp1rev = ((getreg32(TIVA_FCFG1_TRIM_CAL_REVISION) &
FCFG1_TRIM_CAL_REVISION_MP1_MASK) >> FCFG1_TRIM_CAL_REVISION_MP1_MASK) >>
FCFG1_TRIM_CAL_REVISION_MP1_SHIFT); FCFG1_TRIM_CAL_REVISION_MP1_SHIFT);
if (mp1rev < 542) if (mp1rev < 542)
{ {
uint32_t ldoTrimReg = getreg32(TIVA_FCFG1_BAT_RC_LDO_TRIM); uint32_t ldoTrimReg = getreg32(TIVA_FCFG1_BAT_RC_LDO_TRIM);
@@ -317,32 +318,35 @@ void cc13xx_trim_device(void)
rom_setup_cachemode(); rom_setup_cachemode();
/* 1. Check for powerdown 2. Check for shutdown 3. Assume cold reset if none /* 1. Check for powerdown
* of the above. It is always assumed that the application will freeze the * 2. Check for shutdown
* latches in AON_IOC when going to powerdown in order to retain the values * 3. Assume cold reset if none of the above.
* on the IOs. NB. If this bit is not cleared before proceeding to *
* powerdown, the IOs will all default to the reset configuration when * It is always assumed that the application will freeze the latches in
* AON_IOC when going to powerdown in order to retain the values on the
* IOs. NB. If this bit is not cleared before proceeding to powerdown,
* the IOs will all default to the reset configuration when
* restarting. * restarting.
*/ */
if ((getreg32(TIVA_AON_IOC_IOCLATCH) & AON_IOC_IOCLATCH_EN) == 0) if ((getreg32(TIVA_AON_IOC_IOCLATCH) & AON_IOC_IOCLATCH_EN) == 0)
{ {
/* NB. This should be calling a ROM implementation of required trim and /* NB. This should be calling a ROM implementation of required trim and
* compensation e.g. * compensation e.g. trim_wakeup_frompowerdown()
* trim_wakeup_frompowerdown()
*/ */
trim_wakeup_frompowerdown(); trim_wakeup_frompowerdown();
} }
/* Check for shutdown When device is going to shutdown the hardware will /* Check for shutdown. When device is going to shutdown the hardware will
* automatically clear the SLEEPDIS bit in the SLEEP register in the * automatically clear the SLEEPDIS bit in the SLEEP register in the
* AON_SYSCTL module. It is left for the application to assert this bit when * AON_SYSCTL module. It is left for the application to assert this bit when
* waking back up, but not before the desired IO configuration has been * waking back up, but not before the desired IO configuration has been
* re-established. * re-established.
*/ */
else if ((getreg32(TIVA_AON_SYSCTL_SLEEPCTL) & AON_SYSCTL_SLEEPCTL_IO_PAD_SLEEP_DIS) == 0) else if ((getreg32(TIVA_AON_SYSCTL_SLEEPCTL) &
AON_SYSCTL_SLEEPCTL_IO_PAD_SLEEP_DIS) == 0)
{ {
/* NB. This should be calling a ROM implementation of required trim and /* NB. This should be calling a ROM implementation of required trim and
* compensation e.g. trim_wakeup_fromshutdown() --> * compensation e.g. trim_wakeup_fromshutdown() -->
@@ -357,14 +361,12 @@ void cc13xx_trim_device(void)
/* Consider adding a check for soft reset to allow debugging to skip this /* Consider adding a check for soft reset to allow debugging to skip this
* section!!! NB. This should be calling a ROM implementation of * section!!! NB. This should be calling a ROM implementation of
* required trim and compensation e.g. trim_coldreset() --> * required trim and compensation e.g. trim_coldreset() -->
* trim_wakeup_fromshutdown() --> * trim_wakeup_fromshutdown() --> trim_wakeup_frompowerdown()
* trim_wakeup_frompowerdown()
*/ */
trim_coldreset(); trim_coldreset();
trim_wakeup_fromshutdown(fcfg1_revision); trim_wakeup_fromshutdown(fcfg1_revision);
trim_wakeup_frompowerdown(); trim_wakeup_frompowerdown();
} }
/* Set VIMS power domain control. PDCTL1VIMS = 0 ==> VIMS power domain is /* Set VIMS power domain control. PDCTL1VIMS = 0 ==> VIMS power domain is
@@ -377,7 +379,7 @@ void cc13xx_trim_device(void)
* up from sleep * up from sleep
*/ */
regval = getreg32(TIVA_FLASH_FPAC1); regval = getreg32(TIVA_FLASH_FPAC1);
regval &= ~FLASH_FPAC1_PSLEEPTDIS_MASK; regval &= ~FLASH_FPAC1_PSLEEPTDIS_MASK;
regval |= (0x139 << FLASH_FPAC1_PSLEEPTDIS_SHIFT); regval |= (0x139 << FLASH_FPAC1_PSLEEPTDIS_SHIFT);
putreg32(regval, TIVA_FLASH_FPAC1); putreg32(regval, TIVA_FLASH_FPAC1);
@@ -410,6 +412,5 @@ void cc13xx_trim_device(void)
while ((getreg32(TIVA_VIMS_STAT) & VIMS_STAT_MODE_CHANGING) != 0) while ((getreg32(TIVA_VIMS_STAT) & VIMS_STAT_MODE_CHANGING) != 0)
{ {
/* Do nothing - wait for an eventual ongoing mode change to complete. */ /* Do nothing - wait for an eventual ongoing mode change to complete. */
} }
} }
+9 -8
View File
@@ -267,8 +267,7 @@ static void trim_wakeup_fromshutdown(uint32_t fcfg1_revision)
* -Configure XOSC. * -Configure XOSC.
*/ */
rom_setup_coldreset_from_shutdown_cfg2(fcfg1_revision, rom_setup_coldreset_from_shutdown_cfg2(fcfg1_revision, ccfg_modeconf);
ccfg_modeconf);
/* Special shadow register trim propagation on first batch of devices */ /* Special shadow register trim propagation on first batch of devices */
@@ -533,12 +532,14 @@ void cc13xx_trim_device(void)
rom_setup_cachemode(); rom_setup_cachemode();
/* 1. Check for powerdown 2. Check for shutdown 3. Assume cold reset if none /* 1. Check for powerdown
* of the above. It is always assumed that the application will freeze the * 2. Check for shutdown
* latches in AON_IOC when going to powerdown in order to retain the values * 3. Assume cold reset if none of the above.
* on the IOs. NB. If this bit is not cleared before proceeding to *
* powerdown, the IOs will all default to the reset configuration when * It is always assumed that the application will freeze the latches in
* restarting. * AON_IOC when going to powerdown in order to retain the values on the
* IOs. NB. If this bit is not cleared before proceeding to powerdown,
* the IOs will all default to the reset configuration when restarting.
*/ */
if ((getreg32(TIVA_AON_IOC_IOCLATCH) & AON_IOC_IOCLATCH_EN) == 0) if ((getreg32(TIVA_AON_IOC_IOCLATCH) & AON_IOC_IOCLATCH_EN) == 0)
+14 -15
View File
@@ -299,16 +299,16 @@ void cc13xx_trim_device(void)
/* Check for shutdown When device is going to shutdown the hardware will /* Check for shutdown When device is going to shutdown the hardware will
* automatically clear the SLEEPDIS bit in the SLEEP register in the * automatically clear the SLEEPDIS bit in the SLEEP register in the
* AON_PMCTL module. It is left for the application to assert this bit when * AON_PMCTL module. It is left for the application to assert this bit
* waking back up, but not before the desired IO configuration has been * when waking back up, but not before the desired IO configuration has
* re-established. * been re-established.
*/ */
else if ((getreg32(TIVA_AON_PMCTL_SLEEPCTL) & AON_PMCTL_SLEEPCTL_IO_PAD_SLEEP_DIS) else if ((getreg32(TIVA_AON_PMCTL_SLEEPCTL) &
== 0) AON_PMCTL_SLEEPCTL_IO_PAD_SLEEP_DIS) == 0)
{ {
/* NB. This should be calling a ROM implementation of required trim and /* NB. This should be calling a ROM implementation of required trim
* compensation e.g. trim_wakeup_fromshutdown() --> * and compensation e.g. trim_wakeup_fromshutdown() -->
* trim_wakeup_frompowerdown(); * trim_wakeup_frompowerdown();
*/ */
@@ -317,11 +317,10 @@ void cc13xx_trim_device(void)
} }
else else
{ {
/* Consider adding a check for soft reset to allow debugging to skip this /* Consider adding a check for soft reset to allow debugging to skip
* section!!! NB. This should be calling a ROM implementation of * this section!!! NB. This should be calling a ROM implementation of
* required trim and compensation e.g. trim_coldreset() --> * required trim and compensation e.g. trim_coldreset() -->
* trim_wakeup_fromshutdown() --> * trim_wakeup_fromshutdown() --> trim_wakeup_frompowerdown()
* trim_wakeup_frompowerdown()
*/ */
trim_coldreset(); trim_coldreset();
@@ -335,8 +334,8 @@ void cc13xx_trim_device(void)
putreg32(0, TIVA_PRCM_PDCTL1VIMS); putreg32(0, TIVA_PRCM_PDCTL1VIMS);
/* Configure optimal wait time for flash FSM in cases where flash pump wakes /* Configure optimal wait time for flash FSM in cases where flash pump
* up from sleep * wakes up from sleep
*/ */
regval = getreg32(TIVA_FLASH_FPAC1); regval = getreg32(TIVA_FLASH_FPAC1);
@@ -345,8 +344,8 @@ void cc13xx_trim_device(void)
putreg32(regval, TIVA_FLASH_FPAC1); putreg32(regval, TIVA_FLASH_FPAC1);
/* And finally at the end of the flash boot process: SET BOOT_DET bits in /* And finally at the end of the flash boot process: SET BOOT_DET bits in
* AON_PMCTL to 3 if already found to be 1 Note: The BOOT_DET_x_CLR/SET bits * AON_PMCTL to 3 if already found to be 1 Note: The BOOT_DET_x_CLR/SET
* must be manually cleared * bits must be manually cleared
*/ */
if ((getreg32(TIVA_AON_PMCTL_RESETCTL) & if ((getreg32(TIVA_AON_PMCTL_RESETCTL) &
+2 -2
View File
@@ -135,7 +135,7 @@
/* This structure represents the pin configuration */ /* This structure represents the pin configuration */
struct cc134xx_pinconfig_s struct cc13xx_pinconfig_s
{ {
uint32_t gpio; /* GPIO and DIO definitions */ uint32_t gpio; /* GPIO and DIO definitions */
uint32_t ioc; /* IOC configuration register image */ uint32_t ioc; /* IOC configuration register image */
@@ -145,7 +145,7 @@ struct cc134xx_pinconfig_s
* across all MCUs. * across all MCUs.
*/ */
typedef const struct cc134xx_pinconfig_s *pinconfig_t; typedef const struct cc13xx_pinconfig_s *pinconfig_t;
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
+2 -2
View File
@@ -279,8 +279,8 @@ void __start(void)
showprogress('E'); showprogress('E');
#endif #endif
#ifndef CONFIG_ARCH_CHIP_CC13X0 /* REVISIT */ #ifdef CONFIG_TIVA_CC26X2_POWERLIB /* REVISIT */
/* Initialize the Power Manager internal state. It must be called prior /* Initialize the Power Manager internal state. This must be called prior
* to any other Power API. * to any other Power API.
*/ */
+4 -3
View File
@@ -14,9 +14,10 @@ Contents
Status Status
====== ======
2019-12-03: Fragmentary board support in place. The initial intent 2019-01-21: Fragmentary board support in place. The initial intent
of this board support is simply to assist in the CC13xx architecture of this board support is simply to assist in the CC13x0 architecture
development. Serious board development will occur later. development. Serious board development will occur later. At present,
the CC13x0 does not even compile error-free.
Serial Console Serial Console
============== ==============
+17 -1
View File
@@ -9,13 +9,15 @@ Contents
o Status o Status
o Serial Console o Serial Console
o LEDs and Buttons o LEDs and Buttons
o Version 1 or 2?
Status Status
====== ======
2018-12-03: Fragmentary board support in place. The initial intent 2018-12-03: Fragmentary board support in place. The initial intent
of this board support is simply to assist in the CC13xx architecture of this board support is simply to assist in the CC13xx architecture
development. Serious board development will occur later. development. Serious board development will occur later. Board
support is missing LED and button support.
Serial Console Serial Console
============== ==============
@@ -33,3 +35,17 @@ LEDs
Buttons Buttons
------- -------
Version 1 or 2?
===============
Two versions of the CC1312R1 are supported selected by CONFIG_ARCH_CHIP_CC13XX_V1
or CONFIG_ARCH_CHIP_CC13XX_V2. How can you tell which one you have?
Perhaps you can tell by the markings on the chip, but I do not have the
secret decoder ring necessary to do that.
What you can do is enable CONFIG_DEBUG_ASSERTIONS. The firmware can
determine which version you have by looking at register contents. The
firmware will assert if you select the wrong version. If that occurs,
switch to the other version and the assertion should go away.