rng: meson: make core clock optional
PATCH 1/1 rng: meson: make core clock optional
This fixes HWRNG support on Amlogic GXL, GXM, G12A, G12B & SM1 based boards dues to the lack of the core clock in the device tree.
It was reported breaking EFI boot in the Linux EFI stub, because the EFI_RNG_PROTOCOL didn't check for the RNG device presence before installing itself.
The Linux amlogic,meson-rng.yaml doesn't mandate the core clock, this the clock should be ignores if not present.
Nevertheless, the clock should be present and this should be fixed on the Linux meson-gxl.dtsi & meson-g12-common.dtsi then synced with U-Boot.
The change has been tested on a Khadas VIM3, which uses the common meson-g12-common.dtsi like the Odroid-C4 & Odroid-N2 in Scott's report, along with the RNG cmd.
--- drivers/rng/meson-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rng/meson-rng.c +2 -1
@@ -90,8 +90,9 @@ static int meson_rng_ofdata_to_platdata(struct udevice *dev)if (!pdata->base)return -ENODEV ; +/* Get optional "core" clock */ err =clk_get_by_name (dev,"core" , &pdata->clk); -if (err) +if (err && err != -ENODATA )return err;return 0 ;
Signature · 1 line
2.22.0
PATCH 1/1 rng: meson: make core clock optional
Quoted 41 lines · Neil Armstrong
This fixes HWRNG support on Amlogic GXL, GXM, G12A, G12B & SM1 based boards dues to the lack of the core clock in the device tree.
It was reported breaking EFI boot in the Linux EFI stub, because the
EFI_RNG_PROTOCOLdidn't check for the RNG device presence before installing itself.The Linux amlogic,meson-rng.yaml doesn't mandate the core clock, this the clock should be ignores if not present.
Nevertheless, the clock should be present and this should be fixed on the Linux
meson-gxl.dtsi&meson-g12-common.dtsithen synced with U-Boot.The change has been tested on a Khadas VIM3, which uses the common
meson-g12-common.dtsilike the Odroid-C4 & Odroid-N2 in Scott's report, along with the RNG cmd.Cc Heinrich Schuchardt <[email protected]>Reported-by Scott K Logan <[email protected]>Fixes bc40eb278b ("drivers/rng: add Amlogic hardware RNG driver")Signed-off-by Neil Armstrong <[email protected]>--- drivers/rng/meson-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/rng/meson-rng.c +2
-1@@ -90,8 +90,9 @@ static int meson_rng_ofdata_to_platdata(struct udevice *dev)if (!pdata->base)return -ENODEV ; +/* Get optional "core" clock */ err =clk_get_by_name (dev,"core" , &pdata->clk); -if (err) +if (err && err != -ENODATA )return err;
Quoted 3 lines
return 0;
Signature · 1 line
2.22.0
PATCH 1/1 rng: meson: make core clock optional
In reply to Neil ArmstrongQuoted 32 lines · Neil Armstrong
This fixes HWRNG support on Amlogic GXL, GXM, G12A, G12B & SM1 based boards dues to the lack of the core clock in the device tree.
It was reported breaking EFI boot in the Linux EFI stub, because the
EFI_RNG_PROTOCOLdidn't check for the RNG device presence before installing itself.The Linux amlogic,meson-rng.yaml doesn't mandate the core clock, this the clock should be ignores if not present.
Nevertheless, the clock should be present and this should be fixed on the Linux
meson-gxl.dtsi&meson-g12-common.dtsithen synced with U-Boot.The change has been tested on a Khadas VIM3, which uses the common
meson-g12-common.dtsilike the Odroid-C4 & Odroid-N2 in Scott's report, along with the RNG cmd.Cc Heinrich Schuchardt <[email protected]>Reported-by Scott K Logan <[email protected]>Fixes bc40eb278b ("drivers/rng: add Amlogic hardware RNG driver")Signed-off-by Neil Armstrong <[email protected]>--- drivers/rng/meson-rng.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/rng/meson-rng.c +0
-0
drivers/rng/meson-rng.c static int meson_rng_ofdata_to_platdata(struct udevice *dev) · line 98
Quoted 10 lines
drivers/rng/meson-rng.c +2
-1@@ -90,8 +90,9 @@ static int meson_rng_ofdata_to_platdata(struct udevice *dev)if (!pdata->base)return -ENODEV ; +/* Get optional "core" clock */ err =clk_get_by_name (dev,"core" , &pdata->clk); -if (err) +if (err && err != -ENODATA )return err;return 0 ;
Applied to u-boot-amlogic
Neil