Forum Discussion
Altera_Forum
Honored Contributor
15 years agoQuestion on Git Branches to use [nios2mmu vs unstable-nios2mmu]
Hi everyone
I'm currenlty looking into using Linux on the NIOS for my company. Will be getting a DE4 from Terassic shortly but in the meantime I'm doing all the prepwork to understand as much as possible beforehand. I'm a complete newbie to this whole NIOS/Linux dev so please bear with me... I'll be using MMU support. I have been trying the build with MMU support using the following git branches: "unstable-nios2mmu" in linux-2.6 "trunk" in uClinux-dist after setting Vendor=>Altera, Product=>nios2 and then defaulting config settings, building the project has always failed. I have followed the alterawiki instructions as I understand them. Today after reading the info carefully on this page [alterawiki.com/wiki/Downloading_Linux_Distribution ], specifically the last paragraph, I realised that perphaps the "nios2mmu" branch should be checked out instead of "unstable-nios2mmu" as the shell segment on that page suggests. I then managed to complete a succesful build by again just using default config settings. The last paragraph on the index nios/linux webpage [alterawiki.com/wiki/Linux_for_the_Nios_II_Processor] however suggests that the "unstable-nios2mmu" is the branch be used (to get a current build). I appreciate that the "unstable-nios2mmu" branch is at kernel rev 2.6.39 and "nios2mmu" branch at 2.6.35. So, my questions are: 1: Should I be concerned about the "unstable-nios2mmu" branch not compiling 2: Assuming I can get "unstable-nios2mmu" to compile, which branch is the correct/better one to use Cheers Tones36 Replies
- Altera_Forum
Honored Contributor
Hi Pierre
Like I said earlier I'm also very new to the Nios/Linux dev, but if you go to the linux-2.6 directory and type "git show" you will see a quick sumary of the current commit you're working from, the date at the top should be fairly new (mine is late April 2011). about the location of nios.h, i don't have the linux-2.6/arch/nios2/boards/generic-dts/include/asm/ in my branch, but did get the nios.h file in this location linux-2.6/arch/nios2/include/asm/nios.h so I have been modding that file instead. [If that's wrong, will the more experienced guys please let me know please ] For me to get to the dts file location, I do make menuconfig then customize kernel setings => exit and save. then from the kernel config screens I find it under Platform Options, then enable "Compile and link device tree into kernel image" and then the option to enter dts file location becomes available right underneath. Hope that helps. I'm currently struggling to program my kernel into ram, but I'm suspecting a SDRAM timing issue. Keep fighting the good fight dude, we'll get there eventually .... :) Cheers Antonie - Altera_Forum
Honored Contributor
Hi,
Ok, but I don't know why I have any linux-2.6/arch/nios2/include/asm/nios.h path.... May be I have the wrong branch. After untar the Linux tarball, I did : /////////////////////////////////////////////////// cd linux-2.6 git checkout unstable-nios2mmu cd ../uClinux-dist git checkout trunk cd .. ./checkout # to obtain the toolchain-mmu but I stay in unstable-nios2mmu branch for linux-2.6 (checked with "git status") //////////////////////////////////////////////////// Thank you for your help Best regards. Pierre - Altera_Forum
Honored Contributor
I believe that is correct though, as far as I know you must be in the unstable-nios2mmu branch. did you also fetch the latest version of the repository with "git fetch origin" from the linux-2.6 directory?
when you do "git show" from linux-2.6, what date is listed at the top? - Altera_Forum
Honored Contributor
Hi,
Thank you very much for your help!!!! I forgot "git fetch origin"... I optained my first Kernel image, but it dosen't make boot... I have one question : I don't understand the Altera Wiki... Have I to make my SDRAM at the address 0x10000000 or the on-chip memory at this address ? Because Linux is in SDRAM... I work know with mmu. Best regards. Pierre - Altera_Forum
Honored Contributor
Hi,
I found!! The address of the SDRAM is 0x10000000. I fact I used zImage.initramfs.gz instead of linux.initramfs.gz... With this, uClinux boots. Pierre - Altera_Forum
Honored Contributor
Congrats! You're now 1 step ahead of me, still having issues programming my kernel to ram and running my CPU up. I'm glad though cause this confirms that I'm on the right track at least.
Cheers Antonie - Altera_Forum
Honored Contributor
Hi,
Do you have problems with "nios2-download" ? Or is it a hardware problem? Pierre - Altera_Forum
Honored Contributor
Hi Pierre, did get it to download in the end, but it does not boot successfully, during the bootup process I get
BUG: failure at /home/antonie.christie/nios2-linux/linux-2.6/arch/nios2/kernel/time.c:128/nios2_late_time_init()! Kernel panic - not syncing: BUG! I am running on custom hardware with a CPU based on the golden reference for the cycloneIII devkit. I've got a bit of debugging to do and I suspect my hardware or CPU design to be the main cause. Good luck with the rest of the development... - Altera_Forum
Honored Contributor
Hi,
Do you have a timer in your design? You have to add a timer for Linux functioning -> full featured, counter size 32 with interrupt priority level of 0 (most important interrupt). Pierre - Altera_Forum
Honored Contributor
Thanks, I did have one, but it wasn't full featured,
With the full featured timer I managed to get it to boot but it is still temperamental, I suspect faulty SDRAM timings are causing me some issues. Antonie