Hey all, I've successfully added GPIO and SPI drivers to the 2.6.32-2 kernel of my mini2440 board. I've described the process on my website here: http://members.cox.net/ebrombaugh1/embedded/mini2440/index.html I hope this is useful. Please let me know if you have any questions about or corrections to the material.
Adding GPIO and SPI to the mini2440 kernel
Hi Thanks emeb. I was using Angstrom kernel build for SPI & GPIO . How about adding IRQ handling to userspace. For example in the angstrom build I can do a select or poll on IRQ 52 (key 1) in /proc/irq/52 I can get a count of the times it has been pressed. --regards fatbrain
fatbrain - Thanks for looking that over and your comments. I'll check into what's required to add the user-space IRQ support. If it's just a config option it should be pretty easy to do.
Thank you emeb :) you tutorial works well, Now I have access to GPIO thru command line, But do you have any C Programs that uses GPIO syscalls method for mini2440? A very simple that just turns on and off a pin, say GPE15 will suffice. Thanks in advance.
H4med - I'm glad that was helpful for you. I don't yet have any C code to talk to the GPIO sysfs, but that is something I need to do soon. I'll post it when I get it working.
Have a look at: http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO
emeb - I have a Problem, I've installed new complied Kernel, it has gpio class and I have access to gpio thru command line and every thing is ok, but when I reboot, the system dose not work at all just a black screen! DNW says that linux loading... but the screen has nothing! but if I reboot with DNW (by pressing 'b') it reboots correctly. It seems that something dose not work well when I reboot manually... manual Reboot: --------------------------------------------------------------------- load Image of Linux...Uncompressing Linux...................................................................... ............................................................ done, booting the kernel. . . etc DNW Reboot: --------------------------------------------------------------------- Enter your selection: b Copy linux kernel from 0x00060000 to 0x30008000, size = 0x00200000 ... done zImage magic = 0x016f2818 Setup linux parameters at 0x30000100 linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999 NOW, Booting Linux...... Uncompressing Linux...................................................................... ............................................................ done, booting the kernel. pls help me!
in DNW Configuration, the USB address is always 0x30000000, or it differs for bootloader, kernel etc.. ? it seems that it has an "boot address loading problem"! as I wrote before boot from DNW works well and as it shows below, DNW dose some copy stuff!: DNW Reboot: --------------------------------------------------------------------- Enter your selection: b Copy linux kernel from 0x00060000 to 0x30008000, size = 0x00200000 ... done zImage magic = 0x016f2818 Setup linux parameters at 0x30000100 linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999 NOW, Booting Linux...... Uncompressing Linux...................................................................... ............................................................ done, booting the kernel. . . etc.... but manually rebooting dose not do that: manual Reboot: --------------------------------------------------------------------- load Image of Linux...Uncompressing Linux...................................................................... ............................................................ done, booting the kernel. . . etc ,...
Hi emeb, I am new to mini2440. I need to handle interrupts. You were planning to write some code to handle the interrupts in userspace. Did you get to it? If not, I want to write some driver to handle the interrupt. I have done pci based drivers but am bit confused on how to do a request_irq on this board. How would the kernel map which IRQ to the isr. Is it that one generic ISR will be registered and in the isr we will figure out which irq triggered. Thanks
emeb in your manual you say "or else upgrade your entire NAND installation to use more up-to-date firmware" I am "in or else"! Is there a manual of how to do this? Is it enough το upgrade the supervivi to the last version or replace it with u-boot from the friendlyARM-downloads?
Sunitha, I don't recall saying I was going to work on interrupt processing. You must be confusing me with someone else.
Xristos, I don't know precisely what's required to update your entire NAND installation - perhaps the Chinese version of the FriendlyARM manual has details on how to do that. It should be fairly simple though - just download the NAND images of the kernel and filesystem from the FriendlyARM website and use supervivi to transfer them into the NAND.
emeb, I compiled a kernel according to your instruction and it seems to work. I had problems with kernel partition size and I needed to enlarge it. but when I tried to use the new file-system I encountered the problem I describe here: http://www.friendlyarm.net/forum/topic/661#lastpost Now I flashed u-boot and I will try to run emdebian with your kernel since I didn't fount a solution to the previous problem. Do you happen to know, how do I add sys/class/gpio if I have a working system? "which I hope to have soon". Thanks for the help "the kernel instruction was wonderful :)
Hello everyone I am relatively new to handling the linux kernel I have the linux kernel 2.6.29. I recompiled it to include the gpio drivers But now the size of the zImage is going beyond 2MB. What seems to be the problem? Have i included some extra options while compiling? PS I could not get make menuconfig to work... so i am using make config Thanks in advance for any help Cheers
Do you get an error message when you try to do <menuconfig>? Just a guess, something to do with ncurses?
Hi davef There is an error message.. and yes it is about ncurses i could not manage to install ncurses on my pc so i used <config> instead of <menuconfig> But i have knid of solved the issue I repartitioned the system... so that my kernel partition is now 3MB instead of 2MB I also shifted the root partition so as to avoid an overlap Now i am able to port the kernel zImage with the configurations for gpio and spi on my system But now there is a different problem When i boot the system from the NOR flash... ie. from the BIOS menu it works fine But the system does not boot at all from the NAND flash what could be wrong Th only changes i have made are: 1. repartitioning as explained above 2. In linux command line in the boot parameters i changed "root=/dev/mtdblock2" to "root=/dev/mtdblock3" Apart from this everything is the same where am i going wrng? Also could you give me a guideline as to what you mean by "mtdblock" and "zImage" sorry for the newbie questions Thanks in advance Chinmay
Chinmay, There have been several recent posts about your "won't boot from NAND flash" problem. I haven't tried changing kernel partition size. zImage is created when you do a kernel compilation, it seems to be the default. A zImage is loaded by Supervivi. If you want to use u-boot then you use mkimage (with the correct switches) to generate a uImage. You will find mtdblock in /dev, http://www.linux-mtd.infradead.org/faq/jffs2.html and maybe try Wikopedia.
hi emeb i watched your suggestioned webpage and i compilied a linux kernel with that configuraton files but i can't use gpio from shell yet..whould you please help me?
Hi emeb, I have micro2440 with 7'lcd & i followed your tutorial step by step http://members.cox.net/ebrombaugh1/embedded/mini2440/index.html after i port the zImage to board nothing comes up on the console nor on the display need help.
Please, can anybody share the compiled version of Linux for Mini2440 with enabled GPIO and SPI? It will help me a lot! Thanks for it!
please help me i can not access the step by step guide website for spi. is there any other resource that i can use? or any one can send me that tutorial?
Here is a zip with the emeb's page and the needed files: http://dl.dropbox.com/u/6983593/emeb_kernel.zip I had downloaded the page in case it brakes one day. open Compiling_kernel_emeb.zip inside to see the page. It's an old kernel but it works. You will have problems if you try to run new angstrom (openembedded) filesystems ("/dev/misc/rtc: file not fount" or something like that). I thing there is a work around if you are willing to modify .conf I now try to add SPI support in a kernel built this way: http://billforums.station51.net/viewtopic.php?f=4&t=20 I added spi with menuconfig but something is missing. I will propably try to use the script from emeb kernel
If you have the will to adapt the emeb kernel for new angstrom this will probably help: http://dominion.thruhere.net/koen/cms/recommended-kernel-config-options-...
I posted a more analytic answer here: http://billforums.station51.net/viewtopic.php?f=4&t=792 And I attach the mini-mach