From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stelian Pop Date: Sat, 05 Apr 2008 20:02:39 +0200 Subject: [U-Boot-Users] AT91 Header File Clarification In-Reply-To: <206b9e70804041632o391fc02fscac580e81b4bec7c@mail.gmail.com> References: <206b9e70804041332w695212f3me41cfa8f7f182f11@mail.gmail.com> <1207347950.3762.3.camel@voyager.dsnet> <206b9e70804041632o391fc02fscac580e81b4bec7c@mail.gmail.com> Message-ID: <1207418559.4841.7.camel@voyager.dsnet> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le vendredi 04 avril 2008 ? 16:32 -0700, Zac Wheeler a ?crit : > On Fri, Apr 4, 2008 at 3:25 PM, Stelian Pop 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