public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/8] Update at91sam9m10g45_devices.c to fix compile errors.
Date: Mon, 04 Jul 2011 09:35:47 +0200	[thread overview]
Message-ID: <4E116D53.90308@emk-elektronik.de> (raw)
In-Reply-To: <1309462387-22926-3-git-send-email-awaterman@dawning.com>

Dear Alex Waterman,
> Move this file to the new ATMEL_BASE_* and ATMEL_ID_* defines.
> 
> Also fixed a problem appearing in the ethernet initialization where
> the entire board was being reset, not just the ethernet controller.
> This at least makes ethernet work on my board if the correct
> environment (mac address, ip address, etc) is available on boot.
> 
> Signed-off-by: Alex Waterman <awaterman@dawning.com>
> ---
>  .../cpu/arm926ejs/at91/at91sam9m10g45_devices.c    |   26 ++++++++++----------
>  1 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9m10g45_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9m10g45_devices.c
> index 4ad9b1f..9ef8966 100644
> --- a/arch/arm/cpu/arm926ejs/at91/at91sam9m10g45_devices.c
> +++ b/arch/arm/cpu/arm926ejs/at91/at91sam9m10g45_devices.c
> @@ -26,42 +26,42 @@
>  #include <asm/arch/at91_common.h>
>  #include <asm/arch/at91_pmc.h>
>  #include <asm/arch/gpio.h>
> -#include <asm/arch/io.h>
> +#include <asm/io.h>
>  
>  void at91_serial0_hw_init(void)
>  {
> -	at91_pmc_t	*pmc	= (at91_pmc_t *) AT91_PMC_BASE;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
>  
>  	at91_set_a_periph(AT91_PIO_PORTB, 19, 1);	/* TXD0 */
>  	at91_set_a_periph(AT91_PIO_PORTB, 18, 0);	/* RXD0 */
> -	writel(1 << AT91SAM9G45_ID_US0, &pmc->pcer);
> +	writel(1 << ATMEL_ID_USART0, &pmc->pcer);
>  }
>  
>  void at91_serial1_hw_init(void)
>  {
> -	at91_pmc_t	*pmc	= (at91_pmc_t *) AT91_PMC_BASE;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
>  
>  	at91_set_a_periph(AT91_PIO_PORTB, 4, 1);		/* TXD1 */
>  	at91_set_a_periph(AT91_PIO_PORTB, 5, 0);		/* RXD1 */
> -	writel(1 << AT91SAM9G45_ID_US1, &pmc->pcer);
> +	writel(1 << ATMEL_ID_USART1, &pmc->pcer);
>  }
>  
>  void at91_serial2_hw_init(void)
>  {
> -	at91_pmc_t	*pmc	= (at91_pmc_t *) AT91_PMC_BASE;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
>  
>  	at91_set_a_periph(AT91_PIO_PORTD, 6, 1);		/* TXD2 */
>  	at91_set_a_periph(AT91_PIO_PORTD, 7, 0);		/* RXD2 */
> -	writel(1 << AT91SAM9G45_ID_US2, &pmc->pcer);
> +	writel(1 << ATMEL_ID_USART2, &pmc->pcer);
>  }
>  
>  void at91_serial3_hw_init(void)
>  {
> -	at91_pmc_t	*pmc	= (at91_pmc_t *) AT91_PMC_BASE;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
>  
>  	at91_set_a_periph(AT91_PIO_PORTB, 12, 0);	/* DRXD */
>  	at91_set_a_periph(AT91_PIO_PORTB, 13, 1);	/* DTXD */
> -	writel(1 << AT91_ID_SYS, &pmc->pcer);
> +	writel(1 << ATMEL_ID_USART3, &pmc->pcer);
>  }

If this is the debug UART, ID_USART3 is definitely wrong here. Also
following the example set up by at91sam9260_devives.c, this function
should be named "at91_seriald_hw_init".

>  
>  void at91_serial_hw_init(void)

There should be no such function left after rework.


> @@ -86,14 +86,14 @@ void at91_serial_hw_init(void)
>  #ifdef CONFIG_ATMEL_SPI
>  void at91_spi0_hw_init(unsigned long cs_mask)
>  {
> -	at91_pmc_t	*pmc	= (at91_pmc_t *) AT91_PMC_BASE;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
>  
>  	at91_set_a_periph(AT91_PIO_PORTB, 0, 0);	/* SPI0_MISO */
>  	at91_set_a_periph(AT91_PIO_PORTB, 1, 0);	/* SPI0_MOSI */
>  	at91_set_a_periph(AT91_PIO_PORTB, 2, 0);	/* SPI0_SPCK */
>  
>  	/* Enable clock */
> -	writel(1 << AT91SAM9G45_ID_SPI0, &pmc->pcer);
> +	writel(1 << ATMEL_ID_SPI0, &pmc->pcer);
>  
>  	if (cs_mask & (1 << 0)) {
>  		at91_set_a_periph(AT91_PIO_PORTB, 3, 0);
> @@ -123,14 +123,14 @@ void at91_spi0_hw_init(unsigned long cs_mask)
>  
>  void at91_spi1_hw_init(unsigned long cs_mask)
>  {
> -	at91_pmc_t	*pmc	= (at91_pmc_t *) AT91_PMC_BASE;
> +	at91_pmc_t	*pmc	= (at91_pmc_t *) ATMEL_BASE_PMC;
>  
>  	at91_set_a_periph(AT91_PIO_PORTB, 14, 0);	/* SPI1_MISO */
>  	at91_set_a_periph(AT91_PIO_PORTB, 15, 0);	/* SPI1_MOSI */
>  	at91_set_a_periph(AT91_PIO_PORTB, 16, 0);	/* SPI1_SPCK */
>  
>  	/* Enable clock */
> -	writel(1 << AT91SAM9G45_ID_SPI1, &pmc->pcer);
> +	writel(1 << ATMEL_ID_SPI1, &pmc->pcer);
>  
>  	if (cs_mask & (1 << 0)) {
>  		at91_set_a_periph(AT91_PIO_PORTB, 17, 0);

Those also miss the pull-up option like in at91sam9260_devices.c.


Please fix this file in the style done by at91sam9260_devices.c or
wait until I have done so.

Best Regards,
Reinhard

  reply	other threads:[~2011-07-04  7:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 22:47 [U-Boot] Is somebody workin on getting the AT91SAM9G45EKES working on the latest build? William C. Landolina
2011-06-30 12:32 ` Alex Waterman
2011-06-30 13:12   ` Albert ARIBAUD
2011-06-30 20:01     ` Alex Waterman
2011-06-30 19:14   ` [U-Boot] [PATCH 0/8] Fixes compilation for the at91sam9m10g45ek Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 1/8] Remove old config stuff from Makefile Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 2/8] Update at91sam9m10g45_devices.c to fix compile errors Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 3/8] Fix compile problem for some boards in the clock code Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 4/8] Updates the at91sam9mg45_matrix.h header to new defines Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 5/8] Updates the board specific files for the at91sam9mg45ek Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 6/8] Adds wait to atmel_usart serial_init function Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 7/8] Updates the at91sam9m10g45ek.h config file Alex.Waterman.awaterman at dawning.com
2011-06-30 19:14     ` [U-Boot] [PATCH 8/8] Updates the boards.cfg file Alex.Waterman.awaterman at dawning.com
     [not found]   ` <657FC3AB549C7F4DB01F4397232ED733A2DACD735E@Exchange2007.techatl.com>
2011-06-30 19:32     ` [U-Boot] Is somebody workin on getting the AT91SAM9G45EKES working on the latest build? Alex Waterman
2011-06-30 20:54       ` William C. Landolina
2011-07-01 13:15         ` Alex Waterman
2011-07-01 19:37           ` William C. Landolina
2011-06-30 19:32   ` [U-Boot] [PATCH 0/8] Fixes compilation for the at91sam9m10g45ek Alex Waterman
2011-06-30 19:33     ` [U-Boot] [PATCH 1/8] Remove old config stuff from Makefile Alex Waterman
2011-06-30 19:33     ` [U-Boot] [PATCH 2/8] Update at91sam9m10g45_devices.c to fix compile errors Alex Waterman
2011-07-04  7:35       ` Reinhard Meyer [this message]
2011-06-30 19:33     ` [U-Boot] [PATCH 3/8] Fix compile problem for some boards in the clock code Alex Waterman
2011-07-04  7:37       ` Reinhard Meyer
2011-06-30 19:33     ` [U-Boot] [PATCH 4/8] Updates the at91sam9mg45_matrix.h header to new defines Alex Waterman
2011-06-30 19:33     ` [U-Boot] [PATCH 5/8] Updates the board specific files for the at91sam9mg45ek Alex Waterman
2011-06-30 19:33     ` [U-Boot] [PATCH 6/8] Adds wait to atmel_usart serial_init function Alex Waterman
2011-07-01 12:03       ` Sergei Shtylyov
2011-07-01 12:37         ` Alex Waterman
2011-07-01 15:17           ` Albert ARIBAUD
2011-07-04  7:42       ` Reinhard Meyer
2011-06-30 19:33     ` [U-Boot] [PATCH 7/8] Updates the at91sam9m10g45ek.h config file Alex Waterman
2011-07-04  7:50       ` Reinhard Meyer
2011-06-30 19:33     ` [U-Boot] [PATCH 8/8] Updates the boards.cfg file Alex Waterman
2011-07-04  7:52       ` Reinhard Meyer
2011-08-02  8:19     ` [U-Boot] [PATCH 0/8] Fixes compilation for the at91sam9m10g45ek Thomas Petazzoni

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=4E116D53.90308@emk-elektronik.de \
    --to=u-boot@emk-elektronik.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox