Merge branch 'fix/incorrect_reserved_bits_calculation_in_xts_pseudo_round_conf' into 'master'

fix(soc): Fix incorrect reserved bits calculation in xts_pseudo_round_conf

See merge request espressif/esp-idf!36473
This commit is contained in:
Harshal Patil 2025-01-23 18:49:03 +08:00
commit 9cabe79385
3 changed files with 17 additions and 13 deletions

View File

@ -72,7 +72,7 @@ check_chip_support_components:
expire_in: 1 week
script:
- python tools/ci/check_soc_headers_leak.py
- find ${IDF_PATH}/components/soc/**/include/soc/ -name "*_struct.h" -print0 | xargs -0 -n1 ./tools/ci/check_soc_struct_headers.py
- find ${IDF_PATH}/components/soc/**/include/soc/ ${IDF_PATH}/components/soc/**/register/soc/ -name "*_struct.h" -print0 | xargs -0 -n1 ./tools/ci/check_soc_struct_headers.py
- tools/ci/check_esp_memory_utils_headers.sh
check_esp_err_to_name:

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -1039,7 +1039,7 @@ typedef volatile struct spi_mem_dev_s {
uint32_t reg_pseudo_rng_cnt : 3; /*xts aes peseudo function base round that must be performed.*/
uint32_t reg_pseudo_base : 4; /*xts aes peseudo function base round that must be performed.*/
uint32_t reg_pseudo_inc : 2; /*xts aes peseudo function increment round that will be performed randomly between 0 & 2**(inc+1).*/
uint32_t reserved11 : 27; /*reserved*/
uint32_t reserved11 : 21; /*reserved*/
};
uint32_t val;
} xts_pseudo_round_conf;
@ -1080,6 +1080,11 @@ typedef volatile struct spi_mem_dev_s {
} spi_mem_dev_t;
extern spi_mem_dev_t SPIMEM0;
extern spi_mem_dev_t SPIMEM1;
#ifndef __cplusplus
_Static_assert(sizeof(spi_mem_dev_t) == 0x400, "Invalid size of spi_mem_dev_t structure");
#endif
#ifdef __cplusplus
}
#endif

View File

@ -1,12 +1,11 @@
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# A check script that just works at the time of writing...
#
# also builds a structure tree for further reference
#
# Input file format must be similiar to those headers generated by regtool, or this script makes no sense at all
# Input file format must be similar to those headers generated by regtool, or this script makes no sense at all
#
# Known limitation:
# 1. won't accept /* ... */ /* ... */': badly behavior with multiline comment
@ -21,18 +20,18 @@
# 5. typedef volatile struct xxx{}: xxx must exists
#
# Otherwise won't fail but warning
import os
import re
import sys
from typing import Any
from typing import Optional
class MemberField:
member_type = ''
bitfield = None
def __init__(self, m_type: str, m_bits: int=None) -> None:
def __init__(self, m_type: str, m_bits: Optional[int]=None) -> None:
self.member_type = m_type
self.bitfield = m_bits
@ -74,7 +73,7 @@ class SoCStructureHeaderChecker:
# named typedef, or named struct/union. referd but will not delete
__temp_ref_types = dict() # type: dict
def __expand_type(self, member_type: str, bitfield: int=None) -> Any:
def __expand_type(self, member_type: str, bitfield: Optional[int]=None) -> Any:
if member_type == 'uint32_t':
return MemberField(member_type, bitfield)
if bitfield is not None:
@ -121,7 +120,7 @@ class SoCStructureHeaderChecker:
# skip empty line
return self.__getline()
if rawline.count(';') > 1:
print('\033[0;34mINFO\033[0m: line: {}: possibily multiple expression within same line'.format(self.__linecount))
print('\033[0;34mINFO\033[0m: line: {}: possibly multiple expression within same line'.format(self.__linecount))
print(rawline)
return rawline
@ -129,7 +128,7 @@ class SoCStructureHeaderChecker:
ret_val = 0
# first check for anonymous register structs
if is_typedef and is_volatile and name is None:
print('\033[0;31mERROR\033[0m: line {}: annoymous struct'.format(self.__linecount))
print('\033[0;31mERROR\033[0m: line {}: anonymous struct'.format(self.__linecount))
ret_val = -1
node_tree = dict()
bitcount = 0
@ -252,7 +251,7 @@ class SoCStructureHeaderChecker:
ret_val = 0
# first check for anonymous register structs
if is_typedef and is_volatile and name is None:
print('\033[0;31mERROR\033[0m: line {}: annoymous union'.format(self.__linecount))
print('\033[0;31mERROR\033[0m: line {}: anonymous union'.format(self.__linecount))
ret_val = -1
node_tree = dict() # type: Any
has_struct_count = 0
@ -334,7 +333,7 @@ class SoCStructureHeaderChecker:
node_tree[match_obj.groups()[1]] = member_node
else:
if '*' not in match_obj.groups()[0]:
print('\033[0;31mERROR\033[0m: line {}: unknown type {}'.format(self.__linecount, match_obj.groups()[0]))
print('\033[0;31mWARN\033[0m: line {}: unknown type {}'.format(self.__linecount, match_obj.groups()[0]))
else:
print('\033[0;33mWARN\033[0m: line {}: pointer type {}'.format(self.__linecount, match_obj.groups()[0]))
continue