2 moved from nrv2v.c and some lines from crt0.S
3 2006/05/02 - stepan: move nrv2b to an extra file.
5 static inline void print_debug_cp_run(const char *strval, uint32_t val)
7 #if CONFIG_USE_PRINTK_IN_CAR
8 printk_debug("%s%08x\r\n", strval, val);
10 print_debug(strval); print_debug_hex32(val); print_debug("\r\n");
17 #include "lib/nrv2b.c"
21 static void copy_and_run(void)
24 unsigned long ilen, olen;
26 print_debug("Copying coreboot to RAM.\r\n");
34 : "=a" (src), "=b" (dst), "=c" (olen)
36 memcpy(dst, src, olen);
42 : "=a" (src) , "=b" (dst)
45 print_debug_cp_run("src=",(uint32_t)src);
46 print_debug_cp_run("dst=",(uint32_t)dst);
48 // dump_mem(src, src+0x100);
50 olen = unrv2b(src, dst, &ilen);
51 print_debug_cp_run("linxbios_ram.nrv2b length = ", ilen);
54 // dump_mem(dst, dst+0x100);
56 print_debug_cp_run("linxbios_ram.bin length = ", olen);
58 print_debug("Jumping to coreboot.\r\n");
61 "xorl %ebp, %ebp\n\t" /* cpu_reset for hardwaremain dummy */
63 "leal _iseg, %edi\n\t"
69 #if CONFIG_AP_CODE_IN_CAR == 1
71 static void copy_and_run_ap_code_in_car(unsigned ret_addr)
74 unsigned long ilen, olen;
76 // print_debug("Copying coreboot AP code to CAR.\r\n");
80 "leal _liseg_apc, %0\n\t"
81 "leal _iseg_apc, %1\n\t"
82 "leal _eiseg_apc, %2\n\t"
84 : "=a" (src), "=b" (dst), "=c" (olen)
86 memcpy(dst, src, olen);
90 "leal _liseg_apc, %0\n\t"
91 "leal _iseg_apc, %1\n\t"
92 : "=a" (src) , "=b" (dst)
95 // print_debug_cp_run("src=",(uint32_t)src);
96 // print_debug_cp_run("dst=",(uint32_t)dst);
98 // dump_mem(src, src+0x100);
100 olen = unrv2b(src, dst, &ilen);
101 // print_debug_cp_run("linxbios_apc.nrv2b length = ", ilen);
104 // dump_mem(dst, dst+0x100);
106 // print_debug_cp_run("linxbios_apc.bin length = ", olen);
108 // print_debug("Jumping to coreboot AP code in CAR.\r\n");
111 "movl %0, %%ebp\n\t" /* cpu_reset for hardwaremain dummy */
113 "leal _iseg_apc, %%edi\n\t"