[U-Boot-Users] [PATCH 20/21] Support AT91CAP9 revC CPUs

Wolfgang Denk wd at denx.de
Tue May 6 21:33:58 CEST 2008


In message <1210088022-25757-21-git-send-email-stelian at popies.net> you wrote:
> 
> Signed-off-by: Stelian Pop <stelian at popies.net>
> ---
>  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




More information about the U-Boot mailing list