aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fdt/fdt_common.c
diff options
context:
space:
mode:
authorMichal Meloun <mmel@FreeBSD.org>2016-03-26 06:59:01 +0000
committerMichal Meloun <mmel@FreeBSD.org>2016-03-26 06:59:01 +0000
commite64c3743757545698b37676cbad1dadebbd23e7d (patch)
treea6a5e459414c790c7b66aa1d4806c607ddea9c73 /sys/dev/fdt/fdt_common.c
parentf5c06c61e4cfb0cb10e703a129725a6ddc418cf8 (diff)
downloadsrc-e64c3743757545698b37676cbad1dadebbd23e7d.tar.gz
src-e64c3743757545698b37676cbad1dadebbd23e7d.zip
ARM: Parse command line delivered by U-Boot:
- in atags - in DT blob (by using 'fdt chosen' U-Boot command) The command line must start with guard's string 'FreeBSD:' and can contain list of comma separated kenv strings. Also, boot modifier strings from boot.h are recognised and parsed into boothowto. The command line must be passed from U-Boot by setting of bootargs variable: 'setenv bootargs FreeBSD:boot_single=1,vfs.root.mountfrom=ufs:/dev/ada0s1a' followed by 'fdt chosen' (only for DT based boot)
Notes
Notes: svn path=/head/; revision=297286
Diffstat (limited to 'sys/dev/fdt/fdt_common.c')
-rw-r--r--sys/dev/fdt/fdt_common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c
index 6211aca7a01a..73f7ada5771e 100644
--- a/sys/dev/fdt/fdt_common.c
+++ b/sys/dev/fdt/fdt_common.c
@@ -722,3 +722,16 @@ fdt_get_unit(device_t dev)
return (strtol(name,NULL,0));
}
+
+int
+fdt_get_chosen_bootargs(char *bootargs, size_t max_size)
+{
+ phandle_t chosen;
+
+ chosen = OF_finddevice("/chosen");
+ if (chosen == -1)
+ return (ENXIO);
+ if (OF_getprop(chosen, "bootargs", bootargs, max_size) == -1)
+ return (ENXIO);
+ return (0);
+} \ No newline at end of file