diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-20 11:44:14 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-01-20 11:44:14 +0000 |
commit | f063c4d19339144df89d6bc060ee2017b0572c5c (patch) | |
tree | 136e9f5c866e7bbed71a614100121a4ea1ed7013 /os/hal/ports/SAMA | |
parent | e561c21f95c961f5a53ea2bb499bf55c5b045d0e (diff) | |
download | ChibiOS-f063c4d19339144df89d6bc060ee2017b0572c5c.tar.gz ChibiOS-f063c4d19339144df89d6bc060ee2017b0572c5c.tar.bz2 ChibiOS-f063c4d19339144df89d6bc060ee2017b0572c5c.zip |
Mass update of the Apache 2.0 license statement.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11361 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/SAMA')
42 files changed, 1061 insertions, 1061 deletions
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.c b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.c index bbe51ab20..b490b05bc 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.c +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.h b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.h index 3df2d28e1..3875287e6 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.h +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_aes_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.c b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.c index 12c2df965..a4e19d7c7 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.c +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.h b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.h index a496fc201..b7a1a9fae 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.h +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_crypto_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.c b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.c index 673fa6ffd..79432e008 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.c +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.h b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.h index c27d33cac..bc883aeed 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.h +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_sha_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.c b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.c index 76ff34145..fbe000e47 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.c +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.c @@ -1,18 +1,18 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
- 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
+ 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
+ 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.
- */
+ 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.
+*/
#include "hal.h"
#if (HAL_USE_CRY == TRUE) || defined(__DOXYGEN__)
diff --git a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.h b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.h index bc48f02b1..7f714f9e0 100644 --- a/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.h +++ b/os/hal/ports/SAMA/LLD/CRYPTOv1/sama_tdes_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c index 948d87b6c..d43133307 100644 --- a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c +++ b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h index 475627ef0..a3246baf5 100644 --- a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h +++ b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c b/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c index 75df3e0a7..56b9939ad 100644 --- a/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c +++ b/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.h b/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.h index 958612a6d..81e019aaf 100644 --- a/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.h +++ b/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.c b/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.c index 35dbb08c1..81f8d6cd0 100644 --- a/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.c +++ b/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.h b/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.h index df871956a..e2ede7c52 100644 --- a/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.h +++ b/os/hal/ports/SAMA/LLD/PIOv1/hal_pal_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.c b/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.c index 9e49843cd..e35df0fe9 100644 --- a/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.c +++ b/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.h b/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.h index a6ffaa9c9..a5105382f 100644 --- a/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.h +++ b/os/hal/ports/SAMA/LLD/RTCv1/hal_rtc_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.c b/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.c index 2c5a862e1..dadca65b7 100644 --- a/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.c +++ b/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.h b/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.h index 488b57491..c87c90525 100644 --- a/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.h +++ b/os/hal/ports/SAMA/LLD/SDMMCv1/sama_sdmmc_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c b/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c index a450f261b..b5a890fea 100644 --- a/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c +++ b/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.h b/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.h index d5df35dac..f9be8bdee 100644 --- a/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.h +++ b/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.c b/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.c index 04589bcb6..e9ec465f0 100644 --- a/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.c +++ b/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.h b/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.h index d2849916b..552d54b1a 100644 --- a/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.h +++ b/os/hal/ports/SAMA/LLD/USARTv1/hal_serial_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.c b/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.c index 3056d2a73..7589c82fb 100644 --- a/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.c +++ b/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.h b/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.h index a6e6bbb82..6c20da1c4 100644 --- a/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.h +++ b/os/hal/ports/SAMA/LLD/USARTv1/hal_uart_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/aic.c b/os/hal/ports/SAMA/SAMA5D2x/aic.c index 2b5d95e61..ff66cceb9 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/aic.c +++ b/os/hal/ports/SAMA/SAMA5D2x/aic.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/aic.h b/os/hal/ports/SAMA/SAMA5D2x/aic.h index 73f9888c1..a4f220754 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/aic.h +++ b/os/hal/ports/SAMA/SAMA5D2x/aic.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.c b/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.c index 2e841cca7..2e8a67309 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.c +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.c @@ -1,18 +1,18 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
- 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
+ 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
+ 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.
- */
+ 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.
+*/
/**
* @file hal_crypto_lld.c
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.h b/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.h index 4521bb57b..af3985aa2 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.h +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_crypto_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c b/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c index afa9062a5..ce190c7c0 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_lld.h b/os/hal/ports/SAMA/SAMA5D2x/hal_lld.h index d80ee7d11..e28e9bbb3 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_lld.h +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.c b/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.c index adc174363..8d286884e 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.c +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.h b/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.h index 24a656841..bce654bc9 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.h +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_st_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.c b/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.c index 5cfa90968..8edc7f4b0 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.c +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.h b/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.h index b58d6e1cb..cbd20ee7d 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.h +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_tc_lld.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_cache.c b/os/hal/ports/SAMA/SAMA5D2x/sama_cache.c index f20e9e3db..64f1f32d2 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_cache.c +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_cache.c @@ -1,65 +1,65 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - 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. -*/ - -/** - * @file SAMA5D2x/sama_cache.c - * @brief SAMA CACHE support code. - * - * @addtogroup SAMA5D2x_CACHE - * @{ - */ - -#include "hal.h" - -/** - * @brief Invalidate D-Cache Region - * @TODO: Extend to L2C - * - * @param[in] start Pointer to beginning of memory region. - * @param[in] length Length of the memory location. - */ -void cacheInvalidateRegion(void *start, uint32_t length) { - - uint32_t start_addr = (uint32_t)start; - uint32_t end_addr = start_addr + length; - uint32_t mva; - - /* Invalidate L1 D-Cache */ - for (mva = start_addr & ~L1_CACHE_BYTES; mva < end_addr; mva += L1_CACHE_BYTES) { - L1C_InvalidateDCacheMVA((uint32_t *)mva); - } -} - -/** - * @brief Clean D-Cache Region - * @TODO: Extend to L2C - * - * @param[in] start Pointer to beginning of memory region. - * @param[in] length Length of the memory location. - */ -void cacheCleanRegion(void *start, uint32_t length) { - - uint32_t start_addr = (uint32_t)start; - uint32_t end_addr = start_addr + length; - uint32_t mva; - - /* Clean L1 D-Cache */ - for (mva = start_addr & ~L1_CACHE_BYTES; mva < end_addr; mva += L1_CACHE_BYTES) { - L1C_CleanDCacheMVA((uint32_t *)mva); - } -} - -/** @} */ +/*
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
+
+ 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.
+*/
+
+/**
+ * @file SAMA5D2x/sama_cache.c
+ * @brief SAMA CACHE support code.
+ *
+ * @addtogroup SAMA5D2x_CACHE
+ * @{
+ */
+
+#include "hal.h"
+
+/**
+ * @brief Invalidate D-Cache Region
+ * @TODO: Extend to L2C
+ *
+ * @param[in] start Pointer to beginning of memory region.
+ * @param[in] length Length of the memory location.
+ */
+void cacheInvalidateRegion(void *start, uint32_t length) {
+
+ uint32_t start_addr = (uint32_t)start;
+ uint32_t end_addr = start_addr + length;
+ uint32_t mva;
+
+ /* Invalidate L1 D-Cache */
+ for (mva = start_addr & ~L1_CACHE_BYTES; mva < end_addr; mva += L1_CACHE_BYTES) {
+ L1C_InvalidateDCacheMVA((uint32_t *)mva);
+ }
+}
+
+/**
+ * @brief Clean D-Cache Region
+ * @TODO: Extend to L2C
+ *
+ * @param[in] start Pointer to beginning of memory region.
+ * @param[in] length Length of the memory location.
+ */
+void cacheCleanRegion(void *start, uint32_t length) {
+
+ uint32_t start_addr = (uint32_t)start;
+ uint32_t end_addr = start_addr + length;
+ uint32_t mva;
+
+ /* Clean L1 D-Cache */
+ for (mva = start_addr & ~L1_CACHE_BYTES; mva < end_addr; mva += L1_CACHE_BYTES) {
+ L1C_CleanDCacheMVA((uint32_t *)mva);
+ }
+}
+
+/** @} */
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_cache.h b/os/hal/ports/SAMA/SAMA5D2x/sama_cache.h index fe8201438..fc7bcedac 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_cache.h +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_cache.h @@ -1,43 +1,43 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - 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. -*/ - -/** - * @file SAMA5D2x/sama_cache.h - * @brief SAMA CACHE support macros and structures. - * - * @addtogroup SAMA5D2x_CACHE - * @{ - */ -#ifndef SAMA_CACHE_H_ -#define SAMA_CACHE_H_ - -/*===========================================================================*/ -/* Driver constants. */ -/*===========================================================================*/ -#define L1_CACHE_BYTES 32u - -#ifdef __cplusplus -extern "C" { -#endif - extern void cacheInvalidateRegion(void *start, uint32_t length); - extern void cacheCleanRegion(void *start, uint32_t length); -#ifdef __cplusplus -} -#endif - -#endif /* SAMA_CACHE_H_ */ - -/** @} */ +/*
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
+
+ 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.
+*/
+
+/**
+ * @file SAMA5D2x/sama_cache.h
+ * @brief SAMA CACHE support macros and structures.
+ *
+ * @addtogroup SAMA5D2x_CACHE
+ * @{
+ */
+#ifndef SAMA_CACHE_H_
+#define SAMA_CACHE_H_
+
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+#define L1_CACHE_BYTES 32u
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ extern void cacheInvalidateRegion(void *start, uint32_t length);
+ extern void cacheCleanRegion(void *start, uint32_t length);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SAMA_CACHE_H_ */
+
+/** @} */
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.c b/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.c index dc187a5ff..da6f6f340 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.c +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.h b/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.h index b899d413b..5cf4ee29b 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.h +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.h @@ -1,341 +1,341 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - 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. -*/ - -/** - * @file SAMA5D2x/sama_matrix.h - * @brief SAMA MATRIX support macros and structures. - * - * @addtogroup SAMA5D2x_MATRIX - * @{ - */ - -#ifndef SAMA_MATRIX_H -#define SAMA_MATRIX_H - -/*===========================================================================*/ -/* Driver constants. */ -/*===========================================================================*/ -/** - * @name SECURE MATRIX mode macros - * @{ - */ -/** - * @brief The low area of region is the securable one. - */ -#define LOWER_AREA_SECURABLE 0x0u - -/** - * @brief The upper area of region is the non-securable one. - */ -#define UPPER_AREA_SECURABLE 0x1u - -/** - * @brief Securable area is secured for reads. - */ -#define SECURE_READ 0x0u - -/** - * @brief Securable area is secured for writes. - */ -#define SECURE_WRITE 0x0u - -/** - * @brief Securable area is non-secured for reads. - */ -#define NOT_SECURE_READ 0x1u - -/** - * @brief Securable area is non-secured for writes. - */ -#define NOT_SECURE_WRITE 0x1u - -/** - * @brief Peripheral Securable as secure. - */ -#define SECURE_PER FALSE - -/** - * @brief Peripheral Securable as not-secure. - */ -#define NOT_SECURE_PER TRUE -/** @} */ - -/** - * @name MASTER TYPE MATRIX macros - * @{ - */ -/** - * @brief No Default Master. - */ -#define NO_DEFAULT_MASTER 0x0u - -/** - * @brief Last Default Master. - */ -#define LAST_DEFAULT_MASTER 0x1u - -/** - * @brief Fixed Default Master. - */ -#define FIXED_DEFAULT_MASTER 0x2u -/** @} */ - -/** - * @name REGION MATRIX MASK macros - * @{ - */ -/** - * @brief Region 0. - */ -#define REGION_0_MSK (0x1u << 0) - -/** - * @brief Region 1. - */ -#define REGION_1_MSK (0x1u << 1) - -/** - * @brief Region 2. - */ -#define REGION_2_MSK (0x1u << 2) - -/** - * @brief Region 3. - */ -#define REGION_3_MSK (0x1u << 3) - -/** - * @brief Region 4. - */ -#define REGION_4_MSK (0x1u << 4) - -/** - * @brief Region 5. - */ -#define REGION_5_MSK (0x1u << 5) - -/** - * @brief Region 6. - */ -#define REGION_6_MSK (0x1u << 6) - -/** - * @brief Region 7. - */ -#define REGION_7_MSK (0x1u << 7) -/** @} */ - -/** - * @name REGION MATRIX macros - * @{ - */ -/** - * @brief Region 0. - */ -#define REGION_0 0x0u - -/** - * @brief Region 1. - */ -#define REGION_1 0x1u - -/** - * @brief Region 2. - */ -#define REGION_2 0x2u - -/** - * @brief Region 3. - */ -#define REGION_3 0x3u - -/** - * @brief Region 4. - */ -#define REGION_4 0x4u - -/** - * @brief Region 5. - */ -#define REGION_5 0x5u - -/** - * @brief Region 6. - */ -#define REGION_6 0x6u - -/** - * @brief Region 7. - */ -#define REGION_7 0x7u -/** @} */ - -/** - * @name AREA SIZE MATRIX macros - * @{ - */ -/** - * @brief Area size 4 KB. - */ -#define MATRIX_AREA_SIZE_4K 0x0u - -/** - * @brief Area size 8 KB. - */ -#define MATRIX_AREA_SIZE_8K 0x1u - -/** - * @brief Area size 16 KB. - */ -#define MATRIX_AREA_SIZE_16K 0x2u - -/** - * @brief Area size 32 KB. - */ -#define MATRIX_AREA_SIZE_32K 0x3u - -/** - * @brief Area size 64 KB. - */ -#define MATRIX_AREA_SIZE_64K 0x4u - -/** - * @brief Area size 128 KB. - */ -#define MATRIX_AREA_SIZE_128K 0x5u - -/** - * @brief Area size 256 KB. - */ -#define MATRIX_AREA_SIZE_256K 0x6u - -/** - * @brief Area size 512 KB. - */ -#define MATRIX_AREA_SIZE_512K 0x7u - -/** - * @brief Area size 1 MB. - */ -#define MATRIX_AREA_SIZE_1M 0x8u - -/** - * @brief Area size 2 MB. - */ -#define MATRIX_AREA_SIZE_2M 0x9u - -/** - * @brief Area size 4 MB. - */ -#define MATRIX_AREA_SIZE_4M 0xAu - -/** - * @brief Area size 8 MB. - */ -#define MATRIX_AREA_SIZE_8M 0xBu - -/** - * @brief Area size 16 MB. - */ -#define MATRIX_AREA_SIZE_16M 0xCu - -/** - * @brief Area size 32 MB. - */ -#define MATRIX_AREA_SIZE_32M 0xDu - -/** - * @brief Area size 64 MB. - */ -#define MATRIX_AREA_SIZE_64M 0xEu - -/** - * @brief Area size 128 MB. - */ -#define MATRIX_AREA_SIZE_128M 0xFu -/** @} */ - -/*===========================================================================*/ -/* Driver pre-compile time settings. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Derived constants and error checks. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver data structures and types. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver macros. */ -/*===========================================================================*/ -/** - * @brief Configure LANSECH per Region. - * - * @param[in] region Region to configure. - * @param[in] lansech Securable mode. - * - * @api - */ -#define mtxRegionLansech(region, lansech) (lansech << region) - -/** - * @brief Configure RDNSECH per Region. - * - * @param[in] region Region to configure. - * @param[in] rdnsech Read securable mode. - * - * @api - */ -#define mtxRegionRdnsech(region, rdnsech) (rdnsech << region) - -/** - * @brief Configure WRNSECH per Region. - * - * @param[in] region Region to configure. - * @param[in] wrnsech Write securable mode. - * - * @api - */ -#define mtxRegionWrnsech(region, wrnsech) (wrnsech << region) - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ - -#ifdef __cplusplus -extern "C" { -#endif - bool mtxConfigPeriphSecurity(Matrix *mtxp, uint32_t id, bool mode); - void mtxConfigDefaultMaster(Matrix *mtxp, uint8_t slaveID, - uint8_t type, uint8_t masterID); - void mtxConfigSlaveSec(Matrix *mtxp, uint8_t slaveID, - uint8_t selMask, uint8_t readMask, - uint8_t writeMask); - void mtxSetSlaveSplitAddr(Matrix *mtxp, uint8_t slaveID, - uint8_t area, uint8_t mask); - void mtxSetSlaveRegionSize(Matrix *mtxp, uint8_t slaveID, - uint8_t areaSize, uint8_t mask); - void mtxRemapRom(void); - void mtxRemapRam(void); -#ifdef __cplusplus -} -#endif - -#endif /* SAMA_MATRIX_H */ - -/** @} */ +/*
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
+
+ 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.
+*/
+
+/**
+ * @file SAMA5D2x/sama_matrix.h
+ * @brief SAMA MATRIX support macros and structures.
+ *
+ * @addtogroup SAMA5D2x_MATRIX
+ * @{
+ */
+
+#ifndef SAMA_MATRIX_H
+#define SAMA_MATRIX_H
+
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+/**
+ * @name SECURE MATRIX mode macros
+ * @{
+ */
+/**
+ * @brief The low area of region is the securable one.
+ */
+#define LOWER_AREA_SECURABLE 0x0u
+
+/**
+ * @brief The upper area of region is the non-securable one.
+ */
+#define UPPER_AREA_SECURABLE 0x1u
+
+/**
+ * @brief Securable area is secured for reads.
+ */
+#define SECURE_READ 0x0u
+
+/**
+ * @brief Securable area is secured for writes.
+ */
+#define SECURE_WRITE 0x0u
+
+/**
+ * @brief Securable area is non-secured for reads.
+ */
+#define NOT_SECURE_READ 0x1u
+
+/**
+ * @brief Securable area is non-secured for writes.
+ */
+#define NOT_SECURE_WRITE 0x1u
+
+/**
+ * @brief Peripheral Securable as secure.
+ */
+#define SECURE_PER FALSE
+
+/**
+ * @brief Peripheral Securable as not-secure.
+ */
+#define NOT_SECURE_PER TRUE
+/** @} */
+
+/**
+ * @name MASTER TYPE MATRIX macros
+ * @{
+ */
+/**
+ * @brief No Default Master.
+ */
+#define NO_DEFAULT_MASTER 0x0u
+
+/**
+ * @brief Last Default Master.
+ */
+#define LAST_DEFAULT_MASTER 0x1u
+
+/**
+ * @brief Fixed Default Master.
+ */
+#define FIXED_DEFAULT_MASTER 0x2u
+/** @} */
+
+/**
+ * @name REGION MATRIX MASK macros
+ * @{
+ */
+/**
+ * @brief Region 0.
+ */
+#define REGION_0_MSK (0x1u << 0)
+
+/**
+ * @brief Region 1.
+ */
+#define REGION_1_MSK (0x1u << 1)
+
+/**
+ * @brief Region 2.
+ */
+#define REGION_2_MSK (0x1u << 2)
+
+/**
+ * @brief Region 3.
+ */
+#define REGION_3_MSK (0x1u << 3)
+
+/**
+ * @brief Region 4.
+ */
+#define REGION_4_MSK (0x1u << 4)
+
+/**
+ * @brief Region 5.
+ */
+#define REGION_5_MSK (0x1u << 5)
+
+/**
+ * @brief Region 6.
+ */
+#define REGION_6_MSK (0x1u << 6)
+
+/**
+ * @brief Region 7.
+ */
+#define REGION_7_MSK (0x1u << 7)
+/** @} */
+
+/**
+ * @name REGION MATRIX macros
+ * @{
+ */
+/**
+ * @brief Region 0.
+ */
+#define REGION_0 0x0u
+
+/**
+ * @brief Region 1.
+ */
+#define REGION_1 0x1u
+
+/**
+ * @brief Region 2.
+ */
+#define REGION_2 0x2u
+
+/**
+ * @brief Region 3.
+ */
+#define REGION_3 0x3u
+
+/**
+ * @brief Region 4.
+ */
+#define REGION_4 0x4u
+
+/**
+ * @brief Region 5.
+ */
+#define REGION_5 0x5u
+
+/**
+ * @brief Region 6.
+ */
+#define REGION_6 0x6u
+
+/**
+ * @brief Region 7.
+ */
+#define REGION_7 0x7u
+/** @} */
+
+/**
+ * @name AREA SIZE MATRIX macros
+ * @{
+ */
+/**
+ * @brief Area size 4 KB.
+ */
+#define MATRIX_AREA_SIZE_4K 0x0u
+
+/**
+ * @brief Area size 8 KB.
+ */
+#define MATRIX_AREA_SIZE_8K 0x1u
+
+/**
+ * @brief Area size 16 KB.
+ */
+#define MATRIX_AREA_SIZE_16K 0x2u
+
+/**
+ * @brief Area size 32 KB.
+ */
+#define MATRIX_AREA_SIZE_32K 0x3u
+
+/**
+ * @brief Area size 64 KB.
+ */
+#define MATRIX_AREA_SIZE_64K 0x4u
+
+/**
+ * @brief Area size 128 KB.
+ */
+#define MATRIX_AREA_SIZE_128K 0x5u
+
+/**
+ * @brief Area size 256 KB.
+ */
+#define MATRIX_AREA_SIZE_256K 0x6u
+
+/**
+ * @brief Area size 512 KB.
+ */
+#define MATRIX_AREA_SIZE_512K 0x7u
+
+/**
+ * @brief Area size 1 MB.
+ */
+#define MATRIX_AREA_SIZE_1M 0x8u
+
+/**
+ * @brief Area size 2 MB.
+ */
+#define MATRIX_AREA_SIZE_2M 0x9u
+
+/**
+ * @brief Area size 4 MB.
+ */
+#define MATRIX_AREA_SIZE_4M 0xAu
+
+/**
+ * @brief Area size 8 MB.
+ */
+#define MATRIX_AREA_SIZE_8M 0xBu
+
+/**
+ * @brief Area size 16 MB.
+ */
+#define MATRIX_AREA_SIZE_16M 0xCu
+
+/**
+ * @brief Area size 32 MB.
+ */
+#define MATRIX_AREA_SIZE_32M 0xDu
+
+/**
+ * @brief Area size 64 MB.
+ */
+#define MATRIX_AREA_SIZE_64M 0xEu
+
+/**
+ * @brief Area size 128 MB.
+ */
+#define MATRIX_AREA_SIZE_128M 0xFu
+/** @} */
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+/**
+ * @brief Configure LANSECH per Region.
+ *
+ * @param[in] region Region to configure.
+ * @param[in] lansech Securable mode.
+ *
+ * @api
+ */
+#define mtxRegionLansech(region, lansech) (lansech << region)
+
+/**
+ * @brief Configure RDNSECH per Region.
+ *
+ * @param[in] region Region to configure.
+ * @param[in] rdnsech Read securable mode.
+ *
+ * @api
+ */
+#define mtxRegionRdnsech(region, rdnsech) (rdnsech << region)
+
+/**
+ * @brief Configure WRNSECH per Region.
+ *
+ * @param[in] region Region to configure.
+ * @param[in] wrnsech Write securable mode.
+ *
+ * @api
+ */
+#define mtxRegionWrnsech(region, wrnsech) (wrnsech << region)
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ bool mtxConfigPeriphSecurity(Matrix *mtxp, uint32_t id, bool mode);
+ void mtxConfigDefaultMaster(Matrix *mtxp, uint8_t slaveID,
+ uint8_t type, uint8_t masterID);
+ void mtxConfigSlaveSec(Matrix *mtxp, uint8_t slaveID,
+ uint8_t selMask, uint8_t readMask,
+ uint8_t writeMask);
+ void mtxSetSlaveSplitAddr(Matrix *mtxp, uint8_t slaveID,
+ uint8_t area, uint8_t mask);
+ void mtxSetSlaveRegionSize(Matrix *mtxp, uint8_t slaveID,
+ uint8_t areaSize, uint8_t mask);
+ void mtxRemapRom(void);
+ void mtxRemapRam(void);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SAMA_MATRIX_H */
+
+/** @} */
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_pmc.h b/os/hal/ports/SAMA/SAMA5D2x/sama_pmc.h index 611cc9d05..9b4a580c2 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_pmc.h +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_pmc.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_registry.h b/os/hal/ports/SAMA/SAMA5D2x/sama_registry.h index d7735ba0d..31a017707 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_registry.h +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_registry.h @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c index 3652e6b65..63cd35d85 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c @@ -1,5 +1,5 @@ /*
- ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h index 54c7a3207..d73938c4c 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h @@ -1,554 +1,554 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - 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. -*/ - -/** - * @file SAMA5D2x/sama_secumod.h - * @brief SAMA SECUMOD support macros and structures. - * - * @addtogroup SAMA5D2x_SECUMOD - * @{ - */ - -#ifndef SAMA_SECUMOD_LLD_H -#define SAMA_SECUMOD_LLD_H - -#if HAL_USE_SECUMOD || defined(__DOXYGEN__) - -#include <string.h> -/*===========================================================================*/ -/* Driver constants. */ -/*===========================================================================*/ -/** - * @name RAM ACCESS mode macros - * @{ - */ -/** - * @brief No access allowed. - */ -#define RAMACC_NO_ACCESS 0x0U - -/** - * @brief Only write access allowed. - */ -#define RAMACC_WR_ACCESS 0x1U - -/** - * @brief Only read access allowed. - */ -#define RAMACC_RD_ACCESS 0x2U - -/** - * @brief Read and Write access allowed. - */ -#define RAMACC_WR_RD_ACCESS 0x3U -/** @} */ - -/** - * @name SOURCE INTERRUPT macros - * @{ - */ -/* - * @brief Shield Monitor Protection Interrupt Source. - */ -#define SECUMOD_SHLDM (0x1u << 0) - -/* - * @brief Double Frequency Monitor Protection Interrupt Source. - */ -#define SECUMOD_DBLFM (0x1u << 1) - -/* - * @brief Test Pin Protection Interrupt Source. - */ -#define SECUMOD_TST (0x1u << 2) - -/* - * @brief JTAG Pins Protection Interrupt Source. - */ -#define SECUMOD_JTAG (0x1u << 3) - -/* - * @brief Master Clock Monitor Protection Interrupt Source. - */ -#define SECUMOD_MCKM (0x1u << 5) - -/* - * @brief Low Temperature Monitor Protection Interrupt Source. - */ -#define SECUMOD_TPML (0x1u << 6) - -/* - * @brief High Temperature Monitor Protection Interrupt Source. - */ -#define SECUMOD_TPMH (0x1u << 7) - -/* - * @brief Low VDDBU Voltage Monitor Protection Interrupt Source. - */ -#define SECUMOD_VDDBUL (0x1u << 10) - -/* - * @brief High VDDBU Voltage Monitor Protection Interrupt Source. - */ -#define SECUMOD_VDDBUH (0x1u << 11) - -/* - * @brief Low VDDCORE Voltage Monitor Protection Interrupt Source. - */ -#define SECUMOD_VDDCOREL (0x1u << 12) - -/* - * @brief High VDDCORE Voltage Monitor Protection Interrupt Source. - */ -#define SECUMOD_VDDCOREH (0x1u << 13) - -/* - * @brief PIOBUx Intrusion Detector Protection Interrupt Source. - */ -#define SECUMOD_DET0 (0x1u << 16) -#define SECUMOD_DET1 (0x1u << 17) -#define SECUMOD_DET2 (0x1u << 18) -#define SECUMOD_DET3 (0x1u << 19) -#define SECUMOD_DET4 (0x1u << 20) -#define SECUMOD_DET5 (0x1u << 21) -#define SECUMOD_DET6 (0x1u << 22) -#define SECUMOD_DET7 (0x1u << 23) -/** @} */ - -/** - * @name RAM STATUS mode macros - * @{ - */ -/** - * @brief No access violation occurred. - */ -#define RAMACCSR_NO_VIOLATION 0x0U - -/** - * @brief Write access violation occurred. - */ -#define RAMACCSR_WR_VIOLATION 0x1U - -/** - * @brief Read access violation occurred. - */ -#define RAMACCSR_RD_VIOLATION 0x2U - -/** - * @brief Read and Write access violation occurred. - */ -#define RAMACCSR_WR_RD_VIOLATION 0x3U -/** @} */ - -/** - * @name SCRAMB mode macros - * @{ - */ -/** - * @brief SCRAMB ENABLE. - */ -#define SCRAMB_ENABLE 0x1U - -/** - * @brief SCRAMB DISABLE. - */ -#define SCRAMB_DISABLE 0x2U -/** @} */ - -/* - * @brief RAM regions of SECUMOD - */ -#define SECUMOD_RAM_REGIONS 6 - -/*===========================================================================*/ -/* Driver pre-compile time settings. */ -/*===========================================================================*/ -/** - * @name Configuration options - * @{ - */ -/** - * @brief SECUMOD interrupt priority level setting. - */ -#if !defined(SAMA_SECUMOD_IRQ_PRIORITY) || defined(__DOXYGEN__) -#define SAMA_SECUMOD_IRQ_PRIORITY 7 -#endif - -/** - * @brief SECURAM interrupt priority level setting. - */ -#if !defined(SAMA_SECURAM_IRQ_PRIORITY) || defined(__DOXYGEN__) -#define SAMA_SECURAM_IRQ_PRIORITY 7 -#endif - -/** @} */ -/*===========================================================================*/ -/* Derived constants and error checks. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver data structures and types. */ -/*===========================================================================*/ -/** - * @brief Driver state machine possible states. - */ -typedef enum { - SEC_UNINIT = 0, /**< Not initialized. */ - SEC_STOP = 1, /**< Stopped. */ - SEC_ACTIVE = 2 /**< Active. */ -} secstate_t; - -/** - * @brief Type of an SECUMOD event. - */ -typedef enum { - SEC_EVENT_SHLDM = 0, /* Triggered on Shield Monitor. */ - SEC_EVENT_DBLFM = 1, /* Triggered on Double Frequency Monitor. */ - SEC_EVENT_TST = 2, /* Triggered on Test Pin Monitor. */ - SEC_EVENT_JTAG = 3, /* Triggered on JTAG Pins Monitor. */ - SEC_EVENT_MCKM = 4, /* Triggered on Master Clock Monitor. */ - SEC_EVENT_TPML = 5, /* Triggered on Low Temperature Monitor. */ - SEC_EVENT_TPMH = 6, /* Triggered on High Temperature Monitor. */ - SEC_EVENT_VDDBUL = 7, /* Triggered on Low VDDBU Voltage Monitor. */ - SEC_EVENT_VDDBUH = 8, /* Triggered on High VDDBU Voltage Monitor. */ - SEC_EVENT_VDDCOREL = 9, /* Triggered on Low VDDCORE Voltage Monitor. */ - SEC_EVENT_VDDCOREH = 10, /* Triggered on High VDDCORE Voltage Monitor. */ - SEC_EVENT_PIOBU = 11 /* Triggered on PIOBU intrusion. */ -} secevent_t; - -/** - * @brief Type of a structure representing an SEC driver. - */ -typedef struct SECDriver SECDriver; - -/** - * @brief SECURAM notification callback type. - * - * @param[in] secp pointer to a @p SECDriver object - */ -typedef void (*securam_callback_t)(SECDriver *secp); - -/** - * @brief SECUMOD notification callback type. - * - * @param[in] secp pointer to a @p SECDriver object - */ -typedef void (*secumod_callback_t)(SECDriver *secp, secevent_t event); - -/** - * @brief SECUMOD erase callback type. - * - * @param[in] secp pointer to a @p SECDriver object - */ -typedef void (*erased_callback_t)(SECDriver *secp); - -/** - * @brief Type of RAM access mode. - */ -typedef uint32_t ram_access_mode_t; - -/** - * @brief PIOBU configuration structure. - */ -typedef struct { - /* - * @brief PIOBU pin's index - */ - uint32_t pinIndex:3; - /* - * @brief alarm filter value - */ - uint32_t afv:4; - /* - * @brief reset filter value - */ - uint32_t rfv:4; - /* - * @brief I/O line mode - * @note 0: pure input, 1: enabled in output - */ - uint32_t mode:1; - /* - * @brief Configure the I/O line in output mode - * @note 0: clear, 1: set - */ - uint32_t outputLevel:1; - /* - * @brief programmable pull-up state - * @note 0: none, 1: pull-up; 2: pull-down; 3: reserved - */ - uint32_t pullUpState:2; - /* - * @brief Pull-up/Down Scheduled: - * @note 0: no; 1: yes - */ - uint32_t scheduled:1; - /* - * @brief switch input default state - */ - uint32_t inputDefaultLevel:1; - /* - * @brief Mode of detection intrusion. - * @note 0: static, 1: dynamic - */ - uint32_t dynamic:1; - /* - * @brief filter for dynamic signatures input - * @note 0: 3 stages majority vote, 1: 5 stages - */ - uint32_t filter3_5:1; -} PIOBUConfig; - -typedef struct { - /** - * @brief RAM Access Right - */ - ram_access_mode_t mode; - /* End of the mandatory fields.*/ -} RAMAccessConfig; - -/** - * @brief Driver configuration structure. - * @note It could be empty on some architectures. - */ -typedef struct { - /** - * @brief Callback for memory violation - */ - securam_callback_t securam_callback; - /** - * @brief Callback after memory erasing - */ - erased_callback_t erased_callback; - /** - * @brief lenght of PIOBUConfig array - * @note Number of pads to configure - */ - size_t length; - /** - * @brief pointer to PIOBUConfig array - */ - PIOBUConfig *list; - /** - * @brief RAM Access Rights - */ - RAMAccessConfig region[SECUMOD_RAM_REGIONS]; - /** - * @brief SECUMOD CR register initialization data. - */ - uint32_t cr; - /** - * @brief SECUMOD JTAGCR register initialization data. - */ - uint32_t jtagcr; -} SECConfig; - -/** - * @brief Structure representing a SEC driver. - */ -struct SECDriver { - /** - * @brief Driver state. - */ - secstate_t state; - /** - * @brief Current configuration data. - */ - const SECConfig *config; - /* End of the mandatory fields.*/ - /** - * @brief Pointer to the SECUMOD registers block. - */ - Secumod *sec; - /** - * @brief Callback pointer. - */ - secumod_callback_t secumod_callback; -}; - -/*===========================================================================*/ -/* Driver macros. */ -/*===========================================================================*/ -/** - * @brief Switch to Backup Mode. - * - * @api - */ -#define secumodSwitch2BackupMode() { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_BACKUP; \ -} - -/** - * @brief Switch to Normal Mode. - * - * @api - */ -#define secumodSwitch2NormalMode() { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_NORMAL; \ -} - -/** - * @brief Start clear content of SECUMOD internal RAM 4Kbyte and 256bits. - * - * @api - */ -#define secumodSoftwareProtection() { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_SWPROT; \ -} - -/** - * @brief Enable/Disable Auto-Backup. - * - * @param[in] enable Enable auto-backup if true, disable otherwise. - * - * @api - */ -#define secumodSetAutoBackup(enable) { \ - if (enable) { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_AUTOBKP_AUTO_SWITCH; \ - } \ - else { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_AUTOBKP_SW_SWITCH; \ - } \ -} - -/** - * @brief Enable/Disable Memory Scrambling. - * - * @param[in] enable Enable memory scrambling if true, disable otherwise. - * - * @api - */ -#define secumodSetScrambling(enable) { \ - if (enable) { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_SCRAMB_ENABLE; \ - } \ - else { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_SCRAMB_DISABLE; \ - } \ -} - -/** - * @brief Toggle normal or backup protection registers appear and disappear. - * - * @api - */ -#define secumodToggleProtectionReg() { \ - SECUMOD->SECUMOD_CR = SECUMOD_CR_KEY_TOGGLE; \ -} - -/** - * @brief Set scrambling key for secure RAM in SECUMOD. - * - * @param[in] key Scrambling key. - * - * @api - */ -#define secumodSetScramblingKey(key) { \ - SECUMOD->SECUMOD_SCRKEY = key; \ -} - -/** - * @brief Get scrambling key for secure RAM in SECUMOD. - * - * @return Scrambling key. - * - * @api - */ -#define secumodGetScramblingKey() { \ - SECUMOD->SECUMOD_SCRKEY; \ -} - -/** - * @brief Set protections enabled in backup mode. - * - * @note Make sure registers appears before call this function, to toggle the - * appearance of the registers using secumodToggleProtectionReg(). - * - * @param[in] sources Bitwise OR of protections. - * - * @api - */ -#define secumodSetBackupModeProtections(sources) { \ - SECUMOD->SECUMOD_BMPR = sources; \ -} - -/** - * @brief Set protections enabled in normal mode. - * - * @note Make sure registers appears before call this function, to toggle the - * appearance of the registers using secumodToggleProtectionReg(). - * - * @param[in] sources Bitwise OR of protections. - * - * @api - */ -#define secumodSetNormalModeProtections(sources) { \ - SECUMOD->SECUMOD_NMPR = sources; \ - if (SECUMOD->SECUMOD_NMPR != sources) { \ - secumodToggleProtectionReg(); \ - SECUMOD->SECUMOD_NMPR = sources; \ - } \ -} - -/** - * @brief Set protection sources which can cause wake up signal generated. - * - * @param[in] sources Bitwise OR of protection sources. - * - * @api - */ -#define secumodSetWakeupProtections(sources) { \ - SECUMOD->SECUMOD_WKPR = sources; \ -} - -/** - * @brief Wait availability status of memory. - * - * @api - */ -#define secumodMemReady() { \ - while (!(SECUMOD->SECUMOD_RAMRDY & SECUMOD_RAMRDY_READY)); \ -} - -/*===========================================================================*/ -/* External declarations. */ -/*===========================================================================*/ -extern SECDriver SECD0; - -#ifdef __cplusplus -extern "C" { -#endif - void secInit(void); - void secObjectInit(SECDriver *secp); - void secStart(SECDriver *secp, const SECConfig *config); - void secStop(SECDriver *secp); - void secSetCallback(SECDriver *secp, uint32_t sources, secumod_callback_t callback); - void secumodSetJtagProtection(bool reset, uint8_t permissions, bool ack); - void secumodDynamicSignaturesTuning(uint16_t period, uint8_t detectionThr, uint8_t resetThr); - void secumodPeriodicAlarm(bool enable); - void secumodSetRamAccessRights(uint32_t region, uint8_t rights); - uint32_t secumodReadInternalMemory(uint8_t *data, uint32_t addr, uint32_t size); - uint32_t secumodWriteInternalMemory(uint8_t *data, uint32_t addr, uint32_t size); -#ifdef __cplusplus -} -#endif - -#endif /* HAL_USE_SECUMOD */ - -#endif /* SAMA_SECUMOD_LLD_H */ - -/** @} */ +/*
+ ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
+
+ 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.
+*/
+
+/**
+ * @file SAMA5D2x/sama_secumod.h
+ * @brief SAMA SECUMOD support macros and structures.
+ *
+ * @addtogroup SAMA5D2x_SECUMOD
+ * @{
+ */
+
+#ifndef SAMA_SECUMOD_LLD_H
+#define SAMA_SECUMOD_LLD_H
+
+#if HAL_USE_SECUMOD || defined(__DOXYGEN__)
+
+#include <string.h>
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+/**
+ * @name RAM ACCESS mode macros
+ * @{
+ */
+/**
+ * @brief No access allowed.
+ */
+#define RAMACC_NO_ACCESS 0x0U
+
+/**
+ * @brief Only write access allowed.
+ */
+#define RAMACC_WR_ACCESS 0x1U
+
+/**
+ * @brief Only read access allowed.
+ */
+#define RAMACC_RD_ACCESS 0x2U
+
+/**
+ * @brief Read and Write access allowed.
+ */
+#define RAMACC_WR_RD_ACCESS 0x3U
+/** @} */
+
+/**
+ * @name SOURCE INTERRUPT macros
+ * @{
+ */
+/*
+ * @brief Shield Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_SHLDM (0x1u << 0)
+
+/*
+ * @brief Double Frequency Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_DBLFM (0x1u << 1)
+
+/*
+ * @brief Test Pin Protection Interrupt Source.
+ */
+#define SECUMOD_TST (0x1u << 2)
+
+/*
+ * @brief JTAG Pins Protection Interrupt Source.
+ */
+#define SECUMOD_JTAG (0x1u << 3)
+
+/*
+ * @brief Master Clock Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_MCKM (0x1u << 5)
+
+/*
+ * @brief Low Temperature Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_TPML (0x1u << 6)
+
+/*
+ * @brief High Temperature Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_TPMH (0x1u << 7)
+
+/*
+ * @brief Low VDDBU Voltage Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_VDDBUL (0x1u << 10)
+
+/*
+ * @brief High VDDBU Voltage Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_VDDBUH (0x1u << 11)
+
+/*
+ * @brief Low VDDCORE Voltage Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_VDDCOREL (0x1u << 12)
+
+/*
+ * @brief High VDDCORE Voltage Monitor Protection Interrupt Source.
+ */
+#define SECUMOD_VDDCOREH (0x1u << 13)
+
+/*
+ * @brief PIOBUx Intrusion Detector Protection Interrupt Source.
+ */
+#define SECUMOD_DET0 (0x1u << 16)
+#define SECUMOD_DET1 (0x1u << 17)
+#define SECUMOD_DET2 (0x1u << 18)
+#define SECUMOD_DET3 (0x1u << 19)
+#define SECUMOD_DET4 (0x1u << 20)
+#define SECUMOD_DET5 (0x1u << 21)
+#define SECUMOD_DET6 (0x1u << 22)
+#define SECUMOD_DET7 (0x1u << 23)
+/** @} */
+
+/**
+ * @name RAM STATUS mode macros
+ * @{
+ */
+/**
+ * @brief No access violation occurred.
+ */
+#define RAMACCSR_NO_VIOLATION 0x0U
+
+/**
+ * @brief Write access violation occurred.
+ */
+#define RAMACCSR_WR_VIOLATION 0x1U
+
+/**
+ * @brief Read access violation occurred.
+ */
+#define RAMACCSR_RD_VIOLATION 0x2U
+
+/**
+ * @brief Read and Write access violation occurred.
+ */
+#define RAMACCSR_WR_RD_VIOLATION 0x3U
+/** @} */
+
+/**
+ * @name SCRAMB mode macros
+ * @{
+ */
+/**
+ * @brief SCRAMB ENABLE.
+ */
+#define SCRAMB_ENABLE 0x1U
+
+/**
+ * @brief SCRAMB DISABLE.
+ */
+#define SCRAMB_DISABLE 0x2U
+/** @} */
+
+/*
+ * @brief RAM regions of SECUMOD
+ */
+#define SECUMOD_RAM_REGIONS 6
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+/**
+ * @name Configuration options
+ * @{
+ */
+/**
+ * @brief SECUMOD interrupt priority level setting.
+ */
+#if !defined(SAMA_SECUMOD_IRQ_PRIORITY) || defined(__DOXYGEN__)
+#define SAMA_SECUMOD_IRQ_PRIORITY 7
+#endif
+
+/**
+ * @brief SECURAM interrupt priority level setting.
+ */
+#if !defined(SAMA_SECURAM_IRQ_PRIORITY) || defined(__DOXYGEN__)
+#define SAMA_SECURAM_IRQ_PRIORITY 7
+#endif
+
+/** @} */
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+/**
+ * @brief Driver state machine possible states.
+ */
+typedef enum {
+ SEC_UNINIT = 0, /**< Not initialized. */
+ SEC_STOP = 1, /**< Stopped. */
+ SEC_ACTIVE = 2 /**< Active. */
+} secstate_t;
+
+/**
+ * @brief Type of an SECUMOD event.
+ */
+typedef enum {
+ SEC_EVENT_SHLDM = 0, /* Triggered on Shield Monitor. */
+ SEC_EVENT_DBLFM = 1, /* Triggered on Double Frequency Monitor. */
+ SEC_EVENT_TST = 2, /* Triggered on Test Pin Monitor. */
+ SEC_EVENT_JTAG = 3, /* Triggered on JTAG Pins Monitor. */
+ SEC_EVENT_MCKM = 4, /* Triggered on Master Clock Monitor. */
+ SEC_EVENT_TPML = 5, /* Triggered on Low Temperature Monitor. */
+ SEC_EVENT_TPMH = 6, /* Triggered on High Temperature Monitor. */
+ SEC_EVENT_VDDBUL = 7, /* Triggered on Low VDDBU Voltage Monitor. */
+ SEC_EVENT_VDDBUH = 8, /* Triggered on High VDDBU Voltage Monitor. */
+ SEC_EVENT_VDDCOREL = 9, /* Triggered on Low VDDCORE Voltage Monitor. */
+ SEC_EVENT_VDDCOREH = 10, /* Triggered on High VDDCORE Voltage Monitor. */
+ SEC_EVENT_PIOBU = 11 /* Triggered on PIOBU intrusion. */
+} secevent_t;
+
+/**
+ * @brief Type of a structure representing an SEC driver.
+ */
+typedef struct SECDriver SECDriver;
+
+/**
+ * @brief SECURAM notification callback type.
+ *
+ * @param[in] secp pointer to a @p SECDriver object
+ */
+typedef void (*securam_callback_t)(SECDriver *secp);
+
+/**
+ * @brief SECUMOD notification callback type.
+ *
+ * @param[in] secp pointer to a @p SECDriver object
+ */
+typedef void (*secumod_callback_t)(SECDriver *secp, secevent_t event);
+
+/**
+ * @brief SECUMOD erase callback type.
+ *
+ * @param[in] secp pointer to a @p SECDriver object
+ */
+typedef void (*erased_callback_t)(SECDriver *secp);
+
+/**
+ * @brief Type of RAM access mode.
+ */
+typedef uint32_t ram_access_mode_t;
+
+/**
+ * @brief PIOBU configuration structure.
+ */
+typedef struct {
+ /*
+ * @brief PIOBU pin's index
+ */
+ uint32_t pinIndex:3;
+ /*
+ * @brief alarm filter value
+ */
+ uint32_t afv:4;
+ /*
+ * @brief reset filter value
+ */
+ uint32_t rfv:4;
+ /*
+ * @brief I/O line mode
+ * @note 0: pure input, 1: enabled in output
+ */
+ uint32_t mode:1;
+ /*
+ * @brief Configure the I/O line in output mode
+ * @note 0: clear, 1: set
+ */
+ uint32_t outputLevel:1;
+ /*
+ * @brief programmable pull-up state
+ * @note 0: none, 1: pull-up; 2: pull-down; 3: reserved
+ */
+ uint32_t pullUpState:2;
+ /*
+ * @brief Pull-up/Down Scheduled:
+ * @note 0: no; 1: yes
+ */
+ uint32_t scheduled:1;
+ /*
+ * @brief switch input default state
+ */
+ uint32_t inputDefaultLevel:1;
+ /*
+ * @brief Mode of detection intrusion.
+ * @note 0: static, 1: dynamic
+ */
+ uint32_t dynamic:1;
+ /*
+ * @brief filter for dynamic signatures input
+ * @note 0: 3 stages majority vote, 1: 5 stages
+ */
+ uint32_t filter3_5:1;
+} PIOBUConfig;
+
+typedef struct {
+ /**
+ * @brief RAM Access Right
+ */
+ ram_access_mode_t mode;
+ /* End of the mandatory fields.*/
+} RAMAccessConfig;
+
+/**
+ * @brief Driver configuration structure.
+ * @note It could be empty on some architectures.
+ */
+typedef struct {
+ /**
+ * @brief Callback for memory violation
+ */
+ securam_callback_t securam_callback;
+ /**
+ * @brief Callback after memory erasing
+ */
+ erased_callback_t erased_callback;
+ /**
+ * @brief lenght of PIOBUConfig array
+ * @note Number of pads to configure
+ */
+ size_t length;
+ /**
+ * @brief pointer to PIOBUConfig array
+ */
+ PIOBUConfig *list;
+ /**
+ * @brief RAM Access Rights
+ */
+ RAMAccessConfig region[SECUMOD_RAM_REGIONS];
+ /**
+ * @brief SECUMOD CR register initialization data.
+ */
+ uint32_t cr;
+ /**
+ * @brief SECUMOD JTAGCR register initialization data.
+ */
+ uint32_t jtagcr;
+} SECConfig;
+
+/**
+ * @brief Structure representing a SEC driver.
+ */
+struct SECDriver {
+ /**
+ * @brief Driver state.
+ */
+ secstate_t state;
+ /**
+ * @brief Current configuration data.
+ */
+ const SECConfig *config;
+ /* End of the mandatory fields.*/
+ /**
+ * @brief Pointer to the SECUMOD registers block.
+ */
+ Secumod *sec;
+ /**
+ * @brief Callback pointer.
+ */
+ secumod_callback_t secumod_callback;
+};
+
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+/**
+ * @brief Switch to Backup Mode.
+ *
+ * @api
+ */
+#define secumodSwitch2BackupMode() { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_BACKUP; \
+}
+
+/**
+ * @brief Switch to Normal Mode.
+ *
+ * @api
+ */
+#define secumodSwitch2NormalMode() { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_NORMAL; \
+}
+
+/**
+ * @brief Start clear content of SECUMOD internal RAM 4Kbyte and 256bits.
+ *
+ * @api
+ */
+#define secumodSoftwareProtection() { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_SWPROT; \
+}
+
+/**
+ * @brief Enable/Disable Auto-Backup.
+ *
+ * @param[in] enable Enable auto-backup if true, disable otherwise.
+ *
+ * @api
+ */
+#define secumodSetAutoBackup(enable) { \
+ if (enable) { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_AUTOBKP_AUTO_SWITCH; \
+ } \
+ else { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_AUTOBKP_SW_SWITCH; \
+ } \
+}
+
+/**
+ * @brief Enable/Disable Memory Scrambling.
+ *
+ * @param[in] enable Enable memory scrambling if true, disable otherwise.
+ *
+ * @api
+ */
+#define secumodSetScrambling(enable) { \
+ if (enable) { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_SCRAMB_ENABLE; \
+ } \
+ else { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_SCRAMB_DISABLE; \
+ } \
+}
+
+/**
+ * @brief Toggle normal or backup protection registers appear and disappear.
+ *
+ * @api
+ */
+#define secumodToggleProtectionReg() { \
+ SECUMOD->SECUMOD_CR = SECUMOD_CR_KEY_TOGGLE; \
+}
+
+/**
+ * @brief Set scrambling key for secure RAM in SECUMOD.
+ *
+ * @param[in] key Scrambling key.
+ *
+ * @api
+ */
+#define secumodSetScramblingKey(key) { \
+ SECUMOD->SECUMOD_SCRKEY = key; \
+}
+
+/**
+ * @brief Get scrambling key for secure RAM in SECUMOD.
+ *
+ * @return Scrambling key.
+ *
+ * @api
+ */
+#define secumodGetScramblingKey() { \
+ SECUMOD->SECUMOD_SCRKEY; \
+}
+
+/**
+ * @brief Set protections enabled in backup mode.
+ *
+ * @note Make sure registers appears before call this function, to toggle the
+ * appearance of the registers using secumodToggleProtectionReg().
+ *
+ * @param[in] sources Bitwise OR of protections.
+ *
+ * @api
+ */
+#define secumodSetBackupModeProtections(sources) { \
+ SECUMOD->SECUMOD_BMPR = sources; \
+}
+
+/**
+ * @brief Set protections enabled in normal mode.
+ *
+ * @note Make sure registers appears before call this function, to toggle the
+ * appearance of the registers using secumodToggleProtectionReg().
+ *
+ * @param[in] sources Bitwise OR of protections.
+ *
+ * @api
+ */
+#define secumodSetNormalModeProtections(sources) { \
+ SECUMOD->SECUMOD_NMPR = sources; \
+ if (SECUMOD->SECUMOD_NMPR != sources) { \
+ secumodToggleProtectionReg(); \
+ SECUMOD->SECUMOD_NMPR = sources; \
+ } \
+}
+
+/**
+ * @brief Set protection sources which can cause wake up signal generated.
+ *
+ * @param[in] sources Bitwise OR of protection sources.
+ *
+ * @api
+ */
+#define secumodSetWakeupProtections(sources) { \
+ SECUMOD->SECUMOD_WKPR = sources; \
+}
+
+/**
+ * @brief Wait availability status of memory.
+ *
+ * @api
+ */
+#define secumodMemReady() { \
+ while (!(SECUMOD->SECUMOD_RAMRDY & SECUMOD_RAMRDY_READY)); \
+}
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+extern SECDriver SECD0;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void secInit(void);
+ void secObjectInit(SECDriver *secp);
+ void secStart(SECDriver *secp, const SECConfig *config);
+ void secStop(SECDriver *secp);
+ void secSetCallback(SECDriver *secp, uint32_t sources, secumod_callback_t callback);
+ void secumodSetJtagProtection(bool reset, uint8_t permissions, bool ack);
+ void secumodDynamicSignaturesTuning(uint16_t period, uint8_t detectionThr, uint8_t resetThr);
+ void secumodPeriodicAlarm(bool enable);
+ void secumodSetRamAccessRights(uint32_t region, uint8_t rights);
+ uint32_t secumodReadInternalMemory(uint8_t *data, uint32_t addr, uint32_t size);
+ uint32_t secumodWriteInternalMemory(uint8_t *data, uint32_t addr, uint32_t size);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HAL_USE_SECUMOD */
+
+#endif /* SAMA_SECUMOD_LLD_H */
+
+/** @} */
|