Merge changes from topic "us_tc4_rebase_v2" into integration
* changes:
feat(tc): bind DPU SMMU on TC4
feat(tc): bind GPU SMMU on TC4
feat(tc): update DT for Drage GPU
feat(tc): enable SME and SME2 options for TC4
feat(tc): add new TC4 RoS definitions
feat(tc): add system generic timer register definition for TC4
feat(tc): allow TARGET_VERSION=4
feat(tc): add MHUv3 register addresses for TC4
feat(tc): add device tree binding for TC4
diff --git a/Makefile b/Makefile
index 64bccbc..cb88758 100644
--- a/Makefile
+++ b/Makefile
@@ -121,9 +121,6 @@
SP_MK_GEN ?= ${SPTOOLPATH}/sp_mk_generator.py
SP_DTS_LIST_FRAGMENT ?= ${BUILD_PLAT}/sp_list_fragment.dts
-# Variables for use with Certificate Conversion (cot-dt2c) Tool
-CERTCONVPATH ?= tools/cot_dt2c
-
# Variables for use with ROMLIB
ROMLIBPATH ?= lib/romlib
@@ -1619,7 +1616,6 @@
clean:
$(s)echo " CLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_PLAT})
- $(q)${MAKE} -C ${CERTCONVPATH} clean
ifdef UNIX_MK
$(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
else
@@ -1635,7 +1631,6 @@
$(s)echo " REALCLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_BASE})
$(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*)
- $(q)${MAKE} -C ${CERTCONVPATH} clean
ifdef UNIX_MK
$(q)${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
else
diff --git a/changelog.yaml b/changelog.yaml
index df0476f..dbbff99 100644
--- a/changelog.yaml
+++ b/changelog.yaml
@@ -1450,6 +1450,9 @@
- title: Transfer List Compiler
scope: tlc
+ - title: Chain of Trust device tree to C source file
+ scope: cot-dt2c
+
- title: Dependencies
scope: deps
diff --git a/docs/about/maintainers.rst b/docs/about/maintainers.rst
index 8ac09ae..8bb12ab 100644
--- a/docs/about/maintainers.rst
+++ b/docs/about/maintainers.rst
@@ -858,8 +858,6 @@
:|G|: `rockchip-linux`_
:|M|: Heiko Stuebner <heiko@sntech.de>
:|G|: `mmind`_
-:|M|: Julius Werner <jwerner@chromium.org>
-:|G|: `jwerner-chromium`_
:|F|: plat/rockchip/
STMicroelectronics platform ports
diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst
index be38e15..203bf0f 100644
--- a/docs/getting_started/build-options.rst
+++ b/docs/getting_started/build-options.rst
@@ -848,7 +848,7 @@
- ``RME_GPT_MAX_BLOCK``: Numeric value in MB to define the maximum size of
supported contiguous blocks in GPT Library. This parameter can take the
values 0, 2, 32 and 512. Setting this value to 0 disables use of Contigious
- descriptors. Default value is 2.
+ descriptors. Default value is 512.
- ``ROT_KEY``: This option is used when ``GENERATE_COT=1``. It specifies a
file that contains the ROT private key in PEM format or a PKCS11 URI and
diff --git a/docs/tools/cot-dt2c.rst b/docs/tools/cot-dt2c.rst
index 7b7e56f..e8bb1ac 100644
--- a/docs/tools/cot-dt2c.rst
+++ b/docs/tools/cot-dt2c.rst
@@ -13,23 +13,15 @@
#. Python (3.8 or later)
#. `Poetry`_ Python package manager
-
Getting Started
~~~~~~~~~~~~~~~
-#. Install the tool
-
- .. code::
-
- make install
-
+``cot-dt2c`` is installed by default with TF-A's poetry environment. All of it's
+dependencies are listed in `tools/cot_dt2c/pyproject.toml`_.
-#. Verify that the tool runs correctly
-
- .. code::
-
- make test
-
+``cot-dt2c`` requires a standard DTS file without #ifdef, macros, or other
+preprocessor directives. Therefore, you need to provide a preprocessed device
+tree source(DTS) as input to the tool.
#. Usage of the tool
@@ -53,29 +45,6 @@
visualize-cot
validate-dt
-#. Uninstall the tool
- .. code::
-
- make uninstall
-
- This command will uninstall the tool
-
-
-#. Uninstall the tool and clean all the build file
- .. code::
-
- make clean
-
- This command will clean all the build file and implicitly uninstall the tool
-
-
-#. Call the make file from TF-A root directory
- .. code::
-
- make -C tools/cot-dt2c install
- make -C tools/cot-dt2c uninstall
- make -C tools/cot-dt2c clean
-
Convert CoT descriptors to C file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -88,7 +57,7 @@
.. code::
- cot-dt2c convert-to-c [INPUT DTB PATH] [OUTPUT C PATH]
+ cot-dt2c convert-to-c [INPUT DTS PATH] [OUTPUT C PATH]
cot-dt2c convert-to-c fdts/tbbr_cot_descriptors.dtsi test.c
@@ -111,7 +80,7 @@
.. code::
- cot-dt2c validate-cot [INPUT DTB PATH]
+ cot-dt2c validate-cot [INPUT DTS PATH]
cot-dt2c validate-cot fdts/tbbr_cot_descriptors.dtsi
@@ -123,7 +92,7 @@
.. code::
- cot-dt2c visualize-cot [INPUT DTB PATH]
+ cot-dt2c visualize-cot [INPUT DTS PATH]
cot-dt2c visualize-cot fdts/tbbr_cot_descriptors.dtsi
@@ -146,4 +115,5 @@
*Copyright (c) 2024, Arm Limited. All rights reserved.*
+.. _tools/cot_dt2c/pyproject.toml: https://review.trustedfirmware.org/plugins/gitiles/TF-A/trusted-firmware-a/+/refs/heads/integration/tools/cot_dt2c/pyproject.toml
.. _Poetry: https://python-poetry.org/docs/
diff --git a/drivers/rpi3/gpio/rpi3_gpio.c b/drivers/rpi3/gpio/rpi3_gpio.c
index 55a8832..460afe1 100644
--- a/drivers/rpi3/gpio/rpi3_gpio.c
+++ b/drivers/rpi3/gpio/rpi3_gpio.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2019, Linaro Limited
* Copyright (c) 2019, Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -120,7 +121,7 @@
int regN = gpio / 32;
int shift = gpio % 32;
uintptr_t reg_set = reg_base + RPI3_GPIO_GPSET(regN);
- uintptr_t reg_clr = reg_base + RPI3_GPIO_GPSET(regN);
+ uintptr_t reg_clr = reg_base + RPI3_GPIO_GPCLR(regN);
switch (value) {
case GPIO_LEVEL_LOW:
diff --git a/include/lib/cpus/aarch32/cpu_macros.S b/include/lib/cpus/aarch32/cpu_macros.S
index 096e0b1..cfa5831 100644
--- a/include/lib/cpus/aarch32/cpu_macros.S
+++ b/include/lib/cpus/aarch32/cpu_macros.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -115,11 +115,6 @@
.popsection
.endif
- /*
- * Mandatory errata status printing function for CPUs of
- * this class.
- */
- .word \_name\()_errata_report
.word \_name\()_cpu_str
#ifdef IMAGE_BL32
@@ -130,45 +125,6 @@
#endif
.endm
-#if REPORT_ERRATA
- /*
- * Print status of a CPU errata
- *
- * _chosen:
- * Identifier indicating whether or not a CPU errata has been
- * compiled in.
- * _cpu:
- * Name of the CPU
- * _id:
- * Errata identifier
- * _rev_var:
- * Register containing the combined value CPU revision and variant
- * - typically the return value of cpu_get_rev_var
- */
- .macro report_errata _chosen, _cpu, _id, _rev_var=r4
- /* Stash a string with errata ID */
- .pushsection .rodata
- \_cpu\()_errata_\_id\()_str:
- .asciz "\_id"
- .popsection
-
- /* Check whether errata applies */
- mov r0, \_rev_var
- bl check_errata_\_id
-
- .ifeq \_chosen
- /*
- * Errata workaround has not been compiled in. If the errata would have
- * applied had it been compiled in, print its status as missing.
- */
- cmp r0, #0
- movne r0, #ERRATA_MISSING
- .endif
- ldr r1, =\_cpu\()_cpu_str
- ldr r2, =\_cpu\()_errata_\_id\()_str
- bl errata_print_msg
- .endm
-#endif
/*
* Helper macro that reads the part number of the current CPU and jumps
* to the given label if it matches the CPU MIDR provided.
@@ -239,21 +195,4 @@
.popsection
.endm
-/*
- * Maintain compatibility with the old scheme of "each cpu has its own reporter".
- * TODO remove entirely once all cpus have been converted. This includes the
- * cpu_ops entry, as print_errata_status can call this directly for all cpus
- */
-.macro errata_report_shim _cpu:req
- #if REPORT_ERRATA
- func \_cpu\()_errata_report
- push {r12, lr}
-
- bl generic_errata_report
-
- pop {r12, lr}
- bx lr
- endfunc \_cpu\()_errata_report
- #endif
-.endm
#endif /* CPU_MACROS_S */
diff --git a/include/lib/cpus/aarch64/cpu_macros.S b/include/lib/cpus/aarch64/cpu_macros.S
index d49d82e..98294b9 100644
--- a/include/lib/cpus/aarch64/cpu_macros.S
+++ b/include/lib/cpus/aarch64/cpu_macros.S
@@ -132,12 +132,6 @@
.popsection
.endif
-
- /*
- * Mandatory errata status printing function for CPUs of
- * this class.
- */
- .quad \_name\()_errata_report
.quad \_name\()_cpu_str
#ifdef IMAGE_BL31
@@ -171,49 +165,6 @@
\_extra1, \_extra2, \_extra3, 0, \_power_down_ops
.endm
-/* TODO can be deleted once all CPUs have been converted */
-#if REPORT_ERRATA
- /*
- * Print status of a CPU errata
- *
- * _chosen:
- * Identifier indicating whether or not a CPU errata has been
- * compiled in.
- * _cpu:
- * Name of the CPU
- * _id:
- * Errata identifier
- * _rev_var:
- * Register containing the combined value CPU revision and variant
- * - typically the return value of cpu_get_rev_var
- */
- .macro report_errata _chosen, _cpu, _id, _rev_var=x8
- /* Stash a string with errata ID */
- .pushsection .rodata
- \_cpu\()_errata_\_id\()_str:
- .asciz "\_id"
- .popsection
-
- /* Check whether errata applies */
- mov x0, \_rev_var
- /* Shall clobber: x0-x7 */
- bl check_errata_\_id
-
- .ifeq \_chosen
- /*
- * Errata workaround has not been compiled in. If the errata would have
- * applied had it been compiled in, print its status as missing.
- */
- cbz x0, 900f
- mov x0, #ERRATA_MISSING
- .endif
-900:
- adr x1, \_cpu\()_cpu_str
- adr x2, \_cpu\()_errata_\_id\()_str
- bl errata_print_msg
- .endm
-#endif
-
/*
* This macro is used on some CPUs to detect if they are vulnerable
* to CVE-2017-5715.
@@ -622,23 +573,4 @@
endfunc \_cpu\()_reset_func
.endm
-/*
- * Maintain compatibility with the old scheme of each cpu has its own reporting.
- * TODO remove entirely once all cpus have been converted. This includes the
- * cpu_ops entry, as print_errata_status can call this directly for all cpus
- */
-.macro errata_report_shim _cpu:req
- #if REPORT_ERRATA
- func \_cpu\()_errata_report
- /* normal stack frame for pretty debugging */
- stp x29, x30, [sp, #-16]!
- mov x29, sp
-
- bl generic_errata_report
-
- ldp x29, x30, [sp], #16
- ret
- endfunc \_cpu\()_errata_report
- #endif
-.endm
#endif /* CPU_MACROS_S */
diff --git a/include/lib/cpus/cpu_ops.h b/include/lib/cpus/cpu_ops.h
index 8b36ff1..0084189 100644
--- a/include/lib/cpus/cpu_ops.h
+++ b/include/lib/cpus/cpu_ops.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -57,7 +57,6 @@
#define CPU_ERRATA_LIST_END_SIZE CPU_WORD_SIZE
/* Fields required to print errata status */
#if REPORT_ERRATA
-#define CPU_ERRATA_FUNC_SIZE CPU_WORD_SIZE
#define CPU_CPU_STR_SIZE CPU_WORD_SIZE
/* BL1 doesn't require mutual exclusion and printed flag. */
#if defined(IMAGE_BL31) || defined(IMAGE_BL32)
@@ -68,7 +67,6 @@
#define CPU_ERRATA_PRINTED_SIZE 0
#endif /* defined(IMAGE_BL31) || defined(IMAGE_BL32) */
#else
-#define CPU_ERRATA_FUNC_SIZE 0
#define CPU_CPU_STR_SIZE 0
#define CPU_ERRATA_LOCK_SIZE 0
#define CPU_ERRATA_PRINTED_SIZE 0
@@ -98,8 +96,7 @@
#endif /* __aarch64__ */
#define CPU_ERRATA_LIST_START CPU_PWR_DWN_OPS + CPU_PWR_DWN_OPS_SIZE
#define CPU_ERRATA_LIST_END CPU_ERRATA_LIST_START + CPU_ERRATA_LIST_START_SIZE
-#define CPU_ERRATA_FUNC CPU_ERRATA_LIST_END + CPU_ERRATA_LIST_END_SIZE
-#define CPU_CPU_STR CPU_ERRATA_FUNC + CPU_ERRATA_FUNC_SIZE
+#define CPU_CPU_STR CPU_ERRATA_LIST_END + CPU_ERRATA_LIST_END_SIZE
#define CPU_ERRATA_LOCK CPU_CPU_STR + CPU_CPU_STR_SIZE
#define CPU_ERRATA_PRINTED CPU_ERRATA_LOCK + CPU_ERRATA_LOCK_SIZE
#if __aarch64__
@@ -130,7 +127,6 @@
void *errata_list_start;
void *errata_list_end;
#if REPORT_ERRATA
- void (*errata_func)(void);
char *cpu_str;
#if defined(IMAGE_BL31) || defined(IMAGE_BL32)
spinlock_t *errata_lock;
diff --git a/include/lib/cpus/errata.h b/include/lib/cpus/errata.h
index a8eb84c..ef1b02b 100644
--- a/include/lib/cpus/errata.h
+++ b/include/lib/cpus/errata.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -34,7 +34,6 @@
#include <lib/cassert.h>
void print_errata_status(void);
-void errata_print_msg(unsigned int status, const char *cpu, const char *id);
#if ERRATA_A520_2938996 || ERRATA_X4_2726228
unsigned int check_if_affected_core(void);
diff --git a/lib/cpus/aarch32/aem_generic.S b/lib/cpus/aarch32/aem_generic.S
index 9f45e38..f4dc0d1 100644
--- a/lib/cpus/aarch32/aem_generic.S
+++ b/lib/cpus/aarch32/aem_generic.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -40,14 +40,6 @@
b dcsw_op_all
endfunc aem_generic_cluster_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for AEM. Must follow AAPCS.
- */
-func aem_generic_errata_report
- bx lr
-endfunc aem_generic_errata_report
-#endif
/* cpu_ops for Base AEM FVP */
declare_cpu_ops aem_generic, BASE_AEM_MIDR, CPU_NO_RESET_FUNC, \
diff --git a/lib/cpus/aarch32/cortex_a12.S b/lib/cpus/aarch32/cortex_a12.S
index 8eec27c..b95020e 100644
--- a/lib/cpus/aarch32/cortex_a12.S
+++ b/lib/cpus/aarch32/cortex_a12.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -73,8 +73,6 @@
b cortex_a12_disable_smp
endfunc cortex_a12_cluster_pwr_dwn
-errata_report_shim cortex_a12
-
declare_cpu_ops cortex_a12, CORTEX_A12_MIDR, \
cortex_a12_reset_func, \
cortex_a12_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a15.S b/lib/cpus/aarch32/cortex_a15.S
index b41676d..53489ad 100644
--- a/lib/cpus/aarch32/cortex_a15.S
+++ b/lib/cpus/aarch32/cortex_a15.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -172,8 +172,6 @@
b cortex_a15_disable_smp
endfunc cortex_a15_cluster_pwr_dwn
-errata_report_shim cortex_a15
-
declare_cpu_ops cortex_a15, CORTEX_A15_MIDR, \
cortex_a15_reset_func, \
cortex_a15_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a17.S b/lib/cpus/aarch32/cortex_a17.S
index 1877570..05e9616 100644
--- a/lib/cpus/aarch32/cortex_a17.S
+++ b/lib/cpus/aarch32/cortex_a17.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -106,8 +106,6 @@
add_erratum_entry cortex_a17, CVE(2017, 5715), WORKAROUND_CVE_2017_5715
-errata_report_shim cortex_a17
-
func cortex_a17_reset_func
mov r5, lr
bl cpu_get_rev_var
diff --git a/lib/cpus/aarch32/cortex_a32.S b/lib/cpus/aarch32/cortex_a32.S
index d08b4ff..c92a8c1 100644
--- a/lib/cpus/aarch32/cortex_a32.S
+++ b/lib/cpus/aarch32/cortex_a32.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -117,8 +117,6 @@
b cortex_a32_disable_smp
endfunc cortex_a32_cluster_pwr_dwn
-errata_report_shim cortex_a32
-
declare_cpu_ops cortex_a32, CORTEX_A32_MIDR, \
cortex_a32_reset_func, \
cortex_a32_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a5.S b/lib/cpus/aarch32/cortex_a5.S
index 625ea7b..146eb9c 100644
--- a/lib/cpus/aarch32/cortex_a5.S
+++ b/lib/cpus/aarch32/cortex_a5.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -69,8 +69,6 @@
b cortex_a5_disable_smp
endfunc cortex_a5_cluster_pwr_dwn
-errata_report_shim cortex_a5
-
declare_cpu_ops cortex_a5, CORTEX_A5_MIDR, \
cortex_a5_reset_func, \
cortex_a5_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a53.S b/lib/cpus/aarch32/cortex_a53.S
index 89b238a..60be2b3 100644
--- a/lib/cpus/aarch32/cortex_a53.S
+++ b/lib/cpus/aarch32/cortex_a53.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -297,8 +297,6 @@
b cortex_a53_disable_smp
endfunc cortex_a53_cluster_pwr_dwn
-errata_report_shim cortex_a53
-
declare_cpu_ops cortex_a53, CORTEX_A53_MIDR, \
cortex_a53_reset_func, \
cortex_a53_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a57.S b/lib/cpus/aarch32/cortex_a57.S
index 1e5377b..d563482 100644
--- a/lib/cpus/aarch32/cortex_a57.S
+++ b/lib/cpus/aarch32/cortex_a57.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -606,8 +606,6 @@
b cortex_a57_disable_ext_debug
endfunc cortex_a57_cluster_pwr_dwn
-errata_report_shim cortex_a57
-
declare_cpu_ops cortex_a57, CORTEX_A57_MIDR, \
cortex_a57_reset_func, \
cortex_a57_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a7.S b/lib/cpus/aarch32/cortex_a7.S
index 4842ca6..f99ae79 100644
--- a/lib/cpus/aarch32/cortex_a7.S
+++ b/lib/cpus/aarch32/cortex_a7.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -73,8 +73,6 @@
b cortex_a7_disable_smp
endfunc cortex_a7_cluster_pwr_dwn
-errata_report_shim cortex_a7
-
declare_cpu_ops cortex_a7, CORTEX_A7_MIDR, \
cortex_a7_reset_func, \
cortex_a7_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a72.S b/lib/cpus/aarch32/cortex_a72.S
index 77cf84d..8d399fd 100644
--- a/lib/cpus/aarch32/cortex_a72.S
+++ b/lib/cpus/aarch32/cortex_a72.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -256,8 +256,6 @@
b cortex_a72_disable_ext_debug
endfunc cortex_a72_cluster_pwr_dwn
-errata_report_shim cortex_a72
-
declare_cpu_ops cortex_a72, CORTEX_A72_MIDR, \
cortex_a72_reset_func, \
cortex_a72_core_pwr_dwn, \
diff --git a/lib/cpus/aarch32/cortex_a9.S b/lib/cpus/aarch32/cortex_a9.S
index 1e9757a..dc5ff27 100644
--- a/lib/cpus/aarch32/cortex_a9.S
+++ b/lib/cpus/aarch32/cortex_a9.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -57,8 +57,6 @@
add_erratum_entry cortex_a9, CVE(2017, 5715), WORKAROUND_CVE_2017_5715
-errata_report_shim cortex_a9
-
func cortex_a9_reset_func
#if IMAGE_BL32 && WORKAROUND_CVE_2017_5715
ldr r0, =wa_cve_2017_5715_bpiall_vbar
diff --git a/lib/cpus/aarch64/a64fx.S b/lib/cpus/aarch64/a64fx.S
index 54c20c3..4893a44 100644
--- a/lib/cpus/aarch64/a64fx.S
+++ b/lib/cpus/aarch64/a64fx.S
@@ -16,15 +16,6 @@
func a64fx_cluster_pwr_dwn
endfunc a64fx_cluster_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for A64FX. Must follow AAPCS.
- */
-func a64fx_errata_report
- ret
-endfunc a64fx_errata_report
-#endif
-
/* ---------------------------------------------
* This function provides cpu specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/aem_generic.S b/lib/cpus/aarch64/aem_generic.S
index d47279a..d5634cf 100644
--- a/lib/cpus/aarch64/aem_generic.S
+++ b/lib/cpus/aarch64/aem_generic.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2019, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -74,15 +74,6 @@
b dcsw_op_all
endfunc aem_generic_cluster_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for AEM. Must follow AAPCS.
- */
-func aem_generic_errata_report
- ret
-endfunc aem_generic_errata_report
-#endif
-
/* ---------------------------------------------
* This function provides cpu specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a35.S b/lib/cpus/aarch64/cortex_a35.S
index 6ffb944..c3d8c8d 100644
--- a/lib/cpus/aarch64/cortex_a35.S
+++ b/lib/cpus/aarch64/cortex_a35.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -111,8 +111,6 @@
b cortex_a35_disable_smp
endfunc cortex_a35_cluster_pwr_dwn
-errata_report_shim cortex_a35
-
/* ---------------------------------------------
* This function provides cortex_a35 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a510.S b/lib/cpus/aarch64/cortex_a510.S
index a59b92c..b49d45a 100644
--- a/lib/cpus/aarch64/cortex_a510.S
+++ b/lib/cpus/aarch64/cortex_a510.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2023-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -204,8 +204,6 @@
ret
endfunc cortex_a510_core_pwr_dwn
-errata_report_shim cortex_a510
-
cpu_reset_func_start cortex_a510
/* Disable speculative loads */
msr SSBS, xzr
diff --git a/lib/cpus/aarch64/cortex_a520.S b/lib/cpus/aarch64/cortex_a520.S
index b8f1468..811c836 100644
--- a/lib/cpus/aarch64/cortex_a520.S
+++ b/lib/cpus/aarch64/cortex_a520.S
@@ -68,8 +68,6 @@
ret
endfunc cortex_a520_core_pwr_dwn
-errata_report_shim cortex_a520
-
cpu_reset_func_start cortex_a520
/* Disable speculative loads */
msr SSBS, xzr
diff --git a/lib/cpus/aarch64/cortex_a53.S b/lib/cpus/aarch64/cortex_a53.S
index e6fb08a..4a5b318 100644
--- a/lib/cpus/aarch64/cortex_a53.S
+++ b/lib/cpus/aarch64/cortex_a53.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -199,8 +199,6 @@
b cortex_a53_disable_smp
endfunc cortex_a53_cluster_pwr_dwn
-errata_report_shim cortex_a53
-
/* ---------------------------------------------
* This function provides cortex_a53 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a55.S b/lib/cpus/aarch64/cortex_a55.S
index 712b6e0..d5a74e9 100644
--- a/lib/cpus/aarch64/cortex_a55.S
+++ b/lib/cpus/aarch64/cortex_a55.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -116,8 +116,6 @@
cpu_reset_func_start cortex_a55
cpu_reset_func_end cortex_a55
-errata_report_shim cortex_a55
-
/* ---------------------------------------------
* HW will do the cache maintenance while powering down
* ---------------------------------------------
diff --git a/lib/cpus/aarch64/cortex_a57.S b/lib/cpus/aarch64/cortex_a57.S
index 8fafaca..374cc5d 100644
--- a/lib/cpus/aarch64/cortex_a57.S
+++ b/lib/cpus/aarch64/cortex_a57.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -284,8 +284,6 @@
b cortex_a57_disable_ext_debug
endfunc cortex_a57_cluster_pwr_dwn
-errata_report_shim cortex_a57
-
/* ---------------------------------------------
* This function provides cortex_a57 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a65.S b/lib/cpus/aarch64/cortex_a65.S
index 666324c..3023ecb 100644
--- a/lib/cpus/aarch64/cortex_a65.S
+++ b/lib/cpus/aarch64/cortex_a65.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -45,26 +45,6 @@
ret
endfunc cortex_a65_cpu_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for Cortex-A65. Must follow AAPCS.
- */
-func cortex_a65_errata_report
- stp x8, x30, [sp, #-16]!
-
- bl cpu_get_rev_var
- mov x8, x0
-
- /*
- * Report all errata. The revision-variant information is passed to
- * checking functions of each errata.
- */
- report_errata ERRATA_DSU_936184, cortex_a65, dsu_936184
-
- ldp x8, x30, [sp], #16
- ret
-endfunc cortex_a65_errata_report
-#endif
.section .rodata.cortex_a65_regs, "aS"
cortex_a65_regs: /* The ascii list of register names to be reported */
diff --git a/lib/cpus/aarch64/cortex_a65ae.S b/lib/cpus/aarch64/cortex_a65ae.S
index 85d1894..1cbb06a 100644
--- a/lib/cpus/aarch64/cortex_a65ae.S
+++ b/lib/cpus/aarch64/cortex_a65ae.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -41,8 +41,6 @@
ret
endfunc cortex_a65ae_cpu_pwr_dwn
-errata_report_shim cortex_a65ae
-
.section .rodata.cortex_a65ae_regs, "aS"
cortex_a65ae_regs: /* The ascii list of register names to be reported */
.asciz "cpuectlr_el1", ""
diff --git a/lib/cpus/aarch64/cortex_a710.S b/lib/cpus/aarch64/cortex_a710.S
index b99fbb3..4c33dda 100644
--- a/lib/cpus/aarch64/cortex_a710.S
+++ b/lib/cpus/aarch64/cortex_a710.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -229,8 +229,6 @@
ret
endfunc cortex_a710_core_pwr_dwn
-errata_report_shim cortex_a710
-
cpu_reset_func_start cortex_a710
/* Disable speculative loads */
msr SSBS, xzr
diff --git a/lib/cpus/aarch64/cortex_a715.S b/lib/cpus/aarch64/cortex_a715.S
index 16be161..8c9988d 100644
--- a/lib/cpus/aarch64/cortex_a715.S
+++ b/lib/cpus/aarch64/cortex_a715.S
@@ -148,8 +148,6 @@
ret
endfunc cortex_a715_core_pwr_dwn
-errata_report_shim cortex_a715
-
/* ---------------------------------------------
* This function provides Cortex-A715 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a72.S b/lib/cpus/aarch64/cortex_a72.S
index 997f261..c300ea7 100644
--- a/lib/cpus/aarch64/cortex_a72.S
+++ b/lib/cpus/aarch64/cortex_a72.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -271,8 +271,6 @@
b cortex_a72_disable_ext_debug
endfunc cortex_a72_cluster_pwr_dwn
-errata_report_shim cortex_a72
-
/* ---------------------------------------------
* This function provides cortex_a72 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a720.S b/lib/cpus/aarch64/cortex_a720.S
index 9cc3cbc..9befb36 100644
--- a/lib/cpus/aarch64/cortex_a720.S
+++ b/lib/cpus/aarch64/cortex_a720.S
@@ -92,8 +92,6 @@
ret
endfunc cortex_a720_core_pwr_dwn
-errata_report_shim cortex_a720
-
/* ---------------------------------------------
* This function provides Cortex A720-specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a725.S b/lib/cpus/aarch64/cortex_a725.S
index c08945f..af98d14 100644
--- a/lib/cpus/aarch64/cortex_a725.S
+++ b/lib/cpus/aarch64/cortex_a725.S
@@ -40,8 +40,6 @@
ret
endfunc cortex_a725_core_pwr_dwn
-errata_report_shim cortex_a725
-
/* ---------------------------------------------
* This function provides Cortex-A725 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a73.S b/lib/cpus/aarch64/cortex_a73.S
index 3a6b922..2130ceb 100644
--- a/lib/cpus/aarch64/cortex_a73.S
+++ b/lib/cpus/aarch64/cortex_a73.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -178,9 +178,6 @@
b cortex_a73_disable_smp
endfunc cortex_a73_cluster_pwr_dwn
-
-errata_report_shim cortex_a73
-
/* ---------------------------------------------
* This function provides cortex_a73 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a75.S b/lib/cpus/aarch64/cortex_a75.S
index c90be67..9115303 100644
--- a/lib/cpus/aarch64/cortex_a75.S
+++ b/lib/cpus/aarch64/cortex_a75.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -146,8 +146,6 @@
ret
endfunc cortex_a75_core_pwr_dwn
-errata_report_shim cortex_a75
-
/* ---------------------------------------------
* This function provides cortex_a75 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a76.S b/lib/cpus/aarch64/cortex_a76.S
index 8b3d730..97e036e 100644
--- a/lib/cpus/aarch64/cortex_a76.S
+++ b/lib/cpus/aarch64/cortex_a76.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -511,8 +511,6 @@
ret
endfunc cortex_a76_core_pwr_dwn
-errata_report_shim cortex_a76
-
/* ---------------------------------------------
* This function provides cortex_a76 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a76ae.S b/lib/cpus/aarch64/cortex_a76ae.S
index 08a6ef9..2fe3dbc 100644
--- a/lib/cpus/aarch64/cortex_a76ae.S
+++ b/lib/cpus/aarch64/cortex_a76ae.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -41,8 +41,6 @@
cpu_reset_func_start cortex_a76ae
cpu_reset_func_end cortex_a76ae
-errata_report_shim cortex_a76ae
-
/* ----------------------------------------------------
* HW will do the cache maintenance while powering down
* ----------------------------------------------------
diff --git a/lib/cpus/aarch64/cortex_a77.S b/lib/cpus/aarch64/cortex_a77.S
index 86c2561..d1fc41a 100644
--- a/lib/cpus/aarch64/cortex_a77.S
+++ b/lib/cpus/aarch64/cortex_a77.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -167,7 +167,6 @@
ret
endfunc cortex_a77_core_pwr_dwn
-errata_report_shim cortex_a77
/* ---------------------------------------------
* This function provides Cortex-A77 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a78.S b/lib/cpus/aarch64/cortex_a78.S
index b5c24e1..5a63e78 100644
--- a/lib/cpus/aarch64/cortex_a78.S
+++ b/lib/cpus/aarch64/cortex_a78.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -198,8 +198,6 @@
ret
endfunc cortex_a78_core_pwr_dwn
-errata_report_shim cortex_a78
-
/* ---------------------------------------------
* This function provides cortex_a78 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a78_ae.S b/lib/cpus/aarch64/cortex_a78_ae.S
index d3a3e5d..bc10186 100644
--- a/lib/cpus/aarch64/cortex_a78_ae.S
+++ b/lib/cpus/aarch64/cortex_a78_ae.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
* Copyright (c) 2021-2023, NVIDIA Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -128,8 +128,6 @@
ret
endfunc cortex_a78_ae_core_pwr_dwn
-errata_report_shim cortex_a78_ae
-
/* -------------------------------------------------------
* This function provides cortex_a78_ae specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_a78c.S b/lib/cpus/aarch64/cortex_a78c.S
index 0dc34f7..97d5743 100644
--- a/lib/cpus/aarch64/cortex_a78c.S
+++ b/lib/cpus/aarch64/cortex_a78c.S
@@ -121,8 +121,6 @@
cpu_reset_func_start cortex_a78c
cpu_reset_func_end cortex_a78c
-errata_report_shim cortex_a78c
-
/* ----------------------------------------------------
* HW will do the cache maintenance while powering down
* ----------------------------------------------------
diff --git a/lib/cpus/aarch64/cortex_gelas.S b/lib/cpus/aarch64/cortex_gelas.S
index 8870019..891e9a6 100644
--- a/lib/cpus/aarch64/cortex_gelas.S
+++ b/lib/cpus/aarch64/cortex_gelas.S
@@ -58,8 +58,6 @@
ret
endfunc cortex_gelas_core_pwr_dwn
-errata_report_shim cortex_gelas
-
/* ---------------------------------------------
* This function provides Gelas specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_x1.S b/lib/cpus/aarch64/cortex_x1.S
index 42634f1..ca6cac9 100644
--- a/lib/cpus/aarch64/cortex_x1.S
+++ b/lib/cpus/aarch64/cortex_x1.S
@@ -66,8 +66,6 @@
ret
endfunc cortex_x1_core_pwr_dwn
-errata_report_shim cortex_x1
-
/* ---------------------------------------------
* This function provides Cortex X1 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_x2.S b/lib/cpus/aarch64/cortex_x2.S
index d018182..ab0b19d 100644
--- a/lib/cpus/aarch64/cortex_x2.S
+++ b/lib/cpus/aarch64/cortex_x2.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -182,8 +182,6 @@
ret
endfunc cortex_x2_core_pwr_dwn
-errata_report_shim cortex_x2
-
cpu_reset_func_start cortex_x2
/* Disable speculative loads */
msr SSBS, xzr
diff --git a/lib/cpus/aarch64/cortex_x3.S b/lib/cpus/aarch64/cortex_x3.S
index 49e9ad1..248f107 100644
--- a/lib/cpus/aarch64/cortex_x3.S
+++ b/lib/cpus/aarch64/cortex_x3.S
@@ -125,8 +125,6 @@
ret
endfunc cortex_x3_core_pwr_dwn
-errata_report_shim cortex_x3
-
/* ---------------------------------------------
* This function provides Cortex-X3-
* specific register information for crash
diff --git a/lib/cpus/aarch64/cortex_x4.S b/lib/cpus/aarch64/cortex_x4.S
index 7c9a5a4..1220d38 100644
--- a/lib/cpus/aarch64/cortex_x4.S
+++ b/lib/cpus/aarch64/cortex_x4.S
@@ -103,8 +103,6 @@
ret
endfunc cortex_x4_core_pwr_dwn
-errata_report_shim cortex_x4
-
/* ---------------------------------------------
* This function provides Cortex X4-specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/cortex_x925.S b/lib/cpus/aarch64/cortex_x925.S
index 36b442e..8109ffb 100644
--- a/lib/cpus/aarch64/cortex_x925.S
+++ b/lib/cpus/aarch64/cortex_x925.S
@@ -40,8 +40,6 @@
ret
endfunc cortex_x925_core_pwr_dwn
-errata_report_shim cortex_x925
-
/* ---------------------------------------------
* This function provides Cortex-X925 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/denver.S b/lib/cpus/aarch64/denver.S
index 884281d..ca250d3 100644
--- a/lib/cpus/aarch64/denver.S
+++ b/lib/cpus/aarch64/denver.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2020-2022, NVIDIA Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -296,8 +296,6 @@
ret
endfunc denver_cluster_pwr_dwn
-errata_report_shim denver
-
/* ---------------------------------------------
* This function provides Denver specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/generic.S b/lib/cpus/aarch64/generic.S
index ef1f048..5d7a857 100644
--- a/lib/cpus/aarch64/generic.S
+++ b/lib/cpus/aarch64/generic.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -79,7 +79,6 @@
* Unimplemented functions.
* ---------------------------------------------
*/
-.equ generic_errata_report, 0
.equ generic_cpu_reg_dump, 0
.equ generic_reset_func, 0
diff --git a/lib/cpus/aarch64/neoverse_e1.S b/lib/cpus/aarch64/neoverse_e1.S
index 45bd8d3..4bc95d0 100644
--- a/lib/cpus/aarch64/neoverse_e1.S
+++ b/lib/cpus/aarch64/neoverse_e1.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -42,8 +42,6 @@
ret
endfunc neoverse_e1_cpu_pwr_dwn
-errata_report_shim neoverse_e1
-
.section .rodata.neoverse_e1_regs, "aS"
neoverse_e1_regs: /* The ascii list of register names to be reported */
.asciz "cpuectlr_el1", ""
diff --git a/lib/cpus/aarch64/neoverse_n1.S b/lib/cpus/aarch64/neoverse_n1.S
index 36a7ee7..50e1ae3 100644
--- a/lib/cpus/aarch64/neoverse_n1.S
+++ b/lib/cpus/aarch64/neoverse_n1.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -242,8 +242,6 @@
ret
endfunc neoverse_n1_core_pwr_dwn
-errata_report_shim neoverse_n1
-
/*
* Handle trap of EL0 IC IVAU instructions to EL3 by executing a TLB
* inner-shareable invalidation to an arbitrary address followed by a DSB.
diff --git a/lib/cpus/aarch64/neoverse_n2.S b/lib/cpus/aarch64/neoverse_n2.S
index a85d956..7d7cc44 100644
--- a/lib/cpus/aarch64/neoverse_n2.S
+++ b/lib/cpus/aarch64/neoverse_n2.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -282,8 +282,6 @@
ret
endfunc neoverse_n2_core_pwr_dwn
-errata_report_shim neoverse_n2
-
/* ---------------------------------------------
* This function provides Neoverse N2 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/neoverse_n3.S b/lib/cpus/aarch64/neoverse_n3.S
index 0b33b7e..d96c9d4 100644
--- a/lib/cpus/aarch64/neoverse_n3.S
+++ b/lib/cpus/aarch64/neoverse_n3.S
@@ -45,8 +45,6 @@
ret
endfunc neoverse_n3_core_pwr_dwn
-errata_report_shim neoverse_n3
-
/* ---------------------------------------------
* This function provides Neoverse-N3 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/neoverse_v1.S b/lib/cpus/aarch64/neoverse_v1.S
index c2fbb11..89299b7 100644
--- a/lib/cpus/aarch64/neoverse_v1.S
+++ b/lib/cpus/aarch64/neoverse_v1.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -259,8 +259,6 @@
ret
endfunc neoverse_v1_core_pwr_dwn
-errata_report_shim neoverse_v1
-
cpu_reset_func_start neoverse_v1
/* Disable speculative loads */
msr SSBS, xzr
diff --git a/lib/cpus/aarch64/neoverse_v2.S b/lib/cpus/aarch64/neoverse_v2.S
index 3179918..d8c32a4 100644
--- a/lib/cpus/aarch64/neoverse_v2.S
+++ b/lib/cpus/aarch64/neoverse_v2.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -116,7 +116,6 @@
#endif
cpu_reset_func_end neoverse_v2
-errata_report_shim neoverse_v2
/* ---------------------------------------------
* This function provides Neoverse V2-
* specific register information for crash
diff --git a/lib/cpus/aarch64/neoverse_v3.S b/lib/cpus/aarch64/neoverse_v3.S
index 67258c8..01ac38f 100644
--- a/lib/cpus/aarch64/neoverse_v3.S
+++ b/lib/cpus/aarch64/neoverse_v3.S
@@ -60,8 +60,6 @@
msr SSBS, xzr
cpu_reset_func_end neoverse_v3
-errata_report_shim neoverse_v3
-
/* ---------------------------------------------
* This function provides Neoverse V3 specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/nevis.S b/lib/cpus/aarch64/nevis.S
index 36830a9..0180ab7 100644
--- a/lib/cpus/aarch64/nevis.S
+++ b/lib/cpus/aarch64/nevis.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2023-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -40,8 +40,6 @@
ret
endfunc nevis_core_pwr_dwn
-errata_report_shim nevis
-
.section .rodata.nevis_regs, "aS"
nevis_regs: /* The ASCII list of register names to be reported */
.asciz "cpuectlr_el1", ""
diff --git a/lib/cpus/aarch64/qemu_max.S b/lib/cpus/aarch64/qemu_max.S
index 00963bc..fb03cf1 100644
--- a/lib/cpus/aarch64/qemu_max.S
+++ b/lib/cpus/aarch64/qemu_max.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -47,8 +47,6 @@
b dcsw_op_all
endfunc qemu_max_cluster_pwr_dwn
-errata_report_shim qemu_max
-
/* ---------------------------------------------
* This function provides cpu specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/rainier.S b/lib/cpus/aarch64/rainier.S
index c770f54..ea687be 100644
--- a/lib/cpus/aarch64/rainier.S
+++ b/lib/cpus/aarch64/rainier.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -80,8 +80,6 @@
ret
endfunc rainier_core_pwr_dwn
-errata_report_shim rainier
-
/* ---------------------------------------------
* This function provides Rainier specific
* register information for crash reporting.
diff --git a/lib/cpus/aarch64/travis.S b/lib/cpus/aarch64/travis.S
index ba06f55..e8b3860 100644
--- a/lib/cpus/aarch64/travis.S
+++ b/lib/cpus/aarch64/travis.S
@@ -54,8 +54,6 @@
ret
endfunc travis_core_pwr_dwn
-errata_report_shim travis
-
.section .rodata.travis_regs, "aS"
travis_regs: /* The ASCII list of register names to be reported */
.asciz "cpuectlr_el1", ""
diff --git a/lib/cpus/errata_report.c b/lib/cpus/errata_report.c
index 27cfc91..e0a9076 100644
--- a/lib/cpus/errata_report.c
+++ b/lib/cpus/errata_report.c
@@ -67,7 +67,7 @@
* save space. This functionality is only useful on development and platform
* bringup builds, when FEATURE_DETECTION should be used anyway
*/
-void __unused generic_errata_report(void)
+void generic_errata_report(void)
{
struct cpu_ops *cpu_ops = get_cpu_ops_ptr();
struct erratum_entry *entry = cpu_ops->errata_list_start;
@@ -159,70 +159,16 @@
*/
void print_errata_status(void)
{
- struct cpu_ops *cpu_ops;
#ifdef IMAGE_BL1
- /*
- * BL1 doesn't have per-CPU data. So retrieve the CPU operations
- * directly.
- */
- cpu_ops = get_cpu_ops_ptr();
-
- if (cpu_ops->errata_func != NULL) {
- cpu_ops->errata_func();
- }
+ generic_errata_report();
#else /* IMAGE_BL1 */
- cpu_ops = (void *) get_cpu_data(cpu_ops_ptr);
+ struct cpu_ops *cpu_ops = (void *) get_cpu_data(cpu_ops_ptr);
assert(cpu_ops != NULL);
- if (cpu_ops->errata_func == NULL) {
- return;
- }
-
if (errata_needs_reporting(cpu_ops->errata_lock, cpu_ops->errata_reported)) {
- cpu_ops->errata_func();
+ generic_errata_report();
}
#endif /* IMAGE_BL1 */
}
-
-/*
- * Old errata status message printer
- * TODO: remove once all cpus have been converted to the new printing method
- */
-void __unused errata_print_msg(unsigned int status, const char *cpu, const char *id)
-{
- /* Errata status strings */
- static const char *const errata_status_str[] = {
- [ERRATA_NOT_APPLIES] = "not applied",
- [ERRATA_APPLIES] = "applied",
- [ERRATA_MISSING] = "missing!"
- };
- static const char *const __unused bl_str = BL_STRING;
- const char *msg __unused;
-
-
- assert(status < ARRAY_SIZE(errata_status_str));
- assert(cpu != NULL);
- assert(id != NULL);
-
- msg = errata_status_str[status];
-
- switch (status) {
- case ERRATA_NOT_APPLIES:
- VERBOSE(ERRATA_FORMAT, bl_str, cpu, id, msg);
- break;
-
- case ERRATA_APPLIES:
- INFO(ERRATA_FORMAT, bl_str, cpu, id, msg);
- break;
-
- case ERRATA_MISSING:
- WARN(ERRATA_FORMAT, bl_str, cpu, id, msg);
- break;
-
- default:
- WARN(ERRATA_FORMAT, bl_str, cpu, id, "unknown");
- break;
- }
-}
#endif /* !REPORT_ERRATA */
diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk
index 290a6fe..8c884b4 100644
--- a/make_helpers/defaults.mk
+++ b/make_helpers/defaults.mk
@@ -146,7 +146,7 @@
RME_GPT_BITLOCK_BLOCK := 1
# Default maximum size of GPT contiguous block
-RME_GPT_MAX_BLOCK := 2
+RME_GPT_MAX_BLOCK := 512
# Hint platform interrupt control layer that Group 0 interrupts are for EL3. By
# default, they are for Secure EL1.
diff --git a/plat/arm/board/corstone1000/platform.mk b/plat/arm/board/corstone1000/platform.mk
index 9d44a14..dfde5aa 100644
--- a/plat/arm/board/corstone1000/platform.mk
+++ b/plat/arm/board/corstone1000/platform.mk
@@ -6,7 +6,7 @@
# Making sure the corstone1000 platform type is specified
ifeq ($(filter ${TARGET_PLATFORM}, fpga fvp),)
- $(error TARGET_PLATFORM must be fpga or fvp)
+ $(error TARGET_PLATFORM must be fpga or fvp)
endif
CORSTONE1000_CPU_LIBS +=lib/cpus/aarch64/cortex_a35.S
diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk
index dff0135..3c4ad64 100644
--- a/plat/arm/common/arm_common.mk
+++ b/plat/arm/common/arm_common.mk
@@ -406,7 +406,6 @@
COTDTPATH := fdts/tbbr_cot_descriptors.dtsi
endif
endif
- bl2: cot-dt2c
endif
BL1_SOURCES += ${AUTH_SOURCES} \
@@ -481,16 +480,23 @@
endif
endif
-cot-dt2c:
ifneq ($(COTDTPATH),)
- $(info COT CONVERSION FOR ${COTDTPATH})
- toolpath := $(shell which cot-dt2c)
- ifeq (${toolpath},)
- output := $(shell make -C ./${CERTCONVPATH} install)
- $(info install output ${output})
- toolpath := $(shell which cot-dt2c)
- endif
- output := $(shell ${toolpath} convert-to-c ${COTDTPATH} ${BUILD_PLAT}/bl2_cot.c)
- $(info ${output})
- BL2_SOURCES += ${BUILD_PLAT}/bl2_cot.c
+ cot-dt-defines = IMAGE_BL2 $(BL2_DEFINES) $(PLAT_BL_COMMON_DEFINES)
+ cot-dt-include-dirs = $(BL2_INCLUDE_DIRS) $(PLAT_BL_COMMON_INCLUDE_DIRS)
+
+ cot-dt-cpp-flags = $(cot-dt-defines:%=-D%)
+ cot-dt-cpp-flags += $(cot-dt-include-dirs:%=-I%)
+
+ cot-dt-cpp-flags += $(BL2_CPPFLAGS) $(PLAT_BL_COMMON_CPPFLAGS)
+ cot-dt-cpp-flags += $(CPPFLAGS) $(BL_CPPFLAGS) $(TF_CFLAGS_$(ARCH))
+ cot-dt-cpp-flags += -c -x assembler-with-cpp -E -P -o $@ $<
+
+ $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.dts): $(COTDTPATH) | $$(@D)/
+ $(q)$($(ARCH)-cpp) $(cot-dt-cpp-flags)
+
+ $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.c): $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.dts) | $$(@D)/
+ $(q)poetry -q install
+ $(q)poetry run cot-dt2c convert-to-c $< $@
+
+ BL2_SOURCES += $(BUILD_PLAT)/$(COTDTPATH:.dtsi=.c)
endif
diff --git a/plat/hisilicon/poplar/include/hi3798cv200.h b/plat/hisilicon/poplar/include/hi3798cv200.h
index e31f4b3..802dec5 100644
--- a/plat/hisilicon/poplar/include/hi3798cv200.h
+++ b/plat/hisilicon/poplar/include/hi3798cv200.h
@@ -38,7 +38,11 @@
/* SCTL */
#define REG_BASE_SCTL (0xF8000000)
+#define REG_SC_SYSRES (0x0004)
#define REG_SC_GEN12 (0x00B0)
+#define REG_SC_LOCKEN (0x020C)
+
+#define SC_UNLOCK_MAGIC (0x4F50454E)
/* CRG */
#define REG_BASE_CRG (0xF8A22000)
diff --git a/plat/hisilicon/poplar/plat_pm.c b/plat/hisilicon/poplar/plat_pm.c
index 67ebca1..77fc532 100644
--- a/plat/hisilicon/poplar/plat_pm.c
+++ b/plat/hisilicon/poplar/plat_pm.c
@@ -92,14 +92,18 @@
static void __dead2 poplar_system_off(void)
{
ERROR("Poplar System Off: operation not handled.\n");
+ /* Turn off watchdog0 before panic() */
+ mmio_write_32((uintptr_t)(HISI_WDG0_BASE + 0xc00), 0x1ACCE551);
+ mmio_write_32((uintptr_t)(HISI_WDG0_BASE + 0x8), 0x00000000);
panic();
}
static void __dead2 poplar_system_reset(void)
{
- mmio_write_32((uintptr_t)(HISI_WDG0_BASE + 0xc00), 0x1ACCE551);
- mmio_write_32((uintptr_t)(HISI_WDG0_BASE + 0x0), 0x00000100);
- mmio_write_32((uintptr_t)(HISI_WDG0_BASE + 0x8), 0x00000003);
+ /* Unlock Sysctrl critical registers */
+ mmio_write_32((uintptr_t)(REG_BASE_SCTL + REG_SC_LOCKEN), SC_UNLOCK_MAGIC);
+ /* Assert system reset */
+ mmio_write_32((uintptr_t)(REG_BASE_SCTL + REG_SC_SYSRES), 0xfee1dead);
wfi();
ERROR("Poplar System Reset: operation not handled.\n");
diff --git a/plat/intel/soc/common/soc/socfpga_reset_manager.c b/plat/intel/soc/common/soc/socfpga_reset_manager.c
index 5c80798..535e68f 100644
--- a/plat/intel/soc/common/soc/socfpga_reset_manager.c
+++ b/plat/intel/soc/common/soc/socfpga_reset_manager.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2023, Intel Corporation. All rights reserved.
+ * Copyright (c) 2024, Altera Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -106,29 +107,9 @@
}
udelay(1000);
}
- return -ETIMEDOUT;
-}
-
-#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
-static int poll_idle_status_by_counter(uint32_t addr, uint32_t mask,
- uint32_t match, uint32_t delay_ms)
-{
- int time_out = delay_ms;
-
- while (time_out-- > 0) {
- if ((mmio_read_32(addr) & mask) == match) {
- return 0;
- }
-
- /* ToDo: Shall use udelay for product release */
- for (int i = 0; i < 2000; i++) {
- /* dummy delay */
- }
- }
return -ETIMEDOUT;
}
-#endif
#if PLATFORM_MODEL != PLAT_SOCFPGA_AGILEX5
static int poll_idle_status_by_clkcycles(uint32_t addr, uint32_t mask,
@@ -406,6 +387,7 @@
return ret;
}
+/* TODO: Function too long, shall refactor */
int socfpga_bridges_enable(uint32_t mask)
{
int ret = 0;
@@ -419,54 +401,79 @@
uint32_t f2s_respempty = 0;
uint32_t f2s_cmdidle = 0;
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
- uint32_t delay = 0;
+ uint32_t brg_lst = 0;
#endif
/* Enable s2f bridge */
socfpga_s2f_bridge_mask(mask, &brg_mask, &noc_mask);
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
- /* Enable SOC2FPGA bridge */
- if (brg_mask & RSTMGR_BRGMODRSTMASK_SOC2FPGA) {
+/**************** SOC2FPGA ****************/
+ brg_lst = mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST));
+ if ((brg_mask & RSTMGR_BRGMODRSTMASK_SOC2FPGA)
+ && ((brg_lst & RSTMGR_BRGMODRSTMASK_SOC2FPGA) != 0)) {
/*
* To request handshake
* Write Reset Manager hdskreq[soc2fpga_flush_req] = 1
*/
VERBOSE("Set S2F hdskreq ...\n");
mmio_setbits_32(SOCFPGA_RSTMGR(HDSKREQ),
- RSTMGR_HDSKREQ_SOC2FPGAREQ);
+ ((~(brg_lst) << 9) & (RSTMGR_HDSKREQ_LWSOC2FPGAREQ
+ | RSTMGR_HDSKREQ_SOC2FPGAREQ))
+ | (RSTMGR_HDSKREQ_SOC2FPGAREQ));
+
+ udelay(1000);
/*
* To poll idle status
* Read Reset Manager hdskack[soc2fpga] = 1
*/
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_SOC2FPGAACK, RSTMGR_HDSKACK_SOC2FPGAACK,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRST_SOC2FPGA) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKREQ_SOC2FPGAREQ, RSTMGR_HDSKREQ_SOC2FPGAREQ,
+ 300);
+ }
+
+ udelay(1000);
if (ret < 0) {
ERROR("S2F bridge enable: Timeout hdskack\n");
}
/*
+ * To assert reset
+ * Write Reset Manager hdskreq[soc2fpga_flush_req] = 0
+ */
+ VERBOSE("Assert S2F ...\n");
+ mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
+ (~brg_lst & 0x3) | RSTMGR_BRGMODRST_SOC2FPGA);
+
+ udelay(1000);
+
+ /*
* To clear idle request
* Write Reset Manager hdskreq[soc2fpga_flush_req] = 0
*/
VERBOSE("Clear S2F hdskreq ...\n");
mmio_clrbits_32(SOCFPGA_RSTMGR(HDSKREQ),
- RSTMGR_HDSKREQ_SOC2FPGAREQ);
+ ((~(brg_lst) << 9) & (RSTMGR_HDSKREQ_LWSOC2FPGAREQ
+ | RSTMGR_HDSKREQ_SOC2FPGAREQ))
+ | (RSTMGR_HDSKREQ_SOC2FPGAREQ));
+
+ udelay(1000);
/*
- * To assert reset
- * Write Reset Manager hdskreq[soc2fpga_flush_req] = 0
+ * To clear ack status
+ * Write Reset Manager hdskack[soc2fpga_flush_ack] = 1
+ * This bit is W1S/W1C
*/
- VERBOSE("Assert S2F ...\n");
- mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
- RSTMGR_BRGMODRST_SOC2FPGA);
+ VERBOSE("Clear S2F hdskack ...\n");
+ mmio_setbits_32(SOCFPGA_RSTMGR(HDSKACK),
+ ((~(brg_lst) << 9) & (RSTMGR_HDSKREQ_LWSOC2FPGAREQ
+ | RSTMGR_HDSKREQ_SOC2FPGAREQ))
+ | (RSTMGR_HDSKACK_SOC2FPGAACK));
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
/*
* To deassert reset
@@ -474,51 +481,82 @@
*/
VERBOSE("Deassert S2F ...\n");
mmio_clrbits_32(SOCFPGA_RSTMGR(BRGMODRST),
- RSTMGR_BRGMODRST_SOC2FPGA);
+ (~brg_lst & (RSTMGR_BRGMODRST_SOC2FPGA
+ | RSTMGR_BRGMODRST_LWHPS2FPGA))
+ | RSTMGR_BRGMODRST_SOC2FPGA);
}
+/**************** LWSOCFPGA ****************/
+
/* Enable LWSOC2FPGA bridge */
- if (brg_mask & RSTMGR_BRGMODRSTMASK_LWHPS2FPGA) {
+ brg_lst = mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST));
+ if ((brg_mask & RSTMGR_BRGMODRSTMASK_LWHPS2FPGA)
+ && ((brg_lst & RSTMGR_BRGMODRSTMASK_LWHPS2FPGA) != 0)) {
/*
* To request handshake
* Write Reset Manager hdskreq[lwsoc2fpga_flush_req] = 1
*/
VERBOSE("Set LWS2F hdskreq ...\n");
mmio_setbits_32(SOCFPGA_RSTMGR(HDSKREQ),
- RSTMGR_HDSKREQ_LWSOC2FPGAREQ);
+ ((~(brg_lst) << 9) & (RSTMGR_HDSKREQ_LWSOC2FPGAREQ
+ | RSTMGR_HDSKREQ_SOC2FPGAREQ))
+ | (RSTMGR_HDSKREQ_LWSOC2FPGAREQ));
+
+ udelay(1000);
/*
* To poll idle status
* Read Reset Manager hdskack[lwsoc2fpga] = 1
*/
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_LWSOC2FPGAACK, RSTMGR_HDSKACK_LWSOC2FPGAACK,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRST_LWHPS2FPGA) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKREQ_LWSOC2FPGAREQ, RSTMGR_HDSKREQ_LWSOC2FPGAREQ,
+ 300);
+ }
+
+ udelay(1000);
if (ret < 0) {
ERROR("LWS2F bridge enable: Timeout hdskack\n");
}
/*
+ * To assert reset
+ * Write Reset Manager brgmodrst[lwsoc2fpga] = 1
+ */
+ VERBOSE("Assert LWS2F ...\n");
+ mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
+ (~brg_lst & (RSTMGR_BRGMODRST_SOC2FPGA
+ | RSTMGR_BRGMODRST_LWHPS2FPGA))
+ | RSTMGR_BRGMODRST_LWHPS2FPGA);
+
+ udelay(1000);
+
+ /*
* To clear idle request
* Write Reset Manager hdskreq[lwsoc2fpga_flush_req] = 0
*/
VERBOSE("Clear LWS2F hdskreq ...\n");
mmio_clrbits_32(SOCFPGA_RSTMGR(HDSKREQ),
- RSTMGR_HDSKREQ_LWSOC2FPGAREQ);
+ ((~(brg_lst) << 9) & (RSTMGR_HDSKREQ_LWSOC2FPGAREQ
+ | RSTMGR_HDSKREQ_SOC2FPGAREQ))
+ | (RSTMGR_HDSKREQ_LWSOC2FPGAREQ));
+
+ udelay(1000);
/*
- * To assert reset
- * Write Reset Manager brgmodrst[lwsoc2fpga] = 1
+ * To clear ack status
+ * Write Reset Manager hdskack[lwsoc2fpga_flush_ack] = 1
+ * This bit is W1S/W1C
*/
- VERBOSE("Assert LWS2F ...\n");
- mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
- RSTMGR_BRGMODRST_LWHPS2FPGA);
+ VERBOSE("Clear LWS2F hdskack ...\n");
+ mmio_setbits_32(SOCFPGA_RSTMGR(HDSKACK),
+ ((~(brg_lst) << 9) & (RSTMGR_HDSKREQ_LWSOC2FPGAREQ
+ | RSTMGR_HDSKREQ_SOC2FPGAREQ))
+ | (RSTMGR_HDSKACK_SOC2FPGAACK));
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
/*
* To deassert reset
@@ -526,7 +564,9 @@
*/
VERBOSE("Deassert LWS2F ...\n");
mmio_clrbits_32(SOCFPGA_RSTMGR(BRGMODRST),
- RSTMGR_BRGMODRST_LWHPS2FPGA);
+ ((~brg_lst & (RSTMGR_BRGMODRST_SOC2FPGA
+ | RSTMGR_BRGMODRST_LWHPS2FPGA)))
+ | RSTMGR_BRGMODRST_LWHPS2FPGA);
}
#else
if (brg_mask != 0U) {
@@ -552,7 +592,9 @@
&f2s_idleack, &f2s_respempty, &f2s_cmdidle);
#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
/* Enable FPGA2SOC bridge */
- if (brg_mask & RSTMGR_BRGMODRSTMASK_FPGA2SOC) {
+
+ if ((brg_mask & RSTMGR_BRGMODRSTMASK_FPGA2SOC)
+ && ((brg_lst & RSTMGR_BRGMODRSTMASK_FPGA2SOC) != 0)) {
/*
* To request handshake
* Write Reset Manager hdsken[fpgahsen] = 1
@@ -572,9 +614,12 @@
* Read Reset Manager hdskack[fpgahsack] = 1
*/
VERBOSE("Get FPGA hdskack(fpgahsack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRST_FPGA2SOC) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK,
+ 300);
+ }
if (ret < 0) {
ERROR("FPGA bridge fpga handshake fpgahsreq: Timeout\n");
@@ -593,9 +638,12 @@
* Read Reset Manager hdskack[f2s_flush_ack] = 1
*/
VERBOSE("Get F2S hdskack(f2s_flush_ack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_FPGA2SOCACK, RSTMGR_HDSKACK_FPGA2SOCACK,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRST_FPGA2SOC) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_FPGA2SOCACK, RSTMGR_HDSKACK_FPGA2SOCACK,
+ 300);
+ }
if (ret < 0) {
ERROR("F2S bridge fpga handshake f2sdram_flush_req: Timeout\n");
@@ -621,9 +669,12 @@
* Read Reset Manager hdskack[f2s_flush_ack] = 0
*/
VERBOSE("Get F2SDRAM hdskack(f2s_flush_ack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_FPGA2SOCACK, RSTMGR_HDSKACK_FPGA2SOCACK_DASRT,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRST_FPGA2SOC) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_FPGA2SOCACK, RSTMGR_HDSKACK_FPGA2SOCACK_DASRT,
+ 300);
+ }
if (ret < 0) {
ERROR("F2S bridge fpga handshake f2s_flush_ack: Timeout\n");
@@ -634,9 +685,12 @@
* Read Reset Manager hdskack[fpgahsack] = 0
*/
VERBOSE("Get FPGA hdskack(fpgahsack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK_DASRT,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRST_FPGA2SOC) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK_DASRT,
+ 300);
+ }
if (ret < 0) {
ERROR("F2S bridge fpga handshake fpgahsack: Timeout\n");
@@ -649,10 +703,7 @@
VERBOSE("Assert F2S ...\n");
mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST), RSTMGR_BRGMODRST_FPGA2SOC);
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
/*
* To deassert reset
@@ -668,7 +719,8 @@
}
/* Enable FPGA2SDRAM bridge */
- if (brg_mask & RSTMGR_BRGMODRSTMASK_F2SDRAM0) {
+ if ((brg_mask & RSTMGR_BRGMODRSTMASK_F2SDRAM0)
+ && ((brg_lst & RSTMGR_BRGMODRSTMASK_F2SDRAM0) != 0)) {
/*
* To request handshake
* Write Reset Manager hdsken[fpgahsen] = 1
@@ -688,9 +740,12 @@
* Read Reset Manager hdskack[fpgahsack] = 1
*/
VERBOSE("Get F2SDRAM hdskack(fpgahsack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRSTMASK_F2SDRAM0) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK,
+ 300);
+ }
if (ret < 0) {
ERROR("F2SDRAM bridge fpga handshake fpgahsreq: Timeout\n");
@@ -709,9 +764,12 @@
* Read Reset Manager hdskack[f2sdram_flush_ack] = 1
*/
VERBOSE("Get F2SDRAM hdskack(f2sdram_flush_ack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_F2SDRAM0ACK, RSTMGR_HDSKACK_F2SDRAM0ACK,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRSTMASK_F2SDRAM0) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_F2SDRAM0ACK, RSTMGR_HDSKACK_F2SDRAM0ACK,
+ 300);
+ }
if (ret < 0) {
ERROR("F2SDRAM bridge fpga handshake f2sdram_flush_req: Timeout\n");
@@ -736,9 +794,12 @@
* Read Reset Manager hdskack[f2sdram_flush_ack] = 0
*/
VERBOSE("Get F2SDRAM hdskack(f2sdram_flush_ack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_F2SDRAM0ACK, RSTMGR_HDSKACK_F2SDRAM0ACK_DASRT,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRSTMASK_F2SDRAM0) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_F2SDRAM0ACK, RSTMGR_HDSKACK_F2SDRAM0ACK_DASRT,
+ 300);
+ }
if (ret < 0) {
ERROR("F2SDRAM bridge fpga handshake f2sdram_flush_ack: Timeout\n");
@@ -749,9 +810,12 @@
* Read Reset Manager hdskack[fpgahsack] = 0
*/
VERBOSE("Get F2SDRAM hdskack(fpgahsack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
- RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK_DASRT,
- 300);
+ if ((mmio_read_32(SOCFPGA_RSTMGR(BRGMODRST))
+ & RSTMGR_BRGMODRSTMASK_F2SDRAM0) == 0x00) {
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
+ RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK_DASRT,
+ 300);
+ }
if (ret < 0) {
ERROR("F2SDRAM bridge fpga handshake fpgahsack: Timeout\n");
@@ -765,10 +829,7 @@
mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
RSTMGR_BRGMODRST_F2SSDRAM0);
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
/*
* To deassert reset
@@ -863,10 +924,6 @@
uint32_t f2s_idleack = 0;
uint32_t f2s_respempty = 0;
uint32_t f2s_cmdidle = 0;
-#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5
- uint32_t delay = 0;
-#endif
-
/* Disable s2f bridge */
socfpga_s2f_bridge_mask(mask, &brg_mask, &noc_mask);
@@ -885,7 +942,7 @@
* To poll idle status
* Read Reset Manager hdskack[soc2fpga] = 0
*/
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
RSTMGR_HDSKACK_SOC2FPGAACK, RSTMGR_HDSKACK_SOC2FPGAACK_DASRT,
300);
@@ -901,10 +958,7 @@
mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
RSTMGR_BRGMODRST_SOC2FPGA);
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
}
/* Disable LWSOC2FPGA bridge */
@@ -921,7 +975,7 @@
* To poll idle status
* Read Reset Manager hdskack[lwsoc2fpga] = 0
*/
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
RSTMGR_HDSKACK_LWSOC2FPGAACK, RSTMGR_HDSKACK_LWSOC2FPGAACK_DASRT,
300);
@@ -937,10 +991,7 @@
mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
RSTMGR_BRGMODRST_LWHPS2FPGA);
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
}
#else
if (brg_mask != 0U) {
@@ -1001,7 +1052,7 @@
* Read Reset Manager hdskack[f2s_flush_ack] = 0
*/
VERBOSE("Get F2SDRAM hdskack(f2s_flush_ack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
RSTMGR_HDSKACK_FPGA2SOCACK, RSTMGR_HDSKACK_FPGA2SOCACK_DASRT,
300);
@@ -1014,7 +1065,7 @@
* Read Reset Manager hdskack[fpgahsack] = 0
*/
VERBOSE("Get FPGA hdskack(fpgahsack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK_DASRT,
300);
@@ -1029,10 +1080,7 @@
VERBOSE("Assert F2S ...\n");
mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST), RSTMGR_BRGMODRST_FPGA2SOC);
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
/* Write System Manager f2s bridge control register[f2soc_enable] = 0 */
VERBOSE("Assert F2S f2soc_enable ...\n");
@@ -1068,7 +1116,7 @@
* Read Reset Manager hdskack[f2sdram_flush_ack] = 0
*/
VERBOSE("Get F2SDRAM hdskack(f2sdram_flush_ack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
RSTMGR_HDSKACK_F2SDRAM0ACK, RSTMGR_HDSKACK_F2SDRAM0ACK_DASRT,
300);
@@ -1081,7 +1129,7 @@
* Read Reset Manager hdskack[fpgahsack] = 0
*/
VERBOSE("Get F2SDRAM hdskack(fpgahsack) ...\n");
- ret = poll_idle_status_by_counter(SOCFPGA_RSTMGR(HDSKACK),
+ ret = poll_idle_status(SOCFPGA_RSTMGR(HDSKACK),
RSTMGR_HDSKACK_FPGAHSACK, RSTMGR_HDSKACK_FPGAHSACK_DASRT,
300);
@@ -1097,10 +1145,7 @@
mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
RSTMGR_BRGMODRST_F2SSDRAM0);
- /* ToDo: Shall use udelay for product release */
- for (delay = 0; delay < 1000; delay++) {
- /* dummy delay */
- }
+ udelay(1000);
/*
* Assert fpga2sdram_manager_main_SidebandManager_FlagOutClr0
@@ -1139,7 +1184,7 @@
/* Bridge reset */
#if PLATFORM_MODEL == PLAT_SOCFPGA_STRATIX10
- /* Software must never write a 0x1 to FPGA2SOC_M0ASK bit */
+ /* Software must never write a 0x1 to FPGA2SOC_MASK bit */
mmio_setbits_32(SOCFPGA_RSTMGR(BRGMODRST),
brg_mask & ~RSTMGR_FIELD(BRG, FPGA2SOC));
#else
diff --git a/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu.c b/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu.c
index efb70b7..c46cca8 100644
--- a/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu.c
+++ b/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu.c
@@ -120,13 +120,13 @@
{
uint64_t phys_addr = get_decoded_phys_addr(encoded_addr);
struct emi_region_info_t region_info;
- enum MPU_REQ_ORIGIN_ZONE_ID zone_id = get_decoded_zone_id(zone_info);
+ enum region_ids zone_id = get_decoded_zone_id(zone_info);
uint32_t is_set = get_decoded_set_clear_info(zone_info);
INFO("encoded_addr = 0x%lx, zone_size = 0x%lx, zone_info = 0x%lx\n",
encoded_addr, zone_size, zone_info);
- if (zone_id != MPU_REQ_ORIGIN_TEE_ZONE_SVP) {
+ if (zone_id < SVP_DRAM_REGION_ID_START || zone_id > SVP_DRAM_REGION_ID_END) {
ERROR("Invalid param %s, %d\n", __func__, __LINE__);
return MTK_SIP_E_INVALID_PARAM;
}
@@ -135,7 +135,7 @@
/* SVP DRAM */
region_info.start = phys_addr;
region_info.end = phys_addr + zone_size - 1;
- region_info.region = SVP_DRAM_REGION_ID;
+ region_info.region = zone_id;
SET_ACCESS_PERMISSION(region_info.apc, UNLOCK,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
FORBIDDEN, FORBIDDEN, FORBIDDEN, FORBIDDEN,
@@ -144,7 +144,7 @@
emi_mpu_set_protection(®ion_info);
} else { /* clear region protection */
- emi_mpu_clear_protection(SVP_DRAM_REGION_ID);
+ emi_mpu_clear_protection(zone_id);
}
return 0;
diff --git a/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu_priv.h b/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu_priv.h
index 18acb9c..b64020d 100644
--- a/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu_priv.h
+++ b/plat/mediatek/drivers/emi_mpu/mt8188/emi_mpu_priv.h
@@ -56,13 +56,16 @@
#define APUSYS_SEC_BUF_PA (0x55000000)
#define APUSYS_SEC_BUF_SZ (0x100000)
+#define SVP_DRAM_REGION_COUNT (10)
+
enum region_ids {
BL31_EMI_REGION_ID = 0,
BL32_REGION_ID,
SCP_CORE0_REGION_ID,
SCP_CORE1_REGION_ID,
DSP_PROTECT_REGION_ID,
- SVP_DRAM_REGION_ID,
+ SVP_DRAM_REGION_ID_START = 5,
+ SVP_DRAM_REGION_ID_END = SVP_DRAM_REGION_ID_START + SVP_DRAM_REGION_COUNT - 1,
APUSYS_SEC_BUF_EMI_REGION_ID = 21,
diff --git a/plat/qti/common/src/aarch64/qti_kryo4_gold.S b/plat/qti/common/src/aarch64/qti_kryo4_gold.S
index 9bcdf54..49b7cf0 100644
--- a/plat/qti/common/src/aarch64/qti_kryo4_gold.S
+++ b/plat/qti/common/src/aarch64/qti_kryo4_gold.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -41,16 +41,6 @@
ret
endfunc qti_kryo4_gold_cluster_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for Kryo4 Gold. Must follow AAPCS.
- */
-func qti_kryo4_gold_errata_report
- /* TODO : Need to add support. Required only for debug bl31 image.*/
- ret
-endfunc qti_kryo4_gold_errata_report
-#endif
-
/* ---------------------------------------------
* This function provides kryo4_gold specific
* register information for crash reporting.
diff --git a/plat/qti/common/src/aarch64/qti_kryo4_silver.S b/plat/qti/common/src/aarch64/qti_kryo4_silver.S
index 36374b7..4a98912 100644
--- a/plat/qti/common/src/aarch64/qti_kryo4_silver.S
+++ b/plat/qti/common/src/aarch64/qti_kryo4_silver.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -35,17 +35,6 @@
ret
endfunc qti_kryo4_silver_cluster_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for Kryo4 Silver. Must follow AAPCS.
- */
-func qti_kryo4_silver_errata_report
- /* TODO : Need to add support. Required only for debug bl31 image.*/
- ret
-endfunc qti_kryo4_silver_errata_report
-#endif
-
-
/* ---------------------------------------------
* This function provides kryo4_silver specific
* register information for crash reporting.
diff --git a/plat/qti/common/src/aarch64/qti_kryo6_gold.S b/plat/qti/common/src/aarch64/qti_kryo6_gold.S
index 577e7ff..5f9463f 100644
--- a/plat/qti/common/src/aarch64/qti_kryo6_gold.S
+++ b/plat/qti/common/src/aarch64/qti_kryo6_gold.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -41,16 +41,6 @@
ret
endfunc qti_kryo6_gold_cluster_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for Kryo4 Gold. Must follow AAPCS.
- */
-func qti_kryo6_gold_errata_report
- /* TODO : Need to add support. Required only for debug bl31 image.*/
- ret
-endfunc qti_kryo6_gold_errata_report
-#endif
-
/* ---------------------------------------------
* This function provides kryo4_gold specific
* register information for crash reporting.
diff --git a/plat/qti/common/src/aarch64/qti_kryo6_silver.S b/plat/qti/common/src/aarch64/qti_kryo6_silver.S
index 6ad0bca..4a54a64 100644
--- a/plat/qti/common/src/aarch64/qti_kryo6_silver.S
+++ b/plat/qti/common/src/aarch64/qti_kryo6_silver.S
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2018, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2024, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -35,17 +35,6 @@
ret
endfunc qti_kryo6_silver_cluster_pwr_dwn
-#if REPORT_ERRATA
-/*
- * Errata printing function for Kryo4 Silver. Must follow AAPCS.
- */
-func qti_kryo6_silver_errata_report
- /* TODO : Need to add support. Required only for debug bl31 image.*/
- ret
-endfunc qti_kryo6_silver_errata_report
-#endif
-
-
/* ---------------------------------------------
* This function provides kryo4_silver specific
* register information for crash reporting.
diff --git a/plat/xilinx/zynqmp/platform.mk b/plat/xilinx/zynqmp/platform.mk
index c340009..22eceb6 100644
--- a/plat/xilinx/zynqmp/platform.mk
+++ b/plat/xilinx/zynqmp/platform.mk
@@ -21,7 +21,7 @@
EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT)
# pncd SPD requires secure SGI to be handled at EL1
-ifeq (${SPD}, $(filter ${SPD},pncd tspd))
+ifeq (${SPD}, $(filter ${SPD},pncd tspd opteed))
ifeq (${ZYNQMP_WDT_RESTART},1)
$(error "Error: ZYNQMP_WDT_RESTART and SPD=pncd are incompatible")
endif
diff --git a/poetry.lock b/poetry.lock
index b465f48..9b98b18 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -217,6 +217,26 @@
test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"]
[[package]]
+name = "cot-dt2c"
+version = "0.1.0"
+description = "CoT-dt2c Tool is a python script to convert CoT DT file into corresponding C file"
+optional = false
+python-versions = "^3.8"
+files = []
+develop = true
+
+[package.dependencies]
+click = "^8.1.7"
+igraph = "^0.11.6"
+plotly = "^5.23.0"
+pydevicetree = "0.0.13"
+pyparsing = "^3.1.2"
+
+[package.source]
+type = "directory"
+url = "tools/cot_dt2c"
+
+[[package]]
name = "docutils"
version = "0.18.1"
description = "Docutils -- Python Documentation Utilities"
@@ -239,6 +259,66 @@
]
[[package]]
+name = "igraph"
+version = "0.11.6"
+description = "High performance graph data structures and algorithms"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "igraph-0.11.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3f8b837181e8e87676be3873ce87cc92cc234efd58a2da2f6b4e050db150fcf4"},
+ {file = "igraph-0.11.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:245c4b7d7657849eff80416f5df4525c8fc44c74a981ee4d44f0ef2612c3bada"},
+ {file = "igraph-0.11.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bdb7be3d165073c0136295c0808e9edc57ba096cdb26e94086abb04561f7a292"},
+ {file = "igraph-0.11.6-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:58974e20df2986a1ae52a16e51ecb387cc0cbeb41c5c0ddff4d373a1bbf1d9c5"},
+ {file = "igraph-0.11.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bef14de5e8ab70724a43808b1ed14aaa6fe1002f87e592289027a3827a8f44a"},
+ {file = "igraph-0.11.6-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:86c1e98de2e32d074df8510bf18abfa1f4c5fda4cb28a009985a5d746b0c0125"},
+ {file = "igraph-0.11.6-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ebc5b3d702158abeb2e4d2414374586a2b932e1a07e48352b470600e1733d528"},
+ {file = "igraph-0.11.6-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0efe6d0fb22d3987a800eb3857ed04df9eb4c5dddd0998be05232cb646f1c337"},
+ {file = "igraph-0.11.6-cp38-cp38-win32.whl", hash = "sha256:f4e68b27497b1c8ada2fb2bc35ef3fa7b0d72e84306b3d648d3de240fc618c32"},
+ {file = "igraph-0.11.6-cp38-cp38-win_amd64.whl", hash = "sha256:5665b33dfbfca5f54ce9b4fea6b97903bd0e99fb1b02acf5e57e600bdfa5a355"},
+ {file = "igraph-0.11.6-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:8aabef03d787b519d1075dfc0da4a1109fb113b941334883e3e7947ac30a459e"},
+ {file = "igraph-0.11.6-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1f2cc4a518d99cdf6cae514f85e93e56852bc8c325b3abb96037d1d690b5975f"},
+ {file = "igraph-0.11.6-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c1e859238be52ab8ccc614d18f9362942bc88ce543afc12548f81ae99b10801d"},
+ {file = "igraph-0.11.6-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d61fbe5e85eb4ae9efe08c461f9bdeedb02a2b5739fbc223d324a71f40a28be2"},
+ {file = "igraph-0.11.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b6620ba39df29fd42151becf82309b54e57148233c9c3ef890eed62e25eed8a5"},
+ {file = "igraph-0.11.6-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:59666589bb3d07f310cda2c5106a8adeeb77c2ef27fecf1c6438b6091f4ca69d"},
+ {file = "igraph-0.11.6-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:8750b6d6caebf199cf7dc41c931f58e330153779707391e30f0a29f02666fb6e"},
+ {file = "igraph-0.11.6-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:967d6f2c30fe94317da15e459374d0fb8ca3e56020412f201ecd07dd5b5352f2"},
+ {file = "igraph-0.11.6-cp39-abi3-win32.whl", hash = "sha256:9744f95a67319eb6cb487ceabf30f5d7940de34bada51f0ba63adbd23e0f94ad"},
+ {file = "igraph-0.11.6-cp39-abi3-win_amd64.whl", hash = "sha256:b80e69eb11faa9c57330a9ffebdde5808966efe1c1f638d4d4827ea04df7aca8"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0329c16092e2ea7930d5f8368666ce7cb704900cc0ea04e4afe9ea1dd46e44af"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:21752313f449bd8688e5688e95ea7231cea5e9199c7162535029be0d9af848ac"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea25e136c6c4161f53ff58868b23ff6c845193050ab0e502236d68e5d4174e32"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ac84433a03aef15e4b810010b08882b09854a3669450ccf31e392dbe295d2a66"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac697a44e3573169fa2b28c9c37dcf9cf01e0f558b845dd7123860d4c7c8fb89"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:bdeae8bf35316eb1fb27bf667dcf5ecf5fcfb0b8f51831bc1b00c39c09c2d73b"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ad7e4aa442935de72554b96733bf6d7f09eac5cee97988a2562bdd3ca173cfa3"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:8d2818780358a686178866d01568b9df1f29678581734ad7a78882bab54df004"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2352276a20d979f1dea360af4202bb9f0c9a7d2c77f51815c0e625165e82013d"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:687fdab543b507d622fa3043f4227e5b26dc61dcf8ff8c0919fccddcc655f8b8"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57f7f8214cd48c9a4d97f7346a4152ba2d4ac95fb5ee0df4ecf224fce4ba3d14"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:2b9cc69ede53f76ffae03b066609aa90184dd68ef15da8c104a97cebb9210838"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:591e1e447c3f0092daf7613a3eaedab83f9a0b0adbaf7702724c5117ded038a5"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:ca558eb331bc687bc33e5cd23717e22676e9412f8cda3a31d30c996a0487610d"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf43c30e08debb087c9e3da69aa5cf1b6732968da34d55a614e3421b9a452146"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d38e8d7db72b187d9d2211d0d06b3271fa9f32b04d49d789e2859b5480db0d0"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a318b059051ff78144a1c3cb880f4d933c812bcdb3d833a49cd7168d0427672"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2c54027add809b3c5b6685b8deca4ea4763fd000b9ea45c7ee46b7c9d61ff15e"},
+ {file = "igraph-0.11.6.tar.gz", hash = "sha256:837f233256c3319f2a35a6a80d94eafe47b43791ef4c6f9e9871061341ac8e28"},
+]
+
+[package.dependencies]
+texttable = ">=1.6.2"
+
+[package.extras]
+cairo = ["cairocffi (>=1.2.0)"]
+doc = ["Sphinx (>=7.0.0)", "pydoctor (>=23.4.0)", "sphinx-gallery (>=0.14.0)", "sphinx-rtd-theme (>=1.3.0)"]
+matplotlib = ["matplotlib (>=3.6.0)"]
+plotly = ["plotly (>=5.3.0)"]
+plotting = ["cairocffi (>=1.2.0)"]
+test = ["Pillow (>=9)", "cairocffi (>=1.2.0)", "matplotlib (>=3.6.0)", "networkx (>=2.5)", "numpy (>=1.19.0)", "pandas (>=1.1.0)", "plotly (>=5.3.0)", "pytest (>=7.0.1)", "pytest-timeout (>=2.1.0)", "scipy (>=1.5.0)"]
+test-musl = ["cairocffi (>=1.2.0)", "networkx (>=2.5)", "pytest (>=7.0.1)", "pytest-timeout (>=2.1.0)"]
+
+[[package]]
name = "imagesize"
version = "1.4.1"
description = "Getting image size from png/jpeg/jpeg2000/gif file"
@@ -480,6 +560,21 @@
testing = ["flit-core (>=2,<4)", "poetry-core (>=1.0.0)", "pytest (>=7.2.0)", "pytest-rerunfailures", "pytest-xdist", "tomli-w"]
[[package]]
+name = "plotly"
+version = "5.23.0"
+description = "An open-source, interactive data visualization library for Python"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "plotly-5.23.0-py3-none-any.whl", hash = "sha256:76cbe78f75eddc10c56f5a4ee3e7ccaade7c0a57465546f02098c0caed6c2d1a"},
+ {file = "plotly-5.23.0.tar.gz", hash = "sha256:89e57d003a116303a34de6700862391367dd564222ab71f8531df70279fc0193"},
+]
+
+[package.dependencies]
+packaging = "*"
+tenacity = ">=6.2.0"
+
+[[package]]
name = "prettytable"
version = "3.10.2"
description = "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format"
@@ -497,6 +592,20 @@
tests = ["pytest", "pytest-cov", "pytest-lazy-fixtures"]
[[package]]
+name = "pydevicetree"
+version = "0.0.13"
+description = "A library for parsing Devicetree Source v1"
+optional = false
+python-versions = ">=3.5"
+files = [
+ {file = "pydevicetree-0.0.13-py3-none-any.whl", hash = "sha256:d61c695cec925b90a8b5740053f4b604e51154a9b36e62a2f12ed9ceaf2f8c38"},
+ {file = "pydevicetree-0.0.13.tar.gz", hash = "sha256:5700c05df89bad8fd729c11aa6f764a3323bcb3796f13b32481ae34445cfc1b7"},
+]
+
+[package.dependencies]
+pyparsing = "*"
+
+[[package]]
name = "pyelftools"
version = "0.29"
description = "Library for analyzing ELF files and DWARF debugging information"
@@ -522,6 +631,20 @@
windows-terminal = ["colorama (>=0.4.6)"]
[[package]]
+name = "pyparsing"
+version = "3.1.2"
+description = "pyparsing module - Classes and methods to define and execute parsing grammars"
+optional = false
+python-versions = ">=3.6.8"
+files = [
+ {file = "pyparsing-3.1.2-py3-none-any.whl", hash = "sha256:f9db75911801ed778fe61bb643079ff86601aca99fcae6345aa67292038fb742"},
+ {file = "pyparsing-3.1.2.tar.gz", hash = "sha256:a1bac0ce561155ecc3ed78ca94d3c9378656ad4c94c1270de543f621420f94ad"},
+]
+
+[package.extras]
+diagrams = ["jinja2", "railroad-diagrams"]
+
+[[package]]
name = "pyproject-hooks"
version = "1.1.0"
description = "Wrappers to call pyproject.toml-based build backend hooks."
@@ -883,6 +1006,32 @@
cairosvg = ["cairosvg (>=1.0)"]
[[package]]
+name = "tenacity"
+version = "9.0.0"
+description = "Retry code until it succeeds"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "tenacity-9.0.0-py3-none-any.whl", hash = "sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539"},
+ {file = "tenacity-9.0.0.tar.gz", hash = "sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b"},
+]
+
+[package.extras]
+doc = ["reno", "sphinx"]
+test = ["pytest", "tornado (>=4.5)", "typeguard"]
+
+[[package]]
+name = "texttable"
+version = "1.7.0"
+description = "module to create simple ASCII tables"
+optional = false
+python-versions = "*"
+files = [
+ {file = "texttable-1.7.0-py2.py3-none-any.whl", hash = "sha256:72227d592c82b3d7f672731ae73e4d1f88cd8e2ef5b075a7a7f01a23a3743917"},
+ {file = "texttable-1.7.0.tar.gz", hash = "sha256:2d2068fb55115807d3ac77a4ca68fa48803e84ebb0ee2340f858107a36522638"},
+]
+
+[[package]]
name = "tlc"
version = "0.9.0"
description = "Transfer List Compiler (TLC) is a Python-based CLI for efficiently handling transfer lists."
@@ -1005,4 +1154,4 @@
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
-content-hash = "8798a2d1efd456c3b68ae464a216f015afaa1bbb653a905148bef17ab8ce278e"
+content-hash = "d893034cad02533bc86fb98c7d93a0eac6a755fea5efd553924e4762ed3f1fdb"
diff --git a/pyproject.toml b/pyproject.toml
index 03d898e..f0b3925 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,6 +14,7 @@
[tool.poetry.dependencies]
python = "^3.8"
+cot-dt2c = {path = "tools/cot_dt2c", develop = true}
tlc = {path = "tools/tlc"}
[tool.poetry.group.docs]
diff --git a/services/std_svc/sdei/sdei_main.c b/services/std_svc/sdei/sdei_main.c
index 59a1673..01cc131 100644
--- a/services/std_svc/sdei/sdei_main.c
+++ b/services/std_svc/sdei/sdei_main.c
@@ -744,7 +744,9 @@
return SDEI_ENOMEM;
/* The returned mapping must be dynamic */
- assert(is_map_dynamic(map));
+ if (!is_map_dynamic(map)) {
+ return SDEI_ENOMEM;
+ }
/*
* We cannot assert for bound maps here, as we might be racing
diff --git a/tools/cot_dt2c/.gitignore b/tools/cot_dt2c/.gitignore
new file mode 100644
index 0000000..ad4a1f1
--- /dev/null
+++ b/tools/cot_dt2c/.gitignore
@@ -0,0 +1,176 @@
+# Created by https://www.toptal.com/developers/gitignore/api/python
+# Edit at https://www.toptal.com/developers/gitignore?templates=python
+
+### Python ###
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+# This is especially recommended for binary packages to ensure reproducibility, and is more
+# commonly ignored for libraries.
+# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+# and can be added to the global gitignore or merged into this file. For a more nuclear
+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
+#.idea/
+
+### Python Patch ###
+# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
+poetry.toml
+
+# ruff
+.ruff_cache/
+
+# LSP config files
+pyrightconfig.json
+
+# End of https://www.toptal.com/developers/gitignore/api/python
diff --git a/tools/cot_dt2c/Makefile b/tools/cot_dt2c/Makefile
deleted file mode 100644
index ad8d9f5..0000000
--- a/tools/cot_dt2c/Makefile
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-##* Variables
-SHELL := /usr/bin/env bash
-PYTHON := python
-PYTHONPATH := `pwd`
-
-.PHONY: dist
-dist: clean
- poetry build
-
-#* Installation
-.PHONY: dev-install
-dev-install:
- pip3 install mypy
- pip3 install pytest
- pip install -r requirements.txt
- poetry lock -n && poetry export --without-hashes > requirements.txt
- poetry install -n
- -poetry run mypy --install-types --non-interactive ./
-
-.PHONY: install
-install: dist
- pip install mypy
- pip install pytest
- pip install -r requirements.txt
- pip install dist/*.whl
-
-clean-test: ## remove test and coverage artifacts
- rm -fr .tox/
- rm -f .coverage
- rm -fr htmlcov/
-
-clean-pyc: ## remove Python file artifacts
- find . -name '*.pyc' -exec rm -f {} +
- find . -name '*.pyo' -exec rm -f {} +
- find . -name '*~' -exec rm -f {} +
- find . -name '__pycache__' -exec rm -fr {} +
- find . | grep -E ".pytest_cache" | xargs rm -rf
- find . | grep -E ".mypy_cache" | xargs rm -rf
-
-
-clean-build: ## remove build artifacts
- rm -fr build/
- rm -fr dist/
- rm -fr .eggs/
- find . -name '*.egg-info' -exec rm -fr {} +
- find . -name '*.egg' -exec rm -f {} +
-
-clean-tmp:
- rm -rf ./tmp
-
-#* Cleaning
-.PHONY: clean clean-build clean-pyc clean-test
-clean: uninstall clean-build clean-pyc clean-test clean-tmp ## remove all build, test, coverage and Python artifacts
-
-uninstall:
- pip uninstall -y cot-dt2c
-
-.PHONY: reinstall
-reinstall: clean install
-
-.PHONY: test
-test:
- PYTHONPATH=$(PYTHONPATH) poetry run pytest -c pyproject.toml tests/
diff --git a/tools/cot_dt2c/cot_dt2c/LICENSE b/tools/cot_dt2c/cot_dt2c/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/tools/cot_dt2c/cot_dt2c/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/tools/cot_dt2c/cot_dt2c/cot_parser.py b/tools/cot_dt2c/cot_dt2c/cot_parser.py
index c1d53e2..39e51db 100644
--- a/tools/cot_dt2c/cot_dt2c/cot_parser.py
+++ b/tools/cot_dt2c/cot_dt2c/cot_parser.py
@@ -6,35 +6,15 @@
import sys
import re
-from cot_dt2c.pydevicetree.source.parser import ifdef_stack
-from cot_dt2c.pydevicetree.ast import CellArray, LabelReference
-from cot_dt2c.pydevicetree import *
+from pydevicetree.ast import CellArray, LabelReference
+from pydevicetree import Devicetree, Property, Node
from pathlib import Path
-
-def extractNumber(s):
- for i in s:
- if i.isdigit():
- return (int)(i)
-
- return -1
-
-def removeNumber(s):
- result = ''.join([i for i in s if not i.isdigit()])
- return result
+from typing import List, Optional
class COT:
def __init__(self, inputfile: str, outputfile=None):
- with open(inputfile, 'r') as f:
- contents = f.read()
- pos = contents.find("cot")
- if pos == -1:
- print("not a valid CoT DT file")
- exit(1)
-
- contents = contents[pos:]
-
try:
- self.tree = Devicetree.parseStr(contents)
+ self.tree = Devicetree.parseFile(inputfile)
except:
print("not a valid CoT DT file")
exit(1)
@@ -336,13 +316,10 @@
def format_auth_data_val(self, node:Node, cert:Node):
type_desc = node.name
- if "sp_pkg" in type_desc:
- ptr = removeNumber(type_desc) + "_buf"
- else:
- ptr = type_desc + "_buf"
- len = "(unsigned int)HASH_DER_LEN"
- if "pk" in type_desc:
- len = "(unsigned int)PK_DER_LEN"
+ ptr = type_desc + "_buf"
+ len = "HASH_DER_LEN"
+ if re.search("_pk$", type_desc):
+ len = "PK_DER_LEN"
# edge case
if not self.if_root(cert) and "key_cert" in cert.name:
@@ -351,7 +328,7 @@
return type_desc, ptr, len
- def get_node(self, nodes: list[Node], name: str) -> Node:
+ def get_node(self, nodes: List[Node], name: str) -> Node:
for i in nodes:
if i.name == name:
return i
@@ -458,10 +435,6 @@
def validate_nodes(self) -> bool:
valid = True
- if ifdef_stack:
- print("invalid ifdef macro")
- valid = False
-
certs = self.get_all_certificates()
images = self.get_all_images()
@@ -478,71 +451,16 @@
return valid
- def extract_licence(self, f):
- licence = []
-
- licencereg = re.compile(r'/\*')
- licenceendReg = re.compile(r'\*/')
-
- licencePre = False
-
- for line in f:
- match = licencereg.search(line)
- if match != None:
- licence.append(line)
- licencePre = True
- continue
-
- match = licenceendReg.search(line)
- if match != None:
- licence.append(line)
- licencePre = False
- return licence
-
- if licencePre:
- licence.append(line)
- else:
- return licence
-
- return licence
-
- def licence_to_c(self, licence, f):
- if len(licence) != 0:
- for i in licence:
- f.write(i)
-
- f.write("\n")
- return
-
- def extract_include(self, f):
- include = []
-
- for line in f:
- if "cot" in line:
- return include
-
- if line != "" and "common" not in line and line != "\n":
- include.append(line)
-
- return include
-
- def include_to_c(self, include, f):
+ def include_to_c(self, f):
f.write("#include <stddef.h>\n")
f.write("#include <mbedtls/version.h>\n")
f.write("#include <common/tbbr/cot_def.h>\n")
f.write("#include <drivers/auth/auth_mod.h>\n")
- f.write("\n")
- for i in include:
- f.write(i)
- f.write("\n")
f.write("#include <platform_def.h>\n\n")
return
- def generate_header(self, input, output):
- licence = self.extract_licence(input)
- include = self.extract_include(input)
- self.licence_to_c(licence, output)
- self.include_to_c(include, output)
+ def generate_header(self, output):
+ self.include_to_c(output)
def all_cert_to_c(self, f):
certs = self.get_all_certificates()
@@ -552,17 +470,16 @@
f.write("\n")
def cert_to_c(self, node: Node, f):
- ifdef = node.get_fields("ifdef")
- if ifdef:
- for i in ifdef:
- f.write("{}\n".format(i))
+ node_image_id: int = node.get_field("image-id")
- f.write("static const auth_img_desc_t {} = {{\n".format(node.name))
- f.write("\t.img_id = {},\n".format(node.get_field("image-id").values[0].replace('"', "")))
+ f.write(f"static const auth_img_desc_t {node.name} = {{\n")
+ f.write(f"\t.img_id = {node_image_id},\n")
f.write("\t.img_type = IMG_CERT,\n")
if not self.if_root(node):
- f.write("\t.parent = &{},\n".format(node.get_field("parent").label.name))
+ node_parent: Node = node.get_field("parent")
+
+ f.write(f"\t.parent = &{node_parent.label.name},\n")
else:
f.write("\t.parent = NULL,\n")
@@ -608,13 +525,9 @@
f.write("\t\t\t.type_desc = &{},\n".format(type_desc))
f.write("\t\t\t.data = {\n")
- n = extractNumber(type_desc)
- if "pkg" not in type_desc or n == -1:
- f.write("\t\t\t\t.ptr = (void *){},\n".format(ptr))
- else:
- f.write("\t\t\t\t.ptr = (void *){}[{}],\n".format(ptr, n-1))
+ f.write("\t\t\t\t.ptr = (void *){},\n".format(ptr))
- f.write("\t\t\t\t.len = {}\n".format(data_len))
+ f.write("\t\t\t\t.len = (unsigned int){}\n".format(data_len))
f.write("\t\t\t}\n")
f.write("\t\t}}{}\n".format("," if i != len(auth_data) - 1 else ""))
@@ -623,42 +536,31 @@
f.write("};\n\n")
- if ifdef:
- for i in ifdef:
- f.write("#endif\n")
- f.write("\n")
-
return
def img_to_c(self, node:Node, f):
- ifdef = node.get_fields("ifdef")
- if ifdef:
- for i in ifdef:
- f.write("{}\n".format(i))
+ node_image_id: int = node.get_field("image-id")
+ node_parent: Node = node.get_field("parent")
+ node_hash: Node = node.get_field("hash")
- f.write("static const auth_img_desc_t {} = {{\n".format(node.name))
- f.write("\t.img_id = {},\n".format(node.get_field("image-id").values[0].replace('"', "")))
+ f.write(f"static const auth_img_desc_t {node.name} = {{\n")
+ f.write(f"\t.img_id = {node_image_id},\n")
f.write("\t.img_type = IMG_RAW,\n")
- f.write("\t.parent = &{},\n".format(node.get_field("parent").label.name))
+ f.write(f"\t.parent = &{node_parent.label.name},\n")
f.write("\t.img_auth_methods = (const auth_method_desc_t[AUTH_METHOD_NUM]) {\n")
f.write("\t\t[0] = {\n")
f.write("\t\t\t.type = AUTH_METHOD_HASH,\n")
f.write("\t\t\t.param.hash = {\n")
f.write("\t\t\t\t.data = &raw_data,\n")
- f.write("\t\t\t\t.hash = &{}\n".format(node.get_field("hash").label.name))
+ f.write(f"\t\t\t\t.hash = &{node_hash.label.name}\n")
f.write("\t\t\t}\n")
f.write("\t\t}\n")
f.write("\t}\n")
f.write("};\n\n")
- if ifdef:
- for i in ifdef:
- f.write("#endif\n")
- f.write("\n")
-
return
def all_img_to_c(self, f):
@@ -672,7 +574,10 @@
nv_ctr = self.get_all_nv_counters()
for nv in nv_ctr:
- f.write("static auth_param_type_desc_t {} = AUTH_PARAM_TYPE_DESC(AUTH_PARAM_NV_CTR, {});\n".format(nv.name, nv.get_field("oid")))
+ nv_oid: str = nv.get_field("oid")
+
+ f.write(f"static auth_param_type_desc_t {nv.name} = "\
+ f"AUTH_PARAM_TYPE_DESC(AUTH_PARAM_NV_CTR, \"{nv_oid}\");\n")
f.write("\n")
@@ -682,7 +587,10 @@
pks = self.get_all_pks()
for p in pks:
- f.write("static auth_param_type_desc_t {} = AUTH_PARAM_TYPE_DESC(AUTH_PARAM_PUB_KEY, {});\n".format(p.name, p.get_field("oid")))
+ pk_oid: str = p.get_field("oid")
+
+ f.write(f"static auth_param_type_desc_t {p.name} = "\
+ f"AUTH_PARAM_TYPE_DESC(AUTH_PARAM_PUB_KEY, \"{pk_oid}\");\n")
f.write("\n")
return
@@ -690,30 +598,17 @@
def buf_to_c(self, f):
certs = self.get_all_certificates()
- buffers = {}
+ buffers = set()
for c in certs:
auth_data = self.get_auth_data(c)
+
for a in auth_data:
type_desc, ptr, data_len = self.format_auth_data_val(a, c)
- if ptr not in buffers:
- buffers[ptr] = c.get_fields("ifdef")
-
- for key, values in buffers.items():
- if values:
- for i in values:
- f.write("{}\n".format(i))
- if "sp_pkg_hash_buf" in key:
- f.write("static unsigned char {}[MAX_SP_IDS][HASH_DER_LEN];\n".format(key))
- elif "pk" in key:
- f.write("static unsigned char {}[PK_DER_LEN];\n".format(key))
- else:
- f.write("static unsigned char {}[HASH_DER_LEN];\n".format(key))
-
- if values:
- for i in values:
- f.write("#endif\n")
+ if not ptr in buffers:
+ f.write(f"static unsigned char {ptr}[{data_len}];\n")
+ buffers.add(ptr)
f.write("\n")
@@ -726,29 +621,18 @@
certs = self.get_all_certificates()
for c in certs:
- ifdef = c.get_fields("ifdef")
- if ifdef:
- for i in ifdef:
- f.write("{}\n".format(i))
-
hash = c.children
for h in hash:
name = h.name
oid = h.get_field("oid")
- if "pk" in name and "pkg" not in name:
- f.write("static auth_param_type_desc_t {} = "\
- "AUTH_PARAM_TYPE_DESC(AUTH_PARAM_PUB_KEY, {});\n".format(name, oid))
- elif "hash" in name:
- f.write("static auth_param_type_desc_t {} = "\
- "AUTH_PARAM_TYPE_DESC(AUTH_PARAM_HASH, {});\n".format(name, oid))
- elif "ctr" in name:
- f.write("static auth_param_type_desc_t {} = "\
- "AUTH_PARAM_TYPE_DESC(AUTH_PARAM_NV_CTR, {});\n".format(name, oid))
+ if re.search("_pk$", name):
+ ty = "AUTH_PARAM_PUB_KEY"
+ elif re.search("_hash$", name):
+ ty = "AUTH_PARAM_HASH"
- if ifdef:
- for i in ifdef:
- f.write("#endif\n")
+ f.write(f"static auth_param_type_desc_t {name} = "\
+ f"AUTH_PARAM_TYPE_DESC({ty}, \"{oid}\");\n")
f.write("\n")
@@ -759,28 +643,14 @@
f.write("static const auth_img_desc_t * const cot_desc[] = {\n")
for i, c in enumerate(certs):
- ifdef = c.get_fields("ifdef")
- if ifdef:
- for i in ifdef:
- f.write("{}\n".format(i))
+ c_image_id: int = c.get_field("image-id")
- f.write("\t[{}] = &{}{}\n".format(c.get_field("image-id").values[0], c.name, ","))
-
- if ifdef:
- for i in ifdef:
- f.write("#endif\n")
+ f.write(f"\t[{c_image_id}] = &{c.name},\n")
for i, c in enumerate(images):
- ifdef = c.get_fields("ifdef")
- if ifdef:
- for i in ifdef:
- f.write("{}\n".format(i))
+ c_image_id: int = c.get_field("image-id")
- f.write("\t[{}] = &{}{}\n".format(c.get_field("image-id").values[0], c.name, "," if i != len(images) - 1 else ""))
-
- if ifdef:
- for i in ifdef:
- f.write("#endif\n")
+ f.write(f"\t[{c_image_id}] = &{c.name},\n")
f.write("};\n\n")
f.write("REGISTER_COT(cot_desc);\n")
@@ -789,16 +659,15 @@
def generate_c_file(self):
filename = Path(self.output)
filename.parent.mkdir(exist_ok=True, parents=True)
- output = open(self.output, 'w+')
- input = open(self.input, "r")
- self.generate_header(input, output)
- self.buf_to_c(output)
- self.param_to_c(output)
- self.nv_to_c(output)
- self.pk_to_c(output)
- self.all_cert_to_c(output)
- self.all_img_to_c(output)
- self.cot_to_c(output)
+ with open(self.output, 'w+') as output:
+ self.generate_header(output)
+ self.buf_to_c(output)
+ self.param_to_c(output)
+ self.nv_to_c(output)
+ self.pk_to_c(output)
+ self.all_cert_to_c(output)
+ self.all_img_to_c(output)
+ self.cot_to_c(output)
return
diff --git a/tools/cot_dt2c/cot_dt2c/dt_validator.py b/tools/cot_dt2c/cot_dt2c/dt_validator.py
index 65e8ca2..ade037c 100644
--- a/tools/cot_dt2c/cot_dt2c/dt_validator.py
+++ b/tools/cot_dt2c/cot_dt2c/dt_validator.py
@@ -7,7 +7,7 @@
import sys
from os import path, walk, mkdir
import subprocess
-from cot_dt2c.pydevicetree import *
+from pydevicetree import Devicetree
class bcolors:
HEADER = '\033[95m'
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/__init__.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/__init__.py
deleted file mode 100644
index 49595a7..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from cot_dt2c.pydevicetree.ast import Devicetree, Node, Property, Directive, CellArray, LabelReference
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/__init__.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/__init__.py
deleted file mode 100644
index f30d897..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from cot_dt2c.pydevicetree.ast.directive import Directive
-from cot_dt2c.pydevicetree.ast.node import Node, NodeReference, Devicetree
-from cot_dt2c.pydevicetree.ast.property import PropertyValues, Bytestring, CellArray, StringList, Property, \
- RegArray, OneString
-from cot_dt2c.pydevicetree.ast.reference import Label, Path, Reference, LabelReference, PathReference
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/directive.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/directive.py
deleted file mode 100644
index fdd6f0e..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/directive.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from typing import Any
-
-from cot_dt2c.pydevicetree.ast.helpers import formatLevel, wrapStrings
-
-class Directive:
- """Represents a Devicetree directive
-
- Directives in Devicetree source are statements of the form
-
- /directive-name/ [option1 [option2 [...]]];
-
- Common directive examples include:
-
- /dts-v1/;
- /include/ "overlay.dtsi";
- /delete-node/ &uart0;
- /delete-property/ status;
-
- Their semantic meaning depends on the directive name, their location in the Devicetree,
- and their options.
- """
- def __init__(self, directive: str, option: Any = None):
- """Create a directive object"""
- self.directive = directive
- self.option = option
-
- def __repr__(self) -> str:
- return "<Directive %s>" % self.directive
-
- def __str__(self) -> str:
- return self.to_dts()
-
- def to_dts(self, level: int = 0) -> str:
- """Format the Directive in Devicetree Source format"""
- if isinstance(self.option, list):
- return formatLevel(level, "%s %s;\n" % (self.directive,
- wrapStrings(self.option)))
- if isinstance(self.option, str):
- if self.directive == "/include/":
- return formatLevel(level, "%s \"%s\"\n" % (self.directive, self.option))
- return formatLevel(level, "%s \"%s\";\n" % (self.directive, self.option))
- return formatLevel(level, "%s;\n" % self.directive)
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/helpers.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/helpers.py
deleted file mode 100644
index 30c54dc..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/helpers.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from typing import List, Any
-
-from cot_dt2c.pydevicetree.ast.reference import Reference
-
-def formatLevel(level: int, s: str) -> str:
- """Helper to indent a string with a number of tabs"""
- return "\t" * level + s
-
-def wrapStrings(values: List[Any], formatHex: bool = False) -> List[Any]:
- """Helper to wrap strings in quotes where appropriate"""
- wrapped = []
- for v in values:
- if isinstance(v, Reference):
- wrapped.append(v.to_dts())
- elif isinstance(v, str):
- wrapped.append("\"%s\"" % v)
- elif isinstance(v, int):
- if formatHex:
- wrapped.append("0x%x" % v)
- else:
- wrapped.append(str(v))
- else:
- wrapped.append(str(v))
- return wrapped
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/node.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/node.py
deleted file mode 100644
index d203af8..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/node.py
+++ /dev/null
@@ -1,514 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-import re
-import os
-from typing import List, Union, Optional, Iterable, Callable, Any, cast, Pattern
-
-from cot_dt2c.pydevicetree.ast.helpers import formatLevel
-from cot_dt2c.pydevicetree.ast.property import Property, PropertyValues, RegArray, RangeArray
-from cot_dt2c.pydevicetree.ast.directive import Directive
-from cot_dt2c.pydevicetree.ast.reference import Label, Path, Reference, LabelReference, PathReference
-
-# Type signature for elements passed to Devicetree constructor
-ElementList = Iterable[Union['Node', Property, Directive]]
-
-# Callback type signatures for Devicetree.match() and Devicetree.chosen()
-MatchFunc = Callable[['Node'], bool]
-MatchCallback = Optional[Callable[['Node'], None]]
-ChosenCallback = Optional[Callable[[PropertyValues], None]]
-
-class Node:
- """Represents a Devicetree Node
-
- A Devicetree Node generally takes the form
-
- [label:] node-name@unit-address {
- [directives]
- [properties]
- [child nodes]
- };
-
- The structure formed by creating trees of Nodes is the bulk of any Devicetree. As the naming
- system implies, then, each node roughly corresponds to some conceptual device, subsystem of
- devices, bus, etc.
-
- Devices can be referenced by label or by path, and are generally uniquely identified by a
- collection of string identifiers assigned to the "compatible" property.
-
- For instance, a UART device might look like
-
- uart0: uart@10013000 {
- compatible = "sifive,uart0";
- reg = <0x10013000 0x1000>;
- reg-names = "control";
- interrupt-parent = <&plic>;
- interrupts = <3>;
- clocks = <&busclk>;
- status = "okay";
- };
-
- This node can be identified in the following ways:
-
- - By label: uart0
- - By path: /path/to/uart@10013000
- - By name: uart@10013000 (for example when referenced in a /delete-node/ directive)
- """
- # pylint: disable=too-many-arguments
- def __init__(self, name: str, label: Optional[str], address: Optional[int],
- properties: List[Property], directives: List[Directive],
- children: List['Node']):
- """Initializes a Devicetree Node
-
- Also evaluates the /delete-node/ and /delete-property/ directives found in the node
- and deletes the respective nodes and properties.
- """
- self.name = name
- self.parent = None # type: Optional['Node']
-
- self.label = label
- self.address = address
- self.properties = properties
- self.directives = directives
- self.children = children
- self.ifdef = []
-
- for d in self.directives:
- if d.directive == "/delete-node/":
- if isinstance(d.option, LabelReference):
- node = self.get_by_reference(d.option)
- elif isinstance(d.option, str):
- node = self.__get_child_by_handle(d.option)
- if node:
- self.remove_child(node)
- elif d.directive == "/delete-property/":
- # pylint: disable=cell-var-from-loop
- properties = list(filter(lambda p: p.name == d.option, self.properties))
- if properties:
- del self.properties[self.properties.index(properties[0])]
-
- def __repr__(self) -> str:
- if self.address:
- return "<Node %s@%x>" % (self.name, self.address)
- return "<Node %s>" % self.name
-
- def __str__(self) -> str:
- return self.to_dts()
-
- def __eq__(self, other) -> bool:
- return self.name == other.name and self.address == other.address
-
- def __hash__(self):
- return hash((self.name, self.address))
-
- @staticmethod
- def from_dts(source: str) -> 'Node':
- """Create a node from Devicetree Source"""
- # pylint: disable=import-outside-toplevel,cyclic-import
- from pydevicetree.source import parseNode
- return parseNode(source)
-
- def add_child(self, node: 'Node', merge: bool = True):
- """Add a child node and merge it into the tree"""
- node.parent = self
- self.children.append(node)
- if merge:
- self.merge_tree()
-
- def to_dts(self, level: int = 0) -> str:
- """Format the subtree starting at the node as Devicetree Source"""
- out = ""
- if isinstance(self.address, int) and self.label:
- out += formatLevel(level,
- "%s: %s@%x {\n" % (self.label, self.name, self.address))
- elif isinstance(self.address, int):
- out += formatLevel(level, "%s@%x {\n" % (self.name, self.address))
- elif self.label:
- out += formatLevel(level, "%s: %s {\n" % (self.label, self.name))
- elif self.name != "":
- out += formatLevel(level, "%s {\n" % self.name)
-
- for d in self.directives:
- out += d.to_dts(level + 1)
- for p in self.properties:
- out += p.to_dts(level + 1)
- for c in self.children:
- out += c.to_dts(level + 1)
-
- if self.name != "":
- out += formatLevel(level, "};\n")
-
- return out
-
- def merge_tree(self):
- """Recursively merge child nodes into a single tree
-
- Parsed Devicetrees can describe the same tree multiple times, adding nodes and properties
- each time. After parsing, this method is called to recursively merge the tree.
- """
- partitioned_children = []
- for n in self.children:
- partitioned_children.append([e for e in self.children if e == n])
-
- new_children = []
- for part in partitioned_children:
- first = part[0]
- rest = part[1:]
- if first not in new_children:
- for n in rest:
- first.merge(n)
- new_children.append(first)
-
- self.children = new_children
-
- for n in self.children:
- n.parent = self
- n.merge_tree()
-
- def merge(self, other: 'Node'):
- """Merge the contents of a node into this node.
-
- Used by Node.merge_trees()
- """
- if not self.label and other.label:
- self.label = other.label
- self.properties += other.properties
- self.directives += other.directives
- self.children += other.children
- self.ifdef += other.ifdef
-
- def get_path(self, includeAddress: bool = True) -> str:
- """Get the path of a node (ex. /cpus/cpu@0)"""
- if self.name == "/":
- return ""
- if self.parent is None:
- return "/" + self.name
- if isinstance(self.address, int) and includeAddress:
- return self.parent.get_path() + "/" + self.name + "@" + ("%x" % self.address)
- return self.parent.get_path() + "/" + self.name
-
- def get_by_reference(self, reference: Reference) -> Optional['Node']:
- """Get a node from the subtree by reference (ex. &label, &{/path/to/node})"""
- if isinstance(reference, LabelReference):
- return self.get_by_label(reference.label)
- if isinstance(reference, PathReference):
- return self.get_by_path(reference.path)
-
- return None
-
- def get_by_label(self, label: Union[Label, str]) -> Optional['Node']:
- """Get a node from the subtree by label"""
- matching_nodes = list(filter(lambda n: n.label == label, self.child_nodes()))
- if len(matching_nodes) != 0:
- return matching_nodes[0]
- return None
-
- def __get_child_by_handle(self, handle: str) -> Optional['Node']:
- """Get a child node by name or name and unit address"""
- if '@' in handle:
- name, addr_s = handle.split('@')
- address = int(addr_s, base=16)
- nodes = list(filter(lambda n: n.name == name and n.address == address, self.children))
- else:
- name = handle
- nodes = list(filter(lambda n: n.name == name, self.children))
-
- if not nodes:
- return None
- if len(nodes) > 1:
- raise Exception("Handle %s is ambiguous!" % handle)
- return nodes[0]
-
- def get_by_path(self, path: Union[Path, str]) -> Optional['Node']:
- """Get a node in the subtree by path"""
- matching_nodes = list(filter(lambda n: path == n.get_path(includeAddress=True), \
- self.child_nodes()))
- if len(matching_nodes) != 0:
- return matching_nodes[0]
-
- matching_nodes = list(filter(lambda n: path == n.get_path(includeAddress=False), \
- self.child_nodes()))
- if len(matching_nodes) != 0:
- return matching_nodes[0]
- return None
-
- def filter(self, matchFunc: MatchFunc, cbFunc: MatchCallback = None) -> List['Node']:
- """Filter all child nodes by matchFunc
-
- If cbFunc is provided, this method will iterate over the Nodes selected by matchFunc
- and call cbFunc on each Node
-
- Returns a list of all matching Nodes
- """
- nodes = list(filter(matchFunc, self.child_nodes()))
-
- if cbFunc is not None:
- for n in nodes:
- cbFunc(n)
-
- return nodes
-
- def match(self, compatible: Pattern, func: MatchCallback = None) -> List['Node']:
- """Get a node from the subtree by compatible string
-
- Accepts a regular expression to match one of the strings in the compatible property.
- """
- regex = re.compile(compatible)
-
- def match_compat(node: Node) -> bool:
- compatibles = node.get_fields("compatible")
- if compatibles is not None:
- return any(regex.match(c) for c in compatibles)
- return False
-
- return self.filter(match_compat, func)
-
- def child_nodes(self) -> Iterable['Node']:
- """Get an iterable over all the nodes in the subtree"""
- for n in self.children:
- yield n
- for m in n.child_nodes():
- yield m
-
- def remove_child(self, node):
- """Remove a child node"""
- del self.children[self.children.index(node)]
-
- def get_fields(self, field_name: str) -> Optional[PropertyValues]:
- """Get all the values of a property"""
- for p in self.properties:
- if p.name == field_name:
- return p.values
- return None
-
- def has_field(self, field_name: str) -> bool:
- for p in self.properties:
- if p.name == field_name:
- return True
- return False
-
- def get_field(self, field_name: str) -> Any:
- """Get the first value of a property"""
- fields = self.get_fields(field_name)
- if fields is not None:
- if len(cast(PropertyValues, fields)) != 0:
- return fields[0]
- return None
-
- def get_reg(self) -> Optional[RegArray]:
- """If the node defines a `reg` property, return a RegArray for easier querying"""
- reg = self.get_fields("reg")
- reg_names = self.get_fields("reg-names")
- if reg is not None:
- if reg_names is not None:
- return RegArray(reg.values, self.address_cells(), self.size_cells(),
- reg_names.values)
- return RegArray(reg.values, self.address_cells(), self.size_cells())
- return None
-
- def get_ranges(self) -> Optional[RangeArray]:
- """If the node defines a `ranges` property, return a RangeArray for easier querying"""
- ranges = self.get_fields("ranges")
- child_address_cells = self.get_field("#address-cells")
- parent_address_cells = self.address_cells()
- size_cells = self.get_field("#size-cells")
- if ranges is not None:
- return RangeArray(ranges.values, child_address_cells, parent_address_cells, size_cells)
- return None
-
- def address_cells(self):
- """Get the number of address cells
-
- The #address-cells property is defined by the parent of a node and describes how addresses
- are encoded in cell arrays. If no property is defined, the default value is 2.
- """
- if self.parent is not None:
- cells = self.parent.get_field("#address-cells")
- if cells is not None:
- return cells
- return 2
- return 2
-
- def size_cells(self):
- """Get the number of size cells
-
- The #size-cells property is defined by the parent of a node and describes how addresses
- are encoded in cell arrays. If no property is defined, the default value is 1.
- """
- if self.parent is not None:
- cells = self.parent.get_field("#size-cells")
- if cells is not None:
- return cells
- return 1
- return 1
-
-class NodeReference(Node):
- """A NodeReference is used to extend the definition of a previously-defined Node
-
- NodeReferences are commonly used by Devicetree "overlays" to extend the properties of a node
- or add child devices, such as to a bus like I2C.
- """
- def __init__(self, reference: Reference, properties: List[Property],
- directives: List[Directive], children: List[Node]):
- """Instantiate a Node identified by reference to another node"""
- self.reference = reference
- Node.__init__(self, label=None, name="", address=None, properties=properties,
- directives=directives, children=children)
-
- def __repr__(self) -> str:
- return "<NodeReference %s>" % self.reference.to_dts()
-
- def resolve_reference(self, tree: 'Devicetree') -> Node:
- """Given the full tree, get the node being referenced"""
- node = tree.get_by_reference(self.reference)
- if node is None:
- raise Exception("Node reference %s cannot be resolved" % self.reference.to_dts())
- return cast(Node, node)
-
- def to_dts(self, level: int = 0) -> str:
- out = formatLevel(level, self.reference.to_dts() + " {\n")
-
- for d in self.directives:
- out += d.to_dts(level + 1)
- for p in self.properties:
- out += p.to_dts(level + 1)
- for c in self.children:
- out += c.to_dts(level + 1)
-
- out += formatLevel(level, "};\n")
-
- return out
-
-
-class Devicetree(Node):
- """A Devicetree object describes the full Devicetree tree
-
- This class encapsulates both the tree itself (starting at the root node /) and any Directives
- or nodes which exist at the top level of the Devicetree Source files.
-
- Devicetree Source files can be parsed by calling Devicetree.parseFile().
- """
- def __init__(self, elements: ElementList):
- """Instantiate a Devicetree with the list of parsed elements
-
- Resolves all reference nodes and merges the tree to combine all identical nodes.
- """
- properties = [] # type: List[Property]
- directives = [] # type: List[Directive]
- children = [] # type: List[Node]
-
- for e in elements:
- if isinstance(e, Node):
- children.append(cast(Node, e))
- elif isinstance(e, Property):
- properties.append(cast(Property, e))
- elif isinstance(e, Directive):
- directives.append(cast(Directive, e))
-
- Node.__init__(self, label=None, name="", address=None,
- properties=properties, directives=directives, children=children)
-
- for node in self.children:
- node.parent = self
-
- reference_nodes = self.filter(lambda n: isinstance(n, NodeReference))
- for refnode in reference_nodes:
- refnode = cast(NodeReference, refnode)
-
- node = refnode.resolve_reference(self)
-
- if refnode.parent:
- cast(Node, refnode.parent).remove_child(refnode)
-
- node.properties += refnode.properties
- node.directives += refnode.directives
- node.children += refnode.children
-
- self.merge_tree()
-
- def __repr__(self) -> str:
- name = self.root().get_field("compatible")
- return "<Devicetree %s>" % name
-
- def to_dts(self, level: int = 0) -> str:
- """Convert the tree back to Devicetree Source"""
- out = ""
-
- for d in self.directives:
- out += d.to_dts()
- for p in self.properties:
- out += p.to_dts()
- for c in self.children:
- out += c.to_dts()
-
- return out
-
- def get_by_path(self, path: Union[Path, str]) -> Optional[Node]:
- """Get a node in the tree by path (ex. /cpus/cpu@0)"""
-
- # Find and replace all aliases in the path
- aliases = self.aliases()
- if aliases:
- for prop in aliases.properties:
- if prop.name in path and len(prop.values) > 0:
- path = path.replace(prop.name, prop.values[0])
-
- return self.root().get_by_path(path)
-
- @staticmethod
- # pylint: disable=arguments-differ
- def from_dts(dts: str) -> 'Devicetree':
- """Parse a string and return a Devicetree object"""
- # pylint: disable=import-outside-toplevel,cyclic-import
- from pydevicetree.source import parseTree
- return parseTree(dts)
-
- @staticmethod
- def parseFile(filename: str, followIncludes: bool = False) -> 'Devicetree':
- """Parse a file and return a Devicetree object"""
- # pylint: disable=import-outside-toplevel,cyclic-import
- from cot_dt2c.pydevicetree.source.parser import parseTree
- with open(filename, 'r') as f:
- contents = f.read()
- dirname = os.path.dirname(filename)
- if dirname != "":
- dirname += "/"
- return parseTree(contents, dirname, followIncludes)
-
- @staticmethod
- def parseStr(input: str, followIncludes: bool = False) -> 'Devicetree':
- from cot_dt2c.pydevicetree.source.parser import parseTree
- return parseTree(input, "", followIncludes)
-
- def all_nodes(self) -> Iterable[Node]:
- """Get an iterable over all nodes in the tree"""
- return self.child_nodes()
-
- def root(self) -> Node:
- """Get the root node of the tree"""
- for n in self.all_nodes():
- if n.name == "/":
- return n
- raise Exception("Devicetree has no root node!")
-
- def aliases(self) -> Optional[Node]:
- """Get the aliases node of the tree if it exists"""
- for n in self.all_nodes():
- if n.name == "aliases":
- return n
- return None
-
- def chosen(self, property_name: str, func: ChosenCallback = None) -> Optional[PropertyValues]:
- """Get the values associated with one of the properties in the chosen node"""
- def match_chosen(node: Node) -> bool:
- return node.name == "chosen"
-
- for n in filter(match_chosen, self.all_nodes()):
- for p in n.properties:
- if p.name == property_name:
- if func is not None:
- func(p.values)
- return p.values
-
- return None
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/property.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/property.py
deleted file mode 100644
index d5fb687..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/property.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from typing import List, Any, cast, Tuple, Optional, Iterable
-from itertools import zip_longest
-
-from cot_dt2c.pydevicetree.ast.helpers import wrapStrings, formatLevel
-
-class PropertyValues:
- """PropertyValues is the parent class of all values which can be assigned to a Property
-
- Child classes include
-
- Bytestring
- CellArray
- StringList
- """
- def __init__(self, values: List[Any]):
- """Create a PropertyValue"""
- self.values = values
-
- def __repr__(self) -> str:
- return "<PropertyValues " + self.values.__repr__() + ">"
-
- def __str__(self) -> str:
- return self.to_dts()
-
- def __iter__(self):
- return iter(self.values)
-
- def __len__(self) -> int:
- return len(self.values)
-
- def to_dts(self, formatHex: bool = False) -> str:
- """Format the values in Devicetree Source format"""
- return ", ".join(wrapStrings(self.values, formatHex))
-
- def __getitem__(self, key) -> Any:
- return self.values[key]
-
- def __eq__(self, other) -> bool:
- if isinstance(other, PropertyValues):
- return self.values == other.values
- return self.values == other
-
-class Bytestring(PropertyValues):
- """A Bytestring is a sequence of bytes
-
- In Devicetree, Bytestrings are represented as a sequence of two-digit hexadecimal integers,
- optionally space-separated, enclosed by square brackets:
-
- [de ad be eef]
- """
- def __init__(self, bytelist: List[int]):
- """Create a Bytestring object"""
- PropertyValues.__init__(self, cast(List[Any], bytearray(bytelist)))
-
- def __repr__(self) -> str:
- return "<Bytestring " + str(self.values) + ">"
-
- def to_dts(self, formatHex: bool = False) -> str:
- """Format the bytestring in Devicetree Source format"""
- return "[" + " ".join("%02x" % v for v in self.values) + "]"
-
-class CellArray(PropertyValues):
- """A CellArray is an array of integer values
-
- CellArrays are commonly used as the value of Devicetree properties like `reg` and `interrupts`.
- The interpretation of each element of a CellArray is device-dependent. For example, the `reg`
- property encodes a CellArray as a list of tuples (base address, size), while the `interrupts`
- property encodes a CellArray as simply a list of interrupt line numbers.
- """
- def __init__(self, cells: List[Any]):
- """Create a CellArray object"""
- PropertyValues.__init__(self, cells)
-
- def __repr__(self) -> str:
- return "<CellArray " + self.values.__repr__() + ">"
-
- def to_dts(self, formatHex: bool = False) -> str:
- """Format the cell array in Devicetree Source format"""
- dtsValues = []
- for i in self.values:
- if not isinstance(i, OneString) and not isinstance(i, str):
- dtsValues.append(i)
- return "<" + " ".join(wrapStrings(dtsValues, formatHex)) + ">"
-
-class RegArray(CellArray):
- """A RegArray is the CellArray assigned to the reg property"""
- def __init__(self, cells: List[int],
- address_cells: int, size_cells: int,
- names: Optional[List[str]] = None):
- """Create a RegArray from a list of ints"""
- # pylint: disable=too-many-locals
- CellArray.__init__(self, cells)
- self.address_cells = address_cells
- self.size_cells = size_cells
-
- self.tuples = [] # type: List[Tuple[int, int, Optional[str]]]
-
- group_size = self.address_cells + self.size_cells
-
- if len(cells) % group_size != 0:
- raise Exception("CellArray does not contain enough cells")
-
- grouped_cells = [cells[i:i+group_size] for i in range(0, len(cells), group_size)]
-
- if not names:
- names = []
-
- for group, name in zip_longest(grouped_cells, cast(Iterable[Any], names)):
- address = 0
- a_cells = list(reversed(group[:self.address_cells]))
- for a, i in zip(a_cells, range(len(a_cells))):
- address += (1 << (32 * i)) * a
-
- size = 0
- s_cells = list(reversed(group[self.address_cells:]))
- for s, i in zip(s_cells, range(len(s_cells))):
- size += (1 << (32 * i)) * s
-
- self.tuples.append(cast(Tuple[int, int, Optional[str]], tuple([address, size, name])))
-
- def get_by_name(self, name: str) -> Optional[Tuple[int, int]]:
- """Returns the (address, size) tuple with a given name"""
- for t in self.tuples:
- if t[2] == name:
- return cast(Tuple[int, int], tuple(t[:2]))
- return None
-
- def __repr__(self) -> str:
- return "<RegArray " + self.values.__repr__() + ">"
-
- def __iter__(self) -> Iterable[Tuple[int, int]]:
- return cast(Iterable[Tuple[int, int]], map(lambda t: tuple(t[:2]), self.tuples))
-
- def __len__(self) -> int:
- return len(self.tuples)
-
- def __getitem__(self, key) -> Optional[Tuple[int, int]]:
- return list(self.__iter__())[key]
-
-class RangeArray(CellArray):
- """A RangeArray is the CellArray assigned to the range property"""
- def __init__(self, cells: List[int], child_address_cells: int,
- parent_address_cells: int, size_cells: int):
- """Create a RangeArray from a list of ints"""
- # pylint: disable=too-many-locals
- CellArray.__init__(self, cells)
- self.child_address_cells = child_address_cells
- self.parent_address_cells = parent_address_cells
- self.size_cells = size_cells
-
- self.tuples = [] # type: List[Tuple[int, int, int]]
-
- group_size = self.child_address_cells + self.parent_address_cells + self.size_cells
-
- if len(cells) % group_size != 0:
- raise Exception("CellArray does not contain enough cells")
-
- grouped_cells = [cells[i:i+group_size] for i in range(0, len(cells), group_size)]
-
- def sum_cells(cells: List[int]):
- value = 0
- for cell, index in zip(list(reversed(cells)), range(len(cells))):
- value += (1 << (32 * index)) * cell
- return value
-
- for group in grouped_cells:
- child_address = sum_cells(group[:self.child_address_cells])
- parent_address = sum_cells(group[self.child_address_cells: \
- self.child_address_cells + self.parent_address_cells])
- size = sum_cells(group[self.child_address_cells + self.parent_address_cells:])
-
- self.tuples.append(cast(Tuple[int, int, int],
- tuple([child_address, parent_address, size])))
-
- def __repr__(self) -> str:
- return "<RangeArray " + self.values.__repr__() + ">"
-
- def __iter__(self):
- return iter(self.tuples)
-
- def __len__(self) -> int:
- return len(self.tuples)
-
- def __getitem__(self, key) -> Any:
- return self.tuples[key]
-
-class StringList(PropertyValues):
- """A StringList is a list of null-terminated strings
-
- The most common use of a StringList in Devicetree is to describe the `compatible` property.
- """
- def __init__(self, strings: List[str]):
- """Create a StringList object"""
- PropertyValues.__init__(self, strings)
-
- def __repr__(self) -> str:
- return "<StringList " + self.values.__repr__() + ">"
-
- def to_dts(self, formatHex: bool = False) -> str:
- """Format the list of strings in Devicetree Source format"""
- return ", ".join(wrapStrings(self.values))
-
-class OneString(PropertyValues):
- def __init__(self, string: str):
- PropertyValues.__init__(self, string)
-
- def __repr__(self) -> str:
- return self.values.__repr__()
-
- def to_dts(self, formatHex: bool = False) -> str:
- return super().to_dts(formatHex)
-
-class Property:
- """A Property is a key-value pair for a Devicetree Node
-
- Properties are used to describe Nodes in the tree. There are many common properties, like
-
- - compatible
- - reg
- - reg-names
- - ranges
- - interrupt-controller
- - interrupts
- - interrupt-parent
- - clocks
- - status
-
- Which might commonly describe many or all nodes in a tree, and there are device, vendor,
- operating system, runtime-specific properties.
-
- Properties can possess no value, conveing meaning solely by their presence:
-
- interrupt-controller;
-
- Properties can also possess values such as an array of cells, a list of strings, etc.
-
- reg = <0x10013000 0x1000>;
- compatible = "sifive,rocket0", "riscv";
-
- And properties can posses arbitrarily complex values, such as the following from the
- Devicetree specification:
-
- example = <0xf00f0000 19>, "a strange property format";
- """
- def __init__(self, name: str, values: PropertyValues):
- """Create a Property object"""
- self.name = name
- self.values = values
-
- def __repr__(self) -> str:
- return "<Property %s>" % self.name
-
- def __str__(self) -> str:
- return self.to_dts()
-
- @staticmethod
- def from_dts(dts: str) -> 'Property':
- """Parse a file and return a Devicetree object"""
- # pylint: disable=import-outside-toplevel,cyclic-import
- from pydevicetree.source import parseProperty
- return parseProperty(dts)
-
- def to_dts(self, level: int = 0) -> str:
- """Format the Property assignment in Devicetree Source format"""
- if self.name in ["reg", "ranges"]:
- value = self.values.to_dts(formatHex=True)
- else:
- value = self.values.to_dts(formatHex=False)
-
- if value != "":
- return formatLevel(level, "%s = %s;\n" % (self.name, value))
- if self.name == "ifdef":
- return ""
- return formatLevel(level, "%s;\n" % self.name)
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/reference.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/reference.py
deleted file mode 100644
index 54b2d28..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/ast/reference.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from typing import Union, Iterator
-
-class Label:
- """A Label is a unique identifier for a Node
-
- For example, the following node has the label "uart0":
-
- uart0: uart@10013000 {
- ...
- };
- """
- def __init__(self, name: str):
- """Create a Label"""
- self.name = name
-
- def __repr__(self) -> str:
- return "<Label " + self.name + ">"
-
- def __eq__(self, other: object) -> bool:
- if isinstance(other, Label):
- return self.name == other.name
- if isinstance(other, str):
- return self.name == other
- return False
-
- def to_dts(self) -> str:
- """Format the label in Devicetree Source format"""
- return self.name + ":"
-
-class Path:
- """A Path uniquely identifies a Node by its parents and (optionally) unit address"""
- def __init__(self, path: str):
- """Create a path out of a string"""
- self.path = path
-
- def to_dts(self) -> str:
- """Format the Path in Devicetree Source format"""
- return self.path
-
- def __repr__(self) -> str:
- return "<Path " + self.to_dts() + ">"
-
- def __eq__(self, other: object) -> bool:
- if isinstance(other, Path):
- return self.to_dts() == other.to_dts()
- if isinstance(other, str):
- return self.to_dts() == other
- return False
-
- def __iter__(self) -> Iterator[str]:
- return iter(self.path.split("/"))
-
- def replace(self, old: str, new: str) -> 'Path':
- """Replace any elements of the path which match 'old' with a new element 'new'"""
- return Path(self.path.replace(old, new))
-
-class Reference:
- """A Reference is a Devicetree construct which points to a Node in the tree
-
- The following are types of references:
-
- - A reference to a label:
-
- &my-label;
-
- - A reference to a node by path:
-
- &{/path/to/node@deadbeef}
-
- This is the parent class for both types of references, LabelReference and PathReference
- """
- # pylint: disable=no-self-use
- def to_dts(self, formatHex: bool = False) -> str:
- """Format the Reference in Devicetree Source format"""
- return ""
-
-class LabelReference(Reference):
- """A LabelReference is a reference to a Node by label"""
- def __init__(self, label: Union[Label, str]):
- """Create a LabelReference from a Label or string"""
- if isinstance(label, Label):
- self.label = label
- elif isinstance(label, str):
- self.label = Label(label)
-
- def __repr__(self) -> str:
- return "<LabelReference " + self.to_dts() + ">"
-
- def to_dts(self, formatHex: bool = False) -> str:
- """Format the LabelReference in Devicetree Source format"""
- return "&" + self.label.name
-
-class PathReference(Reference):
- """A PathReference is a reference to a Node by path"""
- def __init__(self, path: Union[Path, str]):
- """Create a PathReference from a Path or string"""
- if isinstance(path, Path):
- self.path = path
- elif isinstance(path, str):
- self.path = Path(path)
-
- def __repr__(self) -> str:
- return "<PathReference " + self.to_dts() + ">"
-
- def to_dts(self, formatHex: bool = False) -> str:
- """Format the PathReference in Devicetree Source format"""
- return "&{" + self.path.to_dts() + "}"
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/source/__init__.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/source/__init__.py
deleted file mode 100644
index 96768b3..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/source/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from cot_dt2c.pydevicetree.source.parser import parseTree, parseNode, parseProperty
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/source/grammar.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/source/grammar.py
deleted file mode 100644
index fb165e1..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/source/grammar.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-import os
-import sys
-
-import pyparsing as p # type: ignore
-
-ENV_CACHE_OPTION = "PYDEVICETREE_CACHE_SIZE_BOUND"
-
-cache_bound = None
-if ENV_CACHE_OPTION in os.environ:
- option = os.environ[ENV_CACHE_OPTION]
- if option != "None":
- try:
- cache_bound = int(option)
- except ValueError:
- print("%s requires a valid integer" % ENV_CACHE_OPTION, file=sys.stderr)
-p.ParserElement.enablePackrat(cache_bound)
-
-node_name = p.Word(p.alphanums + ",.-+_") ^ p.Literal("/")
-integer = p.pyparsing_common.integer ^ (p.Literal("0x").suppress() + p.pyparsing_common.hex_integer)
-unit_address = p.pyparsing_common.hex_integer
-unit_addresses = p.delimitedList(unit_address("address"), delim=",")
-node_handle = node_name("node_name") + p.Optional(p.Literal("@") + unit_addresses)
-property_name = p.Word(p.alphanums + ",.-_+?#")
-label = p.Word(p.alphanums + "_").setResultsName("label")
-label_creation = p.Combine(label + p.Literal(":"))
-string = p.QuotedString(quoteChar='"')
-stringlist = p.delimitedList(string)
-node_path = p.Combine(p.Literal("/") + \
- p.delimitedList(node_handle, delim="/", combine=True)).setResultsName("path")
-path_reference = p.Literal("&{").suppress() + node_path + p.Literal("}").suppress()
-label_reference = p.Literal("&").suppress() + label
-label_raw = p.Word(p.alphanums + "_")
-reference = path_reference ^ label_reference ^ label_raw
-include_directive = p.Literal("/include/") + p.QuotedString(quoteChar='"')
-generic_directive = p.QuotedString(quoteChar="/", unquoteResults=False) + \
- p.Optional(string ^ property_name ^ node_name ^ reference ^ (integer * 2)) + \
- p.Literal(";").suppress()
-directive = include_directive ^ generic_directive
-
-operator = p.oneOf("~ ! * / + - << >> < <= > >= == != & ^ | && ||")
-arith_expr = p.Forward()
-ternary_element = arith_expr ^ integer
-ternary_expr = ternary_element + p.Literal("?") + ternary_element + p.Literal(":") + ternary_element
-arith_expr = p.nestedExpr(content=(p.OneOrMore(operator ^ integer) ^ ternary_expr))
-arth_str = p.Forward()
-arith_str_expr = p.nestedExpr(content=(p.OneOrMore(operator ^ integer ^ label_raw ^ p.Literal(",")) ^ ternary_expr))
-
-label_list = p.OneOrMore(p.Combine(label + p.Literal("\n")))
-
-cell_array = p.Literal("<").suppress() + \
- p.ZeroOrMore(integer ^ arith_expr ^ arith_str_expr ^ label_list ^ string ^ reference ^ label_creation.suppress()) + \
- p.Literal(">").suppress()
-bytestring = p.Literal("[").suppress() + \
- (p.OneOrMore(p.Word(p.hexnums, exact=2) ^ label_creation.suppress())) + \
- p.Literal("]").suppress()
-property_values = p.Forward()
-property_values = p.delimitedList(property_values ^ cell_array ^ bytestring ^ stringlist ^ \
- reference ^ label_raw)
-property_assignment = property_name("property_name") + p.Optional(p.Literal("=").suppress() + \
- (property_values)).setResultsName("value") + p.Optional(p.Literal(";").suppress())
-
-ifdef_label = p.ZeroOrMore(p.Word(p.alphanums + " _|//*=/(/)"))
-ifdef_define = p.Combine(p.Keyword("#if") + ifdef_label)
-ifdef_end = p.Combine(p.Keyword("#endif") + ifdef_label)
-ifdef_define_values = p.Forward()
-ifdef_define_values = p.ZeroOrMore(ifdef_define)
-ifdef_end_values = p.Forward()
-ifdef_end_values = p.ZeroOrMore(ifdef_end)
-
-node_opener = ifdef_define_values + p.Optional(label_creation) + node_handle + p.Literal("{").suppress()
-node_reference_opener = reference + p.Literal("{").suppress()
-node_closer = p.Literal("}").suppress() + p.Literal(";").suppress() + ifdef_end_values
-node_definition = p.Forward()
-# pylint: disable=expression-not-assigned
-node_definition << (node_opener ^ node_reference_opener) + \
- p.ZeroOrMore(property_assignment ^ directive ^ node_definition ^ ifdef_define ^ ifdef_end) + \
- node_closer
-
-devicetree = p.ZeroOrMore(directive ^ node_definition)
-
-devicetree.ignore(p.cStyleComment)
-devicetree.ignore("//" + p.SkipTo(p.lineEnd))
-devicetree.ignore("#include" + p.SkipTo(p.lineEnd))
-devicetree.ignore("#define" + p.SkipTo(p.lineEnd))
-devicetree.ignore("#else" + p.SkipTo(p.lineEnd))
-devicetree.ignore("#error" + p.SkipTo(p.lineEnd))
-devicetree.ignore("#ifndef" + p.SkipTo(p.lineEnd))
-
-if __name__ == "__main__":
- if len(sys.argv) > 1:
- devicetree.parseFile(sys.argv[1]).pprint()
diff --git a/tools/cot_dt2c/cot_dt2c/pydevicetree/source/parser.py b/tools/cot_dt2c/cot_dt2c/pydevicetree/source/parser.py
deleted file mode 100644
index 0692482..0000000
--- a/tools/cot_dt2c/cot_dt2c/pydevicetree/source/parser.py
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2019 SiFive Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-from itertools import chain
-
-from cot_dt2c.pydevicetree.source import grammar
-from cot_dt2c.pydevicetree.ast import *
-
-ifdef_stack = []
-
-def transformNode(string, location, tokens):
- """Transforms a ParseResult into a Node"""
- properties = [e for e in tokens.asList() if isinstance(e, Property)]
- directives = [e for e in tokens.asList() if isinstance(e, Directive)]
- children = [e for e in tokens.asList() if isinstance(e, Node)]
-
- if isinstance(tokens[0], Reference):
- return NodeReference(tokens[0], properties=properties,
- directives=directives, children=children)
- return Node(tokens.node_name, tokens.label, tokens.address, properties=properties,
- directives=directives, children=children)
-
-def transformPropertyAssignment(string, location, tokens):
- """Transforms a ParseResult into a Property"""
- for v in tokens.value:
- if isinstance(v, PropertyValues):
- return Property(tokens.property_name, v)
- if isinstance(v, CellArray):
- return Property(tokens.property_name, v)
- if isinstance(v, StringList):
- return Property(tokens.property_name, v)
- if isinstance(v, Reference):
- return Property(tokens.property_name, v)
-
- return Property(tokens.property_name, PropertyValues([]))
-
-def transformDirective(string, location, tokens):
- """Transforms a ParseResult into a Directive"""
- if len(tokens.asList()) > 1:
- return Directive(tokens[0], tokens[1])
- return Directive(tokens[0])
-
-def evaluateArithExpr(string, location, tokens):
- """Evaluates a ParseResult as a python expression"""
- flat_tokens = list(chain.from_iterable(tokens.asList()))
- expr = " ".join(str(t) for t in flat_tokens)
- # pylint: disable=eval-used
- return eval(expr)
-
-def transformTernary(string, location, tokens):
- """Evaluates a ParseResult as a ternary expression"""
- # pylint: disable=eval-used
- return eval(str(tokens[2]) +" if " + str(tokens[0]) + " else " + str(tokens[4]))
-
-def transformPropertyValues(string, location, tokens):
- """Transforms a ParseResult into a PropertyValues"""
- if len(tokens.asList()) == 1:
- return tokens.asList()[0]
- return PropertyValues(tokens.asList())
-
-def transformStringList(string, location, tokens):
- """Transforms a ParseResult into a StringList"""
- return StringList(tokens.asList())
-
-def transformString(string, location, token):
- return OneString(token)
-
-def transformIfdefMacro(string, location, tokens):
- tokenlist = tokens.asList()
- for t in tokenlist:
- ifdef_stack.append(t)
- return Property("ifdef", PropertyValues(ifdef_stack.copy()))
-
-def transformIfdefEnd(string, location, tokens):
- tokenlist = tokens.asList()
- for t in tokenlist:
- ifdef_stack.pop()
-
-def transformIfdef(string, location, tokens):
- return Property("ifdef", PropertyValues(tokens))
-
-def evaluateStrArithExpr(string, location, tokens):
- """Evaluates a ParseResult as a python expression"""
- flat_tokens = list(chain.from_iterable(tokens.asList()))
- for i, t in enumerate(flat_tokens):
- if isinstance(t, int):
- flat_tokens[i] = "(" + str(t) + ")"
- expr = " ".join(str(t) for t in flat_tokens)
- # pylint: disable=eval-used
- return expr
-
-def transformBytestring(string, location, tokens):
- """Transforms a ParseResult into a Bytestring"""
- inttokens = []
- for t in tokens.asList():
- if all(c in "0123456789abcdefABCDEF" for c in t):
- inttokens.append(int(t, base=16))
- return Bytestring(inttokens)
-
-def transformCellArray(string, location, tokens):
- """Transforms a ParseResult into a CellArray"""
- return CellArray(tokens.asList())
-
-def transformLabel(string, location, tokens):
- """Transforms a ParseResult into a Label"""
- return Label(tokens.label)
-
-def transformPath(string, location, tokens):
- """Transforms a ParseResult into a Path"""
- path = ""
- for handle in tokens.path[0].split("/"):
- if "@" in handle:
- node, address = handle.split("@")
- path += "/%s@%x" % (node, int(address))
- elif handle != "":
- path += "/" + handle
- return Path(path)
-
-def transformPathReference(string, location, tokens):
- """Transforms a ParseResult into a PathReference"""
- return PathReference(tokens[0])
-
-def transformLabelReference(string, location, tokens):
- """Transforms a ParseResult into a LabelReference"""
- return LabelReference(tokens[0])
-
-def transformReference(string, location, tokens):
- """Transforms a ParseResult into a Reference"""
- if isinstance(tokens[0], Reference):
- return tokens[0]
- return None
-
-grammar.label.setParseAction(transformLabel)
-grammar.node_path.setParseAction(transformPath)
-grammar.path_reference.setParseAction(transformPathReference)
-grammar.label_reference.setParseAction(transformLabelReference)
-grammar.reference.setParseAction(transformReference)
-grammar.node_definition.setParseAction(transformNode)
-grammar.property_assignment.setParseAction(transformPropertyAssignment)
-grammar.directive.setParseAction(transformDirective)
-grammar.arith_expr.setParseAction(evaluateArithExpr)
-grammar.ternary_expr.setParseAction(transformTernary)
-grammar.stringlist.setParseAction(transformStringList)
-grammar.bytestring.setParseAction(transformBytestring)
-grammar.cell_array.setParseAction(transformCellArray)
-grammar.property_values.setParseAction(transformPropertyValues)
-grammar.label_raw.setParseAction(transformString)
-grammar.ifdef_define_values.setParseAction(transformIfdefMacro)
-grammar.ifdef_end_values.setParseAction(transformIfdefEnd)
-grammar.arith_str_expr.setParseAction(transformPropertyValues)
-
-def printTree(tree, level=0):
- """Helper function to print a bunch of elements as a tree"""
- def printlevel(level, s):
- print(" " * level + s)
-
- for item in tree:
- if isinstance(item, Node):
- if item.address:
- printlevel(level, "Node %s@%x" % (item.name, item.address))
- else:
- printlevel(level, "Node %s" % item.name)
-
- if item.label:
- printlevel(level, " Label: %s" % item.label)
-
- if item.parent:
- printlevel(level, " Parent: %s" % item.parent)
-
- printTree(item.properties, level=(level + 1))
-
- printTree(item.children, level=(level + 1))
- elif isinstance(item, Property):
- if item.values:
- printlevel(level, "Property %s: %s" % (item.name, item.values))
- else:
- printlevel(level, "Property %s" % item.name)
- elif isinstance(item, Directive):
- if item.options:
- printlevel(level, "Directive %s: %s" % (item.directive, item.options))
- else:
- printlevel(level, "Directive %s" % item.directive)
-
-def parentNodes(tree, parent=None):
- """Walks a tree and sets Nodes' parent field to point at their parent"""
- for item in tree:
- if isinstance(item, Node):
- item.parent = parent
- parentNodes(item.children, item)
-
-def recurseIncludeFiles(elements, pwd):
- """Recursively follows and parses /include/ directives an a tree"""
- for e in elements:
- if isinstance(e, Directive):
- if e.directive == "/include/":
- # Prefix with current directory if path is not absolute
- if e.option[0] != '/':
- e.option = pwd + e.option
-
- with open(e.option, 'r') as f:
- contents = f.read()
-
- elements += parseElements(contents)
-
- del elements[elements.asList().index(e)]
-
-def parseElements(dts, pwd="", followIncludes=False):
- """Parses a string into a list of elements"""
- elements = grammar.devicetree.parseString(dts, parseAll=True)
- parentNodes(elements)
- if followIncludes:
- recurseIncludeFiles(elements, pwd)
- return elements
-
-def parseTree(dts, pwd="", followIncludes=False):
- """Parses a string into a full Devicetree"""
- return Devicetree(parseElements(dts, pwd, followIncludes))
-
-def parseNode(dts):
- """Parses a string into a Devictreee Node"""
- return grammar.node_definition.parseString(dts, parseAll=True)[0]
-
-def parseProperty(dts):
- """Parses a string into a Devicetree Property"""
- return grammar.property_assignment.parseString(dts, parseAll=True)[0]
-
-if __name__ == "__main__":
- import sys
- if len(sys.argv) > 1:
- with open(sys.argv[1], 'r') as f:
- dts = f.read()
- tree = parseTree(dts)
- printTree(tree)
- print(tree)
- else:
- print("Please pass the devicetree source file as an argument")
- sys.exit(1)
diff --git a/tools/cot_dt2c/poetry.lock b/tools/cot_dt2c/poetry.lock
new file mode 100644
index 0000000..df58d54
--- /dev/null
+++ b/tools/cot_dt2c/poetry.lock
@@ -0,0 +1,334 @@
+# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand.
+
+[[package]]
+name = "atomicwrites"
+version = "1.4.1"
+description = "Atomic file writes."
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
+files = [
+ {file = "atomicwrites-1.4.1.tar.gz", hash = "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11"},
+]
+
+[[package]]
+name = "attrs"
+version = "24.2.0"
+description = "Classes Without Boilerplate"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"},
+ {file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"},
+]
+
+[package.extras]
+benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
+cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
+dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
+docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"]
+tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]
+tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"]
+
+[[package]]
+name = "click"
+version = "8.1.7"
+description = "Composable command line interface toolkit"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"},
+ {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"},
+]
+
+[package.dependencies]
+colorama = {version = "*", markers = "platform_system == \"Windows\""}
+
+[[package]]
+name = "colorama"
+version = "0.4.6"
+description = "Cross-platform colored terminal text."
+optional = false
+python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
+files = [
+ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
+ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
+]
+
+[[package]]
+name = "igraph"
+version = "0.11.6"
+description = "High performance graph data structures and algorithms"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "igraph-0.11.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3f8b837181e8e87676be3873ce87cc92cc234efd58a2da2f6b4e050db150fcf4"},
+ {file = "igraph-0.11.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:245c4b7d7657849eff80416f5df4525c8fc44c74a981ee4d44f0ef2612c3bada"},
+ {file = "igraph-0.11.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bdb7be3d165073c0136295c0808e9edc57ba096cdb26e94086abb04561f7a292"},
+ {file = "igraph-0.11.6-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:58974e20df2986a1ae52a16e51ecb387cc0cbeb41c5c0ddff4d373a1bbf1d9c5"},
+ {file = "igraph-0.11.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bef14de5e8ab70724a43808b1ed14aaa6fe1002f87e592289027a3827a8f44a"},
+ {file = "igraph-0.11.6-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:86c1e98de2e32d074df8510bf18abfa1f4c5fda4cb28a009985a5d746b0c0125"},
+ {file = "igraph-0.11.6-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ebc5b3d702158abeb2e4d2414374586a2b932e1a07e48352b470600e1733d528"},
+ {file = "igraph-0.11.6-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0efe6d0fb22d3987a800eb3857ed04df9eb4c5dddd0998be05232cb646f1c337"},
+ {file = "igraph-0.11.6-cp38-cp38-win32.whl", hash = "sha256:f4e68b27497b1c8ada2fb2bc35ef3fa7b0d72e84306b3d648d3de240fc618c32"},
+ {file = "igraph-0.11.6-cp38-cp38-win_amd64.whl", hash = "sha256:5665b33dfbfca5f54ce9b4fea6b97903bd0e99fb1b02acf5e57e600bdfa5a355"},
+ {file = "igraph-0.11.6-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:8aabef03d787b519d1075dfc0da4a1109fb113b941334883e3e7947ac30a459e"},
+ {file = "igraph-0.11.6-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1f2cc4a518d99cdf6cae514f85e93e56852bc8c325b3abb96037d1d690b5975f"},
+ {file = "igraph-0.11.6-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c1e859238be52ab8ccc614d18f9362942bc88ce543afc12548f81ae99b10801d"},
+ {file = "igraph-0.11.6-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d61fbe5e85eb4ae9efe08c461f9bdeedb02a2b5739fbc223d324a71f40a28be2"},
+ {file = "igraph-0.11.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b6620ba39df29fd42151becf82309b54e57148233c9c3ef890eed62e25eed8a5"},
+ {file = "igraph-0.11.6-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:59666589bb3d07f310cda2c5106a8adeeb77c2ef27fecf1c6438b6091f4ca69d"},
+ {file = "igraph-0.11.6-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:8750b6d6caebf199cf7dc41c931f58e330153779707391e30f0a29f02666fb6e"},
+ {file = "igraph-0.11.6-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:967d6f2c30fe94317da15e459374d0fb8ca3e56020412f201ecd07dd5b5352f2"},
+ {file = "igraph-0.11.6-cp39-abi3-win32.whl", hash = "sha256:9744f95a67319eb6cb487ceabf30f5d7940de34bada51f0ba63adbd23e0f94ad"},
+ {file = "igraph-0.11.6-cp39-abi3-win_amd64.whl", hash = "sha256:b80e69eb11faa9c57330a9ffebdde5808966efe1c1f638d4d4827ea04df7aca8"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0329c16092e2ea7930d5f8368666ce7cb704900cc0ea04e4afe9ea1dd46e44af"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:21752313f449bd8688e5688e95ea7231cea5e9199c7162535029be0d9af848ac"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea25e136c6c4161f53ff58868b23ff6c845193050ab0e502236d68e5d4174e32"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ac84433a03aef15e4b810010b08882b09854a3669450ccf31e392dbe295d2a66"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac697a44e3573169fa2b28c9c37dcf9cf01e0f558b845dd7123860d4c7c8fb89"},
+ {file = "igraph-0.11.6-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:bdeae8bf35316eb1fb27bf667dcf5ecf5fcfb0b8f51831bc1b00c39c09c2d73b"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ad7e4aa442935de72554b96733bf6d7f09eac5cee97988a2562bdd3ca173cfa3"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:8d2818780358a686178866d01568b9df1f29678581734ad7a78882bab54df004"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2352276a20d979f1dea360af4202bb9f0c9a7d2c77f51815c0e625165e82013d"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:687fdab543b507d622fa3043f4227e5b26dc61dcf8ff8c0919fccddcc655f8b8"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57f7f8214cd48c9a4d97f7346a4152ba2d4ac95fb5ee0df4ecf224fce4ba3d14"},
+ {file = "igraph-0.11.6-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:2b9cc69ede53f76ffae03b066609aa90184dd68ef15da8c104a97cebb9210838"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:591e1e447c3f0092daf7613a3eaedab83f9a0b0adbaf7702724c5117ded038a5"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:ca558eb331bc687bc33e5cd23717e22676e9412f8cda3a31d30c996a0487610d"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf43c30e08debb087c9e3da69aa5cf1b6732968da34d55a614e3421b9a452146"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d38e8d7db72b187d9d2211d0d06b3271fa9f32b04d49d789e2859b5480db0d0"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a318b059051ff78144a1c3cb880f4d933c812bcdb3d833a49cd7168d0427672"},
+ {file = "igraph-0.11.6-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2c54027add809b3c5b6685b8deca4ea4763fd000b9ea45c7ee46b7c9d61ff15e"},
+ {file = "igraph-0.11.6.tar.gz", hash = "sha256:837f233256c3319f2a35a6a80d94eafe47b43791ef4c6f9e9871061341ac8e28"},
+]
+
+[package.dependencies]
+texttable = ">=1.6.2"
+
+[package.extras]
+cairo = ["cairocffi (>=1.2.0)"]
+doc = ["Sphinx (>=7.0.0)", "pydoctor (>=23.4.0)", "sphinx-gallery (>=0.14.0)", "sphinx-rtd-theme (>=1.3.0)"]
+matplotlib = ["matplotlib (>=3.6.0)"]
+plotly = ["plotly (>=5.3.0)"]
+plotting = ["cairocffi (>=1.2.0)"]
+test = ["Pillow (>=9)", "cairocffi (>=1.2.0)", "matplotlib (>=3.6.0)", "networkx (>=2.5)", "numpy (>=1.19.0)", "pandas (>=1.1.0)", "plotly (>=5.3.0)", "pytest (>=7.0.1)", "pytest-timeout (>=2.1.0)", "scipy (>=1.5.0)"]
+test-musl = ["cairocffi (>=1.2.0)", "networkx (>=2.5)", "pytest (>=7.0.1)", "pytest-timeout (>=2.1.0)"]
+
+[[package]]
+name = "iniconfig"
+version = "2.0.0"
+description = "brain-dead simple config-ini parsing"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
+ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
+]
+
+[[package]]
+name = "mypy"
+version = "0.910"
+description = "Optional static typing for Python"
+optional = false
+python-versions = ">=3.5"
+files = [
+ {file = "mypy-0.910-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:a155d80ea6cee511a3694b108c4494a39f42de11ee4e61e72bc424c490e46457"},
+ {file = "mypy-0.910-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:b94e4b785e304a04ea0828759172a15add27088520dc7e49ceade7834275bedb"},
+ {file = "mypy-0.910-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:088cd9c7904b4ad80bec811053272986611b84221835e079be5bcad029e79dd9"},
+ {file = "mypy-0.910-cp35-cp35m-win_amd64.whl", hash = "sha256:adaeee09bfde366d2c13fe6093a7df5df83c9a2ba98638c7d76b010694db760e"},
+ {file = "mypy-0.910-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ecd2c3fe726758037234c93df7e98deb257fd15c24c9180dacf1ef829da5f921"},
+ {file = "mypy-0.910-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d9dd839eb0dc1bbe866a288ba3c1afc33a202015d2ad83b31e875b5905a079b6"},
+ {file = "mypy-0.910-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3e382b29f8e0ccf19a2df2b29a167591245df90c0b5a2542249873b5c1d78212"},
+ {file = "mypy-0.910-cp36-cp36m-win_amd64.whl", hash = "sha256:53fd2eb27a8ee2892614370896956af2ff61254c275aaee4c230ae771cadd885"},
+ {file = "mypy-0.910-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b6fb13123aeef4a3abbcfd7e71773ff3ff1526a7d3dc538f3929a49b42be03f0"},
+ {file = "mypy-0.910-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e4dab234478e3bd3ce83bac4193b2ecd9cf94e720ddd95ce69840273bf44f6de"},
+ {file = "mypy-0.910-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:7df1ead20c81371ccd6091fa3e2878559b5c4d4caadaf1a484cf88d93ca06703"},
+ {file = "mypy-0.910-cp37-cp37m-win_amd64.whl", hash = "sha256:0aadfb2d3935988ec3815952e44058a3100499f5be5b28c34ac9d79f002a4a9a"},
+ {file = "mypy-0.910-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec4e0cd079db280b6bdabdc807047ff3e199f334050db5cbb91ba3e959a67504"},
+ {file = "mypy-0.910-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:119bed3832d961f3a880787bf621634ba042cb8dc850a7429f643508eeac97b9"},
+ {file = "mypy-0.910-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:866c41f28cee548475f146aa4d39a51cf3b6a84246969f3759cb3e9c742fc072"},
+ {file = "mypy-0.910-cp38-cp38-win_amd64.whl", hash = "sha256:ceb6e0a6e27fb364fb3853389607cf7eb3a126ad335790fa1e14ed02fba50811"},
+ {file = "mypy-0.910-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a85e280d4d217150ce8cb1a6dddffd14e753a4e0c3cf90baabb32cefa41b59e"},
+ {file = "mypy-0.910-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:42c266ced41b65ed40a282c575705325fa7991af370036d3f134518336636f5b"},
+ {file = "mypy-0.910-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:3c4b8ca36877fc75339253721f69603a9c7fdb5d4d5a95a1a1b899d8b86a4de2"},
+ {file = "mypy-0.910-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c0df2d30ed496a08de5daed2a9ea807d07c21ae0ab23acf541ab88c24b26ab97"},
+ {file = "mypy-0.910-cp39-cp39-win_amd64.whl", hash = "sha256:c6c2602dffb74867498f86e6129fd52a2770c48b7cd3ece77ada4fa38f94eba8"},
+ {file = "mypy-0.910-py3-none-any.whl", hash = "sha256:ef565033fa5a958e62796867b1df10c40263ea9ded87164d67572834e57a174d"},
+ {file = "mypy-0.910.tar.gz", hash = "sha256:704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150"},
+]
+
+[package.dependencies]
+mypy-extensions = ">=0.4.3,<0.5.0"
+toml = "*"
+typing-extensions = ">=3.7.4"
+
+[package.extras]
+dmypy = ["psutil (>=4.0)"]
+python2 = ["typed-ast (>=1.4.0,<1.5.0)"]
+
+[[package]]
+name = "mypy-extensions"
+version = "0.4.4"
+description = "Experimental type system extensions for programs checked with the mypy typechecker."
+optional = false
+python-versions = ">=2.7"
+files = [
+ {file = "mypy_extensions-0.4.4.tar.gz", hash = "sha256:c8b707883a96efe9b4bb3aaf0dcc07e7e217d7d8368eec4db4049ee9e142f4fd"},
+]
+
+[[package]]
+name = "packaging"
+version = "24.1"
+description = "Core utilities for Python packages"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"},
+ {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"},
+]
+
+[[package]]
+name = "plotly"
+version = "5.23.0"
+description = "An open-source, interactive data visualization library for Python"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "plotly-5.23.0-py3-none-any.whl", hash = "sha256:76cbe78f75eddc10c56f5a4ee3e7ccaade7c0a57465546f02098c0caed6c2d1a"},
+ {file = "plotly-5.23.0.tar.gz", hash = "sha256:89e57d003a116303a34de6700862391367dd564222ab71f8531df70279fc0193"},
+]
+
+[package.dependencies]
+packaging = "*"
+tenacity = ">=6.2.0"
+
+[[package]]
+name = "pluggy"
+version = "1.5.0"
+description = "plugin and hook calling mechanisms for python"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
+ {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"},
+]
+
+[package.extras]
+dev = ["pre-commit", "tox"]
+testing = ["pytest", "pytest-benchmark"]
+
+[[package]]
+name = "py"
+version = "1.11.0"
+description = "library with cross-python path, ini-parsing, io, code, log facilities"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
+files = [
+ {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"},
+ {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"},
+]
+
+[[package]]
+name = "pydevicetree"
+version = "0.0.13"
+description = "A library for parsing Devicetree Source v1"
+optional = false
+python-versions = ">=3.5"
+files = [
+ {file = "pydevicetree-0.0.13-py3-none-any.whl", hash = "sha256:d61c695cec925b90a8b5740053f4b604e51154a9b36e62a2f12ed9ceaf2f8c38"},
+ {file = "pydevicetree-0.0.13.tar.gz", hash = "sha256:5700c05df89bad8fd729c11aa6f764a3323bcb3796f13b32481ae34445cfc1b7"},
+]
+
+[package.dependencies]
+pyparsing = "*"
+
+[[package]]
+name = "pyparsing"
+version = "3.1.2"
+description = "pyparsing module - Classes and methods to define and execute parsing grammars"
+optional = false
+python-versions = ">=3.6.8"
+files = [
+ {file = "pyparsing-3.1.2-py3-none-any.whl", hash = "sha256:f9db75911801ed778fe61bb643079ff86601aca99fcae6345aa67292038fb742"},
+ {file = "pyparsing-3.1.2.tar.gz", hash = "sha256:a1bac0ce561155ecc3ed78ca94d3c9378656ad4c94c1270de543f621420f94ad"},
+]
+
+[package.extras]
+diagrams = ["jinja2", "railroad-diagrams"]
+
+[[package]]
+name = "pytest"
+version = "6.2.5"
+description = "pytest: simple powerful testing with Python"
+optional = false
+python-versions = ">=3.6"
+files = [
+ {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"},
+ {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"},
+]
+
+[package.dependencies]
+atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""}
+attrs = ">=19.2.0"
+colorama = {version = "*", markers = "sys_platform == \"win32\""}
+iniconfig = "*"
+packaging = "*"
+pluggy = ">=0.12,<2.0"
+py = ">=1.8.2"
+toml = "*"
+
+[package.extras]
+testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"]
+
+[[package]]
+name = "tenacity"
+version = "9.0.0"
+description = "Retry code until it succeeds"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "tenacity-9.0.0-py3-none-any.whl", hash = "sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539"},
+ {file = "tenacity-9.0.0.tar.gz", hash = "sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b"},
+]
+
+[package.extras]
+doc = ["reno", "sphinx"]
+test = ["pytest", "tornado (>=4.5)", "typeguard"]
+
+[[package]]
+name = "texttable"
+version = "1.7.0"
+description = "module to create simple ASCII tables"
+optional = false
+python-versions = "*"
+files = [
+ {file = "texttable-1.7.0-py2.py3-none-any.whl", hash = "sha256:72227d592c82b3d7f672731ae73e4d1f88cd8e2ef5b075a7a7f01a23a3743917"},
+ {file = "texttable-1.7.0.tar.gz", hash = "sha256:2d2068fb55115807d3ac77a4ca68fa48803e84ebb0ee2340f858107a36522638"},
+]
+
+[[package]]
+name = "toml"
+version = "0.10.2"
+description = "Python Library for Tom's Obvious, Minimal Language"
+optional = false
+python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
+files = [
+ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},
+ {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
+]
+
+[[package]]
+name = "typing-extensions"
+version = "4.12.2"
+description = "Backported and Experimental Type Hints for Python 3.8+"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"},
+ {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},
+]
+
+[metadata]
+lock-version = "2.0"
+python-versions = "^3.8"
+content-hash = "afa5cb49be96467a848bab753a630c6f5ec42d6750d67d29920c3e3971774e36"
diff --git a/tools/cot_dt2c/pyproject.toml b/tools/cot_dt2c/pyproject.toml
index d383924..73251d7 100644
--- a/tools/cot_dt2c/pyproject.toml
+++ b/tools/cot_dt2c/pyproject.toml
@@ -28,30 +28,33 @@
[tool.poetry.dependencies]
python = "^3.8"
click = "^8.1.7"
-pyparsing = "^2.4.7"
plotly = "^5.23.0"
-pandas = "^2.2.2"
+pydevicetree = "0.0.13"
igraph = "^0.11.6"
+pyparsing = "^3.1.2"
-[tool.poetry.dev-dependencies]
+[tool.poetry.group.dev]
+optional = true
+
+[tool.poetry.group.dev.dependencies]
mypy = "^0.910"
pytest = "^6.2.5"
-pyparsing = "^2.4.7"
-plotly = "^5.23.0"
-pandas = "^2.2.2"
-igraph = "^0.11.6"
[tool.mypy]
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
-python_version = 3.8
+python_version = "3.8"
pretty = true
show_traceback = true
color_output = true
+[[tool.mypy.overrides]]
+module = ["igraph", "pydevicetree", "pydevicetree.ast", "plotly", "plotly.graph_objects"]
+ignore_missing_imports = true
+
[tool.coverage.run]
source = ["tests"]
-[coverage.paths]
+[tool.coverage.paths]
source = "cot_dt2c"
[tool.poetry.scripts]
diff --git a/tools/cot_dt2c/requirements.txt b/tools/cot_dt2c/requirements.txt
deleted file mode 100644
index 246b81d..0000000
--- a/tools/cot_dt2c/requirements.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-mypy
-pylint
-pyparsing
-igraph
-pandas
-plotly
diff --git a/tools/cot_dt2c/tests/test_invalid_bracket.dtsi b/tools/cot_dt2c/tests/test_invalid_bracket.dtsi
index ec5f9c7..9752ecf 100644
--- a/tools/cot_dt2c/tests/test_invalid_bracket.dtsi
+++ b/tools/cot_dt2c/tests/test_invalid_bracket.dtsi
@@ -8,21 +8,18 @@
*
*/
-#include <example/example.h>
-#include <example/example/example.h>
-
cot {
manifests {
compatible = "arm, cert-descs";
example_cert: example_cert {
root-certificate;
- image-id =<EXAMPLE_ID>;
+ image-id =<2>;
antirollback-counter = <&example_ctr>;
example_hash: example_hash
{
- oid = EXAMPLE_HASH_ID;
+ oid = "1.3.6.1.4.1.4128.2100.101";
};
};
@@ -32,7 +29,7 @@
compatible = "arm, img-descs";
example {
- image-id = <EXAMPLE_ID>;
+ image-id = <2>;
parent = <&example_cert>;
hash = <&example_hash>;
};
@@ -45,13 +42,13 @@
#size-cells = <0>;
example_ctr: example_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = CCA_FW_NVCOUNTER_OID;
+ id = <0>;
+ oid = "1.3.6.1.4.1.4128.2100.3";
};
};
rot_keys {
example_pk: example_pk {
- oid = EXAMPLE_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.101";
};
};
diff --git a/tools/cot_dt2c/tests/test_invalid_ifdef.dtsi b/tools/cot_dt2c/tests/test_invalid_ifdef.dtsi
deleted file mode 100644
index 5bc6bb9..0000000
--- a/tools/cot_dt2c/tests/test_invalid_ifdef.dtsi
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2024, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- * This file provide a malformed CoT DT file that there is
- * unmatching ifdef macro
- *
- */
-
-#include <example/example.h>
-#include <example/example/example.h>
-
-cot {
- manifests {
- compatible = "arm, cert-descs";
-
- example_cert: example_cert {
- root-certificate;
- image-id =<EXAMPLE_ID>;
- antirollback-counter = <&example_ctr>;
-
- example_hash: example_hash
- {
- oid = EXAMPLE_HASH_ID;
- };
-
- };
- };
-
-#if defined(test)
- images {
- compatible = "arm, img-descs";
-
- example {
- image-id = <EXAMPLE_ID>;
- parent = <&example_cert>;
- hash = <&example_hash>;
- };
- };
-};
-
-non_volatile_counters: non_volatile_counters {
- compatible = "arm, non-volatile-counter";
-
- #address-cells = <1>;
- #size-cells = <0>;
-
- example_ctr: example_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = CCA_FW_NVCOUNTER_OID;
- };
-};
-
-rot_keys {
- example_pk: example_pk {
- oid = EXAMPLE_PK_OID;
- };
-};
diff --git a/tools/cot_dt2c/tests/test_invalid_ifdef2.dtsi b/tools/cot_dt2c/tests/test_invalid_ifdef2.dtsi
deleted file mode 100644
index c915168..0000000
--- a/tools/cot_dt2c/tests/test_invalid_ifdef2.dtsi
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2024, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- * This file provide a malformed CoT DT file that there is
- * unmatching ifdef macro
- *
- */
-
-#include <example/example.h>
-#include <example/example/example.h>
-
-cot {
- manifests {
- compatible = "arm, cert-descs";
-
- example_cert: example_cert {
- root-certificate;
- image-id =<EXAMPLE_ID>;
- antirollback-counter = <&example_ctr>;
-
- example_hash: example_hash
- {
- oid = EXAMPLE_HASH_ID;
- };
-
- };
- };
-
-#if defined(test)
- images {
- compatible = "arm, img-descs";
-
- example {
- image-id = <EXAMPLE_ID>;
- parent = <&example_cert>;
- hash = <&example_hash>;
- };
- };
-#endif
-#endif
-};
-
-non_volatile_counters: non_volatile_counters {
- compatible = "arm, non-volatile-counter";
-
- #address-cells = <1>;
- #size-cells = <0>;
-
- example_ctr: example_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = CCA_FW_NVCOUNTER_OID;
- };
-};
-
-rot_keys {
- example_pk: example_pk {
- oid = EXAMPLE_PK_OID;
- };
-};
diff --git a/tools/cot_dt2c/tests/test_invalid_missing_attribute.dtsi b/tools/cot_dt2c/tests/test_invalid_missing_attribute.dtsi
index 9c0a5f2..e35ab73 100644
--- a/tools/cot_dt2c/tests/test_invalid_missing_attribute.dtsi
+++ b/tools/cot_dt2c/tests/test_invalid_missing_attribute.dtsi
@@ -8,10 +8,6 @@
*
*/
-#include <tools_share/cca_oid.h>
-#include <common/tbbr/tbbr_img_def.h>
-#include <common/nv_cntr_ids.h>
-
cot {
manifests {
compatible = "arm, cert-descs";
@@ -20,218 +16,63 @@
root-certificate;
antirollback-counter = <&cca_nv_ctr>;
- tb_fw_hash: tb_fw_hash {
- oid = TRUSTED_BOOT_FW_HASH_OID;
- };
- tb_fw_config_hash: tb_fw_config_hash {
- oid = TRUSTED_BOOT_FW_CONFIG_HASH_OID;
- };
hw_config_hash: hw_config_hash {
};
- fw_config_hash: fw_config_hash {
- oid = FW_CONFIG_HASH_OID;
- };
- soc_fw_hash: soc_fw_hash {
- oid = SOC_AP_FW_HASH_OID;
- };
- soc_fw_config_hash: soc_fw_config_hash {
- oid = SOC_FW_CONFIG_HASH_OID;
- };
- rmm_hash: rmm_hash {
- oid = RMM_HASH_OID;
- };
- };
-
- core_swd_key_cert: core_swd_key_cert {
- root-certificate;
- image-id = <CORE_SWD_KEY_CERT_ID>;
- signing-key = <&swd_rot_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- core_swd_pk: core_swd_pk {
- oid = CORE_SWD_PK_OID;
- };
- };
-
- trusted_os_fw_content_cert: trusted_os_fw_content_cert {
- image-id = <TRUSTED_OS_FW_CONTENT_CERT_ID>;
- parent = <&core_swd_key_cert>;
- signing-key = <&core_swd_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
- tos_fw_hash: tos_fw_hash {
- oid = TRUSTED_OS_FW_HASH_OID;
- };
- tos_fw_config_hash: tos_fw_config_hash {
- oid = TRUSTED_OS_FW_CONFIG_HASH_OID;
+ soc_fw_config_hash: soc_fw_config_hash {
+ oid = "1.3.6.1.4.1.4128.2100.604";
};
};
plat_key_cert: plat_key_cert {
root-certificate;
- image-id = <PLAT_KEY_CERT_ID>;
+ image-id = <38>;
signing-key = <&prot_pk>;
antirollback-counter = <&non_trusted_nv_ctr>;
plat_pk: plat_pk {
- oid = PLAT_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1105";
};
};
non_trusted_fw_content_cert: non_trusted_fw_content_cert {
- image-id = <NON_TRUSTED_FW_CONTENT_CERT_ID>;
- parent = <&plat_key_cert>;
+ image-id = <15>;
signing-key = <&plat_pk>;
antirollback-counter = <&non_trusted_nv_ctr>;
nt_world_bl_hash: nt_world_bl_hash {
- oid = NON_TRUSTED_WORLD_BOOTLOADER_HASH_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1201";
};
nt_fw_config_hash: nt_fw_config_hash {
- oid = NON_TRUSTED_FW_CONFIG_HASH_OID;
- };
- };
-
-#if defined(SPD_spmd)
- sip_sp_content_cert: sip_sp_content_cert {
- image-id = <SIP_SP_CONTENT_CERT_ID>;
- parent = <&core_swd_key_cert>;
- signing-key = <&core_swd_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- sp_pkg1_hash: sp_pkg1_hash {
- oid = SP_PKG1_HASH_OID;
- };
- sp_pkg2_hash: sp_pkg2_hash {
- oid = SP_PKG2_HASH_OID;
- };
- sp_pkg3_hash: sp_pkg3_hash {
- oid = SP_PKG3_HASH_OID;
- };
- sp_pkg4_hash: sp_pkg4_hash {
- oid = SP_PKG4_HASH_OID;
- };
- };
-
- plat_sp_content_cert: plat_sp_content_cert {
- parent = <&plat_key_cert>;
- signing-key = <&plat_pk>;
- antirollback-counter = <&non_trusted_nv_ctr>;
-
- sp_pkg5_hash: sp_pkg5_hash {
- oid = SP_PKG5_HASH_OID;
- };
- sp_pkg6_hash: sp_pkg6_hash {
- oid = SP_PKG6_HASH_OID;
- };
- sp_pkg7_hash: sp_pkg7_hash {
- oid = SP_PKG7_HASH_OID;
- };
- sp_pkg8_hash: sp_pkg8_hash {
- oid = SP_PKG8_HASH_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1202";
};
};
-#endif
- };
images {
compatible = "arm, img-descs";
hw_config {
- image-id = <HW_CONFIG_ID>;
+ image-id = <23>;
hash = <&hw_config_hash>;
};
- bl31_image {
- image-id = <BL31_IMAGE_ID>;
- parent = <&cca_content_cert>;
- hash = <&soc_fw_hash>;
- };
-
soc_fw_config {
- image-id = <SOC_FW_CONFIG_ID>;
+ image-id = <25>;
parent = <&cca_content_cert>;
hash = <&soc_fw_config_hash>;
};
- rmm_image {
- image-id = <RMM_IMAGE_ID>;
- parent = <&cca_content_cert>;
- hash = <&rmm_hash>;
- };
-
- bl32_image {
- image-id = <BL32_IMAGE_ID>;
- parent = <&trusted_os_fw_content_cert>;
- hash = <&tos_fw_hash>;
- };
-
- tos_fw_config {
- image-id = <TOS_FW_CONFIG_ID>;
- parent = <&trusted_os_fw_content_cert>;
- hash = <&tos_fw_config_hash>;
- };
-
bl33_image {
- image-id = <BL33_IMAGE_ID>;
+ image-id = <5>;
parent = <&non_trusted_fw_content_cert>;
hash = <&nt_world_bl_hash>;
};
nt_fw_config {
- image-id = <NT_FW_CONFIG_ID>;
+ image-id = <27>;
parent = <&non_trusted_fw_content_cert>;
hash = <&nt_fw_config_hash>;
};
-
-#if defined(SPD_spmd)
- sp_pkg1 {
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg1_hash>;
- };
-
- sp_pkg2 {
- image-id = <SP_PKG2_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg2_hash>;
- };
-
- sp_pkg3 {
- image-id = <SP_PKG3_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg3_hash>;
- };
-
- sp_pkg4 {
- image-id = <SP_PKG4_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg4_hash>;
- };
-
- sp_pkg5 {
- image-id = <SP_PKG5_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg5_hash>;
- };
-
- sp_pkg6 {
- image-id = <SP_PKG6_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg6_hash>;
- };
-
- sp_pkg7 {
- image-id = <SP_PKG7_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg7_hash>;
- };
-
- sp_pkg8 {
- image-id = <SP_PKG8_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg8_hash>;
- };
-#endif
};
};
@@ -242,26 +83,26 @@
#size-cells = <0>;
cca_nv_ctr: cca_nv_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = CCA_FW_NVCOUNTER_OID;
+ id = <0>;
+ oid = "1.3.6.1.4.1.4128.2100.3";
};
trusted_nv_ctr: trusted_nv_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = TRUSTED_FW_NVCOUNTER_OID;
+ id = <0>;
+ oid = "1.3.6.1.4.1.4128.2100.1";
};
non_trusted_nv_ctr: non_trusted_nv_ctr {
- id = <NON_TRUSTED_NV_CTR_ID>;
- oid = NON_TRUSTED_FW_NVCOUNTER_OID;
+ id = <1>;
+ oid = "1.3.6.1.4.1.4128.2100.2";
};
};
rot_keys {
swd_rot_pk: swd_rot_pk {
- oid = SWD_ROT_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1103";
};
prot_pk: prot_pk {
- oid = PROT_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1102";
};
};
diff --git a/tools/cot_dt2c/tests/test_invalid_missing_attribute2.dtsi b/tools/cot_dt2c/tests/test_invalid_missing_attribute2.dtsi
deleted file mode 100644
index 01b2597..0000000
--- a/tools/cot_dt2c/tests/test_invalid_missing_attribute2.dtsi
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (c) 2024, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- * This file provide a malformed CoT DT file that there
- * are image/certificate that points to invalid parent
- *
- */
-
-#include <tools_share/cca_oid.h>
-#include <common/tbbr/tbbr_img_def.h>
-#include <common/nv_cntr_ids.h>
-
-cot {
- manifests {
- compatible = "arm, cert-descs";
-
- cca_content_cert: cca_content_cert {
- root-certificate;
- image-id =<CCA_CONTENT_CERT_ID>;
- antirollback-counter = <&cca_nv_ctr>;
-
- tb_fw_hash: tb_fw_hash {
- oid = TRUSTED_BOOT_FW_HASH_OID;
- };
- tb_fw_config_hash: tb_fw_config_hash {
- oid = TRUSTED_BOOT_FW_CONFIG_HASH_OID;
- };
- hw_config_hash: hw_config_hash {
- oid = HW_CONFIG_HASH_OID;
- };
- fw_config_hash: fw_config_hash {
- oid = FW_CONFIG_HASH_OID;
- };
- soc_fw_hash: soc_fw_hash {
- oid = SOC_AP_FW_HASH_OID;
- };
- soc_fw_config_hash: soc_fw_config_hash {
- oid = SOC_FW_CONFIG_HASH_OID;
- };
- rmm_hash: rmm_hash {
- oid = RMM_HASH_OID;
- };
- };
-
- core_swd_key_cert: core_swd_key_cert {
- root-certificate;
- image-id = <CORE_SWD_KEY_CERT_ID>;
- signing-key = <&swd_rot_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- core_swd_pk: core_swd_pk {
- oid = CORE_SWD_PK_OID;
- };
- };
-
- trusted_os_fw_content_cert: trusted_os_fw_content_cert {
- image-id = <TRUSTED_OS_FW_CONTENT_CERT_ID>;
- parent = <&core_swd_key_cert>;
- signing-key = <&core_swd_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- tos_fw_hash: tos_fw_hash {
- oid = TRUSTED_OS_FW_HASH_OID;
- };
- tos_fw_config_hash: tos_fw_config_hash {
- oid = TRUSTED_OS_FW_CONFIG_HASH_OID;
- };
- };
-
- plat_key_cert: plat_key_cert {
- root-certificate;
- image-id = <PLAT_KEY_CERT_ID>;
- signing-key = <&prot_pk>;
- antirollback-counter = <&non_trusted_nv_ctr>;
-
- plat_pk: plat_pk {
- oid = PLAT_PK_OID;
- };
- };
-
- non_trusted_fw_content_cert: non_trusted_fw_content_cert {
- image-id = <NON_TRUSTED_FW_CONTENT_CERT_ID>;
- parent = <&cca_content_cert>;
- signing-key = <&plat_pk>;
- antirollback-counter = <&non_trusted_nv_ctr>;
-
- nt_world_bl_hash: nt_world_bl_hash {
- oid = NON_TRUSTED_WORLD_BOOTLOADER_HASH_OID;
- };
- nt_fw_config_hash: nt_fw_config_hash {
- oid = NON_TRUSTED_FW_CONFIG_HASH_OID;
- };
- };
-
-#if defined(SPD_spmd)
- sip_sp_content_cert: sip_sp_content_cert {
- image-id = <SIP_SP_CONTENT_CERT_ID>;
- parent = <&cca_content_cert>;
- signing-key = <&core_swd_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- sp_pkg1_hash: sp_pkg1_hash {
- oid = SP_PKG1_HASH_OID;
- };
- sp_pkg2_hash: sp_pkg2_hash {
- oid = SP_PKG2_HASH_OID;
- };
- sp_pkg3_hash: sp_pkg3_hash {
- oid = SP_PKG3_HASH_OID;
- };
- sp_pkg4_hash: sp_pkg4_hash {
- oid = SP_PKG4_HASH_OID;
- };
- };
-
- plat_sp_content_cert: plat_sp_content_cert {
- image-id = <PLAT_SP_CONTENT_CERT_ID>;
- signing-key = <&plat_pk>;
- antirollback-counter = <&non_trusted_nv_ctr>;
-
- sp_pkg5_hash: sp_pkg5_hash {
- oid = SP_PKG5_HASH_OID;
- };
- sp_pkg6_hash: sp_pkg6_hash {
- oid = SP_PKG6_HASH_OID;
- };
- sp_pkg7_hash: sp_pkg7_hash {
- oid = SP_PKG7_HASH_OID;
- };
- sp_pkg8_hash: sp_pkg8_hash {
- oid = SP_PKG8_HASH_OID;
- };
- };
-#endif
- };
-
- images {
- compatible = "arm, img-descs";
-
- hw_config {
- image-id = <HW_CONFIG_ID>;
- parent = <&cca_content_cert>;
- hash = <&hw_config_hash>;
- };
-
- bl31_image {
- image-id = <BL31_IMAGE_ID>;
- parent = <&cca_content_cert>;
- hash = <&soc_fw_hash>;
- };
-
- soc_fw_config {
- image-id = <SOC_FW_CONFIG_ID>;
- parent = <&cca_content_cert>;
- hash = <&soc_fw_config_hash>;
- };
-
- rmm_image {
- image-id = <RMM_IMAGE_ID>;
- parent = <&cca_content_cert>;
- hash = <&rmm_hash>;
- };
-
- bl32_image {
- image-id = <BL32_IMAGE_ID>;
- parent = <&trusted_os_fw_content_cert>;
- hash = <&tos_fw_hash>;
- };
-
- tos_fw_config {
- image-id = <TOS_FW_CONFIG_ID>;
- parent = <&trusted_os_fw_content_cert>;
- hash = <&tos_fw_config_hash>;
- };
-
- bl33_image {
- image-id = <BL33_IMAGE_ID>;
- parent = <&non_trusted_fw_content_cert>;
- hash = <&nt_world_bl_hash>;
- };
-
- nt_fw_config {
- image-id = <NT_FW_CONFIG_ID>;
- hash = <&nt_fw_config_hash>;
- };
-
-#if defined(SPD_spmd)
- sp_pkg1 {
- image-id = <SP_PKG1_ID>;
- hash = <&sp_pkg1_hash>;
- };
-
- sp_pkg2 {
- image-id = <SP_PKG2_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg2_hash>;
- };
-
- sp_pkg3 {
- image-id = <SP_PKG3_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg3_hash>;
- };
-
- sp_pkg4 {
- image-id = <SP_PKG4_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg4_hash>;
- };
-
- sp_pkg5 {
- image-id = <SP_PKG5_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg5_hash>;
- };
-
- sp_pkg6 {
- image-id = <SP_PKG6_ID>;
- parent = <&wrong_parent>;
- hash = <&sp_pkg6_hash>;
- };
-
- sp_pkg7 {
- image-id = <SP_PKG7_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg7_hash>;
- };
-
- sp_pkg8 {
- image-id = <SP_PKG8_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg8_hash>;
- };
-#endif
- };
-};
-
-non_volatile_counters: non_volatile_counters {
- compatible = "arm, non-volatile-counter";
-
- #address-cells = <1>;
- #size-cells = <0>;
-
- cca_nv_ctr: cca_nv_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = CCA_FW_NVCOUNTER_OID;
- };
-
- trusted_nv_ctr: trusted_nv_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = TRUSTED_FW_NVCOUNTER_OID;
- };
-
- non_trusted_nv_ctr: non_trusted_nv_ctr {
- id = <NON_TRUSTED_NV_CTR_ID>;
- oid = NON_TRUSTED_FW_NVCOUNTER_OID;
- };
-};
-
-rot_keys {
- swd_rot_pk: swd_rot_pk {
- oid = SWD_ROT_PK_OID;
- };
- prot_pk: prot_pk {
- oid = PROT_PK_OID;
- };
-};
diff --git a/tools/cot_dt2c/tests/test_invalid_missing_ctr.dtsi b/tools/cot_dt2c/tests/test_invalid_missing_ctr.dtsi
index 5958f5d..c572b1a 100644
--- a/tools/cot_dt2c/tests/test_invalid_missing_ctr.dtsi
+++ b/tools/cot_dt2c/tests/test_invalid_missing_ctr.dtsi
@@ -9,22 +9,19 @@
*
*/
-#include <example/example.h>
-#include <example/example/example.h>
-
cot {
manifests {
compatible = "arm, cert-descs";
example_cert: example_cert {
root-certificate;
- image-id =<EXAMPLE_ID>;
+ image-id =<2>;
signing-key = <&swd_rot_pk>;
antirollback-counter = <&example_ctr>;
example_hash: example_hash
{
- oid = EXAMPLE_HASH_ID;
+ oid = "1.3.6.1.4.1.4128.2100.104";
};
};
@@ -34,7 +31,7 @@
compatible = "arm, img-descs";
example {
- image-id = <EXAMPLE_ID>;
+ image-id = <2>;
parent = <&example_cert>;
hash = <&example_hash>;
};
@@ -51,6 +48,6 @@
rot_keys {
example_pk: example_pk {
- oid = EXAMPLE_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.104";
};
};
diff --git a/tools/cot_dt2c/tests/test_invalid_undefined_parent.dtsi b/tools/cot_dt2c/tests/test_invalid_undefined_parent.dtsi
index b761beb..b6056ca 100644
--- a/tools/cot_dt2c/tests/test_invalid_undefined_parent.dtsi
+++ b/tools/cot_dt2c/tests/test_invalid_undefined_parent.dtsi
@@ -8,75 +8,31 @@
*
*/
-#include <tools_share/cca_oid.h>
-#include <common/tbbr/tbbr_img_def.h>
-#include <common/nv_cntr_ids.h>
-
cot {
manifests {
compatible = "arm, cert-descs";
cca_content_cert: cca_content_cert {
root-certificate;
- image-id =<CCA_CONTENT_CERT_ID>;
+ image-id =<36>;
antirollback-counter = <&cca_nv_ctr>;
- tb_fw_hash: tb_fw_hash {
- oid = TRUSTED_BOOT_FW_HASH_OID;
- };
- tb_fw_config_hash: tb_fw_config_hash {
- oid = TRUSTED_BOOT_FW_CONFIG_HASH_OID;
- };
hw_config_hash: hw_config_hash {
- oid = HW_CONFIG_HASH_OID;
- };
- fw_config_hash: fw_config_hash {
- oid = FW_CONFIG_HASH_OID;
- };
- soc_fw_hash: soc_fw_hash {
- oid = SOC_AP_FW_HASH_OID;
+ oid = "1.3.6.1.4.1.4128.2100.203";
};
soc_fw_config_hash: soc_fw_config_hash {
- oid = SOC_FW_CONFIG_HASH_OID;
- };
- rmm_hash: rmm_hash {
- oid = RMM_HASH_OID;
- };
- };
-
- core_swd_key_cert: core_swd_key_cert {
- root-certificate;
- image-id = <CORE_SWD_KEY_CERT_ID>;
- signing-key = <&swd_rot_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- core_swd_pk: core_swd_pk {
- oid = CORE_SWD_PK_OID;
- };
- };
-
- trusted_os_fw_content_cert: trusted_os_fw_content_cert {
- image-id = <TRUSTED_OS_FW_CONTENT_CERT_ID>;
- parent = <&core_swd_key_cert>;
- signing-key = <&core_swd_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- tos_fw_hash: tos_fw_hash {
- oid = TRUSTED_OS_FW_HASH_OID;
- };
- tos_fw_config_hash: tos_fw_config_hash {
- oid = TRUSTED_OS_FW_CONFIG_HASH_OID;
+ oid = "1.3.6.1.4.1.4128.2100.604";
};
};
plat_key_cert: plat_key_cert {
root-certificate;
- image-id = <PLAT_KEY_CERT_ID>;
+ image-id = <38>;
signing-key = <&prot_pk>;
antirollback-counter = <&non_trusted_nv_ctr>;
plat_pk: plat_pk {
- oid = PLAT_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1105";
};
};
@@ -87,153 +43,40 @@
antirollback-counter = <&non_trusted_nv_ctr>;
nt_world_bl_hash: nt_world_bl_hash {
- oid = NON_TRUSTED_WORLD_BOOTLOADER_HASH_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1201";
};
nt_fw_config_hash: nt_fw_config_hash {
- oid = NON_TRUSTED_FW_CONFIG_HASH_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1202";
};
};
-#if defined(SPD_spmd)
- sip_sp_content_cert: sip_sp_content_cert {
- image-id = <SIP_SP_CONTENT_CERT_ID>;
- parent = <&wrong_parent>;
- signing-key = <&core_swd_pk>;
- antirollback-counter = <&trusted_nv_ctr>;
-
- sp_pkg1_hash: sp_pkg1_hash {
- oid = SP_PKG1_HASH_OID;
- };
- sp_pkg2_hash: sp_pkg2_hash {
- oid = SP_PKG2_HASH_OID;
- };
- sp_pkg3_hash: sp_pkg3_hash {
- oid = SP_PKG3_HASH_OID;
- };
- sp_pkg4_hash: sp_pkg4_hash {
- oid = SP_PKG4_HASH_OID;
- };
- };
-
- plat_sp_content_cert: plat_sp_content_cert {
- image-id = <PLAT_SP_CONTENT_CERT_ID>;
- signing-key = <&plat_pk>;
- antirollback-counter = <&non_trusted_nv_ctr>;
-
- sp_pkg5_hash: sp_pkg5_hash {
- oid = SP_PKG5_HASH_OID;
- };
- sp_pkg6_hash: sp_pkg6_hash {
- oid = SP_PKG6_HASH_OID;
- };
- sp_pkg7_hash: sp_pkg7_hash {
- oid = SP_PKG7_HASH_OID;
- };
- sp_pkg8_hash: sp_pkg8_hash {
- oid = SP_PKG8_HASH_OID;
- };
- };
-#endif
};
images {
compatible = "arm, img-descs";
hw_config {
- image-id = <HW_CONFIG_ID>;
+ image-id = <23>;
parent = <&cca_content_cert>;
hash = <&hw_config_hash>;
};
- bl31_image {
- image-id = <BL31_IMAGE_ID>;
- parent = <&cca_content_cert>;
- hash = <&soc_fw_hash>;
- };
-
soc_fw_config {
- image-id = <SOC_FW_CONFIG_ID>;
+ image-id = <25>;
parent = <&cca_content_cert>;
hash = <&soc_fw_config_hash>;
};
- rmm_image {
- image-id = <RMM_IMAGE_ID>;
- parent = <&cca_content_cert>;
- hash = <&rmm_hash>;
- };
-
- bl32_image {
- image-id = <BL32_IMAGE_ID>;
- parent = <&trusted_os_fw_content_cert>;
- hash = <&tos_fw_hash>;
- };
-
- tos_fw_config {
- image-id = <TOS_FW_CONFIG_ID>;
- parent = <&trusted_os_fw_content_cert>;
- hash = <&tos_fw_config_hash>;
- };
-
bl33_image {
- image-id = <BL33_IMAGE_ID>;
+ image-id = <5>;
parent = <&non_trusted_fw_content_cert>;
hash = <&nt_world_bl_hash>;
};
nt_fw_config {
- image-id = <NT_FW_CONFIG_ID>;
+ image-id = <27>;
hash = <&nt_fw_config_hash>;
};
-
-#if defined(SPD_spmd)
- sp_pkg1 {
- image-id = <SP_PKG1_ID>;
- hash = <&sp_pkg1_hash>;
- };
-
- sp_pkg2 {
- image-id = <SP_PKG2_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg2_hash>;
- };
-
- sp_pkg3 {
- image-id = <SP_PKG3_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg3_hash>;
- };
-
- sp_pkg4 {
- image-id = <SP_PKG4_ID>;
- parent = <&sip_sp_content_cert>;
- hash = <&sp_pkg4_hash>;
- };
-
- sp_pkg5 {
- image-id = <SP_PKG5_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg5_hash>;
- };
-
- sp_pkg6 {
- image-id = <SP_PKG6_ID>;
- parent = <&wrong_parent>;
- hash = <&sp_pkg6_hash>;
- };
-
- sp_pkg7 {
- image-id = <SP_PKG7_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg7_hash>;
- };
-
- sp_pkg8 {
- image-id = <SP_PKG8_ID>;
- parent = <&plat_sp_content_cert>;
- hash = <&sp_pkg8_hash>;
- };
-#endif
};
};
@@ -244,26 +87,27 @@
#size-cells = <0>;
cca_nv_ctr: cca_nv_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = CCA_FW_NVCOUNTER_OID;
+ id = <0>;
+ oid = "1.3.6.1.4.1.4128.2100.3";
};
trusted_nv_ctr: trusted_nv_ctr {
- id = <TRUSTED_NV_CTR_ID>;
- oid = TRUSTED_FW_NVCOUNTER_OID;
+ id = <0>;
+ oid = "1.3.6.1.4.1.4128.2100.1";
};
non_trusted_nv_ctr: non_trusted_nv_ctr {
- id = <NON_TRUSTED_NV_CTR_ID>;
- oid = NON_TRUSTED_FW_NVCOUNTER_OID;
+ id = <1>;
+ oid = "1.3.6.1.4.1.4128.2100.2";
};
};
rot_keys {
swd_rot_pk: swd_rot_pk {
- oid = SWD_ROT_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1103";
};
+
prot_pk: prot_pk {
- oid = PROT_PK_OID;
+ oid = "1.3.6.1.4.1.4128.2100.1102";
};
};