Re: [Qemu-devel] some ROMs questions

2018-04-06 Thread David Gibson
On Fri, Apr 06, 2018 at 01:59:03PM +0200, BALATON Zoltan wrote:
> On Fri, 6 Apr 2018, Michael Tokarev wrote:
> > 02.04.2018 17:30, BALATON Zoltan wrote:
> > > On Mon, 2 Apr 2018, Michael Tokarev wrote:
> > > > roms/u-boot-sam460ex/tools/updater/stubs.c -
> > > > it is some strange symlink pointing to a strange place, probably should 
> > > > be removed?
> > > 
> > > This does not seem to matter for building the rom image but this can be 
> > > fixed by converting it to a relative path. I've done that and will send a 
> > > patch to update the submodule as well to use the QEMU repo now that we 
> > > have a mirror there. Thanks for finding this.
> > 
> > Hmm, I've no idea how to pull a submodule change.. :)
> 
> git submodule update? But it's not in master yet only in David's
> ppc-for-2.12 branch I think.
> 
> > But I've one more question about this rom.  When I'm trying to build it,
> > the build fails:
> > 
> > roms/u-boot-sam460ex$ make Sam460ex_config 
> > CROSS_COMPILE=powerpc64-linux-gnu-
> > Generating include/autoconf.mk
> > cc1: error: -mcall not supported in this configuration
> > cc1: error: -mrelocatable not supported in this configuration
> > cc1: error: -meabi not supported in this configuration
> > cc1: error: -m64 requires a PowerPC64 cpu
> > Generating include/autoconf.mk.dep
> > cc1: error: -mcall not supported in this configuration
> > cc1: error: -mrelocatable not supported in this configuration
> > cc1: error: -meabi not supported in this configuration
> > cc1: error: -m64 requires a PowerPC64 cpu
> > Configuring for Sam460ex board...
> > 
> > roms/u-boot-sam460ex$ make CROSS_COMPILE=powerpc64-linux-gnu-
> > ...
> > make -C arch/powerpc/cpu/ppc4xx start.o
> > make[1]: Entering directory 
> > '/build/qemu/debian-qemu/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx'
> > powerpc64-linux-gnu-gcc   -D__ASSEMBLY__ -g  -Os   -mrelocatable -fPIC 
> > -meabi -ffunction-sections -fdata-sections -D__KERNEL__ 
> > -DTEXT_BASE=0xFFF8 
> > -I/build/qemu/debian-qemu/roms/u-boot-sam460ex/include -fno-builtin 
> > -ffreestanding -nostdinc -isystem 
> > /usr/lib/gcc-cross/powerpc64-linux-gnu/6/include -pipe  -DCONFIG_PPC 
> > -D__powerpc__ -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float -Wa,-m440 
> > -mcpu=440 -DCONFIG_440=1 -I../bios_emulator/scitech/include 
> > -I../bios_emulator/scitech/src/x86emu -Dprintk=printf   \
> >-o start.o start.S -c
> > start.S:1:0: error: -mcall not supported in this configuration
> > /*
> > 
> > start.S:1:0: error: -mrelocatable not supported in this configuration
> > start.S:1:0: error: -meabi not supported in this configuration
> > start.S:1:0: error: -m64 requires a PowerPC64 cpu
> > /build/qemu/debian-qemu/roms/u-boot-sam460ex/config.mk:249: recipe for 
> > target 'start.o' failed
> > make[1]: *** [start.o] Error 1
> > make[1]: Leaving directory 
> > '/build/qemu/debian-qemu/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx'
> > Makefile:353: recipe for target 'arch/powerpc/cpu/ppc4xx/start.o' failed
> > make: *** [arch/powerpc/cpu/ppc4xx/start.o] Error 2
> > 
> > What I'm doing wrong?
> > 
> > $ powerpc64-linux-gnu-gcc --version
> > powerpc64-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
> 
> Note sure, maybe building it with ppc64 compiler or a too new one? This
> board is 32bit and the source is from 2011 so I'm not sure what it does with
> recent compilers. I have powerpc-elf-gcc 4.9.3 which works.

Yeah, if it's a 32-bit board, I'm pretty sure you'll need a 32-bit
compiler.  Or at least add -m32 if it's a biarch compiler.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


signature.asc
Description: PGP signature


Re: [Qemu-devel] some ROMs questions

2018-04-06 Thread BALATON Zoltan

On Fri, 6 Apr 2018, Michael Tokarev wrote:

02.04.2018 17:30, BALATON Zoltan wrote:

On Mon, 2 Apr 2018, Michael Tokarev wrote:

roms/u-boot-sam460ex/tools/updater/stubs.c -
it is some strange symlink pointing to a strange place, probably should be 
removed?


This does not seem to matter for building the rom image but this can be fixed 
by converting it to a relative path. I've done that and will send a patch to 
update the submodule as well to use the QEMU repo now that we have a mirror 
there. Thanks for finding this.


Hmm, I've no idea how to pull a submodule change.. :)


git submodule update? But it's not in master yet only in 
David's ppc-for-2.12 branch I think.



But I've one more question about this rom.  When I'm trying to build it,
the build fails:

roms/u-boot-sam460ex$ make Sam460ex_config CROSS_COMPILE=powerpc64-linux-gnu-
Generating include/autoconf.mk
cc1: error: -mcall not supported in this configuration
cc1: error: -mrelocatable not supported in this configuration
cc1: error: -meabi not supported in this configuration
cc1: error: -m64 requires a PowerPC64 cpu
Generating include/autoconf.mk.dep
cc1: error: -mcall not supported in this configuration
cc1: error: -mrelocatable not supported in this configuration
cc1: error: -meabi not supported in this configuration
cc1: error: -m64 requires a PowerPC64 cpu
Configuring for Sam460ex board...

roms/u-boot-sam460ex$ make CROSS_COMPILE=powerpc64-linux-gnu-
...
make -C arch/powerpc/cpu/ppc4xx start.o
make[1]: Entering directory 
'/build/qemu/debian-qemu/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx'
powerpc64-linux-gnu-gcc   -D__ASSEMBLY__ -g  -Os   -mrelocatable -fPIC -meabi 
-ffunction-sections -fdata-sections -D__KERNEL__ -DTEXT_BASE=0xFFF8 
-I/build/qemu/debian-qemu/roms/u-boot-sam460ex/include -fno-builtin 
-ffreestanding -nostdinc -isystem 
/usr/lib/gcc-cross/powerpc64-linux-gnu/6/include -pipe  -DCONFIG_PPC 
-D__powerpc__ -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float -Wa,-m440 -mcpu=440 
-DCONFIG_440=1 -I../bios_emulator/scitech/include 
-I../bios_emulator/scitech/src/x86emu -Dprintk=printf   \
   -o start.o start.S -c
start.S:1:0: error: -mcall not supported in this configuration
/*

start.S:1:0: error: -mrelocatable not supported in this configuration
start.S:1:0: error: -meabi not supported in this configuration
start.S:1:0: error: -m64 requires a PowerPC64 cpu
/build/qemu/debian-qemu/roms/u-boot-sam460ex/config.mk:249: recipe for target 
'start.o' failed
make[1]: *** [start.o] Error 1
make[1]: Leaving directory 
'/build/qemu/debian-qemu/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx'
Makefile:353: recipe for target 'arch/powerpc/cpu/ppc4xx/start.o' failed
make: *** [arch/powerpc/cpu/ppc4xx/start.o] Error 2

What I'm doing wrong?

$ powerpc64-linux-gnu-gcc --version
powerpc64-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516


Note sure, maybe building it with ppc64 compiler or a too new one? This 
board is 32bit and the source is from 2011 so I'm not sure what it does 
with recent compilers. I have powerpc-elf-gcc 4.9.3 which works.


Regards,
BALATON Zoltan



Re: [Qemu-devel] some ROMs questions

2018-04-06 Thread BALATON Zoltan

On Fri, 6 Apr 2018, Michael Tokarev wrote:

02.04.2018 17:30, BALATON Zoltan wrote:

On Mon, 2 Apr 2018, Michael Tokarev wrote:

roms/u-boot-sam460ex/tools/updater/stubs.c -
it is some strange symlink pointing to a strange place, probably should be 
removed?


This does not seem to matter for building the rom image but this can be fixed 
by converting it to a relative path. I've done that and will send a patch to 
update the submodule as well to use the QEMU repo now that we have a mirror 
there. Thanks for finding this.


There are 2 more files which we might want to remove:
tools/multiplier/multiplier.image
tools/multiplier/multiplier


These all come from the upstream source from the hardware vendor which 
I've taken as is to follow GPL. Thanks for noticing, I've removed these 
and will send another patch to update the submodule. Are there any more of 
these before I do that?


Regards,
BALATON Zoltan



Re: [Qemu-devel] some ROMs questions

2018-04-06 Thread Michael Tokarev
02.04.2018 17:30, BALATON Zoltan wrote:
> On Mon, 2 Apr 2018, Michael Tokarev wrote:
>> roms/u-boot-sam460ex/tools/updater/stubs.c -
>> it is some strange symlink pointing to a strange place, probably should be 
>> removed?
> 
> This does not seem to matter for building the rom image but this can be fixed 
> by converting it to a relative path. I've done that and will send a patch to 
> update the submodule as well to use the QEMU repo now that we have a mirror 
> there. Thanks for finding this.

There are 2 more files which we might want to remove:
 tools/multiplier/multiplier.image
 tools/multiplier/multiplier

FWIW.

Thanks,

/mjt



Re: [Qemu-devel] some ROMs questions

2018-04-06 Thread Michael Tokarev
02.04.2018 17:30, BALATON Zoltan wrote:
> On Mon, 2 Apr 2018, Michael Tokarev wrote:
>> roms/u-boot-sam460ex/tools/updater/stubs.c -
>> it is some strange symlink pointing to a strange place, probably should be 
>> removed?
> 
> This does not seem to matter for building the rom image but this can be fixed 
> by converting it to a relative path. I've done that and will send a patch to 
> update the submodule as well to use the QEMU repo now that we have a mirror 
> there. Thanks for finding this.

Hmm, I've no idea how to pull a submodule change.. :)

But I've one more question about this rom.  When I'm trying to build it,
the build fails:

roms/u-boot-sam460ex$ make Sam460ex_config CROSS_COMPILE=powerpc64-linux-gnu-
Generating include/autoconf.mk
cc1: error: -mcall not supported in this configuration
cc1: error: -mrelocatable not supported in this configuration
cc1: error: -meabi not supported in this configuration
cc1: error: -m64 requires a PowerPC64 cpu
Generating include/autoconf.mk.dep
cc1: error: -mcall not supported in this configuration
cc1: error: -mrelocatable not supported in this configuration
cc1: error: -meabi not supported in this configuration
cc1: error: -m64 requires a PowerPC64 cpu
Configuring for Sam460ex board...

roms/u-boot-sam460ex$ make CROSS_COMPILE=powerpc64-linux-gnu-
...
make -C arch/powerpc/cpu/ppc4xx start.o
make[1]: Entering directory 
'/build/qemu/debian-qemu/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx'
powerpc64-linux-gnu-gcc   -D__ASSEMBLY__ -g  -Os   -mrelocatable -fPIC -meabi 
-ffunction-sections -fdata-sections -D__KERNEL__ -DTEXT_BASE=0xFFF8 
-I/build/qemu/debian-qemu/roms/u-boot-sam460ex/include -fno-builtin 
-ffreestanding -nostdinc -isystem 
/usr/lib/gcc-cross/powerpc64-linux-gnu/6/include -pipe  -DCONFIG_PPC 
-D__powerpc__ -DCONFIG_4xx -ffixed-r2 -mstring -msoft-float -Wa,-m440 -mcpu=440 
-DCONFIG_440=1 -I../bios_emulator/scitech/include 
-I../bios_emulator/scitech/src/x86emu -Dprintk=printf   \
-o start.o start.S -c
start.S:1:0: error: -mcall not supported in this configuration
 /*

start.S:1:0: error: -mrelocatable not supported in this configuration
start.S:1:0: error: -meabi not supported in this configuration
start.S:1:0: error: -m64 requires a PowerPC64 cpu
/build/qemu/debian-qemu/roms/u-boot-sam460ex/config.mk:249: recipe for target 
'start.o' failed
make[1]: *** [start.o] Error 1
make[1]: Leaving directory 
'/build/qemu/debian-qemu/roms/u-boot-sam460ex/arch/powerpc/cpu/ppc4xx'
Makefile:353: recipe for target 'arch/powerpc/cpu/ppc4xx/start.o' failed
make: *** [arch/powerpc/cpu/ppc4xx/start.o] Error 2

What I'm doing wrong?

$ powerpc64-linux-gnu-gcc --version
powerpc64-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516

Thanks!

/mjt



Re: [Qemu-devel] some ROMs questions

2018-04-02 Thread BALATON Zoltan

On Mon, 2 Apr 2018, Michael Tokarev wrote:

roms/u-boot-sam460ex/tools/updater/stubs.c -
it is some strange symlink pointing to a strange place, probably should be 
removed?


This does not seem to matter for building the rom image but this can be 
fixed by converting it to a relative path. I've done that and will send a 
patch to update the submodule as well to use the QEMU repo now that we 
have a mirror there. Thanks for finding this.



When making u-boot-am460ex image, in roms/Makefile, we do a plain copy, while 5
lines above, u-boot image is being stripped on copy. Should we perform strip for
u-boot-am460ex image too, if not only to be consistent?


No, this is correct. These use different images. For e500 the u-boot ELF 
image is used after stripping it while for sam460ex the u-boot.bin is 
needed which is another build target and does not contain symbols to be 
stripped so a plain copy is enough.



BTW, can't u-boot-am460ex image be made from regular u-boot sources, maybe with 
an
additional board added? :)


No. This was discussed before several times. Look up those threads for 
more info or if you don't beleive it just compare the two u-boot versions. 
I don't intend to take up the task of supporting this board in latest 
u-boot versions which even removed support for the CPU type it needs. Also 
we aim to be as compatible to real hardware as possible because of 
assumptions of closed source guests.


Regards,
BALATON Zoltan