From 2aaa7d066ddda44b01a4614b16dee18e84eea401 Mon Sep 17 00:00:00 2001 From: Ernest Date: Wed, 10 Jul 2019 14:13:54 +0800 Subject: [PATCH 1/8] [drivers][crypto]add device CRC/RNG --- bsp/stm32/libraries/HAL_Drivers/SConscript | 5 +- bsp/stm32/libraries/HAL_Drivers/drv_crypto.c | 306 +++++++++++++++++++ bsp/stm32/libraries/HAL_Drivers/drv_crypto.h | 16 + 3 files changed, 326 insertions(+), 1 deletion(-) create mode 100644 bsp/stm32/libraries/HAL_Drivers/drv_crypto.c create mode 100644 bsp/stm32/libraries/HAL_Drivers/drv_crypto.h diff --git a/bsp/stm32/libraries/HAL_Drivers/SConscript b/bsp/stm32/libraries/HAL_Drivers/SConscript index afa1fa2d75..0cb64a650e 100644 --- a/bsp/stm32/libraries/HAL_Drivers/SConscript +++ b/bsp/stm32/libraries/HAL_Drivers/SConscript @@ -72,7 +72,10 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH', 'SOC_SERIES_STM32F7']): if GetDepend(['BSP_USING_ON_CHIP_FLASH', 'SOC_SERIES_STM32L4']): src += ['drv_flash/drv_flash_l4.c'] - + +if GetDepend('RT_USING_HWCRYPTO'): + src += ['drv_crypto.c'] + if GetDepend(['BSP_USING_WDT']): src += ['drv_wdt.c'] diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c new file mode 100644 index 0000000000..c9a0c5288d --- /dev/null +++ b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-07-10 Ernest 1st version + */ + +#include +#include +#include +#include +#include "drv_crypto.h" +#include "board.h" + +#if !defined(SOC_SERIES_STM32F0)&& !defined(SOC_SERIES_STM32F1) && !defined(SOC_SERIES_STM32F4) \ + && !defined(SOC_SERIES_STM32F7)&& !defined(SOC_SERIES_STM32L4) && !defined(SOC_SERIES_STM32H7) + #error "Please define at least one SOC_SERIES" +#endif + +#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + static struct hwcrypto_crc_cfg crc_backup_cfg; +#endif + +struct stm32_hwcrypto_device +{ + struct rt_hwcrypto_device dev; + struct rt_mutex mutex; +}; + +struct hash_ctx_des +{ + CRC_HandleTypeDef contex; +}; + +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +static rt_uint32_t _rng_rand(struct hwcrypto_rng *ctx) +{ + rt_uint32_t gen_random = 0; + + RNG_HandleTypeDef *HW_TypeDef = (RNG_HandleTypeDef *)(ctx->parent.contex); + + if (HAL_OK == HAL_RNG_GenerateRandomNumber(HW_TypeDef, &gen_random)) + { + return gen_random ; + } + + return 0; +} +#endif + +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +static int reverse_bit(rt_uint32_t n) +{ + n = ((n >> 1) & 0x55555555) | ((n << 1) & 0xaaaaaaaa); + n = ((n >> 2) & 0x33333333) | ((n << 2) & 0xcccccccc); + n = ((n >> 4) & 0x0f0f0f0f) | ((n << 4) & 0xf0f0f0f0); + n = ((n >> 8) & 0x00ff00ff) | ((n << 8) & 0xff00ff00); + n = ((n >> 16) & 0x0000ffff) | ((n << 16) & 0xffff0000); + + return n; +} +#endif + +static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, rt_size_t length) +{ + rt_uint32_t result = 0; + struct stm32_hwcrypto_device *stm32_hw_dev = (struct stm32_hwcrypto_device *)ctx->parent.device->user_data; +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + CRC_HandleTypeDef *HW_TypeDef = (CRC_HandleTypeDef *)(ctx->parent.contex); +#endif + + rt_mutex_take(&stm32_hw_dev->mutex, RT_WAITING_FOREVER); +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + if (0 != memcmp(&crc_backup_cfg, &ctx->crc_cfg, sizeof(struct hwcrypto_crc_cfg))) + { + if (HW_TypeDef->Init.DefaultPolynomialUse == DEFAULT_POLYNOMIAL_DISABLE) + { + HW_TypeDef->Init.GeneratingPolynomial = ctx ->crc_cfg.poly; + } + else + { + HW_TypeDef->Init.GeneratingPolynomial = DEFAULT_CRC32_POLY; + } + + switch (ctx ->crc_cfg.flags) + { + case 0: + HW_TypeDef->Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE; + HW_TypeDef->Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE; + break; + case CRC_FLAG_REFIN: + HW_TypeDef->Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_BYTE; + break; + case CRC_FLAG_REFOUT: + HW_TypeDef->Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_ENABLE; + break; + case CRC_FLAG_REFIN|CRC_FLAG_REFOUT: + HW_TypeDef->Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_BYTE; + HW_TypeDef->Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_ENABLE; + break; + default : + goto _exit; + } + + HW_TypeDef->Init.CRCLength = ctx ->crc_cfg.width; + if (HW_TypeDef->Init.DefaultInitValueUse == DEFAULT_INIT_VALUE_DISABLE) + { + HW_TypeDef->Init.InitValue = ctx ->crc_cfg.last_val; + } + + if (HAL_CRC_Init(HW_TypeDef) != HAL_OK) + { + goto _exit; + } + memcpy(&crc_backup_cfg, &ctx->crc_cfg, sizeof(struct hwcrypto_crc_cfg)); + } + + if (HAL_CRC_STATE_READY != HAL_CRC_GetState(HW_TypeDef)) + { + goto _exit; + } +#elif defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F1) + if (length % 4 != 0) + { + goto _exit; + } + length >>= 2; +#endif + + result = HAL_CRC_Accumulate(ctx->parent.contex, (rt_uint32_t *)in, length); + +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + if (HW_TypeDef->Init.OutputDataInversionMode) + { + ctx ->crc_cfg.last_val = reverse_bit(result); + } + else + { + ctx ->crc_cfg.last_val = result; + } + crc_backup_cfg.last_val = ctx ->crc_cfg.last_val; + result = (result ? result ^ (ctx ->crc_cfg.xorout) : result); + +#endif +_exit: + rt_mutex_release(&stm32_hw_dev->mutex); + + return result; +} + +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +static const struct hwcrypto_rng_ops rng_ops = +{ + .update = _rng_rand, +}; +#endif + +static const struct hwcrypto_crc_ops crc_ops = +{ + .update = _crc_update, +}; +static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx) +{ + rt_err_t res = RT_EOK; + + switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) + { +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + case HWCRYPTO_TYPE_RNG: + { + RNG_HandleTypeDef *hrng = rt_calloc(1, sizeof(RNG_HandleTypeDef)); + + hrng->Instance = RNG; + HAL_RNG_Init(hrng); + ctx->contex = hrng; + ((struct hwcrypto_rng *)ctx)->ops = &rng_ops; + + break; + } +#endif + case HWCRYPTO_TYPE_CRC: + { + CRC_HandleTypeDef *hcrc = rt_calloc(1, sizeof(CRC_HandleTypeDef)); + if (RT_NULL == hcrc) + { + res = -RT_ERROR; + break; + } + + hcrc->Instance = CRC; +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + hcrc->Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; + hcrc->Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_DISABLE; + hcrc->Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_BYTE; + hcrc->Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_ENABLE; + hcrc->InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES; +#elif defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F1) + if (HAL_CRC_Init(hcrc) != HAL_OK) + { + res = -RT_ERROR; + } +#endif + ctx->contex = hcrc; + ((struct hwcrypto_crc *)ctx)->ops = &crc_ops; + break; + } + default: + res = -RT_ERROR; + break; + } + + return res; +} + +static void _crypto_destroy(struct rt_hwcrypto_ctx *ctx) +{ + switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) + { + case HWCRYPTO_TYPE_RNG: + break; + case HWCRYPTO_TYPE_CRC: + HAL_CRC_DeInit((CRC_HandleTypeDef *)(ctx->contex)); + break; + default: + break; + } + + rt_free(ctx->contex); +} + +static rt_err_t _crypto_clone(struct rt_hwcrypto_ctx *des, const struct rt_hwcrypto_ctx *src) +{ + rt_err_t res = RT_EOK; + + switch (src->type & HWCRYPTO_MAIN_TYPE_MASK) + { + case HWCRYPTO_TYPE_RNG: + break; + case HWCRYPTO_TYPE_CRC: + if (des->contex && src->contex) + { + rt_memcpy(des->contex, src->contex, sizeof(struct hash_ctx_des)); + } + break; + default: + res = -RT_ERROR; + break; + } + return res; +} + +static void _crypto_reset(struct rt_hwcrypto_ctx *ctx) +{ + switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) + { + case HWCRYPTO_TYPE_RNG: + break; + case HWCRYPTO_TYPE_CRC: + __HAL_CRC_DR_RESET((CRC_HandleTypeDef *)ctx-> contex); + break; + default: + break; + } +} + +static const struct rt_hwcrypto_ops _ops = +{ + .create = _crypto_create, + .destroy = _crypto_destroy, + .copy = _crypto_clone, + .reset = _crypto_reset, +}; + +int stm32_hw_crypto_device_init(void) +{ + static struct stm32_hwcrypto_device _crypto_dev; + + rt_uint32_t cpuid[3] = {0}; + +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32F7) + cpuid[0] = HAL_GetUIDw0(); + cpuid[1] = HAL_GetUIDw1(); +#elif defined(SOC_SERIES_STM32F1) + HAL_GetUID(cpuid); +#elif defined(SOC_SERIES_STM32H7) + cpuid[0] = HAL_GetREVID(); + cpuid[1] = HAL_GetDEVID(); +#endif + _crypto_dev.dev.ops = &_ops; + _crypto_dev.dev.id = 0; + rt_memcpy(&_crypto_dev.dev.id, cpuid, 8); + + _crypto_dev.dev.user_data = &_crypto_dev; + + if (rt_hwcrypto_register(&_crypto_dev.dev, + RT_HWCRYPTO_DEFAULT_NAME) != RT_EOK) + { + return -1; + } + rt_mutex_init(&_crypto_dev.mutex, RT_HWCRYPTO_DEFAULT_NAME, RT_IPC_FLAG_FIFO); + return 0; +} +INIT_DEVICE_EXPORT(stm32_hw_crypto_device_init); diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.h b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.h new file mode 100644 index 0000000000..727a5ab64e --- /dev/null +++ b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2019 Winner Microelectronics Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2019-07-10 Ernest 1st version + */ + +#ifndef __DRV_CRYPTO_H__ +#define __DRV_CRYPTO_H__ + +int l4_hw_crypto_device_init(void); + +#endif /* __DRV_CRYPTO_H__ */ From 1f114ec22f07755bb13919e1837506f7e86fcc81 Mon Sep 17 00:00:00 2001 From: Ernest Date: Wed, 10 Jul 2019 18:40:01 +0800 Subject: [PATCH 2/8] [bsp][stm32]upgrade menuconfig about crypto --- .../libraries/HAL_Drivers/Kconfig.crypto | 20 +++ bsp/stm32/libraries/HAL_Drivers/drv_crypto.c | 115 +++++++++++------- bsp/stm32/stm32f091-st-nucleo/board/Kconfig | 1 + .../stm32f103-atk-warshipv3/board/Kconfig | 3 +- .../stm32f407-atk-explorer/board/Kconfig | 2 + bsp/stm32/stm32f767-atk-apollo/board/Kconfig | 2 + bsp/stm32/stm32h743-atk-apollo/board/Kconfig | 3 + bsp/stm32/stm32l475-atk-pandora/board/Kconfig | 4 +- .../stm32l496-ali-developer/board/Kconfig | 2 + 9 files changed, 103 insertions(+), 49 deletions(-) create mode 100644 bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto diff --git a/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto b/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto new file mode 100644 index 0000000000..0c19f9468d --- /dev/null +++ b/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto @@ -0,0 +1,20 @@ + +config BSP_USING_CRC + bool "Enable CRC (CRC-32 0x04C11DB7 polynomial)" + select RT_USING_HWCRYPTO + select RT_HWCRYPTO_USING_CRC + default n + +config BSP_USING_RNG + bool "Enable RNG" + select RT_USING_HWCRYPTO + select RT_HWCRYPTO_USING_RNG + depends on (SOC_SERIES_STM32L4 || SOC_SERIES_STM32F4 || SOC_SERIES_STM32F7 || \ + SOC_SERIES_STM32H7) + default n + +config BSP_USING_UDID + bool "Enable unique device identifier" + select RT_USING_HWCRYPTO + default n + diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c index c9a0c5288d..0c0e76b7c2 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c @@ -15,43 +15,22 @@ #include "drv_crypto.h" #include "board.h" -#if !defined(SOC_SERIES_STM32F0)&& !defined(SOC_SERIES_STM32F1) && !defined(SOC_SERIES_STM32F4) \ - && !defined(SOC_SERIES_STM32F7)&& !defined(SOC_SERIES_STM32L4) && !defined(SOC_SERIES_STM32H7) - #error "Please define at least one SOC_SERIES" -#endif - -#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) - static struct hwcrypto_crc_cfg crc_backup_cfg; -#endif - struct stm32_hwcrypto_device { struct rt_hwcrypto_device dev; struct rt_mutex mutex; }; +#if defined(BSP_USING_CRC) + struct hash_ctx_des { CRC_HandleTypeDef contex; }; -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) -static rt_uint32_t _rng_rand(struct hwcrypto_rng *ctx) -{ - rt_uint32_t gen_random = 0; +#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +static struct hwcrypto_crc_cfg crc_backup_cfg; - RNG_HandleTypeDef *HW_TypeDef = (RNG_HandleTypeDef *)(ctx->parent.contex); - - if (HAL_OK == HAL_RNG_GenerateRandomNumber(HW_TypeDef, &gen_random)) - { - return gen_random ; - } - - return 0; -} -#endif - -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) static int reverse_bit(rt_uint32_t n) { n = ((n >> 1) & 0x55555555) | ((n << 1) & 0xaaaaaaaa); @@ -68,12 +47,13 @@ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, r { rt_uint32_t result = 0; struct stm32_hwcrypto_device *stm32_hw_dev = (struct stm32_hwcrypto_device *)ctx->parent.device->user_data; -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + +#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) CRC_HandleTypeDef *HW_TypeDef = (CRC_HandleTypeDef *)(ctx->parent.contex); #endif rt_mutex_take(&stm32_hw_dev->mutex, RT_WAITING_FOREVER); -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) if (0 != memcmp(&crc_backup_cfg, &ctx->crc_cfg, sizeof(struct hwcrypto_crc_cfg))) { if (HW_TypeDef->Init.DefaultPolynomialUse == DEFAULT_POLYNOMIAL_DISABLE) @@ -122,8 +102,9 @@ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, r { goto _exit; } -#elif defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F1) - if (length % 4 != 0) +#else + if (ctx->crc_cfg.flags == 0 && ctx->crc_cfg.last_val == 0xFFFFFFFF && \ + ctx->crc_cfg.xorout == 0 && length % 4 != 0) { goto _exit; } @@ -132,7 +113,7 @@ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, r result = HAL_CRC_Accumulate(ctx->parent.contex, (rt_uint32_t *)in, length); -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) if (HW_TypeDef->Init.OutputDataInversionMode) { ctx ->crc_cfg.last_val = reverse_bit(result); @@ -143,32 +124,48 @@ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, r } crc_backup_cfg.last_val = ctx ->crc_cfg.last_val; result = (result ? result ^ (ctx ->crc_cfg.xorout) : result); - #endif + _exit: rt_mutex_release(&stm32_hw_dev->mutex); return result; } -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) -static const struct hwcrypto_rng_ops rng_ops = -{ - .update = _rng_rand, -}; -#endif - static const struct hwcrypto_crc_ops crc_ops = { .update = _crc_update, }; +#endif /* BSP_USING_CRC */ + +#if defined(BSP_USING_RNG) +static rt_uint32_t _rng_rand(struct hwcrypto_rng *ctx) +{ + rt_uint32_t gen_random = 0; + + RNG_HandleTypeDef *HW_TypeDef = (RNG_HandleTypeDef *)(ctx->parent.contex); + + if (HAL_OK == HAL_RNG_GenerateRandomNumber(HW_TypeDef, &gen_random)) + { + return gen_random ; + } + + return 0; +} + +static const struct hwcrypto_rng_ops rng_ops = +{ + .update = _rng_rand, +}; +#endif /* BSP_USING_RNG */ + static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx) { rt_err_t res = RT_EOK; switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) { -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +#if defined(BSP_USING_RNG) case HWCRYPTO_TYPE_RNG: { RNG_HandleTypeDef *hrng = rt_calloc(1, sizeof(RNG_HandleTypeDef)); @@ -180,7 +177,9 @@ static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx) break; } -#endif +#endif /* BSP_USING_RNG */ + +#if defined(BSP_USING_CRC) case HWCRYPTO_TYPE_CRC: { CRC_HandleTypeDef *hcrc = rt_calloc(1, sizeof(CRC_HandleTypeDef)); @@ -191,13 +190,13 @@ static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx) } hcrc->Instance = CRC; -#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) hcrc->Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; hcrc->Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_DISABLE; hcrc->Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_BYTE; hcrc->Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_ENABLE; hcrc->InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES; -#elif defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F1) +#else if (HAL_CRC_Init(hcrc) != HAL_OK) { res = -RT_ERROR; @@ -207,11 +206,11 @@ static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx) ((struct hwcrypto_crc *)ctx)->ops = &crc_ops; break; } +#endif /* BSP_USING_CRC */ default: res = -RT_ERROR; break; } - return res; } @@ -219,11 +218,16 @@ static void _crypto_destroy(struct rt_hwcrypto_ctx *ctx) { switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) { +#if defined(BSP_USING_RNG) case HWCRYPTO_TYPE_RNG: break; +#endif /* BSP_USING_RNG */ + +#if defined(BSP_USING_CRC) case HWCRYPTO_TYPE_CRC: HAL_CRC_DeInit((CRC_HandleTypeDef *)(ctx->contex)); break; +#endif /* BSP_USING_CRC */ default: break; } @@ -237,14 +241,23 @@ static rt_err_t _crypto_clone(struct rt_hwcrypto_ctx *des, const struct rt_hwcry switch (src->type & HWCRYPTO_MAIN_TYPE_MASK) { +#if defined(BSP_USING_RNG) case HWCRYPTO_TYPE_RNG: + if (des->contex && src->contex) + { + rt_memcpy(des->contex, src->contex, sizeof(struct hash_ctx_des)); + } break; +#endif /* BSP_USING_RNG */ + +#if defined(BSP_USING_CRC) case HWCRYPTO_TYPE_CRC: if (des->contex && src->contex) { rt_memcpy(des->contex, src->contex, sizeof(struct hash_ctx_des)); } break; +#endif /* BSP_USING_CRC */ default: res = -RT_ERROR; break; @@ -256,11 +269,16 @@ static void _crypto_reset(struct rt_hwcrypto_ctx *ctx) { switch (ctx->type & HWCRYPTO_MAIN_TYPE_MASK) { +#if defined(BSP_USING_RNG) case HWCRYPTO_TYPE_RNG: break; +#endif /* BSP_USING_RNG */ + +#if defined(BSP_USING_CRC) case HWCRYPTO_TYPE_CRC: __HAL_CRC_DR_RESET((CRC_HandleTypeDef *)ctx-> contex); break; +#endif /* BSP_USING_CRC */ default: break; } @@ -277,9 +295,11 @@ static const struct rt_hwcrypto_ops _ops = int stm32_hw_crypto_device_init(void) { static struct stm32_hwcrypto_device _crypto_dev; - rt_uint32_t cpuid[3] = {0}; + _crypto_dev.dev.ops = &_ops; +#if defined(BSP_USING_UDID) + #if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32F7) cpuid[0] = HAL_GetUIDw0(); cpuid[1] = HAL_GetUIDw1(); @@ -289,14 +309,15 @@ int stm32_hw_crypto_device_init(void) cpuid[0] = HAL_GetREVID(); cpuid[1] = HAL_GetDEVID(); #endif - _crypto_dev.dev.ops = &_ops; + +#endif /* BSP_USING_UDID */ + _crypto_dev.dev.id = 0; rt_memcpy(&_crypto_dev.dev.id, cpuid, 8); _crypto_dev.dev.user_data = &_crypto_dev; - if (rt_hwcrypto_register(&_crypto_dev.dev, - RT_HWCRYPTO_DEFAULT_NAME) != RT_EOK) + if (rt_hwcrypto_register(&_crypto_dev.dev, RT_HWCRYPTO_DEFAULT_NAME) != RT_EOK) { return -1; } diff --git a/bsp/stm32/stm32f091-st-nucleo/board/Kconfig b/bsp/stm32/stm32f091-st-nucleo/board/Kconfig index b1cb41d203..2d48e056fd 100644 --- a/bsp/stm32/stm32f091-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f091-st-nucleo/board/Kconfig @@ -156,6 +156,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n + source "../libraries/HAL_Drivers/Kconfig.crypto" endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig b/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig index c23799f24f..b62c6ba828 100644 --- a/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig +++ b/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig @@ -200,7 +200,8 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - + + source "../libraries/HAL_Drivers/Kconfig.crypto" endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig index 455d8b0ef9..383e5aaefa 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig +++ b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig @@ -294,6 +294,8 @@ menu "On-chip Peripheral Drivers" select RT_USING_DFS default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig index 77d2f5eaf8..22da1628dc 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig @@ -245,6 +245,8 @@ menu "On-chip Peripheral Drivers" select RT_USING_DFS default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32h743-atk-apollo/board/Kconfig b/bsp/stm32/stm32h743-atk-apollo/board/Kconfig index c83704cd0e..2c328fa3a3 100644 --- a/bsp/stm32/stm32h743-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32h743-atk-apollo/board/Kconfig @@ -67,6 +67,9 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n + + + source "../libraries/HAL_Drivers/Kconfig.crypto" endmenu diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index a09e96da0a..07f4631485 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -250,7 +250,9 @@ menu "On-chip Peripheral Drivers" bool "Enable OTGFS as USB device" select RT_USING_USB_DEVICE default n - + + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l496-ali-developer/board/Kconfig b/bsp/stm32/stm32l496-ali-developer/board/Kconfig index 7b405f7a47..20f4e50db3 100644 --- a/bsp/stm32/stm32l496-ali-developer/board/Kconfig +++ b/bsp/stm32/stm32l496-ali-developer/board/Kconfig @@ -218,6 +218,8 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n + + source "../libraries/HAL_Drivers/Kconfig.crypto" endmenu From a962fb35321b7440af08caabc2f6065723d7179a Mon Sep 17 00:00:00 2001 From: Ernest Date: Thu, 11 Jul 2019 18:21:24 +0800 Subject: [PATCH 3/8] [bsp][stm32]add source kconfig by batch --- bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig | 3 ++- bsp/stm32/libraries/templates/stm32f10x/board/Kconfig | 3 ++- bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig | 3 ++- bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig | 3 ++- bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig | 3 ++- bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig | 3 ++- bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig | 3 ++- bsp/stm32/stm32f072-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32f091-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32f103-atk-nano/board/Kconfig | 4 +++- bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig | 3 ++- bsp/stm32/stm32f103-dofly-M3S/board/Kconfig | 3 ++- bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig | 3 ++- bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig | 3 ++- bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig | 3 ++- bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig | 2 ++ bsp/stm32/stm32f103-mini-system/board/Kconfig | 3 ++- bsp/stm32/stm32f103-yf-ufun/board/Kconfig | 3 ++- bsp/stm32/stm32f107-uc-eval/board/Kconfig | 3 ++- bsp/stm32/stm32f401-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig | 3 ++- bsp/stm32/stm32f407-atk-explorer/board/Kconfig | 5 ++--- bsp/stm32/stm32f407-st-discovery/board/Kconfig | 3 ++- bsp/stm32/stm32f411-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32f429-armfly-v6/board/Kconfig | 2 ++ bsp/stm32/stm32f429-atk-apollo/board/Kconfig | 2 ++ bsp/stm32/stm32f429-fire-challenger/board/Kconfig | 2 ++ bsp/stm32/stm32f446-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32f469-st-disco/board/Kconfig | 2 ++ bsp/stm32/stm32f746-st-disco/board/Kconfig | 2 ++ bsp/stm32/stm32f767-atk-apollo/board/Kconfig | 6 +++--- bsp/stm32/stm32f767-fire-challenger/board/Kconfig | 2 ++ bsp/stm32/stm32f767-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32g071-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32h743-atk-apollo/board/Kconfig | 2 +- bsp/stm32/stm32l053-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32l432-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32l452-st-nucleo/board/Kconfig | 3 ++- bsp/stm32/stm32l475-atk-pandora/board/Kconfig | 2 +- bsp/stm32/stm32l475-st-discovery/board/Kconfig | 2 ++ bsp/stm32/stm32l476-st-nucleo/board/Kconfig | 2 ++ bsp/stm32/stm32l496-ali-developer/board/Kconfig | 4 ++-- bsp/stm32/stm32l4r9-st-eval/board/Kconfig | 3 ++- 43 files changed, 86 insertions(+), 39 deletions(-) diff --git a/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig index 2af0bda763..6b3807bf1e 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig b/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig index a8a2e516f2..4ec597660a 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig index b3a105c3bc..75af78dc72 100644 --- a/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig index a04f418b5b..5cb8efccbd 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig index bfd687cbc1..f66923c194 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig index 455041563f..e405a57054 100644 --- a/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig @@ -26,7 +26,8 @@ menu "On-chip Peripheral Drivers" default y endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig index e16439982f..7668cdafd8 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 176 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f072-st-nucleo/board/Kconfig b/bsp/stm32/stm32f072-st-nucleo/board/Kconfig index ce845a3606..9ffc3fb8d6 100644 --- a/bsp/stm32/stm32f072-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f072-st-nucleo/board/Kconfig @@ -77,7 +77,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f091-st-nucleo/board/Kconfig b/bsp/stm32/stm32f091-st-nucleo/board/Kconfig index 2d48e056fd..5b6d609d39 100644 --- a/bsp/stm32/stm32f091-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f091-st-nucleo/board/Kconfig @@ -156,7 +156,8 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-atk-nano/board/Kconfig b/bsp/stm32/stm32f103-atk-nano/board/Kconfig index 0dfaab5960..f0ec3de759 100644 --- a/bsp/stm32/stm32f103-atk-nano/board/Kconfig +++ b/bsp/stm32/stm32f103-atk-nano/board/Kconfig @@ -200,7 +200,9 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - + + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig b/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig index b62c6ba828..5dfb7c6016 100644 --- a/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig +++ b/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig @@ -201,7 +201,8 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig b/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig index 274e0577f0..18d0e96ff1 100644 --- a/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig +++ b/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig @@ -125,7 +125,8 @@ menu "On-chip Peripheral Drivers" select RT_USING_SDIO select RT_USING_DFS default n - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig b/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig index 3a719f9b7a..cf372a7167 100644 --- a/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig +++ b/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig @@ -30,7 +30,8 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA default n endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig b/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig index db000c4808..1a8ead7588 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig +++ b/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig @@ -288,7 +288,8 @@ menu "On-chip Peripheral Drivers" bool "using CAN1" default n endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig b/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig index 2bacd47793..f101912a2a 100644 --- a/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig +++ b/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig b/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig index e21b212d87..29e395eb2d 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig +++ b/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig @@ -215,6 +215,8 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-mini-system/board/Kconfig b/bsp/stm32/stm32f103-mini-system/board/Kconfig index 108193a289..b56006fdf7 100644 --- a/bsp/stm32/stm32f103-mini-system/board/Kconfig +++ b/bsp/stm32/stm32f103-mini-system/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" default n endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f103-yf-ufun/board/Kconfig b/bsp/stm32/stm32f103-yf-ufun/board/Kconfig index 1dd60c1469..b591294c7a 100644 --- a/bsp/stm32/stm32f103-yf-ufun/board/Kconfig +++ b/bsp/stm32/stm32f103-yf-ufun/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f107-uc-eval/board/Kconfig b/bsp/stm32/stm32f107-uc-eval/board/Kconfig index 6fe139b164..cd330a92fe 100644 --- a/bsp/stm32/stm32f107-uc-eval/board/Kconfig +++ b/bsp/stm32/stm32f107-uc-eval/board/Kconfig @@ -39,7 +39,8 @@ menu "On-chip Peripheral Drivers" endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f401-st-nucleo/board/Kconfig b/bsp/stm32/stm32f401-st-nucleo/board/Kconfig index 707f4531a3..69dbc7fbda 100644 --- a/bsp/stm32/stm32f401-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f401-st-nucleo/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig b/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig index 2d393bda9f..75ac95f70d 100644 --- a/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig +++ b/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig @@ -30,7 +30,8 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA default n endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig index 383e5aaefa..e893193e23 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig +++ b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig @@ -293,9 +293,8 @@ menu "On-chip Peripheral Drivers" select RT_USING_SDIO select RT_USING_DFS default n - - source "../libraries/HAL_Drivers/Kconfig.crypto" - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f407-st-discovery/board/Kconfig b/bsp/stm32/stm32f407-st-discovery/board/Kconfig index cdb1f1ff48..a187de1428 100644 --- a/bsp/stm32/stm32f407-st-discovery/board/Kconfig +++ b/bsp/stm32/stm32f407-st-discovery/board/Kconfig @@ -68,7 +68,8 @@ menu "On-chip Peripheral Drivers" range 1 216 default 25 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f411-st-nucleo/board/Kconfig b/bsp/stm32/stm32f411-st-nucleo/board/Kconfig index 92982f2158..19c0cc52f9 100644 --- a/bsp/stm32/stm32f411-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f411-st-nucleo/board/Kconfig @@ -127,7 +127,8 @@ menu "On-chip Peripheral Drivers" config BSP_USING_ON_CHIP_FLASH bool "Enable on-chip FLASH" default n - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f429-armfly-v6/board/Kconfig b/bsp/stm32/stm32f429-armfly-v6/board/Kconfig index af025cf400..521dd7fed6 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/Kconfig +++ b/bsp/stm32/stm32f429-armfly-v6/board/Kconfig @@ -218,6 +218,8 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f429-atk-apollo/board/Kconfig b/bsp/stm32/stm32f429-atk-apollo/board/Kconfig index c0d59a5512..7cd152c6ef 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32f429-atk-apollo/board/Kconfig @@ -251,6 +251,8 @@ menu "On-chip Peripheral Drivers" config BSP_USING_FMC bool default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f429-fire-challenger/board/Kconfig b/bsp/stm32/stm32f429-fire-challenger/board/Kconfig index ea6183f4f2..9959390c84 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/Kconfig +++ b/bsp/stm32/stm32f429-fire-challenger/board/Kconfig @@ -240,6 +240,8 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f446-st-nucleo/board/Kconfig b/bsp/stm32/stm32f446-st-nucleo/board/Kconfig index 70a73de979..a25533b936 100644 --- a/bsp/stm32/stm32f446-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f446-st-nucleo/board/Kconfig @@ -30,7 +30,8 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA default n endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f469-st-disco/board/Kconfig b/bsp/stm32/stm32f469-st-disco/board/Kconfig index 4afca13d7b..6c72716b3f 100644 --- a/bsp/stm32/stm32f469-st-disco/board/Kconfig +++ b/bsp/stm32/stm32f469-st-disco/board/Kconfig @@ -155,6 +155,8 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool "Enable LTDC" default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f746-st-disco/board/Kconfig b/bsp/stm32/stm32f746-st-disco/board/Kconfig index 40be7298c1..a9277dac76 100644 --- a/bsp/stm32/stm32f746-st-disco/board/Kconfig +++ b/bsp/stm32/stm32f746-st-disco/board/Kconfig @@ -107,6 +107,8 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig index 22da1628dc..f5208d6d99 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig @@ -244,9 +244,9 @@ menu "On-chip Peripheral Drivers" select RT_USING_SDIO select RT_USING_DFS default n - - source "../libraries/HAL_Drivers/Kconfig.crypto" - + + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f767-fire-challenger/board/Kconfig b/bsp/stm32/stm32f767-fire-challenger/board/Kconfig index c3535dc5bc..b55017e47f 100644 --- a/bsp/stm32/stm32f767-fire-challenger/board/Kconfig +++ b/bsp/stm32/stm32f767-fire-challenger/board/Kconfig @@ -225,6 +225,8 @@ menuconfig BSP_USING_SPI bool default n + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32f767-st-nucleo/board/Kconfig b/bsp/stm32/stm32f767-st-nucleo/board/Kconfig index 6bb14b0a83..b3b6e48a90 100644 --- a/bsp/stm32/stm32f767-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f767-st-nucleo/board/Kconfig @@ -54,7 +54,8 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA default n endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32g071-st-nucleo/board/Kconfig b/bsp/stm32/stm32g071-st-nucleo/board/Kconfig index 8766f9943f..1c1d633336 100644 --- a/bsp/stm32/stm32g071-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32g071-st-nucleo/board/Kconfig @@ -167,7 +167,8 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32h743-atk-apollo/board/Kconfig b/bsp/stm32/stm32h743-atk-apollo/board/Kconfig index 2c328fa3a3..cbe5b47a6b 100644 --- a/bsp/stm32/stm32h743-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32h743-atk-apollo/board/Kconfig @@ -67,7 +67,7 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - + source "../libraries/HAL_Drivers/Kconfig.crypto" diff --git a/bsp/stm32/stm32l053-st-nucleo/board/Kconfig b/bsp/stm32/stm32l053-st-nucleo/board/Kconfig index d737913f5e..6bb17ec174 100644 --- a/bsp/stm32/stm32l053-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l053-st-nucleo/board/Kconfig @@ -35,7 +35,8 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA default n endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l432-st-nucleo/board/Kconfig b/bsp/stm32/stm32l432-st-nucleo/board/Kconfig index e71484dcfa..b0b549605a 100644 --- a/bsp/stm32/stm32l432-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l432-st-nucleo/board/Kconfig @@ -61,7 +61,8 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l452-st-nucleo/board/Kconfig b/bsp/stm32/stm32l452-st-nucleo/board/Kconfig index 4a6113c652..d949377fc3 100644 --- a/bsp/stm32/stm32l452-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l452-st-nucleo/board/Kconfig @@ -77,7 +77,8 @@ menu "On-chip Peripheral Drivers" range 1 176 default 16 endif - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index 07f4631485..f5e954acf8 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -252,7 +252,7 @@ menu "On-chip Peripheral Drivers" default n source "../libraries/HAL_Drivers/Kconfig.crypto" - + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l475-st-discovery/board/Kconfig b/bsp/stm32/stm32l475-st-discovery/board/Kconfig index 163e816a68..f552c09b8b 100644 --- a/bsp/stm32/stm32l475-st-discovery/board/Kconfig +++ b/bsp/stm32/stm32l475-st-discovery/board/Kconfig @@ -30,6 +30,8 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA default n endif + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l476-st-nucleo/board/Kconfig b/bsp/stm32/stm32l476-st-nucleo/board/Kconfig index 22ee3bb2a4..ae4cbc02ca 100644 --- a/bsp/stm32/stm32l476-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l476-st-nucleo/board/Kconfig @@ -105,6 +105,8 @@ menu "On-chip Peripheral Drivers" endchoice endif + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l496-ali-developer/board/Kconfig b/bsp/stm32/stm32l496-ali-developer/board/Kconfig index 20f4e50db3..eef69bdcfc 100644 --- a/bsp/stm32/stm32l496-ali-developer/board/Kconfig +++ b/bsp/stm32/stm32l496-ali-developer/board/Kconfig @@ -219,8 +219,8 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" diff --git a/bsp/stm32/stm32l4r9-st-eval/board/Kconfig b/bsp/stm32/stm32l4r9-st-eval/board/Kconfig index 09c1ff58ca..4a99a82277 100644 --- a/bsp/stm32/stm32l4r9-st-eval/board/Kconfig +++ b/bsp/stm32/stm32l4r9-st-eval/board/Kconfig @@ -88,7 +88,8 @@ menu "On-chip Peripheral Drivers" config BSP_USING_FMC bool default n - + source "../libraries/HAL_Drivers/Kconfig.crypto" + endmenu menu "Board extended module Drivers" From 3211ae2c1677f34c80d6db4c2ba7f610e3151ee6 Mon Sep 17 00:00:00 2001 From: Ernest Date: Fri, 12 Jul 2019 09:37:26 +0800 Subject: [PATCH 4/8] [bsp][stm32][prefect] crypto configure and solve a problem --- .../libraries/HAL_Drivers/Kconfig.crypto | 6 ++--- bsp/stm32/libraries/HAL_Drivers/drv_crypto.c | 23 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto b/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto index 0c19f9468d..9c224da4e1 100644 --- a/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto +++ b/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto @@ -1,12 +1,12 @@ config BSP_USING_CRC - bool "Enable CRC (CRC-32 0x04C11DB7 polynomial)" + bool "Enable CRC (CRC-32 0x04C11DB7 Polynomial)" select RT_USING_HWCRYPTO select RT_HWCRYPTO_USING_CRC default n config BSP_USING_RNG - bool "Enable RNG" + bool "Enable RNG (Random Number Generator)" select RT_USING_HWCRYPTO select RT_HWCRYPTO_USING_RNG depends on (SOC_SERIES_STM32L4 || SOC_SERIES_STM32F4 || SOC_SERIES_STM32F7 || \ @@ -14,7 +14,7 @@ config BSP_USING_RNG default n config BSP_USING_UDID - bool "Enable unique device identifier" + bool "Enable UDID (Unique Device Identifier)" select RT_USING_HWCRYPTO default n diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c index 0c0e76b7c2..7606066201 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c @@ -28,7 +28,7 @@ struct hash_ctx_des CRC_HandleTypeDef contex; }; -#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) static struct hwcrypto_crc_cfg crc_backup_cfg; static int reverse_bit(rt_uint32_t n) @@ -41,7 +41,7 @@ static int reverse_bit(rt_uint32_t n) return n; } -#endif +#endif /* defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) */ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, rt_size_t length) { @@ -53,8 +53,8 @@ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, r #endif rt_mutex_take(&stm32_hw_dev->mutex, RT_WAITING_FOREVER); -#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) - if (0 != memcmp(&crc_backup_cfg, &ctx->crc_cfg, sizeof(struct hwcrypto_crc_cfg))) +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) + if (memcmp(&crc_backup_cfg, &ctx->crc_cfg, sizeof(struct hwcrypto_crc_cfg)) != 0) { if (HW_TypeDef->Init.DefaultPolynomialUse == DEFAULT_POLYNOMIAL_DISABLE) { @@ -103,17 +103,16 @@ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, r goto _exit; } #else - if (ctx->crc_cfg.flags == 0 && ctx->crc_cfg.last_val == 0xFFFFFFFF && \ - ctx->crc_cfg.xorout == 0 && length % 4 != 0) + if (ctx->crc_cfg.flags != 0 || ctx->crc_cfg.last_val != 0xFFFFFFFF || ctx->crc_cfg.xorout != 0 || length % 4 != 0) { goto _exit; } - length >>= 2; -#endif + length /= 4; +#endif /* defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) */ result = HAL_CRC_Accumulate(ctx->parent.contex, (rt_uint32_t *)in, length); -#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) if (HW_TypeDef->Init.OutputDataInversionMode) { ctx ->crc_cfg.last_val = reverse_bit(result); @@ -124,7 +123,7 @@ static rt_uint32_t _crc_update(struct hwcrypto_crc *ctx, const rt_uint8_t *in, r } crc_backup_cfg.last_val = ctx ->crc_cfg.last_val; result = (result ? result ^ (ctx ->crc_cfg.xorout) : result); -#endif +#endif /* defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) */ _exit: rt_mutex_release(&stm32_hw_dev->mutex); @@ -190,7 +189,7 @@ static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx) } hcrc->Instance = CRC; -#if defined(SOC_SERIES_STM32L4)|| defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) +#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) hcrc->Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; hcrc->Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_DISABLE; hcrc->Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_BYTE; @@ -201,7 +200,7 @@ static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx) { res = -RT_ERROR; } -#endif +#endif /* defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32F7) */ ctx->contex = hcrc; ((struct hwcrypto_crc *)ctx)->ops = &crc_ops; break; From 7b7443bb7bce2510407f58d7a0df92210cd74c69 Mon Sep 17 00:00:00 2001 From: Ernest Date: Fri, 12 Jul 2019 15:10:10 +0800 Subject: [PATCH 5/8] [bsp][stm32][prefect] avoid a bug from HAL --- bsp/stm32/libraries/HAL_Drivers/drv_crypto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c index 7606066201..b7a7db3a15 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_crypto.c @@ -224,6 +224,7 @@ static void _crypto_destroy(struct rt_hwcrypto_ctx *ctx) #if defined(BSP_USING_CRC) case HWCRYPTO_TYPE_CRC: + __HAL_CRC_DR_RESET((CRC_HandleTypeDef *)ctx-> contex); HAL_CRC_DeInit((CRC_HandleTypeDef *)(ctx->contex)); break; #endif /* BSP_USING_CRC */ From b4afc7748da34d72c0fcd5c768f26c77903e93d0 Mon Sep 17 00:00:00 2001 From: Ernest Date: Fri, 12 Jul 2019 16:54:15 +0800 Subject: [PATCH 6/8] [bsp][stm32][unite] input format by bytes --- bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto b/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto index 9c224da4e1..59f0939245 100644 --- a/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto +++ b/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto @@ -3,6 +3,9 @@ config BSP_USING_CRC bool "Enable CRC (CRC-32 0x04C11DB7 Polynomial)" select RT_USING_HWCRYPTO select RT_HWCRYPTO_USING_CRC + # "Crypto device frame dose not support above 8-bits granularity" + # "Reserve progress, running well, about 32-bits granularity, such as stm32f1, stm32f4" + depends on (SOC_SERIES_STM32L4 || SOC_SERIES_STM32F0 || SOC_SERIES_STM32F7 || SOC_SERIES_STM32H7) default n config BSP_USING_RNG From 9058fb26847ffcd2312b4429e22c3c36cea240a0 Mon Sep 17 00:00:00 2001 From: Ernest Date: Thu, 18 Jul 2019 11:01:19 +0800 Subject: [PATCH 7/8] [bsp][stm32][kconfig] rename quote kconfig --- bsp/stm32/libraries/HAL_Drivers/{Kconfig.crypto => Kconfig} | 0 bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig | 2 +- bsp/stm32/libraries/templates/stm32f10x/board/Kconfig | 2 +- bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig | 2 +- bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig | 2 +- bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig | 2 +- bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig | 2 +- bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig | 2 +- bsp/stm32/stm32f072-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32f091-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32f103-atk-nano/board/Kconfig | 2 +- bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig | 2 +- bsp/stm32/stm32f103-dofly-M3S/board/Kconfig | 2 +- bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig | 2 +- bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig | 2 +- bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig | 2 +- bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig | 2 +- bsp/stm32/stm32f103-mini-system/board/Kconfig | 2 +- bsp/stm32/stm32f103-yf-ufun/board/Kconfig | 2 +- bsp/stm32/stm32f107-uc-eval/board/Kconfig | 2 +- bsp/stm32/stm32f401-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig | 2 +- bsp/stm32/stm32f407-atk-explorer/board/Kconfig | 2 +- bsp/stm32/stm32f407-st-discovery/board/Kconfig | 2 +- bsp/stm32/stm32f411-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32f429-armfly-v6/board/Kconfig | 2 +- bsp/stm32/stm32f429-atk-apollo/board/Kconfig | 2 +- bsp/stm32/stm32f429-fire-challenger/board/Kconfig | 2 +- bsp/stm32/stm32f446-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32f469-st-disco/board/Kconfig | 2 +- bsp/stm32/stm32f746-st-disco/board/Kconfig | 2 +- bsp/stm32/stm32f767-atk-apollo/board/Kconfig | 2 +- bsp/stm32/stm32f767-fire-challenger/board/Kconfig | 2 +- bsp/stm32/stm32f767-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32g071-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32h743-atk-apollo/board/Kconfig | 2 +- bsp/stm32/stm32l053-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32l432-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32l452-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32l475-atk-pandora/board/Kconfig | 2 +- bsp/stm32/stm32l475-st-discovery/board/Kconfig | 2 +- bsp/stm32/stm32l476-st-nucleo/board/Kconfig | 2 +- bsp/stm32/stm32l496-ali-developer/board/Kconfig | 2 +- bsp/stm32/stm32l4r9-st-eval/board/Kconfig | 2 +- 44 files changed, 43 insertions(+), 43 deletions(-) rename bsp/stm32/libraries/HAL_Drivers/{Kconfig.crypto => Kconfig} (100%) diff --git a/bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto b/bsp/stm32/libraries/HAL_Drivers/Kconfig similarity index 100% rename from bsp/stm32/libraries/HAL_Drivers/Kconfig.crypto rename to bsp/stm32/libraries/HAL_Drivers/Kconfig diff --git a/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig index 6b3807bf1e..ae56cab5a4 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f0xx/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig b/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig index 4ec597660a..913c52dbbb 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f10x/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig index 75af78dc72..512a3b5be3 100644 --- a/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f2xx/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig index 5cb8efccbd..0e5bacf28b 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f4xx/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig index f66923c194..0ab9b6b224 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32f7xx/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig index e405a57054..249d3d6772 100644 --- a/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32h7xx/board/Kconfig @@ -26,7 +26,7 @@ menu "On-chip Peripheral Drivers" default y endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig b/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig index 7668cdafd8..ca508a0961 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig +++ b/bsp/stm32/libraries/templates/stm32l4xx/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 176 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f072-st-nucleo/board/Kconfig b/bsp/stm32/stm32f072-st-nucleo/board/Kconfig index 9ffc3fb8d6..252d7aa20f 100644 --- a/bsp/stm32/stm32f072-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f072-st-nucleo/board/Kconfig @@ -77,7 +77,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f091-st-nucleo/board/Kconfig b/bsp/stm32/stm32f091-st-nucleo/board/Kconfig index 5b6d609d39..5810eea1d0 100644 --- a/bsp/stm32/stm32f091-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f091-st-nucleo/board/Kconfig @@ -156,7 +156,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-atk-nano/board/Kconfig b/bsp/stm32/stm32f103-atk-nano/board/Kconfig index f0ec3de759..0d53ea19d0 100644 --- a/bsp/stm32/stm32f103-atk-nano/board/Kconfig +++ b/bsp/stm32/stm32f103-atk-nano/board/Kconfig @@ -201,7 +201,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig b/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig index 5dfb7c6016..8cbacb4bab 100644 --- a/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig +++ b/bsp/stm32/stm32f103-atk-warshipv3/board/Kconfig @@ -201,7 +201,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig b/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig index 18d0e96ff1..8ea2fa2093 100644 --- a/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig +++ b/bsp/stm32/stm32f103-dofly-M3S/board/Kconfig @@ -125,7 +125,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_SDIO select RT_USING_DFS default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig b/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig index cf372a7167..96330d54e5 100644 --- a/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig +++ b/bsp/stm32/stm32f103-dofly-lyc8/board/Kconfig @@ -30,7 +30,7 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig b/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig index 1a8ead7588..f9d8ee51d6 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig +++ b/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig @@ -288,7 +288,7 @@ menu "On-chip Peripheral Drivers" bool "using CAN1" default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig b/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig index f101912a2a..8e0ef52b6d 100644 --- a/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig +++ b/bsp/stm32/stm32f103-gizwits-gokitv21/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig b/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig index 29e395eb2d..cf4b3feed9 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig +++ b/bsp/stm32/stm32f103-hw100k-ibox/board/Kconfig @@ -215,7 +215,7 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-mini-system/board/Kconfig b/bsp/stm32/stm32f103-mini-system/board/Kconfig index b56006fdf7..48c5214b3f 100644 --- a/bsp/stm32/stm32f103-mini-system/board/Kconfig +++ b/bsp/stm32/stm32f103-mini-system/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f103-yf-ufun/board/Kconfig b/bsp/stm32/stm32f103-yf-ufun/board/Kconfig index b591294c7a..4e33d0eb73 100644 --- a/bsp/stm32/stm32f103-yf-ufun/board/Kconfig +++ b/bsp/stm32/stm32f103-yf-ufun/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f107-uc-eval/board/Kconfig b/bsp/stm32/stm32f107-uc-eval/board/Kconfig index cd330a92fe..b00de3bf8d 100644 --- a/bsp/stm32/stm32f107-uc-eval/board/Kconfig +++ b/bsp/stm32/stm32f107-uc-eval/board/Kconfig @@ -39,7 +39,7 @@ menu "On-chip Peripheral Drivers" endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f401-st-nucleo/board/Kconfig b/bsp/stm32/stm32f401-st-nucleo/board/Kconfig index 69dbc7fbda..30646918ce 100644 --- a/bsp/stm32/stm32f401-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f401-st-nucleo/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig b/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig index 75ac95f70d..42d338626f 100644 --- a/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig +++ b/bsp/stm32/stm32f405-smdz-breadfruit/board/Kconfig @@ -30,7 +30,7 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig index e893193e23..4ee6fdd657 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig +++ b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig @@ -293,7 +293,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_SDIO select RT_USING_DFS default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f407-st-discovery/board/Kconfig b/bsp/stm32/stm32f407-st-discovery/board/Kconfig index a187de1428..51cb9ea9a6 100644 --- a/bsp/stm32/stm32f407-st-discovery/board/Kconfig +++ b/bsp/stm32/stm32f407-st-discovery/board/Kconfig @@ -68,7 +68,7 @@ menu "On-chip Peripheral Drivers" range 1 216 default 25 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f411-st-nucleo/board/Kconfig b/bsp/stm32/stm32f411-st-nucleo/board/Kconfig index 19c0cc52f9..0364dc8b17 100644 --- a/bsp/stm32/stm32f411-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f411-st-nucleo/board/Kconfig @@ -127,7 +127,7 @@ menu "On-chip Peripheral Drivers" config BSP_USING_ON_CHIP_FLASH bool "Enable on-chip FLASH" default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f429-armfly-v6/board/Kconfig b/bsp/stm32/stm32f429-armfly-v6/board/Kconfig index 521dd7fed6..3cdb862125 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/Kconfig +++ b/bsp/stm32/stm32f429-armfly-v6/board/Kconfig @@ -218,7 +218,7 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f429-atk-apollo/board/Kconfig b/bsp/stm32/stm32f429-atk-apollo/board/Kconfig index 7cd152c6ef..7d9091a981 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32f429-atk-apollo/board/Kconfig @@ -251,7 +251,7 @@ menu "On-chip Peripheral Drivers" config BSP_USING_FMC bool default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f429-fire-challenger/board/Kconfig b/bsp/stm32/stm32f429-fire-challenger/board/Kconfig index 9959390c84..f83b82056f 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/Kconfig +++ b/bsp/stm32/stm32f429-fire-challenger/board/Kconfig @@ -240,7 +240,7 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f446-st-nucleo/board/Kconfig b/bsp/stm32/stm32f446-st-nucleo/board/Kconfig index a25533b936..cc61a9b5a2 100644 --- a/bsp/stm32/stm32f446-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f446-st-nucleo/board/Kconfig @@ -30,7 +30,7 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f469-st-disco/board/Kconfig b/bsp/stm32/stm32f469-st-disco/board/Kconfig index 6c72716b3f..726681628a 100644 --- a/bsp/stm32/stm32f469-st-disco/board/Kconfig +++ b/bsp/stm32/stm32f469-st-disco/board/Kconfig @@ -155,7 +155,7 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool "Enable LTDC" default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f746-st-disco/board/Kconfig b/bsp/stm32/stm32f746-st-disco/board/Kconfig index a9277dac76..fdb76f0a39 100644 --- a/bsp/stm32/stm32f746-st-disco/board/Kconfig +++ b/bsp/stm32/stm32f746-st-disco/board/Kconfig @@ -107,7 +107,7 @@ menu "On-chip Peripheral Drivers" config BSP_USING_LTDC bool default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig index f5208d6d99..5992093b44 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig @@ -245,7 +245,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_DFS default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f767-fire-challenger/board/Kconfig b/bsp/stm32/stm32f767-fire-challenger/board/Kconfig index b55017e47f..204b28702e 100644 --- a/bsp/stm32/stm32f767-fire-challenger/board/Kconfig +++ b/bsp/stm32/stm32f767-fire-challenger/board/Kconfig @@ -225,7 +225,7 @@ menuconfig BSP_USING_SPI bool default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32f767-st-nucleo/board/Kconfig b/bsp/stm32/stm32f767-st-nucleo/board/Kconfig index b3b6e48a90..0d0b50b6d6 100644 --- a/bsp/stm32/stm32f767-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32f767-st-nucleo/board/Kconfig @@ -54,7 +54,7 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32g071-st-nucleo/board/Kconfig b/bsp/stm32/stm32g071-st-nucleo/board/Kconfig index 1c1d633336..1ffc07568c 100644 --- a/bsp/stm32/stm32g071-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32g071-st-nucleo/board/Kconfig @@ -167,7 +167,7 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32h743-atk-apollo/board/Kconfig b/bsp/stm32/stm32h743-atk-apollo/board/Kconfig index cbe5b47a6b..9b76de7dc1 100644 --- a/bsp/stm32/stm32h743-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32h743-atk-apollo/board/Kconfig @@ -69,7 +69,7 @@ menu "On-chip Peripheral Drivers" default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l053-st-nucleo/board/Kconfig b/bsp/stm32/stm32l053-st-nucleo/board/Kconfig index 6bb17ec174..27d7acc9fb 100644 --- a/bsp/stm32/stm32l053-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l053-st-nucleo/board/Kconfig @@ -35,7 +35,7 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l432-st-nucleo/board/Kconfig b/bsp/stm32/stm32l432-st-nucleo/board/Kconfig index b0b549605a..a028fb2f10 100644 --- a/bsp/stm32/stm32l432-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l432-st-nucleo/board/Kconfig @@ -61,7 +61,7 @@ menu "On-chip Peripheral Drivers" bool "Enable Watchdog Timer" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l452-st-nucleo/board/Kconfig b/bsp/stm32/stm32l452-st-nucleo/board/Kconfig index d949377fc3..e757acf26d 100644 --- a/bsp/stm32/stm32l452-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l452-st-nucleo/board/Kconfig @@ -77,7 +77,7 @@ menu "On-chip Peripheral Drivers" range 1 176 default 16 endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index f5e954acf8..a9ae8b906c 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -251,7 +251,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_USB_DEVICE default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l475-st-discovery/board/Kconfig b/bsp/stm32/stm32l475-st-discovery/board/Kconfig index f552c09b8b..b5b0a0cd0d 100644 --- a/bsp/stm32/stm32l475-st-discovery/board/Kconfig +++ b/bsp/stm32/stm32l475-st-discovery/board/Kconfig @@ -30,7 +30,7 @@ menu "On-chip Peripheral Drivers" depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA default n endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l476-st-nucleo/board/Kconfig b/bsp/stm32/stm32l476-st-nucleo/board/Kconfig index ae4cbc02ca..5335f7c0e8 100644 --- a/bsp/stm32/stm32l476-st-nucleo/board/Kconfig +++ b/bsp/stm32/stm32l476-st-nucleo/board/Kconfig @@ -105,7 +105,7 @@ menu "On-chip Peripheral Drivers" endchoice endif - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l496-ali-developer/board/Kconfig b/bsp/stm32/stm32l496-ali-developer/board/Kconfig index eef69bdcfc..6242d1268d 100644 --- a/bsp/stm32/stm32l496-ali-developer/board/Kconfig +++ b/bsp/stm32/stm32l496-ali-developer/board/Kconfig @@ -219,7 +219,7 @@ menu "On-chip Peripheral Drivers" select RT_USING_WDT default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu diff --git a/bsp/stm32/stm32l4r9-st-eval/board/Kconfig b/bsp/stm32/stm32l4r9-st-eval/board/Kconfig index 4a99a82277..c409ef8073 100644 --- a/bsp/stm32/stm32l4r9-st-eval/board/Kconfig +++ b/bsp/stm32/stm32l4r9-st-eval/board/Kconfig @@ -88,7 +88,7 @@ menu "On-chip Peripheral Drivers" config BSP_USING_FMC bool default n - source "../libraries/HAL_Drivers/Kconfig.crypto" + source "../libraries/HAL_Drivers/Kconfig" endmenu From 9333bbadbf65f65aed5736268d849b2b2dd846a5 Mon Sep 17 00:00:00 2001 From: Ernest Date: Thu, 18 Jul 2019 10:25:15 +0800 Subject: [PATCH 8/8] [dist][modify] crypto kconfig path --- tools/mkdist.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/mkdist.py b/tools/mkdist.py index 3b77739282..7e4b9a8bbe 100644 --- a/tools/mkdist.py +++ b/tools/mkdist.py @@ -141,6 +141,19 @@ def bsp_update_kconfig_library(dist_dir): found = 0 f.write(line) + # change board/kconfig path + if not os.path.isfile(os.path.join(dist_dir, 'board/Kconfig')): + return + + with open(os.path.join(dist_dir, 'board/Kconfig'), 'r') as f: + data = f.readlines() + with open(os.path.join(dist_dir, 'board/Kconfig'), 'w') as f: + for line in data: + if line.find('../libraries/HAL_Drivers/Kconfig') != -1: + position = line.find('../libraries/HAL_Drivers/Kconfig') + line = line[0:position] + 'libraries/HAL_Drivers/Kconfig"\n' + f.write(line) + def bs_update_ide_project(bsp_root, rtt_root, rttide = None): import subprocess # default update the projects which have template file