Re: [PATCH v2 1/2] efi_loader: fix set_capsule_result()

2021-06-30 Thread AKASHI Takahiro
NAK. On Wed, Jun 30, 2021 at 05:31:15PM +0200, Heinrich Schuchardt wrote: > The log category must be LOG_CATEGORY LOGC_EFI. > > efi_set_variable() should be called with EFI_CALL(). Use > efi_set_variable_int() instead. > > A log text "Updating ..." if SetVariable() fails does not make sense for

Re: [PATCH v2 1/2] efi_loader: fix set_capsule_result()

2021-06-30 Thread Heinrich Schuchardt
Am 1. Juli 2021 02:49:09 MESZ schrieb AKASHI Takahiro : >NAK. > >On Wed, Jun 30, 2021 at 05:31:15PM +0200, Heinrich Schuchardt wrote: >> The log category must be LOG_CATEGORY LOGC_EFI. >> >> efi_set_variable() should be called with EFI_CALL(). Use >> efi_set_variable_int() instead. >> >> A log t

Re: [PATCH v2 1/2] efi_loader: fix set_capsule_result()

2021-06-30 Thread AKASHI Takahiro
On Thu, Jul 01, 2021 at 03:20:48AM +0200, Heinrich Schuchardt wrote: > Am 1. Juli 2021 02:49:09 MESZ schrieb AKASHI Takahiro > : > >NAK. For example, > >On Wed, Jun 30, 2021 at 05:31:15PM +0200, Heinrich Schuchardt wrote: > >> The log category must be LOG_CATEGORY LOGC_EFI. This one above and

Suggestion: When flash is uninitialized, *silently* fall back to default environment

2021-06-30 Thread Zack Weinberg
Consider a boot ROM that looks for u-boot in several places (SPI flash, eMMC flash, etc) and loads the first one it finds, and then u-boot repeats the same search to find its own configuration. If there is _nothing_ on the SPI flash and u-boot and all its configuration is on the eMMC, this will wo

[PATCH 0/4] Zyxel NSA310S NAS : convert to Driver Model.

2021-06-30 Thread Tony Dinh
- Add device tree kirkwood-nsa310s.dts - Add DM_USB, DM_ETH, DM_SATA and associated configs to nsa310s_defconfig - Move some miscellaneous configs from board file to nsa310s_defconfig - Replace old device name "egiga0" with Ethernet PHY name from device tree kirkwood.dtsi - Removed IDE, and add S

[PATCH 1/4] NSA310S : Add device tree DTS for Zyxel NSA310S board

2021-06-30 Thread Tony Dinh
Add device tree kirkwood-nsa310s.dts for Zyxel NSA310S board to convert to Driver Model. Signed-off-by: Tony Dinh --- arch/arm/dts/Makefile | 1 + arch/arm/dts/kirkwood-nsa310s.dts | 318 ++ 2 files changed, 319 insertions(+) create mode 100644 arch/ar

[PATCH 2/4] NSA310S : Add DM USB, DM Ethernet, and DM SATA configs

2021-06-30 Thread Tony Dinh
Convert to Driver Model. - Add DM USB, DM Ethernet, and DM SATA configs to nsa310s_defconfig - Add CONFIG_DEFAULT_DEVICE_TREE to nsa310s_defconfig - Move CONFIG_ENV_SECT_SIZE from board file to nsa310s_defconfig - Add CONFIG_IDENT_STRING, and CONFIG_NET_RANDOM_ETHADDR to nsa310s_defconfig Signed-

[PATCH 3/4] NSA310S : Use Ethernet PHY name from device tree

2021-06-30 Thread Tony Dinh
In DM Ethernet, the old "egiga0" name is no longer valid, so replace it with Ethernet PHY name from device tree. Signed-off-by: Tony Dinh --- board/zyxel/nsa310s/nsa310s.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/board/zyxel/nsa310s/nsa310s.c b/board/z

[PATCH 4/4] NSA310S : Add DM SATA configs

2021-06-30 Thread Tony Dinh
Enable DM SATA, removed IDE driver, and add SATA MV driver. Signed-off-by: Tony Dinh --- include/configs/nsa310s.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/configs/nsa310s.h b/include/configs/nsa310s.h index e38c65a485..94f293de90 100644 --- a/include

[PATCH v11 0/2] Add OpenPiton-riscv64 Board Support

2021-06-30 Thread Tianrui Wei
This patch set is to add OpenPiton board support. Patches are split into several parts: - [PATCH 1/2] add OpenPiton support to mmc driver - [PATCH 2/2] add support for OpenPiton board Description - for mmc driver, it's settings are automatically configured at hardware level. We only need to ex

[PATCH v11 2/2] mmc: openpiton: add piton_mmc driver

2021-06-30 Thread Tianrui Wei
This commit adds support to piton_mmc driver for OpenPiton-riscv64 This driver has many things set as preconfigured because the hardware automatically configures most of the settings during startup. Signed-off-by: Tianrui Wei Signed-off-by: Jonathan Balkind Reviewed-by: Jaehoon Chung --- drive

[PATCH v11 1/2] board: riscv: add openpiton-riscv64 SoC support

2021-06-30 Thread Tianrui Wei
This patch adds openpiton-riscv64 SOC support. In particular, this board supports a standard bootflow through zsbl->u-boot SPL-> opensbi->u-boot proper->Linux. There are separate defconfigs for building u-boot SPL and u-boot proper Signed-off-by: Tianrui Wei Signed-off-by: Jonathan Balkind Revie

[RFC PATCH 00/28] cli: Add a new shell

2021-06-30 Thread Sean Anderson
Well, this has been sitting on my hard drive for too long without feedback ("Release early, release often"), so here's the first RFC. This is not ready to merge (see the "Future work" section below), but the shell is functional and at least partially tested. The goal is to have 0 bytes gained over

[RFC PATCH 03/28] cli: lil: Replace strclone with strdup

2021-06-30 Thread Sean Anderson
Apparently strdup is not portable, so LIL used its own. Use strdup. Signed-off-by: Sean Anderson --- common/cli_lil.c | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/common/cli_lil.c b/common/cli_lil.c index c8c6986fe1..294d79e86e 100644 --- a/co

[RFC PATCH 01/28] Add Zlib License

2021-06-30 Thread Sean Anderson
This adds the Zlib License which is compatible with GPLv2 as long as its terms are met. Files originally licensed as Zlib should use the "GPL-2.0+ AND Zlib" SPDX identifier. Signed-off-by: Sean Anderson --- Licenses/README | 1 + Licenses/zlib.txt | 14 ++ 2 files changed, 15 ins

[RFC PATCH 04/28] cli: lil: Remove most functions by default

2021-06-30 Thread Sean Anderson
This helps reduce the size impact of LIL to approximately that of hush. The builtin functions have been chosen to roughly match the functionality present in hush. In addition, arithmetic is removed from expr to reduce size further. Signed-off-by: Sean Anderson --- cmd/Kconfig | 10 ++

[RFC PATCH 06/28] cli: lil: Convert some defines to enums

2021-06-30 Thread Sean Anderson
This converts some defines to enums. This allows them to be documented more easily, and helps the compiler give better errors for switch statements. Signed-off-by: Sean Anderson --- common/cli_lil.c | 44 +++- include/cli_lil.h | 12 +++- 2 files

[RFC PATCH 05/28] cli: lil: Rename some functions to be more like TCL

2021-06-30 Thread Sean Anderson
Several functions have different names than they do in TCL. To make things easier for those familiar with TCL, rename them to their TCL equivalents. At the moment, this is only done for functions not used by LIL_FULL. Some functions need more substantive work to conform them to TCL. For example, in

[RFC PATCH 02/28] cli: Add LIL shell

2021-06-30 Thread Sean Anderson
This is the LIL programming language [1] as originally written by Kostas Michalopoulos . LIL is a stripped-down TCL variant. Many syntax features are very similar to shell: => echo Hello from $stdout Hello from serial,vidconsole LIL supports functions, scoped variables, and comman

[RFC PATCH 07/28] cli: lil: Simplify callbacks

2021-06-30 Thread Sean Anderson
We only need the getvar and setvar callbacks for now (to integrate with the environment). So remove all the other callbacks. Instead of allowing callbacks to be set at any time, just set them once in lil_new. Lastly, get rid of the typedefs and use a struct to pass in the callbacks instead. Signed

[RFC PATCH 08/28] cli: lil: Handle commands with dots

2021-06-30 Thread Sean Anderson
Some commands (such as md, mw, etc) use dot suffixes as options to the command. Therefore, we must ignore anything after a dot when finding commands. Signed-off-by: Sean Anderson --- common/cli_lil.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/cli_lil

[RFC PATCH 10/28] cli: lil: Add printf-style format helper for errors

2021-06-30 Thread Sean Anderson
This adds a helper for dynamically-created error messages. Signed-off-by: Sean Anderson --- common/cli_lil.c | 43 --- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/common/cli_lil.c b/common/cli_lil.c index 1bdf0e5265..f29c8065d8 100644

[RFC PATCH 09/28] cli: lil: Use error codes

2021-06-30 Thread Sean Anderson
This adds numeric error codes to be used for errors. This makes it easier for code to differentiate between different classes of errors. Some error codes are not used yet, and will be added in future commits. The position argument has been removed for a few reasons: - It doesn't make sense for som

[RFC PATCH 13/28] cli: lil: Wire up LIL to the rest of U-Boot

2021-06-30 Thread Sean Anderson
This sets the shell to LIL when CONFIG_LIL is enabled. Repeated commands are not supporteed. Neither are partial commands a la Hush's secondary prompt. Setting and getting environmental variables is done through callbacks to assist with testing. Signed-off-by: Sean Anderson --- cmd/Kconfig

[RFC PATCH 14/28] cli: lil: Document structures

2021-06-30 Thread Sean Anderson
This documents the major structures of LIL. Signed-off-by: Sean Anderson --- common/cli_lil.c | 100 ++ include/cli_lil.h | 57 ++ 2 files changed, 157 insertions(+) diff --git a/common/cli_lil.c b/common/cli_lil.c index 66e

[RFC PATCH 15/28] cli: lil: Convert LIL_ENABLE_POOLS to Kconfig

2021-06-30 Thread Sean Anderson
This adds a Kconfig option to enable memory pools for some commonly-created and destroyed LIL structures. There is still some significant code duplication, so perhaps these functions can be refactored further to all use common pool functions. Signed-off-by: Sean Anderson --- cmd/Kconfig |

[RFC PATCH 16/28] cli: lil: Convert LIL_ENABLE_RECLIMIT to KConfig

2021-06-30 Thread Sean Anderson
This adds a configuration option to set the recursion limit. I've set it to a (conservative) 1000 by default. In addition, there is an option to turn it off for a very minor space savings and performance increase. Signed-off-by: Sean Anderson --- Do we need this? Perhaps it should default to 0.

[RFC PATCH 12/28] cli: lil: Check for ctrl-c

2021-06-30 Thread Sean Anderson
Check for ctrl-c in lil_parse. This works out to around every time a function or command is called. We also check at the beginning of lil_eval_expr so that constructs like while {1} {} get interrupted. Since there are no non-trivial commands in that example, lil_parse never gets to its ct

[RFC PATCH 11/28] cli: lil: Add several helper functions for errors

2021-06-30 Thread Sean Anderson
This adds several helper functions for common error types. This helps keep down code duplication, and also ensures that each of these errors uses the same message. Signed-off-by: Sean Anderson --- common/cli_lil.c | 38 +- 1 file changed, 33 insertions(+), 5

[RFC PATCH 17/28] test: Add tests for LIL

2021-06-30 Thread Sean Anderson
This tests several aspects of the parser. These tests are primarily adapted from the *.lil code examples included with upstream LIL. These tests should probably get their own category, especially if I add additional styles of tests. Signed-off-by: Sean Anderson --- Yes, I know checkpatch complain

[RFC PATCH 18/28] cli: lil: Remove duplicate function bodies

2021-06-30 Thread Sean Anderson
lil_append_val is just lil_append_string with the string and length taken from a struct lil_value. Use lil_append_stringh_len to implement both. Do the same for lil_clone_value. Signed-off-by: Sean Anderson --- common/cli_lil.c | 51 ++-- 1 file chang

[RFC PATCH 20/28] cli: lil: Add config to enable debug output

2021-06-30 Thread Sean Anderson
This provides an easy way to enable assertions and debug messages. It will also be used to enable tracing features in future patches. Signed-off-by: Sean Anderson --- cmd/Kconfig | 6 ++ common/Makefile | 3 +++ 2 files changed, 9 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig in

[RFC PATCH 19/28] cli: lil: Add "symbol" structure

2021-06-30 Thread Sean Anderson
We need a generic structure to hold symbols parsed by the parser. We would also like to re-use existing code as much as possible without rewriting everything. To do this, we hijack the allocators for lil_list and lil_value and have them allocate enough space for a lil_symbol. While we're at it, we

[RFC PATCH 22/28] env: Add a priv pointer to hwalk_r

2021-06-30 Thread Sean Anderson
This allows callers of hwalk_r to pass data to their callback. This mirrors e.g. env_attr_walk. Signed-off-by: Sean Anderson --- cmd/nvedit.c | 8 env/callback.c | 4 ++-- env/flags.c | 4 ++-- include/search.h | 2 +- lib/hashtable.c | 5 +++-- 5 files changed, 12 insertio

[RFC PATCH 21/28] cli: lil: Add a distinct parsing step

2021-06-30 Thread Sean Anderson
This adds a parser to LIL (as separate from the interpreter). This is necessary to detect syntax errors before evaluating anything. Before this, running a script like echo some message; echo syntax error} would result in "some message" being printed before the error was discovered. This i

[RFC PATCH 23/28] cli: lil: Handle OOM for hm_put

2021-06-30 Thread Sean Anderson
hm_put allocates memory, and this can fail. Instead of failing silently, return an error code. This also fixes up callers to handle this error. Signed-off-by: Sean Anderson --- common/cli_lil.c | 47 --- 1 file changed, 32 insertions(+), 15 deletions(

[RFC PATCH 24/28] cli: lil: Make proc always take 3 arguments

2021-06-30 Thread Sean Anderson
This rewrites proc to always take 3 arguments. It also adds proper error handling. TCL does not allow for anonymous functions to be created with proc. Allowing for a variable number of arguments makes the code much more complex when adding error handling. Since fnc_proc was the last user of lil_un

[RFC PATCH 25/28] cli: lil: Always quote items in lil_list_to_value

2021-06-30 Thread Sean Anderson
This function took an argument do_quote which determined whether or not to quote an item. All callers set it to true, so remove it and always quote. Signed-off-by: Sean Anderson --- common/cli_lil.c | 34 ++ include/cli_lil.h | 2 +- 2 files changed, 15 inserti

[RFC PATCH 28/28] cli: lil: Load procs from the environment

2021-06-30 Thread Sean Anderson
When we start up the LIL interpreter, go through every variable and see if it looks like a new procedure. If it does, try and parse it. For the return trip, every time that we create a new procedure, create a new global variable containing that procedure. The end result of this is that procedures

[RFC PATCH 26/28] cli: lil: Allocate len even when str is NULL in alloc_value_len

2021-06-30 Thread Sean Anderson
This allows us to reserve some space ahead of time, avoiding another alloc/copy/free. Signed-off-by: Sean Anderson --- common/cli_lil.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/common/cli_lil.c b/common/cli_lil.c index 153c34791b..42659920b5 100644 ---

[RFC PATCH 27/28] cli: lil: Add a function to quote values

2021-06-30 Thread Sean Anderson
This allows us to convert lil_values into a form which can be re-parsed. We were already doing this for lists, so we just have to expose the inner loop. Signed-off-by: Sean Anderson --- common/cli_lil.c | 89 1 file changed, 52 insertions(+), 37

<    1   2