Skip to content

Commit

Permalink
Add kASLR for rk3399 u-boot (#4311)
Browse files Browse the repository at this point in the history
* Add rk3399's rng to u-boot.

* Add kASLR support to the NanoPi R4S' u-boot.

* Fix rng for rk3399.

The manual clocks screw it up, so remove those.
  • Loading branch information
Manouchehri committed Oct 26, 2022
1 parent 420c118 commit 0d67456
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
11 changes: 11 additions & 0 deletions patch/u-boot/u-boot-rockchip64/rk3399-rp64-kaslr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
index 65423202..ca8955f8 100644
--- a/configs/nanopi-r4s-rk3399_defconfig
+++ b/configs/nanopi-r4s-rk3399_defconfig
@@ -63,3 +63,6 @@ CONFIG_VIDEO_ROCKCHIP=y
CONFIG_DISPLAY_ROCKCHIP_HDMI=y
CONFIG_SPL_TINY_MEMSET=y
CONFIG_ERRNO_STR=y
+CONFIG_DM_RNG=y
+CONFIG_CMD_KASLRSEED=y
+CONFIG_RNG_ROCKCHIP=y
28 changes: 12 additions & 16 deletions patch/u-boot/u-boot-rockchip64/rk3399-rp64-rng.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
diff --git a/arch/arm/dts/rk3399.dtsi b/arch/arm/dts/rk3399.dtsi
index 3871c7fd..5518b765 100644
index 3871c7fd..fda51508 100644
--- a/arch/arm/dts/rk3399.dtsi
+++ b/arch/arm/dts/rk3399.dtsi
@@ -1937,6 +1937,16 @@
};
};
@@ -1937,6 +1937,12 @@
};
};

+ rng: rng@ff8b8000 {
+ compatible = "rockchip,cryptov1-rng";
+ reg = <0x0 0xff8b8000 0x0 0x1000>;
+ clocks = <&cru SCLK_CRYPTO1>, <&cru HCLK_S_CRYPTO1>;
+ clock-names = "clk_crypto", "hclk_crypto";
+ assigned-clocks = <&cru SCLK_CRYPTO1>, <&cru HCLK_S_CRYPTO1>;
+ assigned-clock-rates = <150000000>, <100000000>;
+ status = "okay";
+ };
+ rng: rng@ff8b8000 {
+ compatible = "rockchip,cryptov1-rng";
+ reg = <0x0 0xff8b8000 0x0 0x1000>;
+ status = "okay";
+ };
+
gpu: gpu@ff9a0000 {
compatible = "rockchip,rk3399-mali", "arm,mali-t860";
reg = <0x0 0xff9a0000 0x0 0x10000>;
gpu: gpu@ff9a0000 {
compatible = "rockchip,rk3399-mali", "arm,mali-t860";
reg = <0x0 0xff9a0000 0x0 0x10000>;

0 comments on commit 0d67456

Please sign in to comment.