Results for various Linux kernels on Loongson 3A/Xinghuo

38 views
Skip to first unread message

David Kuehling

unread,
Apr 6, 2014, 11:03:56 PM4/6/14
to loongs...@googlegroups.com, Huacai Chen
There seems to be something broken with the 'linux-official' [1] line of
kernels. I now tested a lot of kernels from various sources and these
are the results:

* linux-official-3.5.0-7.lemote
* linux-official-3.5.0-8.lemote :

Loading the Debian wheezy initrd [2], I get a blank screen about half
a minute into the installation, then the system looks frozen (maybe
just the display is gone?).

* linux-official master branch (abab4490cfb4b89) :

Same problem as above, plus the fan is spinning very loudly
(CONFIG_LOONGSON3_CPUAUTOPLUG=y is set, anything else I need for
proper fan control or power management?)

Also tried with the newer Debian Jessie installer initrd [5], with
the same result. I think that rules out a userspace issue.
I.e. linux-official looks unusable for my system :/

* ralf's linux mips branch, master (859a350909b3ee) [3]
* torvald's linux branch, master (04535d273ee3e) [4] :

Fan spins very loudly, but Debian installer seems to work. I get a
segfault somewhere early in the installation when using the Debian
Wheezy installer initrd [2], but does not seem kernel related. The
Debian Jessie installer [5] works much better, so far I encountered
no (unexpected) problems.

Remaining questions:

- What's wrong with linux-official line of kernels WRT frame buffer
becoming unusable? Whatever it is, hopefully the "feature" does not
get merged upstream ;) Anything else I can do to help triage/debug the
problem?

- How do I get proper fan control (and power management) with the more
recent kernels? Ralf's and Torvald's branches lack the
CONFIG_LOONGSON3_CPUAUTOPLUG option. Any workarounds?

cheers,

David

[1] http://dev.lemote.com/cgit/linux-official.git
[2]
http://ftp.debian.org/debian/dists/wheezy/main/installer-mipsel/current/images/loongson-2f/netboot/initrd.gz
[3] git://git.linux-mips.org/pub/scm/ralf/linux
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[5] ftp://ftp.de.debian.org/debian/dists/jessie/main/installer-mipsel/current/images/loongson-2f/netboot/initrd.gz
--
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk2.gpg
Fingerprint: B63B 6AF2 4EEB F033 46F7 7F1D 935E 6F08 E457 205F

David Kuehling

unread,
Apr 7, 2014, 9:08:03 PM4/7/14
to loongs...@googlegroups.com, Huacai Chen
The v3.5 kernel included in binary form on the boot disks of the Xinghuo
seems to work (file "vmlinuz3.x"). It also includes a kernel config
"config-3.x". Trying to rebuild any of included kernels using Lemote's
"official" source repositories with kernel config taken from the boot
partition does not result in a working kernel though:

* linux-official-3.5.0-1.lemote [1], using original kernel config
("config-3.x") as included on the Xinghuo's boot partition: Fan is
silent, but screen blanks after a minute or so, not usable. Radeon
firmware had to be retrived from [3], isn't included in the tarball.

* linux-official-3.5.0-8.lemote, using original kernel config
("config-3.x") as included on the Xinghuo's boot partition (plus
tweaks required by 'make oldconfig'): Fan is silent, but screen
blanks after a minute or so, not usable. Radeon firmware had to be
retrived from [3], isn't included in the tarball.

* kernel 2.6.36-21.lemote [2] using original kernel config "config-2.6.36+"
from boot disk:
This shows 4 penguins and that's it, no kernel messages, no kernel
console, nothing.

* kernel 2.6.36-23.lemote using original kernel config "config-2.6.36+"
from boot disk (plus 'make oldconfig' tweaks):
This shows 4 penguins and that's it, no kernel messages, no kernel
console, nothing.

This is getting frustrating. Whatever magic Lemote applied to their
kernels doesn't seem to have made it into their repositories.

cheers,

David

[1] http://dev.lemote.com/cgit/linux-official.git/snapshot/linux-official-3.5.0-1.lemote.tar.bz2
[2]
http://dev.lemote.com/cgit/linux-3A.git/snapshot/linux-3A-2.6.36-21.lemote.tar.bz2
[3] http://people.freedesktop.org/~agd5f/radeon_ucode/R600_rlc.bin

Aron Xu

unread,
Apr 8, 2014, 4:38:20 AM4/8/14
to loongs...@googlegroups.com
On Tue, Apr 8, 2014 at 9:08 AM, David Kuehling <dvdk...@posteo.de> wrote:
>
> This is getting frustrating. Whatever magic Lemote applied to their
> kernels doesn't seem to have made it into their repositories.
>

I wonder which version of GCC are you using, I can recall that people
from Lemote said there could be problem if compile their code using a
very new version of GCC.


--
Regards,
Aron Xu

David Kuehling

unread,
Apr 8, 2014, 4:54:41 AM4/8/14
to loongs...@googlegroups.com
Which is why I went conservatively with gcc-4.6.4 (4.6.3 is the standard
compiler on Debian Wheezy mipsel). Also if I built Ralf's linux branch,
the resulting kernel works better, which makes a gcc bug seem less
likely (but won't rule it out, though).

If anybody wants to try, here [1] is the Makefile I used to download and
build my toolchain (just checkout via svn and run 'make
gcc-4.6.4.build.stamp'. resulting toolchain ./staging/)

If anybody can suggest a different compiler version I'll happily
recompile and tests the kernels using it.

cheers,

David

[1] http://mosquito.selfhost.eu/opensvn/free/trunk/loongson/loongson3a-debian-wheezy-installer/

Huacai Chen

unread,
Apr 8, 2014, 10:37:13 PM4/8/14
to loongs...@googlegroups.com
Hi, David,

Lemote's pre-installed kernel uses exactly the same source in
http://dev.lemote.com/cgit/linux-official.git/, the only difference is
GCC,
we use the cross-compiler which can be found here:
http://dev.lemote.com/files/resource/toolchain/cross-compile/

Huacai

David Kuehling

unread,
Apr 9, 2014, 1:10:09 AM4/9/14
to loongs...@googlegroups.com
Hi Huacei,

>>>>> "Huacai" == Huacai Chen <chenh...@gmail.com> writes:

> Hi, David, Lemote's pre-installed kernel uses exactly the same source
> in http://dev.lemote.com/cgit/linux-official.git/,

As I wrote before: the kernel 3.5.1 repository tag lacks a copy of the
radeon firmware. A difference in the firmware may explain the problems
I encountered. Any pointer to the source for the radeon firmware
version used (embedded) in the pre-installed kernel images?

> the only difference
> is GCC, we use the cross-compiler which can be found here:
> http://dev.lemote.com/files/resource/toolchain/cross-compile/

Which one? You mean the binary cross compiler in

http://dev.lemote.com/files/resource/toolchain/cross-compile/x86_64_cross-loongson-gcc4_6_4-binutils2_22.tar.bz2

? There is a tarball for gcc 4.5, too.

This looks very similar to the GCC I'm using. But it's worth a try.

thanks for keeping up with my complaints :)

cheers,

David

David Kuehling

unread,
Apr 13, 2014, 9:19:19 AM4/13/14
to loongs...@googlegroups.com, Huacai Chen, Aron Xu
Hi Huacai

> Hi, David, Lemote's pre-installed kernel uses exactly the same source
> in http://dev.lemote.com/cgit/linux-official.git/, the only difference
> is GCC, we use the cross-compiler which can be found here:
> http://dev.lemote.com/files/resource/toolchain/cross-compile/

You were right, the toolchain may be the culprit here!

Compiling kernel 3.5.0-8.lemote with the lemote gcc-4.5.2 toolchain [1],
produces a kernel that works without problems. 3.5.0-2, 3.5.0-3,
3.5.0-5 also work when built with that toolchain. Just to make sure I
also built 3.5.0-2, -3, -5 with my gcc-4.6.4 toolchain and all these
kernels exhibit the same screen blanking problem I encountered before.

Quite unbelievable.

Then I tried to build my own toolchain using upstream gcc-4.5.4 from [2]
and binutils 2.22 from [3]. Kernels built with this toolchain do work
:)

I wonder whether Lemote's gcc-4.6.4 [4] toolchain actually works. I
cannot easily test it as these binaries require libc 2.14 which is
unavailable under Debian Wheezy here. I tried to build my own toolchain
matching the exact versioning as lemote (gcc-4.6.4 and binutils 2.22),
but kernels compiled with that version do have the blank screen problem.

Does lemote use any non-upstream version of GCC (linaro?) or any other
patches? Where's the source corresponding to [1,4]?

Maybe it's not even a GCC problem but just some interaction between
kernel bugs and CPU errata (?) that are triggered by certain machine
code sequences or code addresses that just happen to be output by my
4.6.4 toolchain? I think I also need to find out how to run the PMON
RAM tester to rule out any issues caused by faulty memory.

cheers,

David

[1]
http://dev.lemote.com/files/resource/toolchain/cross-compile/cross-loongson-gcc4_5_2-binutils2_21.tar.bz2
[2] ftp://ftp.cs.tu-berlin.de/pub/gnu/gcc/
[3] ftp://ftp.cs.tu-berlin.de/pub/gnu/binutils/
[4] http://dev.lemote.com/files/resource/toolchain/cross-compile/x86_64_cross-loongson-gcc4_6_4-binutils2_22.tar.bz2

David Kuehling

unread,
Apr 13, 2014, 10:36:04 AM4/13/14
to loongs...@googlegroups.com, Huacai Chen, Aron Xu
And a few more distressing data points:

* Building kernel 3.5.0-8.lemote natively on a Debian "stable" Wheezy
System with Debian's default compiler gcc-4.6.3-14 results in
another broken kernel (blank screen).

* Building another mipsel cross-toolchain on amd64 using upstream GNU
gcc-4.7.3 and binutils 2.23.2 results in a working kernel. I think
I'll settle on that toolchain for now.

With Debian's gcc-4.6.3 and my gcc-4.6.4 both exhibiting problems here,
maybe Lemote should reconsider whether it's a good idea to use gcc-4.6
for any serious mips work.

cheers,

David
Reply all
Reply to author
Forward
0 new messages