cores/cpu/microwatt: revert setup stack and fix missing subi %r1,%r1,0x100 (thanks...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 22 Jun 2020 15:09:55 +0000 (17:09 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 22 Jun 2020 15:09:55 +0000 (17:09 +0200)
Tested with powerpc64le-buildroot-linux-gnu-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 8.4.0.

litex/soc/cores/cpu/microwatt/crt0.S

index 5fc295f1baa6f8f8840d1132b680674bf10f4bc5..cfd67017001fb122daa9b5fd6196298c7e3d2c70 100644 (file)
@@ -76,10 +76,9 @@ _start:
        bdnz    0b
 1:
        /* setup stack */
-       LOAD_IMM64(%r1, _fstack - 0x100)
-       LOAD_IMM64(%r12, main)
-       mtctr   %r12,
-       bctrl
+       ld      %r1,_fstack@got(%r2)
+       subi  %r1,%r1,0x100
+       bl      main
        b .
 
 #define EXCEPTION(nr)          \