Skip to content

Commit ead16f1

Browse files
committed
Merge branch 'bugfix/fix_c61_msmspi_soc' into 'master'
fix(memspi): Correct the wrong c61 memspi soc file See merge request espressif/esp-idf!32921
2 parents dbce23f + 6290fed commit ead16f1

File tree

2 files changed

+72
-15
lines changed

2 files changed

+72
-15
lines changed

components/soc/esp32c61/include/soc/spi_mem_c_reg.h

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ extern "C" {
339339
#define SPI_MEM_ECC_16TO18_BYTE_EN_M (SPI_MEM_ECC_16TO18_BYTE_EN_V << SPI_MEM_ECC_16TO18_BYTE_EN_S)
340340
#define SPI_MEM_ECC_16TO18_BYTE_EN_V 0x00000001U
341341
#define SPI_MEM_ECC_16TO18_BYTE_EN_S 14
342-
/** SPI_MEM_SPLIT_TRANS_EN : R/W; bitpos: [24]; default: 1;
342+
/** SPI_MEM_SPLIT_TRANS_EN : R/W; bitpos: [24]; default: 0;
343343
* Set this bit to enable SPI0 split one AXI read flash transfer into two SPI
344344
* transfers when one transfer will cross flash or EXT_RAM page corner, valid no
345345
* matter whether there is an ECC region or not.
@@ -2896,7 +2896,7 @@ extern "C" {
28962896
#define SPI_SMEM_CS_HOLD_DELAY_M (SPI_SMEM_CS_HOLD_DELAY_V << SPI_SMEM_CS_HOLD_DELAY_S)
28972897
#define SPI_SMEM_CS_HOLD_DELAY_V 0x0000003FU
28982898
#define SPI_SMEM_CS_HOLD_DELAY_S 25
2899-
/** SPI_SMEM_SPLIT_TRANS_EN : HRO; bitpos: [31]; default: 1;
2899+
/** SPI_SMEM_SPLIT_TRANS_EN : HRO; bitpos: [31]; default: 0;
29002900
* Set this bit to enable SPI0 split one AXI accesses EXT_RAM transfer into two SPI
29012901
* transfers when one transfer will cross flash/EXT_RAM page corner, valid no matter
29022902
* whether there is an ECC region or not.
@@ -2962,14 +2962,14 @@ extern "C" {
29622962
* Manual Encryption physical address register
29632963
*/
29642964
#define SPI_MEM_XTS_PHYSICAL_ADDRESS_REG(i) (REG_SPI_MEM_BASE(i) + 0x348)
2965-
/** SPI_XTS_PHYSICAL_ADDRESS : R/W; bitpos: [25:0]; default: 0;
2965+
/** SPI_XTS_PHYSICAL_ADDRESS : R/W; bitpos: [29:0]; default: 0;
29662966
* This bits stores the physical-address parameter which will be used in manual
29672967
* encryption calculation. This value should aligned with byte number decided by
29682968
* line-size parameter.
29692969
*/
2970-
#define SPI_XTS_PHYSICAL_ADDRESS 0x03FFFFFFU
2970+
#define SPI_XTS_PHYSICAL_ADDRESS 0x3FFFFFFFU
29712971
#define SPI_XTS_PHYSICAL_ADDRESS_M (SPI_XTS_PHYSICAL_ADDRESS_V << SPI_XTS_PHYSICAL_ADDRESS_S)
2972-
#define SPI_XTS_PHYSICAL_ADDRESS_V 0x03FFFFFFU
2972+
#define SPI_XTS_PHYSICAL_ADDRESS_V 0x3FFFFFFFU
29732973
#define SPI_XTS_PHYSICAL_ADDRESS_S 0
29742974

29752975
/** SPI_MEM_XTS_TRIGGER_REG register
@@ -3033,7 +3033,7 @@ extern "C" {
30333033
* Manual Encryption version register
30343034
*/
30353035
#define SPI_MEM_XTS_DATE_REG(i) (REG_SPI_MEM_BASE(i) + 0x35c)
3036-
/** SPI_XTS_DATE : R/W; bitpos: [29:0]; default: 538972176;
3036+
/** SPI_XTS_DATE : R/W; bitpos: [29:0]; default: 539035911;
30373037
* This bits stores the last modified-time of manual encryption feature.
30383038
*/
30393039
#define SPI_XTS_DATE 0x3FFFFFFFU
@@ -3153,6 +3153,35 @@ extern "C" {
31533153
#define SPI_CRYPT_DPA_SELECT_REGISTER_V 0x00000001U
31543154
#define SPI_CRYPT_DPA_SELECT_REGISTER_S 4
31553155

3156+
/** SPI_MEM_XTS_PSEUDO_ROUND_CONF_REG register
3157+
* SPI memory cryption PSEUDO register
3158+
*/
3159+
#define SPI_MEM_XTS_PSEUDO_ROUND_CONF_REG(i) (REG_SPI_MEM_BASE(i) + 0x38c)
3160+
/** SPI_MEM_MODE_PSEUDO : R/W; bitpos: [1:0]; default: 0;
3161+
* Set the mode of pseudo. 2'b00: crypto without pseudo. 2'b01: state T with pseudo
3162+
* and state D without pseudo. 2'b10: state T with pseudo and state D with few pseudo.
3163+
* 2'b11: crypto with pseudo.
3164+
*/
3165+
#define SPI_MEM_MODE_PSEUDO 0x00000003U
3166+
#define SPI_MEM_MODE_PSEUDO_M (SPI_MEM_MODE_PSEUDO_V << SPI_MEM_MODE_PSEUDO_S)
3167+
#define SPI_MEM_MODE_PSEUDO_V 0x00000003U
3168+
#define SPI_MEM_MODE_PSEUDO_S 0
3169+
/** SPI_MEM_PSEUDO_BASE : R/W; bitpos: [5:2]; default: 2;
3170+
* xts aes peseudo function base round that must be performed.
3171+
*/
3172+
#define SPI_MEM_PSEUDO_BASE 0x0000000FU
3173+
#define SPI_MEM_PSEUDO_BASE_M (SPI_MEM_PSEUDO_BASE_V << SPI_MEM_PSEUDO_BASE_S)
3174+
#define SPI_MEM_PSEUDO_BASE_V 0x0000000FU
3175+
#define SPI_MEM_PSEUDO_BASE_S 2
3176+
/** SPI_MEM_PSEUDO_INC : R/W; bitpos: [7:6]; default: 2;
3177+
* xts aes peseudo function increment round that will be performed randomly between 0 &
3178+
* 2**(inc+1).
3179+
*/
3180+
#define SPI_MEM_PSEUDO_INC 0x00000003U
3181+
#define SPI_MEM_PSEUDO_INC_M (SPI_MEM_PSEUDO_INC_V << SPI_MEM_PSEUDO_INC_S)
3182+
#define SPI_MEM_PSEUDO_INC_V 0x00000003U
3183+
#define SPI_MEM_PSEUDO_INC_S 6
3184+
31563185
/** SPI_MEM_REGISTERRND_ECO_HIGH_REG register
31573186
* MSPI ECO high register
31583187
* This register is only for internal debugging purposes. Do not use it in
@@ -3187,7 +3216,7 @@ extern "C" {
31873216
* SPI0 version control register
31883217
*/
31893218
#define SPI_MEM_DATE_REG(i) (REG_SPI_MEM_BASE(i) + 0x3fc)
3190-
/** SPI_MEM_DATE : R/W; bitpos: [27:0]; default: 36712560;
3219+
/** SPI_MEM_DATE : R/W; bitpos: [27:0]; default: 36770128;
31913220
* SPI0 register version.
31923221
*/
31933222
#define SPI_MEM_DATE 0x0FFFFFFFU

components/soc/esp32c61/include/soc/spi_mem_c_struct.h

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ typedef union {
262262
*/
263263
uint32_t mem_ecc_16to18_byte_en:1;
264264
uint32_t reserved_15:9;
265-
/** mem_split_trans_en : R/W; bitpos: [24]; default: 1;
265+
/** mem_split_trans_en : R/W; bitpos: [24]; default: 0;
266266
* Set this bit to enable SPI0 split one AXI read flash transfer into two SPI
267267
* transfers when one transfer will cross flash or EXT_RAM page corner, valid no
268268
* matter whether there is an ECC region or not.
@@ -999,7 +999,7 @@ typedef union {
999999
* MSPI core clock cycles.
10001000
*/
10011001
uint32_t smem_cs_hold_delay:6;
1002-
/** smem_split_trans_en : HRO; bitpos: [31]; default: 1;
1002+
/** smem_split_trans_en : HRO; bitpos: [31]; default: 0;
10031003
* Set this bit to enable SPI0 split one AXI accesses EXT_RAM transfer into two SPI
10041004
* transfers when one transfer will cross flash/EXT_RAM page corner, valid no matter
10051005
* whether there is an ECC region or not.
@@ -2046,13 +2046,13 @@ typedef union {
20462046
*/
20472047
typedef union {
20482048
struct {
2049-
/** xts_physical_address : R/W; bitpos: [25:0]; default: 0;
2049+
/** xts_physical_address : R/W; bitpos: [29:0]; default: 0;
20502050
* This bits stores the physical-address parameter which will be used in manual
20512051
* encryption calculation. This value should aligned with byte number decided by
20522052
* line-size parameter.
20532053
*/
2054-
uint32_t xts_physical_address:26;
2055-
uint32_t reserved_26:6;
2054+
uint32_t xts_physical_address:30;
2055+
uint32_t reserved_30:2;
20562056
};
20572057
uint32_t val;
20582058
} spi_mem_c_xts_physical_address_reg_t;
@@ -2131,7 +2131,7 @@ typedef union {
21312131
*/
21322132
typedef union {
21332133
struct {
2134-
/** xts_date : R/W; bitpos: [29:0]; default: 538972176;
2134+
/** xts_date : R/W; bitpos: [29:0]; default: 539035911;
21352135
* This bits stores the last modified-time of manual encryption feature.
21362136
*/
21372137
uint32_t xts_date:30;
@@ -2241,6 +2241,33 @@ typedef union {
22412241
} spi_mem_c_dpa_ctrl_reg_t;
22422242

22432243

2244+
/** Group: External mem cryption PSEUDO registers */
2245+
/** Type of mem_xts_pseudo_round_conf register
2246+
* SPI memory cryption PSEUDO register
2247+
*/
2248+
typedef union {
2249+
struct {
2250+
/** mem_mode_pseudo : R/W; bitpos: [1:0]; default: 0;
2251+
* Set the mode of pseudo. 2'b00: crypto without pseudo. 2'b01: state T with pseudo
2252+
* and state D without pseudo. 2'b10: state T with pseudo and state D with few pseudo.
2253+
* 2'b11: crypto with pseudo.
2254+
*/
2255+
uint32_t mem_mode_pseudo:2;
2256+
/** mem_pseudo_base : R/W; bitpos: [5:2]; default: 2;
2257+
* xts aes peseudo function base round that must be performed.
2258+
*/
2259+
uint32_t mem_pseudo_base:4;
2260+
/** mem_pseudo_inc : R/W; bitpos: [7:6]; default: 2;
2261+
* xts aes peseudo function increment round that will be performed randomly between 0 &
2262+
* 2**(inc+1).
2263+
*/
2264+
uint32_t mem_pseudo_inc:2;
2265+
uint32_t reserved_8:24;
2266+
};
2267+
uint32_t val;
2268+
} spi_mem_c_xts_pseudo_round_conf_reg_t;
2269+
2270+
22442271
/** Group: ECO registers */
22452272
/** Type of mem_registerrnd_eco_high register
22462273
* MSPI ECO high register
@@ -2277,7 +2304,7 @@ typedef union {
22772304
*/
22782305
typedef union {
22792306
struct {
2280-
/** mem_date : R/W; bitpos: [27:0]; default: 36712560;
2307+
/** mem_date : R/W; bitpos: [27:0]; default: 36770128;
22812308
* SPI0 register version.
22822309
*/
22832310
uint32_t mem_date:28;
@@ -2359,7 +2386,8 @@ typedef struct {
23592386
volatile spi_mem_c_mmu_item_index_reg_t mem_mmu_item_index;
23602387
volatile spi_mem_c_mmu_power_ctrl_reg_t mem_mmu_power_ctrl;
23612388
volatile spi_mem_c_dpa_ctrl_reg_t mem_dpa_ctrl;
2362-
uint32_t reserved_38c[25];
2389+
volatile spi_mem_c_xts_pseudo_round_conf_reg_t mem_xts_pseudo_round_conf;
2390+
uint32_t reserved_390[24];
23632391
volatile spi_mem_c_registerrnd_eco_high_reg_t mem_registerrnd_eco_high;
23642392
volatile spi_mem_c_registerrnd_eco_low_reg_t mem_registerrnd_eco_low;
23652393
uint32_t reserved_3f8;

0 commit comments

Comments
 (0)