| // SPDX-License-Identifier: GPL-2.0+ |
| * The 'kaslrseed' command takes bytes from the hardware random number |
| * generator and uses them to set the kaslr-seed value in the chosen node. |
| * Copyright (c) 2021, Chris Morgan <macromorgan@hotmail.com> |
| static int do_kaslr_seed(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
| int err = CMD_RET_SUCCESS; |
| printf("Notice: a /chosen/kaslr-seed is automatically added to the device-tree when booted via booti/bootm/bootz therefore using this command is likely no longer needed\n"); |
| printf("No FDT memory address configured. Please configure\n" |
| "the FDT address via \"fdt addr <address>\" command.\n" |
| if (fdt_kaslrseed(working_fdt, true) < 0) |
| return cmd_process_error(cmdtp, err); |
| U_BOOT_LONGHELP(kaslrseed, |
| " - append random bytes to chosen kaslr-seed node\n"); |
| kaslrseed, 1, 0, do_kaslr_seed, |
| "feed bytes from the hardware random number generator to the kaslr-seed", |