Skip to content

Commit 0e914f9

Browse files
Ayush1325vaishnavachath
authored andcommitted
Revert "simplelink: update to Ti SimpleLink SDK 7.41.00.17"
This reverts commit 46407c7.
1 parent 46407c7 commit 0e914f9

File tree

315 files changed

+5726
-32248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+5726
-32248
lines changed

simplelink/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ elseif(CONFIG_HAS_CC13X2_CC26X2_SDK OR CONFIG_HAS_CC13X2X7_CC26X2X7_SDK)
7979
zephyr_library_compile_definitions(${COMPILER})
8080
zephyr_library_sources(
8181
source/ti/drivers/power/PowerCC26X2.c
82-
source/ti/drivers/power/PowerCC26X2_helpers.c
8382
source/ti/drivers/power/PowerCC26X2_calibrateRCOSC.c
84-
source/ti/drivers/power/PowerCC26X2_calibrateRCOSC_helpers.c
8583
source/ti/drivers/utils/List.c
8684
source/ti/drivers/rf/RFCC26X2_multiMode.c
8785
source/ti/drivers/temperature/TemperatureCC26X2.c

simplelink/README

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,31 @@ The SimpleLink SDKs provide peripheral driver and WiFi libraries
22
and hardware register access header files for the Texas Instruments
33
SimpleLink SoCs.
44

5-
1. CC13x2/26x2 SDK
6-
75
For an explanation of the SimpleLink family SDK directory structure, see:
6+
http://dev.ti.com/tirex/content/simplelink_cc32xx_sdk_2_40_01_01/docs/simplelink_mcu_sdk/Users_Guide.html#directory-structure
87

9-
https://dev.ti.com/tirex/explore/node?node=A__AGhAXIxP6gouUA7QxaW0Lg__com.ti.SIMPLELINK_CC13XX_CC26XX_SDK__BSEc4rl__LATEST&placeholder=true
8+
1. CC13x2/26x2 SDK
109

1110
The current version supported in Zephyr is the SimpleLink CC13x2 and CC26x2 SDK
12-
7.41.00.17, downloaded from:
11+
4.40.04.04, downloaded from:
1312

1413
http://www.ti.com/tool/simplelink-cc13x2-26x2-sdk
1514

1615
The driver library source is copied from the SDK, as follows:
1716

1817
EXT_DIR=$HOME/hal_ti/simplelink/source/ti
19-
pushd simplelink_cc13x2_26x2_sdk_7_41_00_17/source/ti
18+
pushd simplelink_cc13x2_26x2_sdk_4_40_04_04/source/ti
2019
find devices/cc13x2_cc26x2/{driverlib,inc,rf_patches} -depth -name '*.[c|h]' -print0 | cpio --null -pvdm $EXT_DIR
2120
find devices/cc13x2_cc26x2/startup_files -depth -name ccfg.c -print0 | cpio --null -pvd $EXT_DIR
22-
find devices/cc13x2x7_cc26x2x7/{driverlib,inc,rf_patches} -depth -name '*.[c|h]' -print0 | cpio --null -pvdm $EXT_DIR
23-
find devices/cc13x2x7_cc26x2x7/startup_files -depth -name ccfg.c -print0 | cpio --null -pvd $EXT_DIR
24-
mkdir -p $EXT_DIR/drivers/power
25-
cp drivers/*.h $EXT_DIR/drivers/.
2621
cp -r drivers/power/* $EXT_DIR/drivers/power/.
2722
mkdir $EXT_DIR/drivers/temperature
2823
cp -r drivers/temperature/* $EXT_DIR/drivers/temperature/.
29-
mkdir $EXT_DIR/drivers/utils
30-
cp -r drivers/utils/* $EXT_DIR/drivers/utils/.
3124
cp drivers/Temperature.* $EXT_DIR/drivers/.
3225
mkdir $EXT_DIR/drivers/rf
3326
cp drivers/rf/RF.h $EXT_DIR/drivers/rf/.
3427
cp drivers/rf/RFCC26X2.h $EXT_DIR/drivers/rf/.
3528
cp drivers/rf/RFCC26X2_multiMode.c $EXT_DIR/drivers/rf/.
3629
find $EXT_DIR/devices/cc13x2_cc26x2 -name '*.[c|h]' -exec dos2unix {} \;
37-
find $EXT_DIR/devices/cc13x2x7_cc26x2x7 -name '*.[c|h]' -exec dos2unix {} \;
3830
find $EXT_DIR/drivers/power -name '*.[c|h]' -exec dos2unix {} \;
3931
find $EXT_DIR/drivers/rf -name '*.[c|h]' -exec dos2unix {} \;
4032
find $EXT_DIR/drivers/temperature -name '*.[c|h]' -exec dos2unix {} \;

simplelink/source/ti/devices/cc13x2_cc26x2/driverlib/adi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/******************************************************************************
22
* Filename: adi.c
3+
* Revised: 2016-11-17 16:39:28 +0100 (Thu, 17 Nov 2016)
4+
* Revision: 47706
35
*
46
* Description: Driver for the ADI interface
57
*
6-
* Copyright (c) 2015 - 2022, Texas Instruments Incorporated
8+
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
79
* All rights reserved.
810
*
911
* Redistribution and use in source and binary forms, with or without
@@ -34,4 +36,8 @@
3436
*
3537
******************************************************************************/
3638

39+
#include "../inc/hw_types.h"
40+
#include "../inc/hw_memmap.h"
41+
#include "../inc/hw_aux_smph.h"
3742
#include "adi.h"
43+
#include "cpu.h"

simplelink/source/ti/devices/cc13x2_cc26x2/driverlib/adi.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/******************************************************************************
22
* Filename: adi.h
3+
* Revised: 2016-11-17 16:39:28 +0100 (Thu, 17 Nov 2016)
4+
* Revision: 47706
35
*
46
* Description: Defines and prototypes for the ADI master interface.
57
*
6-
* Copyright (c) 2015 - 2022, Texas Instruments Incorporated
8+
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
79
* All rights reserved.
810
*
911
* Redistribution and use in source and binary forms, with or without

simplelink/source/ti/devices/cc13x2_cc26x2/driverlib/adi_doc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/******************************************************************************
22
* Filename: adi_doc.h
3+
* Revised: 2016-03-30 13:03:59 +0200 (Wed, 30 Mar 2016)
4+
* Revision: 45971
35
*
4-
* Copyright (c) 2015 - 2022, Texas Instruments Incorporated
6+
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
57
* All rights reserved.
68
*
79
* Redistribution and use in source and binary forms, with or without

simplelink/source/ti/devices/cc13x2_cc26x2/driverlib/aes.c

Lines changed: 9 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
12
/******************************************************************************
2-
* Filename: aes.c
3+
* Filename: crypto.c
4+
* Revised: 2020-08-25 16:10:23 +0200 (Tue, 25 Aug 2020)
5+
* Revision: 58298
36
*
4-
* Description: Driver for the AES functions of the crypto module
7+
* Description: Driver for the aes functions of the crypto module
58
*
6-
* Copyright (c) 2015 - 2022, Texas Instruments Incorporated
9+
* Copyright (c) 2015 - 2020, Texas Instruments Incorporated
710
* All rights reserved.
811
*
912
* Redistribution and use in source and binary forms, with or without
@@ -65,26 +68,6 @@
6568

6669

6770

68-
#ifndef CRYPTO_SWRESET_SW_RESET
69-
/* This definition is missing in hw_crypto.h for CC26X0 and CC13X0 devices */
70-
#define CRYPTO_SWRESET_SW_RESET 0x00000001
71-
#endif
72-
73-
#ifndef CRYPTO_DMASWRESET_SWRES
74-
/* This definition is missing in hw_crypto.h for CC26X0 and CC13X0 devices */
75-
#define CRYPTO_DMASWRESET_SWRES 0x00000001
76-
#endif
77-
78-
#ifndef CRYPTO_DMASTAT_CH0_ACT
79-
/* This definition is missing in hw_crypto.h for CC26X0 and CC13X0 devices */
80-
#define CRYPTO_DMASTAT_CH0_ACT 0x00000001
81-
#endif
82-
83-
#ifndef CRYPTO_DMASTAT_CH1_ACT
84-
/* This definition is missing in hw_crypto.h for CC26X0 and CC13X0 devices */
85-
#define CRYPTO_DMASTAT_CH1_ACT 0x00000002
86-
#endif
87-
8871
//*****************************************************************************
8972
//
9073
// Load the initialization vector.
@@ -99,36 +82,6 @@ void AESSetInitializationVector(const uint32_t *initializationVector)
9982
HWREG(CRYPTO_BASE + CRYPTO_O_AESIV3) = initializationVector[3];
10083
}
10184

102-
//*****************************************************************************
103-
//
104-
// Read the IV for Authenticated Modes (CCM or GCM) after the tag has been read.
105-
//
106-
//*****************************************************************************
107-
void AESReadAuthenticationModeIV(uint32_t *iv)
108-
{
109-
/* Read the computed IV out from the hw registers */
110-
iv[0] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV0);
111-
iv[1] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV1);
112-
iv[2] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV2);
113-
/* This read will clear the saved_context_ready bit
114-
* and allow the AES core to start the next operation.
115-
*/
116-
iv[3] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV3);
117-
}
118-
119-
//*****************************************************************************
120-
//
121-
// Read the IV for Non-Authenticated Modes (CBC or CTR).
122-
//
123-
//*****************************************************************************
124-
void AESReadNonAuthenticationModeIV(uint32_t *iv)
125-
{
126-
/* Wait until the saved context is ready */
127-
while(!(HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) & CRYPTO_AESCTL_SAVED_CONTEXT_RDY_M));
128-
129-
AESReadAuthenticationModeIV(iv);
130-
}
131-
13285
//*****************************************************************************
13386
//
13487
// Start a crypto DMA operation.
@@ -193,7 +146,7 @@ uint32_t AESWaitForIRQFlags(uint32_t irqFlags)
193146

194147
//*****************************************************************************
195148
//
196-
// Transfer a key from CPU memory to a key store location.
149+
// Transfer a key from CM3 memory to a key store location.
197150
//
198151
//*****************************************************************************
199152
uint32_t AESWriteToKeyStore(const uint8_t *aesKey, uint32_t aesKeyLength, uint32_t keyStoreArea)
@@ -212,8 +165,6 @@ uint32_t AESWriteToKeyStore(const uint8_t *aesKey, uint32_t aesKeyLength, uint32
212165
(aesKeyLength == AES_192_KEY_LENGTH_BYTES) ||
213166
(aesKeyLength == AES_256_KEY_LENGTH_BYTES));
214167

215-
// This buffer must be declared at function scope to prevent LLVM compiler from optimizing out memcpy.
216-
uint8_t paddedKey[AES_256_KEY_LENGTH_BYTES] = {0};
217168
uint32_t keySize = 0;
218169

219170
switch (aesKeyLength) {
@@ -256,19 +207,8 @@ uint32_t AESWriteToKeyStore(const uint8_t *aesKey, uint32_t aesKeyLength, uint32
256207
// Enable key to write (e.g. Key 0).
257208
HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITEAREA) = 1 << keyStoreArea;
258209

259-
if (aesKeyLength == AES_192_KEY_LENGTH_BYTES)
260-
{
261-
// Writing a 192-bit key to the key store RAM must be done by writing
262-
// 256 bits of data with the 64 most significant bits set to zero.
263-
memcpy(paddedKey, aesKey, AES_192_KEY_LENGTH_BYTES);
264-
265-
AESStartDMAOperation(paddedKey, AES_256_KEY_LENGTH_BYTES, 0, 0);
266-
}
267-
else
268-
{
269-
// Total key length in bytes (16 for 1 x 128-bit key and 32 for 1 x 256-bit key).
270-
AESStartDMAOperation(aesKey, aesKeyLength, 0, 0);
271-
}
210+
// Total key length in bytes (16 for 1 x 128-bit key and 32 for 1 x 256-bit key).
211+
AESStartDMAOperation(aesKey, aesKeyLength, 0, 0);
272212

273213
// Wait for the DMA operation to complete.
274214
uint32_t irqTrigger = AESWaitForIRQFlags(CRYPTO_IRQCLR_RESULT_AVAIL | CRYPTO_IRQCLR_DMA_IN_DONE | CRYPTO_IRQSTAT_DMA_BUS_ERR | CRYPTO_IRQSTAT_KEY_ST_WR_ERR);
@@ -430,122 +370,3 @@ void AESWriteCCMInitializationVector(const uint8_t *nonce, uint32_t nonceLength)
430370

431371
AESSetInitializationVector(initializationVector.word);
432372
}
433-
434-
//*****************************************************************************
435-
//
436-
// Write AES_KEY2 registers
437-
//
438-
//*****************************************************************************
439-
void AESWriteKey2(const uint32_t *key2) {
440-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY20) = key2[0];
441-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY21) = key2[1];
442-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY22) = key2[2];
443-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY23) = key2[3];
444-
}
445-
446-
//*****************************************************************************
447-
//
448-
// Write AES_KEY3 register
449-
//
450-
//*****************************************************************************
451-
void AESWriteKey3(const uint32_t *key3) {
452-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY30) = key3[0];
453-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY31) = key3[1];
454-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY32) = key3[2];
455-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY33) = key3[3];
456-
}
457-
458-
//*****************************************************************************
459-
//
460-
// Clear AES_DATA_IN registers
461-
//
462-
//*****************************************************************************
463-
void AESClearDataIn(void) {
464-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN0) = 0;
465-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN1) = 0;
466-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN2) = 0;
467-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN3) = 0;
468-
}
469-
470-
//*****************************************************************************
471-
//
472-
// Write AES_DATA_IN registers
473-
//
474-
//*****************************************************************************
475-
void AESWriteDataIn(const uint32_t *dataInBuffer) {
476-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN0) = dataInBuffer[0];
477-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN1) = dataInBuffer[1];
478-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN2) = dataInBuffer[2];
479-
HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN3) = dataInBuffer[3];
480-
}
481-
482-
//*****************************************************************************
483-
//
484-
// Read AES_DATA_OUT registers
485-
//
486-
//*****************************************************************************
487-
void AESReadDataOut(uint32_t *dataOutBuffer) {
488-
dataOutBuffer[0] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT0);
489-
dataOutBuffer[1] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT1);
490-
dataOutBuffer[2] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT2);
491-
dataOutBuffer[3] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT3);
492-
}
493-
494-
//*****************************************************************************
495-
//
496-
// Clear AES_KEY2 registers
497-
//
498-
//*****************************************************************************
499-
void AESClearKey2(void) {
500-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY20) = 0;
501-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY21) = 0;
502-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY22) = 0;
503-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY23) = 0;
504-
}
505-
506-
//*****************************************************************************
507-
//
508-
// Clear AES_KEY3 registers
509-
//
510-
//*****************************************************************************
511-
void AESClearKey3(void) {
512-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY30) = 0;
513-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY31) = 0;
514-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY32) = 0;
515-
HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY33) = 0;
516-
}
517-
518-
519-
//*****************************************************************************
520-
//
521-
// Reset crypto engine
522-
//
523-
//*****************************************************************************
524-
void AESReset(void)
525-
{
526-
/* Soft reset routine per SafeXcel */
527-
HWREG(CRYPTO_BASE + CRYPTO_O_SWRESET) = CRYPTO_SWRESET_SW_RESET;
528-
AESSetCtrl(0);
529-
AESSetDataLength(0);
530-
AESSetAuthLength(0);
531-
532-
/* Only CC26X2, CC13X2, CC26X2F6, CC13X2F6, CC26X4, and CC13X4 devices have hash support */
533-
HWREG(CRYPTO_BASE + CRYPTO_O_HASHMODE) = 0;
534-
HWREG(CRYPTO_BASE + CRYPTO_O_HASHINLENL) = 0;
535-
/* CRYPTO_O_HASHINLENH is automatically set to 0 by HW */
536-
}
537-
538-
//*****************************************************************************
539-
//
540-
// Reset crypto DMA
541-
//
542-
//*****************************************************************************
543-
void AESDMAReset(void)
544-
{
545-
/* Reset DMA */
546-
HWREG(CRYPTO_BASE + CRYPTO_O_DMASWRESET) = CRYPTO_DMASWRESET_SWRES;
547-
548-
/* Wait for DMA channels to be inactive */
549-
while (HWREG(CRYPTO_BASE + CRYPTO_O_DMASTAT) &
550-
(CRYPTO_DMASTAT_CH0_ACT | CRYPTO_DMASTAT_CH1_ACT));
551-
}

0 commit comments

Comments
 (0)