mbox series

[v3,0/5] arm: exynos: Enable TRNG for E850-96 board

Message ID 20240723181439.7089-1-semen.protsenko@linaro.org
Headers show
Series arm: exynos: Enable TRNG for E850-96 board | expand

Message

Sam Protsenko July 23, 2024, 6:14 p.m. UTC
This series enables True Random Number Generator (TRNG) for E850-96
board. Here is a short breakdown of features implemented in this series:

  1. Load LDFW (Loadable Firmware) on E850-96 board. It's needed to make
     TRNG SMC commands functional. To do so, add the default eMMC
     partition table and implement reading and applying LDFW in
     board_init().
  2. Add Exynos TRNG driver
  3. Enable Exynos TRNG driver on E850-96 board. It requires SSS clocks
     to be enabled, so add those clocks as well.

With this series it's possible to generate random numbers in U-Boot
(e.g. using 'rng' command). The main reason for RNG enablement on
E850-96 board -- it's needed for EFI_RNG_PROTOCOL and kaslr, so it's one
of the requirements to enable EFI boot support on E850-96 board, which
in turn is needed (among other things) for EBBR spec and SystemReady IR
certification. With this series it's also possible to use TRNG in Linux
kernel (which was recently added, see [1] for details), as Linux kernel
Exynos TRNG driver also relies on LDFW firmware to be loaded in the
bootloader.

Changes in v3:
  - Fixed applying the defconfig changes (patch 5/5)
  - Rebased on top of the most recent U-Boot/master

Changes in v2:
  - Addressed comments for [PATCH 4/5] rng: Add Exynos TRNG driver

Sam Protsenko (5):
  board: samsung: e850-96: Add default partitions
  board: samsung: e850-96: Load LDFW firmware on board init
  clk: exynos: Add SSS clocks for Exynos850
  rng: Add Exynos TRNG driver
  arm: exynos: Enable TRNG on E850-96 board

 arch/arm/dts/exynos850-e850-96-u-boot.dtsi |  11 +
 arch/arm/mach-exynos/Kconfig               |   2 +
 board/samsung/e850-96/Makefile             |   4 +-
 board/samsung/e850-96/e850-96.c            |   6 +-
 board/samsung/e850-96/e850-96.env          |  26 ++
 board/samsung/e850-96/fw.c                 | 131 ++++++++++
 board/samsung/e850-96/fw.h                 |  12 +
 configs/e850-96_defconfig                  |   1 +
 drivers/clk/exynos/clk-exynos850.c         |  10 +
 drivers/rng/Kconfig                        |  13 +
 drivers/rng/Makefile                       |   1 +
 drivers/rng/exynos-trng.c                  | 291 +++++++++++++++++++++
 12 files changed, 504 insertions(+), 4 deletions(-)
 create mode 100644 board/samsung/e850-96/e850-96.env
 create mode 100644 board/samsung/e850-96/fw.c
 create mode 100644 board/samsung/e850-96/fw.h
 create mode 100644 drivers/rng/exynos-trng.c

Comments

Minkyu Kang July 24, 2024, 10:27 a.m. UTC | #1
Hi,


2024년 7월 24일 (수) 03:14, Sam Protsenko <semen.protsenko@linaro.org>님이 작성:

> This series enables True Random Number Generator (TRNG) for E850-96
> board. Here is a short breakdown of features implemented in this series:
>
>   1. Load LDFW (Loadable Firmware) on E850-96 board. It's needed to make
>      TRNG SMC commands functional. To do so, add the default eMMC
>      partition table and implement reading and applying LDFW in
>      board_init().
>   2. Add Exynos TRNG driver
>   3. Enable Exynos TRNG driver on E850-96 board. It requires SSS clocks
>      to be enabled, so add those clocks as well.
>
> With this series it's possible to generate random numbers in U-Boot
> (e.g. using 'rng' command). The main reason for RNG enablement on
> E850-96 board -- it's needed for EFI_RNG_PROTOCOL and kaslr, so it's one
> of the requirements to enable EFI boot support on E850-96 board, which
> in turn is needed (among other things) for EBBR spec and SystemReady IR
> certification. With this series it's also possible to use TRNG in Linux
> kernel (which was recently added, see [1] for details), as Linux kernel
> Exynos TRNG driver also relies on LDFW firmware to be loaded in the
> bootloader.
>
> Changes in v3:
>   - Fixed applying the defconfig changes (patch 5/5)
>   - Rebased on top of the most recent U-Boot/master
>
> Changes in v2:
>   - Addressed comments for [PATCH 4/5] rng: Add Exynos TRNG driver
>
> Sam Protsenko (5):
>   board: samsung: e850-96: Add default partitions
>   board: samsung: e850-96: Load LDFW firmware on board init
>   clk: exynos: Add SSS clocks for Exynos850
>   rng: Add Exynos TRNG driver
>   arm: exynos: Enable TRNG on E850-96 board
>
>  arch/arm/dts/exynos850-e850-96-u-boot.dtsi |  11 +
>  arch/arm/mach-exynos/Kconfig               |   2 +
>  board/samsung/e850-96/Makefile             |   4 +-
>  board/samsung/e850-96/e850-96.c            |   6 +-
>  board/samsung/e850-96/e850-96.env          |  26 ++
>  board/samsung/e850-96/fw.c                 | 131 ++++++++++
>  board/samsung/e850-96/fw.h                 |  12 +
>  configs/e850-96_defconfig                  |   1 +
>  drivers/clk/exynos/clk-exynos850.c         |  10 +
>  drivers/rng/Kconfig                        |  13 +
>  drivers/rng/Makefile                       |   1 +
>  drivers/rng/exynos-trng.c                  | 291 +++++++++++++++++++++
>  12 files changed, 504 insertions(+), 4 deletions(-)
>  create mode 100644 board/samsung/e850-96/e850-96.env
>  create mode 100644 board/samsung/e850-96/fw.c
>  create mode 100644 board/samsung/e850-96/fw.h
>  create mode 100644 drivers/rng/exynos-trng.c
>
> --
> 2.39.2
>

applied to u-boot-samsung.

Thanks.
Minkyu Kang.