mbox series

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

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

Message

Sam Protsenko July 16, 2024, 3:17 a.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 v2:
  - Addressed comments for [PATCH 4/5] rng: Add Exynos TRNG driver

[1] https://lore.kernel.org/all/20240618003743.2975-1-semen.protsenko@linaro.org/T/#me6ba1762a254ca438a9715f011d32820babfe2d8

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

Sam Protsenko July 22, 2024, 6:17 p.m. UTC | #1
Hi Minkyu,

Can you please take a look at this series? And also my MMC series [1]
has been pending for a while now, if it's ok with you -- can you
please apply it?

Thanks!

[1] https://lists.denx.de/pipermail/u-boot/2024-July/559602.html

On Mon, Jul 15, 2024 at 10:17 PM Sam Protsenko
<semen.protsenko@linaro.org> wrote:
>
> 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 v2:
>   - Addressed comments for [PATCH 4/5] rng: Add Exynos TRNG driver
>
> [1] https://lore.kernel.org/all/20240618003743.2975-1-semen.protsenko@linaro.org/T/#me6ba1762a254ca438a9715f011d32820babfe2d8
>
> 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
>
Minkyu Kang July 23, 2024, 4:58 a.m. UTC | #2
Hi,


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

> Hi Minkyu,
>
> Can you please take a look at this series? And also my MMC series [1]
> has been pending for a while now, if it's ok with you -- can you
> please apply it?
>
> Thanks!
>
> [1] https://lists.denx.de/pipermail/u-boot/2024-July/559602.html
>
> On Mon, Jul 15, 2024 at 10:17 PM Sam Protsenko
> <semen.protsenko@linaro.org> wrote:
> >
> > 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 v2:
> >   - Addressed comments for [PATCH 4/5] rng: Add Exynos TRNG driver
> >
> > [1]
> https://lore.kernel.org/all/20240618003743.2975-1-semen.protsenko@linaro.org/T/#me6ba1762a254ca438a9715f011d32820babfe2d8
> >
> > 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
> >


Your patch was failed to apply to u-boot-samsung due to the
e850-96_defconfig.
please rebase the patch.

and about mmc patches, those have delegated to mmc maintainers.

Thanks,
Minkyu Kang.
Sam Protsenko July 23, 2024, 6:23 p.m. UTC | #3
[snip]

>
> Your patch was failed to apply to u-boot-samsung due to the e850-96_defconfig.
> please rebase the patch.
>

Just sent v3, please take a look.

> and about mmc patches, those have delegated to mmc maintainers.
>

Do you know if I should I ask some specific MMC maintainer to apply
that series? That series was pending for a while now and I really want
to get it merged as soon as possible :)

Thanks!

> Thanks,
> Minkyu Kang.
>
Minkyu Kang July 24, 2024, 10:28 a.m. UTC | #4
Hi,


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

> [snip]
>
> >
> > Your patch was failed to apply to u-boot-samsung due to the
> e850-96_defconfig.
> > please rebase the patch.
> >
>
> Just sent v3, please take a look.
>
> > and about mmc patches, those have delegated to mmc maintainers.
> >
>
> Do you know if I should I ask some specific MMC maintainer to apply
> that series? That series was pending for a while now and I really want
> to get it merged as soon as possible :)


Mr. Chung will check.


>
> Thanks!
>
> > Thanks,
> > Minkyu Kang.
> >
>