AT91 kernel programming documentation ?
Hi,
I'm looking for some good documentation concerning AT91 Linux kernel development. Currently I have a Olimex AT91SAM9260 development board which is supported by the at91 patch set.
Now I would like to add different hardware to the board and write some kernel code for it.
Unfortunately, there doesn't seem to be a lot of documentation.
At the moment I'm reading mach-at91 related source code and trying to find out how things work.
Specificly, I would like to know how the different SoC devices can be accessed and used, how I can do port multiplexing, how I can tell the kernel which hardware is attached to where and so on.
Can you guys suggest any documentation ?
Quoted 3 lines · Stefan Schoenleitner
I'm looking for some good documentation concerning AT91 Linux kernel development. Currently I have a Olimex AT91SAM9260 development board which is supported by the at91 patch set.
The base functionality is supported in the Linux mainline.
Quoted 2 lines
Now I would like to add different hardware to the board and write some kernel code for it.
What kind of hardware?
Quoted 3 lines
Unfortunately, there doesn't seem to be a lot of documentation. At the moment I'm reading mach-at91 related source code and trying to find out how things work.
I assume you've already bought a copy of the Rubini Device Driver book?
Quoted 3 lines
Specificly, I would like to know how the different SoC devices can be accessed and used, how I can do port multiplexing, how I can tell the kernel which hardware is attached to where and so on.
Check arch/arm/mach-at91/*. It very much depends on what you want to do. Documentation/drivermodel/ might also be worth a look.
rsc
Signature · 5 lines
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9Hi,
Quoted 6 lines · Robert Schwebel
[...]
Quoted 2 lines
Now I would like to add different hardware to the board and write some kernel code for it.
What kind of hardware?
An audio codec (TLV320AIC23B) connected to the I2C and I2S (over Atmel SSC) bus. There seems to be a codec driver already (drivers/media/video/tlv320aic23b.c) though it looks like I'll have to modify the driver a bit to support other sampling rates as well.
Currently my first goal is to get the audio codec up and running so that it works with ALSA.
Then I would like to add two SPI devices as well.
Since most of the chipselect lines are already used I was thinking of using a demultiplexer which is supported by the AT91SAM9260.
Due to the fact that the board will be a custom design, I guess I will also have to write a board implementation (i.e. arch/arm/mach-at91/board-<myboardname>.c) so that the kernel for example knows which ports are used for communication buses on the pins.
Reading the source code already shed a little light on how things are done.
Quoted 6 lines
Quoted 4 lines
Unfortunately, there doesn't seem to be a lot of documentation. At the moment I'm reading mach-at91 related source code and trying to find out how things work.
I assume you've already bought a copy of the Rubini Device Driver book?
I read various papers and kernel documentation, parts of it also being from the second edition of the book.
However, I just saw that there's a newer (third edition) available. It's online under a CC license: http://lwn.net/Kernel/LDD3/
However, although the book gives a good intoduction on writing drivers, it seems to miss some parts like SPI, I2C, board implementation and such. IMHO the best way is to use the book as reference for driver implementation and to read the existing AT91 kernel code.
Quoted 6 lines
Quoted 3 lines
Specificly, I would like to know how the different SoC devices can be accessed and used, how I can do port multiplexing, how I can tell the kernel which hardware is attached to where and so on.
Check
arch/arm/mach-at91/*. It very much depends on what you want to do.Documentation/drivermodel/might also be worth a look.
arch/arm/mach-at91 is where I looked at the source most of the time. However, I didn't notice Documentation/drivermodel until now. Thank you for mentioning it.
Book about embedded-type device drivers
Quoted 4 lines · Stefan Schoenleitner
I read various papers and kernel documentation, parts of it also being from the second edition of the book.
However, I just saw that there's a newer (third edition) available. It's online under a CC license: http://lwn.net/Kernel/LDD3/
The 3rd edition is certainly newer than the second, but starts to be quite old. It has been written against the 2.6.10/2.6.11 kernels.
Quoted 5 lines
However, although the book gives a good intoduction on writing drivers, it seems to miss some parts like SPI, I2C, board implementation and such. IMHO the best way is to use the book as reference for driver implementation and to read the existing AT91 kernel code.
In addition to « Linux Device Drivers », a good book is « Essential Linux Device Drivers », from Sreekrishnan Venkateswaran, available at Prentice Hall. This book is very recent (April 2008).
1. Introduction
2. A peek inside the kernel (timers, concurrency, memory, etc.)
3. Kernel facilities (threads, helper interfaces)
4. Laying the groundwork (IRQ, device model, memory barriers, etc.)
5. Character drivers
6. Serial drivers (including TTY drivers and line discipline drivers)
7. Input drivers (evdev interface, serio, keyboard, mice, touch controllers, accelerometers, etc.)
8. I2C (I2C core, EEPROM driver, RTC driver, i2c-dev, SPI, 1-wire)
9. PCMCIA and Compact Flash
10. PCI
11. USB
12. Video drivers (frame buffer, console drivers)
13. Audio drivers
14. Block drivers
15. Network interface cards
16. Linux without wires (Bluetooth, Infrared, Wifi)
17. MTD
18. Embedded Linux
19. Drivers in userspace
20. More devices and drivers
21. Debugging device drivers
22. Maintenance and delivery
23. Shutting Down
I'm at the end of chapter 8, and until now, it's really good.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com
Re: Book about embedded-type device drivers
Hi,
Quoted 3 lines · Thomas Petazzoni
In addition to « Linux Device Drivers », a good book is « Essential Linux Device Drivers », from Sreekrishnan Venkateswaran, available at Prentice Hall. This book is very recent (April 2008).
thank you very much for the hint. LDD3 is indeed a bit outdated and I also missed a chapter about I2C device driver development.
Best regards,
Markus