]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/of/fdt.c
Merge remote-tracking branch 'tty/tty-next'
[karo-tx-linux.git] / drivers / of / fdt.c
index 918809e6f9131d0584f352c4c43e86c9d58b29e4..d5fbca07620a398a600234e022ad040cffbdeaa9 100644 (file)
@@ -820,11 +820,14 @@ static int __init early_init_dt_scan_chosen_serial(void)
        q = strchrnul(p, ':');
        if (*q != '\0')
                options = q + 1;
+       l = q - p;
 
        /* Get the node specified by stdout-path */
-       offset = fdt_path_offset_namelen(fdt, p, q - p);
-       if (offset < 0)
-               return -ENODEV;
+       offset = fdt_path_offset_namelen(fdt, p, l);
+       if (offset < 0) {
+               pr_warn("earlycon: stdout-path %.*s not found\n", l, p);
+               return 0;
+       }
 
        for (match = __earlycon_table; match < __earlycon_table_end; match++) {
                if (!match->compatible[0])
@@ -971,13 +974,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
 }
 
 #ifdef CONFIG_HAVE_MEMBLOCK
+#ifndef MIN_MEMBLOCK_ADDR
+#define MIN_MEMBLOCK_ADDR      __pa(PAGE_OFFSET)
+#endif
 #ifndef MAX_MEMBLOCK_ADDR
 #define MAX_MEMBLOCK_ADDR      ((phys_addr_t)~0)
 #endif
 
 void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
 {
-       const u64 phys_offset = __pa(PAGE_OFFSET);
+       const u64 phys_offset = MIN_MEMBLOCK_ADDR;
 
        if (!PAGE_ALIGNED(base)) {
                if (size < PAGE_SIZE - (base & ~PAGE_MASK)) {