On Sat, May 02, 2009 at 04:38:12PM -0700, ron minnich wrote:
> On Sat, May 2, 2009 at 2:58 PM, Ward Vandewege <[email protected]> wrote:
> > On Sat, May 02, 2009 at 01:42:34PM -0700, ron minnich wrote:
> >> It does look like an SMP machine in which both CPUs are trying to run
> >> as the BSP.
> >>
> >> Possible?
> >
> > It's definitely an SMP machine, two dual-core CPUs.
>
> So can you see what changed in the k8 north/cpu support since the last
> time it worked?
Sure. The last time it worked is r4232, I had to bisect to find the commit
causing the problem. r4233/4234 are one changeset.
src/northbridge/amd is unchanged by this changeset.
The diff for src/cpu/amd is attached.
Thanks,
Ward.
--
Ward Vandewege <[email protected]>
Free Software Foundation - Senior Systems Administrator
Index: car/copy_and_run.c
===================================================================
--- car/copy_and_run.c (revision 4232)
+++ car/copy_and_run.c (revision 4234)
@@ -2,119 +2,36 @@
moved from nrv2v.c and some lines from crt0.S
2006/05/02 - stepan: move nrv2b to an extra file.
*/
-static inline void print_debug_cp_run(const char *strval, uint32_t val)
-{
-#if CONFIG_USE_PRINTK_IN_CAR
- printk_debug("%s%08x\r\n", strval, val);
-#else
- print_debug(strval); print_debug_hex32(val); print_debug("\r\n");
-#endif
-}
-#if CONFIG_COMPRESS
-#define ENDIAN 0
-#define BITSIZE 32
-#include "lib/nrv2b.c"
-#endif
+void copy_and_run_core(u8 *src, u8 *dst, unsigned long ilen, unsigned ebp);
+extern u8 _liseg, _iseg, _eiseg;
static void copy_and_run(void)
{
uint8_t *src, *dst;
- unsigned long ilen, olen;
+ unsigned long ilen;
+ src = &_liseg;
+ dst = &_iseg;
+ ilen = &_eiseg - dst;
-#if !CONFIG_COMPRESS
- print_debug("Copying coreboot to RAM.\r\n");
- __asm__ volatile (
- "leal _liseg, %0\n\t"
- "leal _iseg, %1\n\t"
- "leal _eiseg, %2\n\t"
- "subl %1, %2\n\t"
- : "=a" (src), "=b" (dst), "=c" (olen)
- );
- memcpy(dst, src, olen);
-#else
- print_debug("Uncompressing coreboot to RAM.\r\n");
-
- __asm__ volatile (
- "leal _liseg, %0\n\t"
- "leal _iseg, %1\n\t"
- : "=a" (src) , "=b" (dst)
- );
-
- print_debug_cp_run("src=",(uint32_t)src);
- print_debug_cp_run("dst=",(uint32_t)dst);
-
-// dump_mem(src, src+0x100);
-
- olen = unrv2b(src, dst, &ilen);
- print_debug_cp_run("coreboot_ram.nrv2b length = ", ilen);
-
-#endif
-// dump_mem(dst, dst+0x100);
-
- print_debug_cp_run("coreboot_ram.bin length = ", olen);
-
- print_debug("Jumping to coreboot.\r\n");
-
- __asm__ volatile (
- "xorl %ebp, %ebp\n\t" /* cpu_reset for hardwaremain dummy */
- "cli\n\t"
- "leal _iseg, %edi\n\t"
- "jmp *%edi\n\t"
- );
-
+ copy_and_run_core(src, dst, ilen, 0);
}
#if CONFIG_AP_CODE_IN_CAR == 1
+extern u8 _liseg_apc, _iseg_apc, _eiseg_apc;
+
static void copy_and_run_ap_code_in_car(unsigned ret_addr)
{
uint8_t *src, *dst;
- unsigned long ilen, olen;
+ unsigned long ilen;
-// print_debug("Copying coreboot AP code to CAR.\r\n");
+ src = &_liseg_apc;
+ dst = &_iseg_apc;
+ ilen = &_eiseg_apc - dst;
-#if !CONFIG_COMPRESS
- __asm__ volatile (
- "leal _liseg_apc, %0\n\t"
- "leal _iseg_apc, %1\n\t"
- "leal _eiseg_apc, %2\n\t"
- "subl %1, %2\n\t"
- : "=a" (src), "=b" (dst), "=c" (olen)
- );
- memcpy(dst, src, olen);
-#else
-
- __asm__ volatile (
- "leal _liseg_apc, %0\n\t"
- "leal _iseg_apc, %1\n\t"
- : "=a" (src) , "=b" (dst)
- );
-
-// print_debug_cp_run("src=",(uint32_t)src);
-// print_debug_cp_run("dst=",(uint32_t)dst);
-
-// dump_mem(src, src+0x100);
-
- olen = unrv2b(src, dst, &ilen);
-// print_debug_cp_run("coreboot_apc.nrv2b length = ", ilen);
-
-#endif
-// dump_mem(dst, dst+0x100);
-
-// print_debug_cp_run("coreboot_apc.bin length = ", olen);
-
-// print_debug("Jumping to coreboot AP code in CAR.\r\n");
-
- __asm__ volatile (
- "movl %0, %%ebp\n\t" /* cpu_reset for hardwaremain dummy */
- "cli\n\t"
- "leal _iseg_apc, %%edi\n\t"
- "jmp *%%edi\n\t"
- :: "a"(ret_addr)
- );
-
+ copy_and_run_core(src, dst, ilen, ret_addr);
}
#endif
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot