linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rmallon@gmail.com (Ryan Mallon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 17/21] ARM: at91: merge SRAM Memory banks thanks to mirroring
Date: Fri, 24 Feb 2012 08:47:11 +1100	[thread overview]
Message-ID: <4F46B3DF.7010402@gmail.com> (raw)
In-Reply-To: <c9b1e3ffbc322a1d1e1272062a9361abe536a33a.1330006537.git.nicolas.ferre@atmel.com>

On 24/02/12 01:26, Nicolas Ferre wrote:

> From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> 
> On at91sam9260 and at91sam9g20 the SRAM banks are mirrored. We can
> merge them together to be able to have bigger and continuous
> internal RAM.

I think this patch needs some comments in the code. As mentioned in the
last round, this functionality is not documented, so it is not obvious
how/why this works. This is especially true for any user who has
problems with this code and then tries to look up those addresses in
their at91 manual only to find the regions are reserved.

Nicolas, are you able to give an official Atmel stance on this?

~Ryan

> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  arch/arm/mach-at91/at91sam9260.c              |   13 +++++--------
>  arch/arm/mach-at91/include/mach/at91sam9260.h |    4 ++++
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
> index 14882ae..4ade265 100644
> --- a/arch/arm/mach-at91/at91sam9260.c
> +++ b/arch/arm/mach-at91/at91sam9260.c
> @@ -310,15 +310,12 @@ static void __init at91sam9xe_map_io(void)
>  
>  static void __init at91sam9260_map_io(void)
>  {
> -	if (cpu_is_at91sam9xe()) {
> +	if (cpu_is_at91sam9xe())
>  		at91sam9xe_map_io();
> -	} else if (cpu_is_at91sam9g20()) {
> -		at91_init_sram(0, AT91SAM9G20_SRAM0_BASE, AT91SAM9G20_SRAM0_SIZE);
> -		at91_init_sram(1, AT91SAM9G20_SRAM1_BASE, AT91SAM9G20_SRAM1_SIZE);
> -	} else {
> -		at91_init_sram(0, AT91SAM9260_SRAM0_BASE, AT91SAM9260_SRAM0_SIZE);
> -		at91_init_sram(1, AT91SAM9260_SRAM1_BASE, AT91SAM9260_SRAM1_SIZE);
> -	}
> +	else if (cpu_is_at91sam9g20())
> +		at91_init_sram(0, AT91SAM9G20_SRAM_BASE, AT91SAM9G20_SRAM_SIZE);
> +	else
> +		at91_init_sram(0, AT91SAM9260_SRAM_BASE, AT91SAM9260_SRAM_SIZE);
>  }
>  
>  static void __init at91sam9260_ioremap_registers(void)
> diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h
> index 2e47b6d..08ae9af 100644
> --- a/arch/arm/mach-at91/include/mach/at91sam9260.h
> +++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
> @@ -113,6 +113,8 @@
>  #define AT91SAM9260_SRAM0_SIZE	SZ_4K		/* Internal SRAM 0 size (4Kb) */
>  #define AT91SAM9260_SRAM1_BASE	0x00300000	/* Internal SRAM 1 base address */
>  #define AT91SAM9260_SRAM1_SIZE	SZ_4K		/* Internal SRAM 1 size (4Kb) */
> +#define AT91SAM9260_SRAM_BASE	0x002FF000	/* Internal SRAM base address */
> +#define AT91SAM9260_SRAM_SIZE	SZ_8K		/* Internal SRAM size (8Kb) */
>  
>  #define AT91SAM9260_UHP_BASE	0x00500000	/* USB Host controller */
>  
> @@ -126,6 +128,8 @@
>  #define AT91SAM9G20_SRAM0_SIZE	SZ_16K		/* Internal SRAM 0 size (16Kb) */
>  #define AT91SAM9G20_SRAM1_BASE	0x00300000	/* Internal SRAM 1 base address */
>  #define AT91SAM9G20_SRAM1_SIZE	SZ_16K		/* Internal SRAM 1 size (16Kb) */
> +#define AT91SAM9G20_SRAM_BASE	0x002FC000	/* Internal SRAM base address */
> +#define AT91SAM9G20_SRAM_SIZE	SZ_32K		/* Internal SRAM size (32Kb) */
>  
>  #define AT91SAM9G20_UHP_BASE	0x00500000	/* USB Host controller */
>  

  reply	other threads:[~2012-02-23 21:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 14:25 [PATCH v3 00/21] at91 first cleanup series for 3.4 Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 01/21] ARM: at91: factorise duplicated at91sam9 idle Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 02/21] ARM: at91/at91x40: remove use of at91_sys_read/write Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 03/21] ARM: at91: make matrix register base soc independent Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 04/21] ARM: at91: make ST (System Timer) " Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 05/21] ARM: at91/ST: remove not needed casts Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 06/21] ARM: at91/pm_slowclock: rename register to named define Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 07/21] ARM: at91/pm_slowclock: function slow_clock() accepts parameters Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 08/21] ARM: at91: move at91rm9200 sdramc defines to at91rm9200_sdramc.h Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 09/21] ARM: at91: make sdram/ddr register base soc independent Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 10/21] ARM: at91/pm_slowclock: add runtime detection of memory contoller Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 11/21] ARM: at91/PMC: move assignment out of printf Nicolas Ferre
2012-02-23 21:50   ` Ryan Mallon
2012-02-23 14:25 ` [PATCH v3 12/21] ARM: at91/PMC: make register base soc independent Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 13/21] ARM: at91/rtc-at91sam9: each SoC can select the RTT device to use Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 14/21] ARM: at91:rtc/rtc-at91sam9: ioremap register bank Nicolas Ferre
2012-02-23 14:25 ` [PATCH v3 15/21] ARM: at91/rtc-at91sam9: pass the GPBR to use via resources Nicolas Ferre
2012-02-23 14:26 ` [PATCH v3 16/21] ARM: at91: finally drop at91_sys_read/write Nicolas Ferre
2012-02-23 21:48   ` Ryan Mallon
2012-02-23 14:26 ` [PATCH v3 17/21] ARM: at91: merge SRAM Memory banks thanks to mirroring Nicolas Ferre
2012-02-23 21:47   ` Ryan Mallon [this message]
2012-02-24 16:54     ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-26 22:45       ` Ryan Mallon
2012-02-23 14:26 ` [PATCH v3 18/21] Atmel: move console default platform_device to serial driver Nicolas Ferre
2012-02-23 14:26 ` [PATCH v3 19/21] ARM: at91/board-dt: drop default console Nicolas Ferre
2012-02-23 14:26 ` [PATCH v3 20/21] ARM: at91: add at91sam9g25ek.dts in Makefile.boot Nicolas Ferre
2012-02-23 14:26 ` [PATCH v3 21/21] ARM: at91: properly sort dtb files " Nicolas Ferre

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=4F46B3DF.7010402@gmail.com \
    --to=rmallon@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).