Skip to contentSkip to conversation

crypto: stm32 - Add CRC32 support for STM32F4XX

PATCH Superseded Cosar Dindar 2 participants 2 messages May 16, 2017 – May 23, 2017

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: stm32 - Add CRC32 support for STM32F4XX

This patch series add hardware CRC32 ("Ethernet") calculation support for STMicroelectronics STM32F4XX series devices.

As an hardware limitation polynomial and key setting are not supported as they are fixed as 0x4C11DB7 (poly) and 0xFFFFFFFF (key).

CRC32C Castagnoli algorithm is not supported also. Module is tested on STM32F429-disco board with crypto testmgr using cases within the key 0xFFFFFFFF.

---
 .../devicetree/bindings/crypto/st,stm32-crc.txt    |  4 +-
 arch/arm/boot/dts/stm32429i-eval.dts               |  4 ++
 arch/arm/boot/dts/stm32f429-disco.dts              |  4 ++
 arch/arm/boot/dts/stm32f429.dtsi                   |  7 +++
 arch/arm/boot/dts/stm32f469-disco.dts              |  4 ++
 drivers/crypto/stm32/stm32_crc32.c                 | 68 ++++++++++++++++++----
 6 files changed, 79 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/crypto/st,stm32-crc.txt +2 -2
index 3ba92a5..7b30f1e 100644
@@ -1,7 +1,7 @@
 * STMicroelectronics STM32 CRC
 
 Required properties:
-- compatible: Should be "st,stm32f7-crc".
+- compatible: Can be either "st,stm32f7-crc" or "st,srm32f4-crc".
 - reg: The address and length of the peripheral registers space
 - clocks: The input clock of the CRC instance
 
@@ -10,7 +10,7 @@ Optional properties: none
 Example:
 
 crc: crc at 40023000 {
-	compatible = "st,stm32f7-crc";
+	compatible = "st,stm32f7-crc", "st,stm32f4-crc";
 	reg = <0x40023000 0x400>;
 	clocks = <&rcc 0 12>;
 };
arch/arm/boot/dts/stm32429i-eval.dts +4 -0
index b633114..360fb19 100644
@@ -141,6 +141,10 @@
 	clock-frequency = <25000000>;
 };
 
+&crc {
+	status = "okay";
+};
+
 &i2c1 {
 	pinctrl-0 = <&i2c1_pins>;
 	pinctrl-names = "default";
arch/arm/boot/dts/stm32f429-disco.dts +4 -0
index 191fa50..ae47cde 100644
@@ -102,6 +102,10 @@
 	clock-frequency = <8000000>;
 };
 
+&crc {
+	status = "okay";
+};
+
 &rtc {
 	assigned-clocks = <&rcc 1 CLK_RTC>;
 	assigned-clock-parents = <&rcc 1 CLK_LSI>;
arch/arm/boot/dts/stm32f429.dtsi +7 -0
index b2a2b5c..18343de 100644
@@ -766,6 +766,13 @@
 			};
 		};
 
+		crc: crc at 40023000 {
+			compatible = "st,stm32f4-crc";
+			reg = <0x40023000 0x400>;
+			clocks = <&rcc 0 STM32F4_AHB1_CLOCK(CRC)>;
+			status = "disabled";
+		};
+
 		rcc: rcc at 40023810 {
 			#reset-cells = <1>;
 			#clock-cells = <2>;
arch/arm/boot/dts/stm32f469-disco.dts +4 -0
index 75470c3..8cb8b73 100644
@@ -87,6 +87,10 @@
 	clock-frequency = <8000000>;
 };
 
+&crc {
+	status = "okay";
+};
+
 &rtc {
 	status = "okay";
 };
drivers/crypto/stm32/stm32_crc32.c +58 -10

125 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Cosar Dindar

This patch series add hardware CRC32 ("Ethernet") calculation support for STMicroelectronics STM32F4XX series devices.

As an hardware limitation polynomial and key setting are not supported as they are fixed as 0x4C11DB7 (poly) and 0xFFFFFFFF (key).

CRC32C Castagnoli algorithm is not supported also. Module is tested on STM32F429-disco board with crypto testmgr using cases within the key 0xFFFFFFFF.

Quoted 8 lines
---
 .../devicetree/bindings/crypto/st,stm32-crc.txt    |  4 +-
 arch/arm/boot/dts/stm32429i-eval.dts               |  4 ++
 arch/arm/boot/dts/stm32f429-disco.dts              |  4 ++
 arch/arm/boot/dts/stm32f429.dtsi                   |  7 +++
 arch/arm/boot/dts/stm32f469-disco.dts              |  4 ++
 drivers/crypto/stm32/stm32_crc32.c                 | 68 ++++++++++++++++++----
 6 files changed, 79 insertions(+), 12 deletions(-)