Skip to content

Commit

Permalink
dts: esp32s3: add TRNG support
Browse files Browse the repository at this point in the history
Add True Random Number Generator support on esp32s3

Signed-off-by: Lucas Tamborrino <[email protected]>
  • Loading branch information
LucasTambor authored and carlescufi committed Mar 23, 2023
1 parent d5672c9 commit 7486fe7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boards/xtensa/esp32s3_devkitm/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
config BOARD
default "esp32s3_devkitm"
depends on BOARD_ESP32S3_DEVKITM

config ENTROPY_GENERATOR
default y
2 changes: 2 additions & 0 deletions boards/xtensa/esp32s3_devkitm/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Current Zephyr's ESP32-S3-DevKitM board supports the following features:
+------------+------------+-------------------------------------+
| Watchdog | on-chip | watchdog |
+------------+------------+-------------------------------------+
| TRNG | on-chip | entropy |
+------------+------------+-------------------------------------+

Prerequisites
-------------
Expand Down
4 changes: 4 additions & 0 deletions boards/xtensa/esp32s3_devkitm/esp32s3_devkitm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
status = "okay";
};

&trng0 {
status = "okay";
};

&flash0 {
status = "okay";
partitions {
Expand Down
1 change: 1 addition & 0 deletions boards/xtensa/esp32s3_devkitm/esp32s3_devkitm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ supported:
- spi
- counter
- watchdog
- entropy
testing:
ignore_tags:
- net
Expand Down
7 changes: 7 additions & 0 deletions dts/xtensa/espressif/esp32s3.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

/ {
chosen {
zephyr,entropy = &trng0;
zephyr,flash-controller = &flash;
};

Expand Down Expand Up @@ -251,5 +252,11 @@
clocks = <&rtc ESP32_TIMG1_MODULE>;
status = "disabled";
};

trng0: trng@6003507c {
compatible = "espressif,esp32-trng";
reg = <0x6003507c 0x4>;
status = "disabled";
};
};
};

0 comments on commit 7486fe7

Please sign in to comment.