[U-Boot] MIPS cpu has problem detecting CFI
Andrew Dyer
amdyer at gmail.com
Tue Oct 13 00:11:19 CEST 2009
On Mon, Oct 12, 2009 at 10:10 AM, <myuboot at fastmail.fm> wrote:
> Thanks for 1) and 2).
> For 3), both results show GP register is modified.
> the result of ${CROSS_COMPILE}objdump --source cpu.o is:
>
> void flush_cache(ulong start_addr, ulong size)
> {
> 7c: 3c1c0000 lui gp,0x0
> 80: 279c0000 addiu gp,gp,0
> 84: 0399e021 addu gp,gp,t9
It looks like the code expects t9 to have the gp value. I need to get
my setup up to -current and do a build test with eldk to help much
more (we don't do much mips anymore here, so my setup is a bit behind
the times).
> unsigned long lsize = CONFIG_SYS_CACHELINE_SIZE;
> unsigned long addr = start_addr & ~(lsize - 1);
> 88: 2403fff0 li v1,-16
> 8c: 00831024 and v0,a0,v1
> unsigned long aend = (start_addr + size - 1) & ~(lsize - 1);
> 90: 2484ffff addiu a0,a0,-1
> 94: 00852021 addu a0,a0,a1
> 98: 00831824 and v1,a0,v1
>
> while (1) {
> cache_op(Hit_Writeback_Inv_D, addr);
> 9c: bc550000 cache 0x15,0(v0)
> cache_op(Hit_Invalidate_I, addr);
> a0: bc500000 cache 0x10,0(v0)
> if (addr == aend)
> a4: 1443fffd bne v0,v1,9c <flush_cache+0x20>
> a8: 24420010 addiu v0,v0,16
> break;
> addr += lsize;
> }
> #if defined(CONFIG_TNETVxxxx)
> invalidate_dcache();
> ac: 8f990000 lw t9,0(gp)
> b0: 03200008 jr t9
> b4: 00000000 nop
>
> 000000b8 <do_reset>:
> void __attribute__((weak)) _machine_restart(void)
> {
> }
>
> For 4), I generated the toolchain by myself using buildroot 2009.08.
> Using built-in specs. And the result of gcc -v is:
> Target: mips-linux-uclibc
> Configured with:
> /home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/gcc-4.4.1/configure
> --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu
> --target=mips-linux-uclibc --enable-languages=c
> --with-sysroot=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir
> --with-build-time-tools=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/mips-linux-uclibc/bin
> --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld
> --disable-libssp --disable-tls --enable-shared
> --with-gmp=/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/gmp
> --with-mpfr=/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/mpfr
> --disable-nls --enable-threads --disable-multilib
> --disable-decimal-float --with-float=soft --with-abi=32
> --with-tune=mips32 : (reconfigured)
> /home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/gcc-4.4.1/configure
> --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu
> --target=mips-linux-uclibc --enable-languages=c
> --with-sysroot=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir
> --with-build-time-tools=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/mips-linux-uclibc/bin
> --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld
> --disable-libssp --disable-tls --enable-shared
> --with-gmp=/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/gmp
> --with-mpfr=/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/mpfr
> --disable-nls --enable-threads --disable-multilib
> --disable-decimal-float --with-float=soft --with-abi=32
> --with-tune=mips32
> Thread model: posix
> gcc version 4.4.1 (GCC)
>
> For most of the flags above, they are automatically added by buildroot.
> Please let me know if there is anything wrong with the setting.
>
nothing stands out, but I'm not a gcc expert.
> 4) I am not familiar with ELDK. It seems to be able to create toolchain
> quickly. I will give it a try. How is the toolchain created by ELDK
> different from buildroot or openembedded?
It comes with a prebuilt toolchain. I believe the compiler version is
a bit older than what you are running (looks like 4.2.2 from the web
page).
More information about the U-Boot
mailing list