681ec90f1cec6a5197e06ca7c0ac7752b5b5ace5
[openwrt/staging/jow.git] /
1 Index: uboot-layerscape-lf-6.1.1-1.0.0/arch/arm/cpu/armv8/sec_firmware.c
2 ===================================================================
3 --- uboot-layerscape-lf-6.1.1-1.0.0.orig/arch/arm/cpu/armv8/sec_firmware.c
4 +++ uboot-layerscape-lf-6.1.1-1.0.0/arch/arm/cpu/armv8/sec_firmware.c
5 @@ -473,12 +473,6 @@ int fdt_fixup_kaslr(void *fdt)
6 return 0;
7 }
8
9 - ret = sec_firmware_get_random(rand, 8);
10 - if (ret < 0) {
11 - printf("WARNING: No random number to set kaslr-seed\n");
12 - return 0;
13 - }
14 -
15 err = fdt_check_header(fdt);
16 if (err < 0) {
17 printf("fdt_chosen: %s\n", fdt_strerror(err));
18 @@ -490,6 +484,15 @@ int fdt_fixup_kaslr(void *fdt)
19 if (nodeoffset < 0)
20 return 0;
21
22 + if (fdt_find_or_add_subnode(fdt, nodeoffset, "kaslr-seed"))
23 + return 0;
24 +
25 + ret = sec_firmware_get_random(rand, 8);
26 + if (ret < 0) {
27 + printf("WARNING: No random number to set kaslr-seed\n");
28 + return 0;
29 + }
30 +
31 err = fdt_setprop(fdt, nodeoffset, "kaslr-seed", rand,
32 sizeof(rand));
33 if (err < 0) {