All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stelian Pop <stelian@popies.net>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] AT91 Header File Clarification
Date: Sat, 05 Apr 2008 20:02:39 +0200	[thread overview]
Message-ID: <1207418559.4841.7.camel@voyager.dsnet> (raw)
In-Reply-To: <206b9e70804041632o391fc02fscac580e81b4bec7c@mail.gmail.com>


Le vendredi 04 avril 2008 ? 16:32 -0700, Zac Wheeler a ?crit :
> On Fri, Apr 4, 2008 at 3:25 PM, Stelian Pop <stelian@popies.net> wrote:
> >
> >  Le vendredi 04 avril 2008 ? 13:32 -0700, Zac Wheeler a ?crit :
> >
> > > I have a question about the arrangement of include files for the
> >  > at91sam9 family.
> >  >
> >  > Is the intention that asm/arch/at91_xxx.h be applicable for all
> >  > at91sam9 microcontrollers, or should they be broken down into subarch
> >  > folders (e.g. asm/arch/at91sam9261/at91_pmc.h)?
> >
> >  They are supposed to be shareable for all at91sam microcontrollers, in
> >  the same way it's done in Linux.
> 
> So should things like AT91_ECC as defined in at91sam960.h be
> AT91SAM9260_ECC instead or moved to an at91_sys.h file?

No, the idea is to keep the same conventions as the kernel guys. In fact
the header files have been copied from Linux, and are 95% identical to
them (we cannot use the header files provided by Atmel, because there is
too much craft inside, and rewriting a third form of the same headers
seemed to me too error prone).

As for AT91_ECC:

at91cap9.h:#define AT91_ECC     (0xffffe200 - AT91_BASE_SYS)
at91sam9260.h:#define AT91_ECC  (0xffffe800 - AT91_BASE_SYS)
at91sam9263.h:#define AT91_ECC0 (0xffffe000 - AT91_BASE_SYS)
at91sam9263.h:#define AT91_ECC1 (0xffffe600 - AT91_BASE_SYS)
at91sam9rl.h:#define AT91_ECC   (0xffffe800 - AT91_BASE_SYS)

seems to me quite nice this way !

>  It seems
> somewhat dangerous to define an AT91_ in a AT91SAM9260-specific file.

It shouldn't be. All the AT91 platforms have pretty much the same
hardware, so having the same constants means we don't need extra #ifdefs
in the driver code.

Of course, one should take care of including only the header file which
goes with his platform. This is what
include/asm-arm/arch-at91sam9/hardware.h does: based on what
CONFIG_AT91xxxxx is defined, the relevant platform specific header file
is included.

Stelian.
-- 
Stelian Pop <stelian@popies.net>

  reply	other threads:[~2008-04-05 18:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 20:32 [U-Boot-Users] AT91 Header File Clarification Zac Wheeler
2008-04-04 22:25 ` Stelian Pop
2008-04-04 23:32   ` Zac Wheeler
2008-04-05 18:02     ` Stelian Pop [this message]
2008-04-05  2:08   ` Zac Wheeler
2008-04-05 16:46     ` Stelian Pop

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=1207418559.4841.7.camel@voyager.dsnet \
    --to=stelian@popies.net \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.