【注】因该项目的原主页已无法访问,这里将作为社区版龙芯 Linux 的临时主页。
The Linux Kernel For Loongson Maintained by Community.
This project is launched to maintain the latest Linux for Loongson, the objective is making the loongson machines be friendly supported.
Linux-Loongson-Community here means it is a community project and welcome contribution from everybody.
So, this project will function as a bridge between the Loongson companies and the upstream communities.
Current maintainer
<lxoliva [AT] fsfla [DOT] org>
Old maintainers
<r0bertz [AT] gentoo [DOT] org>
<wuzhangjin [AT] gmail [DOT] com>
Git repo of this project
Related git repo
Download methods:
Browser source code, download them via the Tags or Branch commits.
Clone, pull or fetch one branch of the git repository (use master
branch as an example)
$ git clone git://dev.lemote.com/linux-loongson-community.git -b master
Lemote Loongson-2F family of machines
DEXXON Gdium netbook
default config files
Config Options
Please make sure your compiler support: -mfix-loongson2f-nop
and -mfix-loongson2f-jump
at first, then compile it as following:
$ make menuconfig $ make -j2 $ make modules_install $ make install
Exisiting cross-compiler
Please download one from http://dev.lemote.com/files/resource/toolchain/cross-compile, decompress it and configure the PATH and LIBRARY_PATH environment in /etc/profile or .bashrc.
Build Cross-Compiler for Loongson from scratch
Compile
$ make menuconfig ARCH=mips $ make CROSS_COMPILE=<prefix>- ARCH=mips -j<N> $ make modules_install INSTALL_MOD_PATH=/path/to/modules_install_directory $ make install INSTALL_PATH=/path/to/kernel_image_install_directory
Dexxon Gdium Netbook
You must set the al and karg variables of PMON to boot the kernel, al is used to indicate the path to the kernel image, karg is used to pass the kernel command line parameters.
After power on the netbook, enter into the PMON command line via pressing c
or <DEL>
, then, you can get help via the h *
command, please get details from the PMON user manual.
For the other machines
Except the above method, you can also edit the config file(/boot/boot.cfg) of PMON, here is an example:
# /boot/boot.cfg default 0 showmenu 1 title Fedora MIPS/N32 kernel (wd0,1)/boot/vmlinuz-2.6.31-0.167.rc5.fc11.mips64el args console=tty root=/dev/sda2
The above configuration means:
default 0
means if there are lots of config entries in the boot.cfg, the default entry is the first one. showmenu 1
menas the menu will be shown.title
indicates the Title of the entry shown in the menu, here is “Fedora MIPS/N32″. kernel
indicates the path to the kernel image file, (wd0, 1) here indicates the /dev/sda2, so, it means vmlinuz-2.6.31-0.167.rc5.fc11.mips64el is stored in the /dev/sda2 partition and put into the /boot directory. If you have stored the kernel image in /dev/sda4, please use (wd0,3) instead. args
indicates the kernel command line arguments. root=/dev/sda2 means the partition stored the root file system is /dev/sda2.Please get more information from the [PMON manual](http://dev.lemote.com/files/document/pmon/PMON%E6%89%8B%E5%86%8Cv0.1.pdf PMON).
PMON is the current BIOS & Bootloader pre-installed on the loongson family of machines.
Grub itself is only a bootloader, which has been ported to YeeLoong for the Gnewsense project. but perhaps you can make it work in the other distributions.
Grub 1.98 is available for YeeLoong, but currently, it can only be loaded from PMON.
Kexec support(Only 32bit currently) is added for Loongson in the tiny36 branch of this project, with the kernel support and the user-space kexec-tools, we can load another kernel image, then, Linux itself work as a bootloader.
To use it, please read the Linux for Loongson is ready as bootloader thread in the linux-dev google group.
Rescue system is always needed when you have broken the whole system, you can load it via tftp protocol or from a u-disk to get a basic system.
Recovery system(support all of Loongson-2F machines made by Lemote) will help to format your broken system and re-install a basic system there (be careful!).
Gnewsense is a 100% free/libre GNU/Linux distribution developed by FSF. Installation guide is available here: http://wiki.gnewsense.org/Projects/GNewSenseToMIPS
This Debian 6.0 is not that one from the official debian, but improved from it, which is developed by Liu Shiwei.
Why this one? it is newer and better than the one from Lemote and also from the official debian, which provides feature-rich kernel, accelerated video driver…
Please get it here: http://www.anheng.com.cn/loongson/install/, download the latest compressed system, decompress it to one of the partitions and config /boot/boot.cfg then boot it.
To install debian on your Gdium, please refer to http://vm-kernel.org/blog/2009/03/20/how-to-install-debian-lenny-on-gdium/
Change the default language to your preferable one:
$ dpkg-reconfigure locales
Loongson-2E Manual
Loongson-2F Manual
Loongson-2 built-in Northbridge Manual
http://kernelnewbies.org/KernelProjects
http://www.linux-mips.org/wiki/Todo_List
More:
Maintain the Hibernation support for MIPS
Maintain the Ftrace support for MIPS
Maintain the Compressed-kernel support for MIPS
grep CS553[56] -ur {drivers,sound}/
Although this project only care about the linux kernel for loongson machines, but without a good X Window and related driver, people will get a bad experience of the machine, the same to the network support, so, we will give you the latest information of them too.
How to use a light weight login manager
There are lots of light weight login managers, but slim may be a good choice, to use it instead of gdm, you just need to install it and replace the gdm with it.
$ sudo apt-get install slim $ sudo dpkg-reconfigure slim
To login automatically with slim, you just need to edit /etc/slim.conf and add the following lines:
default_user <your login user name> focus_password yes auto_login yes
How to make the X window work on my YeeLoong netbook?
You need to install a suitable Xorg-server and the related silicon motion driver or the generic fbdev driver. in the default official debian 6.0, that Xrog-server and the fbdev module works on YeeLoong netbook, but do not have a good performance, If you need the fastest X window for your YeeLoong, the debian 6.0 maintained by LiuShiwei are recommended.
To get a better network support, please install the latest NetworkManager tool into your system.
My RTL8187B wifi can not survive from hibernation, how to fix it?
Please use kernel >= 2.6.36.
How to enable my RTL8187 Wifi when booting?
You can append the following line into /etc/rc.local:
$ echo 1 > /sys/class/rfkill/rfkill0/state
How to make a 3G card work on my YeeLoong netbook?
Please refer to how to use 3G card on YeeLoong netbook.
How to fix the data corruption problem? (Please refer to “Fuloong 6005 linux-community-kernel corrupt data”)
$ ethtool -K eth0 rx off $ ethtool -K eth1 rx off
The root cause may be the hardware offload support of the network card may not be well supported in Linux, so, disable it as a temp solution.
How to make camera work?
Please install v4l*
and webcam*
packages, and then, enable it with Fn+ESC, at last, test it with the following command:
$ mplayer tv://dev/video0
If works, you will see your head.
does YeeLoong support audio mixing (混音,同时播放多首歌曲)?
Yes, but it only support software audio mixing and need an extra config for the ALSA audio output of cs5535audio card.
Firstly, install the config:
$ cp /path/to/cs5535audio.conf /usr/share/alsa/cards/
Then test it:
// on one terminal $ mplayer -ao alsa file1.mp3 // on another $ mplayer -ao alsa fil2.mp3 // You may get two different songs
does Loongson support ALSA audio output?
Yes, but please install the kernel >= 2.6.33.3, or 2.6.32, 2.6.31
All of the Lemote machines support Hibernation if with the suitable kernel(>=2.6.36) and the right config, but only Loongson (>=2F) family of machines(Currently, Only YeeLoong) support Suspend.
Kernel config
Bugs & Workarounds
Will RTL8187B Wifi Driver survive after resuming from Hibernation? Yes, but please use kernel >= 2.6.36.
How can we make dynamic CPU Frequency work normally? Please use kernel >= 2.6.35.
You need to ensure the yeeloong platform driver(CONFIG_LEMOTE_YEELOONG2F) is enabled and also the related user-space applications are installed. for the official debian system, if the yeeloong platform driver is enabled, it should work.
Which hotkey does YeeLoong netbook support?
Is there a tool to test hotkey support?
Yes, please download the hotkey.py and test it as below:
$ sudo apt-get install python-pyosd $ python hotkey.py // You can press `Fn+{ESC,F1~F5, ^/V, </>}` and take a look at the command line output
How to get the information of the fan, battery, cpu of YeeLoong netbook?
You also need to enable the yeeloong platform driver(CONFIG_LEMOTE_YEELOONG2F) and install the lm-sensors(or the other related tools, for example, sensors-applet) in your system, then you can get the information via the following command.
$ sensors yeeloong-virtual-0 Adapter: Virtual device Voltage: +12.46 V Fan RPM: 4403 RPM CPU Temperature: +51.0°C (high = +60.0°C) Battery Temperature: +23.0°C Current: +0.00 A
Yes, but there is no existing J2 header, you need to solder one yourself, here is the HOWTO.
Because Loongson machines use the standard GNU/Linux systems, you can use almost all of the tools you can used in the linux system of the other machines, the most important tools include GNU toolchains: gcc, gdb, binutils …., and the latest gcc >= 4.4 is recommended for the loongson specific support is only available in this version, to enable the loongson specific support, for loongson2f, please use the option -march=loongson2f, for loongson2e, please use -march=loongson2e.
And again, please remember to use the latest binutils for it provides two new options to workaround the hardware bug of loongson2f, to get more information about it, please access this page.
Yes, but you need to get a suitable kernel(>=2.6.33 with CONFIG_OPROFILE=y) which support oprofile and also the user-space oprofile >= 0.9.7 is needed.
~原创有您,更持久!期待您的支持~