Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137799269
D13993.id38558.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D13993.id38558.diff
View Options
Index: head/stand/efi/fdt/efi_fdt.c
===================================================================
--- head/stand/efi/fdt/efi_fdt.c
+++ head/stand/efi/fdt/efi_fdt.c
@@ -53,12 +53,7 @@
return (1);
printf("Using DTB provided by EFI at %p.\n", hdr);
- s = getenv("fdt_overlays");
- if (s != NULL && *s != '\0') {
- printf("Loading DTB overlays: '%s'\n", s);
- fdt_load_dtb_overlays(s);
- }
-
+ fdt_load_dtb_overlays(NULL);
return (0);
}
Index: head/stand/fdt/fdt_loader_cmd.c
===================================================================
--- head/stand/fdt/fdt_loader_cmd.c
+++ head/stand/fdt/fdt_loader_cmd.c
@@ -76,6 +76,7 @@
static void fdt_print_overlay_load_error(int err, const char *filename);
static int fdt_cmd_nyi(int argc, char *argv[]);
+static int fdt_load_dtb_overlays_string(const char * filenames);
static int fdt_cmd_addr(int argc, char *argv[]);
static int fdt_cmd_mkprop(int argc, char *argv[]);
@@ -331,15 +332,15 @@
}
}
-int
-fdt_load_dtb_overlays(const char * filenames)
+static int
+fdt_load_dtb_overlays_string(const char * filenames)
{
char *names;
char *name, *name_ext;
char *comaptr;
int err, namesz;
- debugf("fdt_load_dtb_overlay(%s)\n", filenames);
+ debugf("fdt_load_dtb_overlays_string(%s)\n", filenames);
names = strdup(filenames);
if (names == NULL)
@@ -829,6 +830,25 @@
strlen((char *)&tmp) + 1);
fdt_setprop(fdtp, no, "stdin", &tmp,
strlen((char *)&tmp) + 1);
+ }
+}
+
+void
+fdt_load_dtb_overlays(const char *extras)
+{
+ const char *s;
+
+ /* Any extra overlays supplied by pre-loader environment */
+ if (extras != NULL && *extras != '\0') {
+ printf("Loading DTB overlays: '%s'\n", extras);
+ fdt_load_dtb_overlays_string(extras);
+ }
+
+ /* Any overlays supplied by loader environment */
+ s = getenv("fdt_overlays");
+ if (s != NULL && *s != '\0') {
+ printf("Loading DTB overlays: '%s'\n", s);
+ fdt_load_dtb_overlays_string(s);
}
}
Index: head/stand/fdt/fdt_platform.h
===================================================================
--- head/stand/fdt/fdt_platform.h
+++ head/stand/fdt/fdt_platform.h
@@ -46,7 +46,7 @@
void fdt_apply_overlays(void);
int fdt_load_dtb_addr(struct fdt_header *);
int fdt_load_dtb_file(const char *);
-int fdt_load_dtb_overlays(const char *);
+void fdt_load_dtb_overlays(const char *);
int fdt_setup_fdtp(void);
/* The platform library needs to implement these functions */
Index: head/stand/uboot/fdt/uboot_fdt.c
===================================================================
--- head/stand/uboot/fdt/uboot_fdt.c
+++ head/stand/uboot/fdt/uboot_fdt.c
@@ -89,16 +89,8 @@
}
exit:
- if (rv == 0) {
- s = getenv("fdt_overlays");
- if (s == NULL)
- s = ub_env_get("fdt_overlays");
- if (s != NULL && *s != '\0') {
- printf("Loading DTB overlays: '%s'\n", s);
- fdt_load_dtb_overlays(s);
- }
- }
-
+ if (rv == 0)
+ fdt_load_dtb_overlays(ub_env_get("fdt_overlays"));
return (rv);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 26, 10:24 PM (3 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26233000
Default Alt Text
D13993.id38558.diff (2 KB)
Attached To
Mode
D13993: stand/fdt: Consolidate overlay handling a little further
Attached
Detach File
Event Timeline
Log In to Comment