linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Schoenleitner <dev.c0debabe@gmail.com>
To: Robert Schwebel <r.schwebel@pengutronix.de>
Cc: linux-embedded@vger.kernel.org
Subject: Re: AT91 kernel programming documentation ?
Date: Fri, 01 Aug 2008 08:36:49 +0200	[thread overview]
Message-ID: <4892AF01.7040205@gmail.com> (raw)
In-Reply-To: <20080730140113.GY8254@pengutronix.de>

Hi,

Robert Schwebel wrote:
> [...]
> 
>> 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.


> 
>> 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.

>> 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.

  reply	other threads:[~2008-08-01  6:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30 13:53 AT91 kernel programming documentation ? Stefan Schoenleitner
2008-07-30 14:01 ` Robert Schwebel
2008-08-01  6:36   ` Stefan Schoenleitner [this message]
2008-08-01  8:42     ` Book about embedded-type device drivers Thomas Petazzoni
2008-08-01  9:13       ` Markus Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4892AF01.7040205@gmail.com \
    --to=dev.c0debabe@gmail.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=r.schwebel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).