http://www.nioswiki.com/linux Nios Community Wiki > Linux for
the Nios II Processor
Linux for the Nios II ProcessorTable of contentsNo headers
This
is the community supported version of Nios II Linux with MMU. This is
package will work only on Linux. You will need a virtual Linux to run
it on Windows. This is GPL software, and come with absolutely NO
warranty.
Install the required development packages on your Linux
desktop, as root or sudo, # for RHEL5/Centos5 only wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm rpm -Uvh epel-release-5-3.noarch.rpm # for RHEL5/Centos5/Fedora11 yum install git-all git-gui tcsh make gcc ncurses-devel bison libglade2-devel \ byacc flex gawk gettext ccache zlib-devel gtk2-devel lzo-devel pax-utils
For new users who didn't
used nios2 git before, please download the tarball (1.7GB) ,as a normal
user, http://www.niosftp.com/pub/linux/nios2-linux-20090825.tar sha1sum nios2-linux-20090825.tar c156d21b1b6adf1b47102a5f37c4d1d9acdb637f nios2-linux-20090825.tar tar xf nios2-linux-20090825.tar cd nios2-linux ./checkout For existing nios2 git users,
(with nios2-linux-20080619.tar or nios2-linux-20090730.tar) there is no
need to download the tarball. You may add a new branch to track nios2
mmu kernel and clone to get the binary toolchain.
In
short, to build with MMU, use nios2mmu branch on linux-2.6, trunk
branch on uClinux-dist. To build without MMU, use test-nios2 branch on
linux-2.6, test-nios2 branch on uClinux-dist. QUICK START
cd nios2-linux/uClinux-dist make menuconfig # or make xconfig
In the menuconfig, make sure it is selected as follows: Vendor/Product Selection ---> # select --- Select the Vendor you wish to target Vendor (Altera) ---> # select Altera --- Select the Product you wish to target Altera Products (nios2) ---> # select nios2 Kernel/Library/Defaults Selection ---> # select --- Kernel is linux-2.6.x Libc Version (None) ---> # should default to None - very important. [*] Default all settings (lose changes) # select [ ] Customize Kernel Settings [ ] Customize Vendor/User Settings [ ] Update Default Vendor SettingsThen <exit> <exit> <yes> (If you were asked option like this, "Build faac (LIB_FAAC) [N/y/?]
(NEW)" just enter to use default. This will be fixed.)
Compile kernel and apps, make
(this will take a while) 3. The images created are, images/linux.initramfs.gz is the elf image with initramfs built-in images/zImge.initramfs.gz is the compressed elf image with initramfs
built-in images/vmImage is compressed u-boot image images/rootfs.initramfs.gz is compressed initramfs to be used as initrd by u-boot images/rootfs.jffs2
is jffs2 image, eg, cp rootfs.jffs2 /dev/mtd0. This is available when
jffs2 is selected in kernel. Please note the flash erase sector size on
3c120 dev board is 128KB, you will have to specify "MKFS_JFFS2_FLAGS =
-l -p -e 128" at the beginning of your product Makefile. nios2-configure-sof ../3c120_default/nios2_linux_3c120_125mhz_top.sof nios2-download -g images/linux.initramfs.gz nios2-terminal
IdentityFile ~/.ssh/id_rsa IdentityFile ~/nios2-linux/sshkey/id_rsa ProxyCommand corkscrew <http_proxy_ip> <port> %h %p
Create a Nios II design with MMU 1. Add a 512B or 1KB dual-port tightly coupled memory. Connect one port to tightly_coupled_instruction_master, and the other port to tightly_coupled_data_master. 2. Include MMU to your Nios II
processor using SOPC builder. Assign "Fast TLB Miss Exception Vector"
to the tightly coupled memory. You may use default MMU setting. You may find a golden reference design for 3C120 dev board, which is
the default_mmu in kernel config. Nios II Hardware Reference Design for Linux, Cyclone III (EP3C120) Edition Release R15 (download .zip file via FTP)
sopc-create-header-files --single custom_fpga.h cp custom_fpga.h nios2-linux/linux-2.6/arch/nios2/include/asm
cd uClinux-dist make menuconfig # select Altera,nios2. kernel config your FPGA. NiosII Configuration --->NiosII FPGA configuration --->(X) CUSTOM_FPGA make
Debug usespace
set solib-absolute-prefix ~/nios2-linux/toolchain-mmu/x86-linux2/nios2-wrs-linux-gnu/libc
Please refer to the wiki about user space debugging,
|
- [linuxkernelnewbies] Linux for the Nios II Processor - Nios Com... peter teoh