Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154826474
D16101.id44770.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D16101.id44770.diff
View Options
Index: stand/uboot/fdt/uboot_fdt.c
===================================================================
--- stand/uboot/fdt/uboot_fdt.c
+++ stand/uboot/fdt/uboot_fdt.c
@@ -39,6 +39,30 @@
#define STR(number) #number
#define STRINGIFY(number) STR(number)
+static int
+fdt_platform_load_from_ubenv(const char *var)
+{
+ struct fdt_header *hdr;
+ const char *s;
+ char *p;
+
+ s = ub_env_get(var);
+ if (s == NULL || *s == '\0')
+ return (1);
+
+ hdr = (struct fdt_header *)strtoul(s, &p, 16);
+ if (*p != '\0')
+ return (1);
+
+ if (fdt_load_dtb_addr(hdr) == 0) {
+ printf("Using DTB provided by U-Boot at "
+ "address %p.\n", hdr);
+ return (0);
+ }
+
+ return (1);
+}
+
int
fdt_platform_load_dtb(void)
{
@@ -53,22 +77,12 @@
* variable for fdt data loaded into ram is fdt_addr_r, so try that
* first. Board vendors also use both fdtaddr and fdt_addr names.
*/
- s = ub_env_get("fdt_addr_r");
- if (s == NULL)
- s = ub_env_get("fdtaddr");
- if (s == NULL)
- s = ub_env_get("fdt_addr");
- if (s != NULL && *s != '\0') {
- hdr = (struct fdt_header *)strtoul(s, &p, 16);
- if (*p == '\0') {
- if (fdt_load_dtb_addr(hdr) == 0) {
- printf("Using DTB provided by U-Boot at "
- "address %p.\n", hdr);
- rv = 0;
- goto exit;
- }
- }
- }
+ if ((rv = fdt_platform_load_from_ubenv("fdt_addr_r")) == 0)
+ goto exit;
+ if ((rv = fdt_platform_load_from_ubenv("fdt_addr")) == 0)
+ goto exit;
+ if ((rv = fdt_platform_load_from_ubenv("fdtaddr")) == 0)
+ goto exit;
rv = 1;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 30, 1:15 PM (2 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32517521
Default Alt Text
D16101.id44770.diff (1 KB)
Attached To
Mode
D16101: loader: fdt: Try to load every possible DTB from u-boot
Attached
Detach File
Event Timeline
Log In to Comment