use movsl for copying resume memory back
[coreboot.git] / src / boot / selfboot.c
index c45fa636522bf6c1085bfc8096a249b02f07a79b..3c310234cb48ff312dab512892b49630d6acfff7 100644 (file)
@@ -29,6 +29,9 @@
 #include <string.h>
 #include <cbfs.h>
 #include <lib.h>
+#if CONFIG_COLLECT_TIMESTAMPS
+#include <timestamp.h>
+#endif
 
 /* Maximum physical address we can use for the coreboot bounce buffer. */
 #ifndef MAX_ADDR
@@ -146,6 +149,11 @@ static int valid_area(struct lb_memory *mem, unsigned long buffer,
                }
        }
        if (i == mem_entries) {
+               if (start < (1024*1024) && end <=(1024*1024)) {
+                       printk(BIOS_DEBUG, "Payload (probably SeaBIOS) loaded"
+                               " into a reserved area in the lower 1MB\n");
+                       return 1;
+               }
                printk(BIOS_ERR, "No matching ram area found for range:\n");
                printk(BIOS_ERR, "  [0x%016lx, 0x%016lx)\n", start, end);
                printk(BIOS_ERR, "Ram areas\n");
@@ -507,11 +515,15 @@ static int selfboot(struct lb_memory *mem, struct cbfs_payload *payload)
        printk(BIOS_DEBUG, "Jumping to boot code at %x\n", entry);
        post_code(POST_ENTER_ELF_BOOT);
 
+#if CONFIG_COLLECT_TIMESTAMPS
+       timestamp_add_now(TS_SELFBOOT_JUMP);
+#endif
+
        /* Jump to kernel */
        jmp_to_elf_entry((void*)entry, bounce_buffer, bounce_size);
        return 1;
 
- out:
+out:
        return 0;
 }