aboutsummaryrefslogtreecommitdiff
path: root/include/bootflow.h
diff options
context:
space:
mode:
authorSimon Glass2023-07-12 09:04:42 -0600
committerBin Meng2023-07-17 13:38:35 +0800
commit33ebcb468109c40ef0dce262be00a4c161265b90 (patch)
tree7d2a0d0fd11a2d8c9329d2e83fb3f76ed8a39600 /include/bootflow.h
parent63b7ccbf9ffe9e79a6762a94eec74c8159f11a14 (diff)
bootstd: Support automatically setting Linux parameters
Some Linux parameters can be set automatically by U-Boot, if it knows the device being used. For example, since U-Boot knows the serial console being used, it can add parameters for earlycon and console. Add support for this. Note that this is an experimental feature and we will see how useful it turns out to be. It is very handy for ChromeOS, since otherwise it is very difficult to manually determine the UART address or port number, particularly in a script. Provide an example of how this is used with ChromeOS. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/bootflow.h')
-rw-r--r--include/bootflow.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/bootflow.h b/include/bootflow.h
index 7a8595f3dfc..4152577afb7 100644
--- a/include/bootflow.h
+++ b/include/bootflow.h
@@ -526,4 +526,16 @@ int cmdline_get_arg(const char *cmdline, const char *arg, int *posp);
int bootflow_cmdline_get_arg(struct bootflow *bflow, const char *arg,
const char **val);
+/**
+ * bootflow_cmdline_auto() - Automatically set a value for a known argument
+ *
+ * This handles a small number of known arguments, for Linux in particular. It
+ * adds suitable kernel parameters automatically, e.g. to enable the console.
+ *
+ * @bflow: Bootflow to update
+ * @arg: Name of argument to set (e.g. "earlycon" or "console")
+ * Return: 0 if OK -ve on error
+ */
+int bootflow_cmdline_auto(struct bootflow *bflow, const char *arg);
+
#endif