summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-28test: hush: Fix instructions list tests for modern hushFrancis Laniel
Modifies the expected result for modern hush. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As modern hush is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Francis Laniel <[email protected]>
2023-12-28cli: add modern hush as parser for run_command*()Francis Laniel
Enables using, in code, modern hush as parser for run_command function family. It also enables the command run to be used by CLI user of modern hush. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Francis Laniel <[email protected]>
2023-12-28cli: hush_modern: Add functions to be called from run_command()Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to modern hush. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28cli: hush_modern: Enable variables expansion for modern hushFrancis Laniel
Enables variables expansion for modern hush, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28cli: Enables using modern hush parser as command line parserFrancis Laniel
If one defines HUSH_MODERN_PARSER, it is then possible to use modern parser with: => cli get old => cli set modern => cli get modern Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Francis Laniel <[email protected]>
2023-12-28cmd: Add new cli commandFrancis Laniel
This command can be used to print the current parser with 'cli get'. It can also be used to set the current parser with 'cli set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel <[email protected]>
2023-12-28global_data.h: add GD_FLG_HUSH_OLD_PARSER flagFrancis Laniel
This flag is used to indicate we are using the hush parser. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Francis Laniel <[email protected]>
2023-12-28cli: Add menu for hush parserFrancis Laniel
For the moment, the menu contains only entry: HUSH_OLD_PARSER which is the default. The goal is to prepare the field to add a new hush parser which guarantees actual behavior is still correct. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Francis Laniel <[email protected]>
2023-12-28cli: Port upstream Busybox hush to U-BootFrancis Laniel
Adds new file cli_hush_upstream.c, it is a copy of Busybox hush file as it was of time to commit 37460f5da. This commit modifies Busybox hush to not compile some part specific to Busybox and adds some code needed by U-Boot. The modifications consists mainly on adding code #if(n)def guards. For the moment, this refurbished flavor of hush only permits running command without any keywords (i.e., if and for are not recognized) or variable expansion (i.e., echo $foo prints foo and not value stored in variable foo). A new file was also added to define some functions specific to U-Boot. Signed-off-by: Francis Laniel <[email protected]> Signed-off-by: Harald Seiler <[email protected]>
2023-12-28cli: Add Busybox upstream hush.c fileFrancis Laniel
This commit adds new file cli_hush_upstream.c, it is a copy of Busybox hush file it was of time to Busybox commit 37460f5da. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28test: hush: Test hush loopsFrancis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28test: hush: Test hush commands listFrancis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28test: hush: Test hush variable expansionFrancis Laniel
Verifies shell variables are replaced by their values. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Francis Laniel <[email protected]>
2023-12-28test/py: hush_if_test: Remove the test fileFrancis Laniel
5804ebfeb1ce ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28test: hush: Test hush if/elseFrancis Laniel
As asked in commit 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28test: Add framework to test hush behaviorFrancis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-28Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv ↵Tom Rini
into next - Andes: Enable Andes CPU memboost and ECC feature by default - Sifive: Add private L2 cache driver
2023-12-27andes: ae350: Enable MISC_INIT_R for ae350 platformLeo Yu-Chi Liang
Enable MISC_INIT_R for ae350 to support CPU name detection and re-sync the configs via make savedefconfig. Signed-off-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]>
2023-12-27andes: ae350: Save cpu name to envLeo Yu-Chi Liang
Detect CPU name through marchid and then save it to env. Signed-off-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]>
2023-12-27andes: cpu: Enable cache and TLB ECC supportLeo Yu-Chi Liang
Andes CPU supports cache and TLB ECC. Enable them by default. Signed-off-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]>
2023-12-27andes: cpu: Enable memboost featureLeo Yu-Chi Liang
Andes CPU has memboost feature including prefetch, write-around and non-blocking load. Enable them by default. Signed-off-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]>
2023-12-27andes: ae350: Implement cache switch via KconfigLeo Yu-Chi Liang
Kconfig provides SYS_[I|D]CACHE_OFF config options to switch off caches. Provide the corresponding implementation to the options. Signed-off-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]>
2023-12-27andes: csr.h: Clean up CSR definitionLeo Yu-Chi Liang
Signed-off-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]>
2023-12-27riscv: Extend board compatible string with "qemu,mbv"Michal Simek
Extend compatible string to match the latest change in dt binding. Fixes: 7576ab2facae ("riscv: Add support for AMD/Xilinx MicroBlaze V") Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2023-12-27riscv: cache: support cache enable in SPL stageZong Li
The power gating feature of pl2 should be enabled as early as possible, it would be better to put it in SPL stage. Signed-off-by: Zong Li <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2023-12-27cache: add sifive private L2 cache driverZong Li
This driver is currently responsible for enabling the clock gating feature of SiFive pre core's private L2 cache. Signed-off-by: Zong Li <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2023-12-26arm: apple: Disable SMBIOS againMark Kettenis
Apple machines do not have memory below 4G. Since U-Boot does not support the SMBIOS 3 header structures this means we can't support SMBIOS on these machines. Unfortunately the refactoring of the SMBIOS code this cycle accidentally enabled it again. Fixes: 53fab13a7b1 ("efi: Use the installed SMBIOS tables") Signed-off-by: Mark Kettenis <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-26spi: npcm_pspi: Fix the wrong clock divider calculationJim Liu
Fix the wrong clock divider calculation. Signed-off-by: Jim Liu <[email protected]>
2023-12-22bootmeth: pass size to efi_binary_run()Heinrich Schuchardt
If we call efi_binary_run() with size parameter set to zero, we get an error Not a PE-COFF file Fill the missing value. Fixes: 1373ffde52e1 ("Merge tag 'v2024.01-rc5' into next") Fixes: 7017fc54a5bc ("bootmeth: use efi_loader interfaces instead of bootefi command") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2023-12-21Merge patch series "Complete decoupling of bootm logic from commands"Tom Rini
Simon Glass <[email protected]> says: This series continues refactoring the bootm code to allow it to be used with CONFIG_COMMAND disabled. The OS-handling code is refactored and a new bootm_run() function is created to run through the bootm stages. This completes the work. A booti_go() function is created also, in case it proves useful, but at last for now standard boot does not use this. This is cmdd (part d of CMDLINE refactoring) It depends on dm/bootstda-working which depends on dm/cmdc-working
2023-12-21bootm: Create a new boot_run() function to handle bootingSimon Glass
Create a common function used by the three existing bootz/i/m_run() functions, to reduce duplicated code. Signed-off-by: Simon Glass <[email protected]> Suggested-by: Tom Rini <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Create a function to run through the booti statesSimon Glass
In a few places, the booti command is used to handle a boot. We want these to be done without needing CONFIG_CMDLINE, so add a new booti_run() function to handle this. So far this is not used. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21stm32: Use bootm_run() and bootz_run()Simon Glass
Use the new bootm/z_run() functions to avoid having to create an argument list for the stm32prog code. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2023-12-21bootm: Create a function to run through the bootz statesSimon Glass
In a few places, the bootz command is used to handle a boot. We want these to be done without needing CONFIG_CMDLINE, so add a new bootz_run() function to handle this. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21stm32: Use local vars in stm32prog for initrd and fdtSimon Glass
Rather than assigning to the bootm_argv[] array multiple times, use local variables for the two things that can change and assign them at the end. This makes it easier to drop the array eventually. Tidu up an overly short line while we are here. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2023-12-21bootm: Create a function to run through the bootm statesSimon Glass
In quite a few places, the bootm command is used to handle a boot. We want these to be done without needing CONFIG_CMDLINE, so add a new bootm_run() function to handle this. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Tidy up boot_selected_os()Simon Glass
Use struct bootm_info with this function, to avoiding needing to create a new one. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Rename do_bootm_states() to bootm_run_states()Simon Glass
Rename the function to bootm_run_states() to better indicate ts purpose. The 'do_' prefix is used to indicate a command processor, which this is now not. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Drop arguments from do_bootm_states()Simon Glass
Use the bootm_info struct to hold the information required by bootm. Now that none of the functions called from do_bootm_states() needs an argv[] list, change the arguments of do_bootm_states() as well. Take care to use the same value for boot_progress even though it is a little inconsistent. For booti make sure it only uses argv[] and argc at the top of the function, so we can eventually refactor to remove these parameters. With bootm, some OSes need access to the arguments provided to the command, so set these up in the bootm_info struct, for bootm only. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootz: Avoid use of #ifdefSimon Glass
Use the compiler to get the set of states, instead of the preprocessor. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21booti: Avoid use of #ifdefSimon Glass
Use the compiler to get the set of states, instead of the preprocessor. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Move do_bootm_states() comment to header fileSimon Glass
This is an exported function, so move the function comment to the bootm.h header file. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Add more fields to bootm_infoSimon Glass
Add fields for the three bootm parameters and other things needed for booting. Also add a helper to set up the struct correctly. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Adjust arguments of boot_os_fnSimon Glass
Adjust boot_os_fn to use struct bootm_info instead of the separate argc, argv and image parameters. Update the handlers accordingly. Few of the functions make use of the arguments, so this improves code size slightly. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Create a struct for argument informationSimon Glass
Some OS functions require the arguments to the 'bootm' command. This is inconvenient for two reasons. Firstly, there may not be any actual command, if CMDLINE is not enabled and programmatic boot is being used. Secondly, most functions don't require the arguments, so it is inefficient to pass them when not needed. For example it increases code size. Create a new struct which holds the arguments, which can be used if needed. Add the images pointer as well, since this is commonly needed. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21sandbox: bootm: Enable more bootm OS methodsSimon Glass
It is useful for sandbox to build as much code as possible. Enable support for booting various other operating systems. Add the missing cache functions. These operating systems do not actually boot on sandbox, of course. Signed-off-by: Simon Glass <[email protected]>
2023-12-21bootm: Adjust how the board is resetSimon Glass
Use reset_cpu() to reset the board, copying the logic from the 'reset' command. This makes more sense than directly calling the do_reset() function with the arguments passsed to the bootm command. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-12-21riscv: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. Adjust do_reset() to call it. Note that reset_cpu() is normally provided by SYSRESET so make this declaration conditional on that being disabled. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Chanho Park <[email protected]> Tested-by: Chanho Park <[email protected]>
2023-12-21nios2: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. Signed-off-by: Simon Glass <[email protected]>
2023-12-21ppc: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. This is only needed if CONFIG_SYSRESET is disabled. Since there are lots of reset functions, this one actually just calls do_reset(). Future refactoring could correct this. Signed-off-by: Simon Glass <[email protected]>