From: Wolfgang Denk Date: Tue, 06 May 2008 21:33:58 +0200 Subject: [U-Boot-Users] [PATCH 20/21] Support AT91CAP9 revC CPUs In-Reply-To: Your message of "Tue, 06 May 2008 17:33:42 +0200." <1210088022-25757-21-git-send-email-stelian@popies.net> Message-ID: <20080506193358.89C49247F5@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <1210088022-25757-21-git-send-email-stelian@popies.net> you wrote: > > Signed-off-by: Stelian Pop > --- > board/atmel/at91cap9adk/at91cap9adk.c | 28 ++++++++++++++++++++++++++++ > include/asm-arm/arch-at91sam9/at91_pmc.h | 5 +++++ > include/asm-arm/arch-at91sam9/at91cap9.h | 14 +++++++++++++- > 3 files changed, 46 insertions(+), 1 deletions(-) > > diff --git a/board/atmel/at91cap9adk/at91cap9adk.c b/board/atmel/at91cap9adk/at91cap9adk.c > index ee4f26e..b92dd82 100644 > --- a/board/atmel/at91cap9adk/at91cap9adk.c > +++ b/board/atmel/at91cap9adk/at91cap9adk.c > @@ -72,6 +72,33 @@ static void at91cap9_serial_hw_init(void) > #endif > } > > +static void at91cap9_slowclock_hw_init(void) > +{ > + /* > + * On AT91CAP9 revC CPUs, the slow clock can be based on an > + * internal impreciseRC oscillator or an external 32kHz oscillator. > + * Switch to the latter. > + */ > +#define ARCH_ID_AT91CAP9_REVB 0x399 > +#define ARCH_ID_AT91CAP9_REVC 0x601 > + if (at91_sys_read(AT91_PMC_VER) == ARCH_ID_AT91CAP9_REVC) { > + unsigned i, tmp = at91_sys_read(AT91_SCKCR); > + if ((tmp & AT91CAP9_SCKCR_OSCSEL) == AT91CAP9_SCKCR_OSCSEL_RC) { Please don't add #defines in the middle of a source file. Either right at the beginning, or in a header file. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage. - Ambrose Bierce