Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMSIS6 update #55

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cborpretty
cffi
cmac
CMAC
CMSDK
cmsis
CMSIS
CMSIS's
Expand Down Expand Up @@ -55,6 +56,7 @@ fftwrap
fsanitize
FVPs
gemmlowp
GPIO
havege
hkdf
HKDF
Expand Down Expand Up @@ -110,19 +112,22 @@ otapalconfig
OTARSA
PAKE
PCKS
PERIPH
pkeyutl
pkparse
pkwrite
ppuc
prepoccessor
pyelftools
pyproject
QSPI
Retarget
Rfbo
RIHN
RLATENCY
RSAES
RSASSA
SBCON
SECP
speex
Speex
Expand All @@ -131,7 +136,9 @@ speexdsp
srecord
srtp
SRTP
SSRAM
suppr
SYSWDOG
tinycbor
tinycbor's
TINYCBOR
Expand Down
12 changes: 7 additions & 5 deletions bsp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ include(ApplyPatches)

set(PATCH_FILES_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/patches")
set(PATCH_FILES
"${PATCH_FILES_DIRECTORY}/0001-corstone300-Add-missing-FVP-VSI-handlers.patch"
"${PATCH_FILES_DIRECTORY}/0002-platform-irq-Add-VSI-IRQ-numbers-for-CS300-and-CS310.patch"
"${PATCH_FILES_DIRECTORY}/0003-bsp-Add-CMSIS-Driver-implementation-for-VSI.patch"
"${PATCH_FILES_DIRECTORY}/0001-bsp-Add-CMSIS-Driver-implementation-for-VSI.patch"
)
iot_reference_arm_corstone3xx_apply_patches("${arm_corstone_platform_bsp_SOURCE_DIR}" "${PATCH_FILES}")

Expand Down Expand Up @@ -145,6 +143,12 @@ target_sources(toolchain-override
$<$<VERSION_GREATER_EQUAL:${ARM_GNU_TOOLCHAIN_VERSION},11.3.1>:${CMAKE_CURRENT_LIST_DIR}/common/syscalls_stub.c>
)

target_include_directories(arm-corstone-platform-bsp
PUBLIC
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:${CMAKE_CURRENT_LIST_DIR}/corstone300/include>
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:${CMAKE_CURRENT_LIST_DIR}/corstone310/include>
)

# BSP serial library

add_library(fri-bsp STATIC)
Expand All @@ -157,8 +161,6 @@ target_sources(fri-bsp

target_include_directories(fri-bsp
PUBLIC
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:${CMAKE_CURRENT_LIST_DIR}/corstone300/include>
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:${CMAKE_CURRENT_LIST_DIR}/corstone310/include>
common
)

Expand Down
13 changes: 12 additions & 1 deletion bsp/common/bsp_serial.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2017-2023 Arm Limited and/or its affiliates
/* Copyright 2017-2024 Arm Limited and/or its affiliates
* <[email protected]>
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -43,7 +43,10 @@ static void prvWriteChars( int fd,
void bsp_serial_init( void )
{
Driver_USART0.Initialize( NULL );
Driver_USART0.PowerControl( ARM_POWER_FULL );
Driver_USART0.Control( ARM_USART_MODE_ASYNCHRONOUS, DEFAULT_UART_BAUDRATE );
Driver_USART0.Control( ARM_USART_CONTROL_TX, 1 );
Driver_USART0.Control( ARM_USART_CONTROL_RX, 1 );

if( xLoggingMutex == NULL )
{
Expand All @@ -55,6 +58,10 @@ void bsp_serial_init( void )
void bsp_serial_print( char * str )
{
( void ) Driver_USART0.Send( str, strlen( str ) );

while( Driver_USART0.GetTxCount() != strlen( str ) )
{
}
}

#if defined( __ARMCOMPILER_VERSION )
Expand Down Expand Up @@ -203,6 +210,10 @@ static void prvWriteChars( int fd,

bool allCharsWritten = ( bool ) ( Driver_USART0.Send( str, len ) == ARM_DRIVER_OK );

while( Driver_USART0.GetTxCount() != len )
{
}

( void ) xSemaphoreGive( xLoggingMutex );

if( allCharsWritten == true )
Expand Down
30 changes: 30 additions & 0 deletions bsp/corstone300/include/RTE_Components.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2019-2024 Arm Limited. All rights reserved.
*
* 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.
*/

/*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- */

#ifndef __RTE_COMPONENTS_H
#define __RTE_COMPONENTS_H

/* <q> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0] */
/* <i> Configuration settings for Driver_USART0 in component ::Drivers:USART */
#define RTE_USART0 1

/* <q> IO (Input- Output) [arm_mps3_io_drv] */
/* <i> Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:arm_mps3_io_drv */
#define RTE_MPS3_IO 1

#endif /* __RTE_COMPONENTS_H */
187 changes: 187 additions & 0 deletions bsp/corstone300/include/device_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
/*
* Copyright (c) 2020-2024 Arm Limited. All rights reserved.
*
* 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.
*/

#ifndef __DEVICE_CFG_H__
#define __DEVICE_CFG_H__

#include "RTE_Components.h"

/**
* \file device_cfg.h
* \brief Configuration file native driver re-targeting
*
* \details This file can be used to add native driver specific macro
* definitions to select which peripherals are available in the build.
*
* This is a default device configuration file with all peripherals enabled.
*/

/* Secure only peripheral configuration */

/* ARM MPS3 IO SCC */
#ifdef RTE_MPS3_IO
#define MPS3_IO_NS
#define MPS3_IO_DEV MPS3_IO_DEV_NS
#endif

/* I2C_SBCon */
#ifdef RTE_I2C0
#define I2C0_SBCON_S
#define I2C0_SBCON_DEV I2C0_SBCON_DEV_S
#endif

/* I2S */
#ifdef RTE_I2S
#define MPS3_I2S_S
#define MPS3_I2S_DEV MPS3_I2S_DEV_S
#endif

/* ARM UART Controller CMSDK */
#ifdef RTE_USART0
#define UART0_CMSDK_NS
#define UART0_CMSDK_DEV UART0_CMSDK_DEV_NS
#endif
#ifdef RTE_USART1
#define UART1_CMSDK_S
#define UART1_CMSDK_DEV UART1_CMSDK_DEV_S
#endif

#define DEFAULT_UART_BAUDRATE 115200U

/* To be used as CODE and DATA sram */
#ifdef RTE_ISRAM0_MPC
#define MPC_ISRAM0_S
#define MPC_ISRAM0_DEV MPC_ISRAM0_DEV_S
#endif

#ifdef RTE_ISRAM1_MPC
#define MPC_ISRAM1_S
#define MPC_ISRAM1_DEV MPC_ISRAM0_DEV_S
#endif

#ifdef RTE_SRAM_MPC
#define MPC_SRAM_S
#define MPC_SRAM_DEV MPC_SRAM_DEV_S
#endif

#ifdef RTE_QSPI_MPC
#define MPC_QSPI_S
#define MPC_QSPI_DEV MPC_QSPI_DEV_S
#endif

/** System Counter Armv8-M */
#ifdef RTE_SYSCOUNTER
#define SYSCOUNTER_CNTRL_ARMV8_M_S
#define SYSCOUNTER_CNTRL_ARMV8_M_DEV SYSCOUNTER_CNTRL_ARMV8_M_DEV_S

#define SYSCOUNTER_READ_ARMV8_M_S
#define SYSCOUNTER_READ_ARMV8_M_DEV SYSCOUNTER_READ_ARMV8_M_DEV_S

/**
* Arbitrary scaling values for test purposes
*/
#define SYSCOUNTER_ARMV8_M_DEFAULT_SCALE0_INT 1u
#define SYSCOUNTER_ARMV8_M_DEFAULT_SCALE0_FRACT 0u
#define SYSCOUNTER_ARMV8_M_DEFAULT_SCALE1_INT 1u
#define SYSCOUNTER_ARMV8_M_DEFAULT_SCALE1_FRACT 0u
#endif /* ifdef RTE_SYSCOUNTER */

/* System timer */
#ifdef RTE_TIMEOUT
#define SYSTIMER0_ARMV8_M_S
#define SYSTIMER0_ARMV8_M_DEV SYSTIMER0_ARMV8_M_DEV_S
#define SYSTIMER1_ARMV8_M_S
#define SYSTIMER1_ARMV8_M_DEV SYSTIMER1_ARMV8_M_DEV_S
#define SYSTIMER2_ARMV8_M_S
#define SYSTIMER2_ARMV8_M_DEV SYSTIMER2_ARMV8_M_DEV_S
#define SYSTIMER3_ARMV8_M_S
#define SYSTIMER3_ARMV8_M_DEV SYSTIMER3_ARMV8_M_DEV_S

#define SYSTIMER0_ARMV8M_DEFAULT_FREQ_HZ ( 25000000ul )
#define SYSTIMER1_ARMV8M_DEFAULT_FREQ_HZ ( 25000000ul )
#define SYSTIMER2_ARMV8M_DEFAULT_FREQ_HZ ( 25000000ul )
#define SYSTIMER3_ARMV8M_DEFAULT_FREQ_HZ ( 25000000ul )
#endif /* ifdef RTE_TIMEOUT */

/* CMSDK GPIO driver structures */
#ifdef RTE_GPIO
#define GPIO0_CMSDK_S
#define GPIO0_CMSDK_DEV GPIO0_CMSDK_DEV_S
#define GPIO1_CMSDK_S
#define GPIO1_CMSDK_DEV GPIO1_CMSDK_DEV_S
#define GPIO2_CMSDK_S
#define GPIO2_CMSDK_DEV GPIO2_CMSDK_DEV_S
#define GPIO3_CMSDK_S
#define GPIO3_CMSDK_DEV GPIO3_CMSDK_DEV_S
#endif

/* System Watchdogs */
#ifdef RTE_WATCHDOG
#define SYSWDOG_ARMV8_M_S
#define SYSWDOG_ARMV8_M_DEV SYSWDOG_ARMV8_M_DEV_S
#endif

/* ARM MPC SIE 310 driver structures */
#ifdef RTE_VM0_MPC
#define MPC_VM0_S
#define MPC_VM0_DEV MPC_VM0_DEV_S
#endif
#ifdef RTE_VM1_MPC
#define MPC_VM1_S
#define MPC_VM1_DEV MPC_VM1_DEV_S
#endif
#ifdef RTE_SSRAM2_MPC
#define MPC_SSRAM2_S
#define MPC_SSRAM2_DEV MPC_SSRAM2_DEV_S
#endif
#ifdef RTE_SSRAM3_MPC
#define MPC_SSRAM3_S
#define MPC_SSRAM3_DEV MPC_SSRAM3_DEV_S
#endif

/* ARM PPC driver structures */
#define PPC_SSE300_MAIN0_S
#define PPC_SSE300_MAIN0_DEV PPC_SSE300_MAIN0_DEV_S
#define PPC_SSE300_MAIN_EXP0_S
#define PPC_SSE300_MAIN_EXP0_DEV PPC_SSE300_MAIN_EXP0_DEV_S
#define PPC_SSE300_MAIN_EXP1_S
#define PPC_SSE300_MAIN_EXP1_DEV PPC_SSE300_MAIN_EXP1_DEV_S
#define PPC_SSE300_MAIN_EXP2_S
#define PPC_SSE300_MAIN_EXP2_DEV PPC_SSE300_MAIN_EXP2_DEV_S
#define PPC_SSE300_MAIN_EXP3_S
#define PPC_SSE300_MAIN_EXP3_DEV PPC_SSE300_MAIN_EXP3_DEV_S
#define PPC_SSE300_PERIPH0_S
#define PPC_SSE300_PERIPH0_DEV PPC_SSE300_PERIPH0_DEV_S
#define PPC_SSE300_PERIPH1_S
#define PPC_SSE300_PERIPH1_DEV PPC_SSE300_PERIPH1_DEV_S
#define PPC_SSE300_PERIPH_EXP0_S
#define PPC_SSE300_PERIPH_EXP0_DEV PPC_SSE300_PERIPH_EXP0_DEV_S
#define PPC_SSE300_PERIPH_EXP1_S
#define PPC_SSE300_PERIPH_EXP1_DEV PPC_SSE300_PERIPH_EXP1_DEV_S
#define PPC_SSE300_PERIPH_EXP2_S
#define PPC_SSE300_PERIPH_EXP2_DEV PPC_SSE300_PERIPH_EXP2_DEV_S
#define PPC_SSE300_PERIPH_EXP3_S
#define PPC_SSE300_PERIPH_EXP3_DEV PPC_SSE300_PERIPH_EXP3_DEV_S

/* ARM SPI PL022 */
/* Invalid device stubs are not defined */
#define DEFAULT_SPI_SPEED_HZ 4000000U /* 4MHz */
#ifdef RTE_SPI1
#define SPI1_PL022_S
#define SPI1_PL022_DEV SPI1_PL022_DEV_S
#endif

#endif /* __DEVICE_CFG_H__ */
30 changes: 30 additions & 0 deletions bsp/corstone310/include/RTE_Components.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2019-2024 Arm Limited. All rights reserved.
*
* 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.
*/

/*-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- */

#ifndef __RTE_COMPONENTS_H
#define __RTE_COMPONENTS_H

/* <q> USART (Universal synchronous - asynchronous receiver transmitter) [Driver_USART0] */
/* <i> Configuration settings for Driver_USART0 in component ::Drivers:USART */
#define RTE_USART0 1

/* <q> IO (Input- Output) [arm_mps3_io_drv] */
/* <i> Configuration settings for ARM MPS3 IO SCC in component ::Native Driver:arm_mps3_io_drv */
#define RTE_MPS3_IO 1

#endif /* __RTE_COMPONENTS_H */
Loading
Loading