mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org,
	Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: Re: [PATCH] cfa10036: Retrieve the RAM size at runtime
Date: Mon, 25 Mar 2013 13:58:40 +0100	[thread overview]
Message-ID: <51504A00.3050303@free-electrons.com> (raw)
In-Reply-To: <20130325125156.GD1906@pengutronix.de>

On 25/03/2013 13:51, Sascha Hauer wrote:
>
> index 1bc20cf..37cc17e 100644
> --- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
> +++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
> @@ -39,6 +39,8 @@
>  #include <asm/armlinux.h>
>  #include <asm/mmu.h>
>  
> +#include <asm-generic/sections.h>
> +
>  #include <mach/fb.h>
>  
>  #include <generated/mach-types.h>
> @@ -90,9 +92,77 @@ static struct i2c_gpio_platform_data i2c_gpio_pdata = {
>  	.udelay			= 5,		/* ~100 kHz */
>  };
>  
> +/*
> + * Copied from get_ram_size in common/memory.c
> + */
> +long cfa10036_get_ram_size(volatile long *base, long maxsize)
> +{
> When I asked for a local version of this function I had something like
> this in mind, not a complete copy of the function.
>
> 	volatile u32 *base = (void *)IMX_MEMORY_BASE;
> 	volatile u32 *ofs = base + SZ_128M;
>
> 	*base = *ofs = 0xdeadbeef;
>
> 	*ofs = 0x11223344;
> 	if (*base == 0x11223344)
> 		return SZ_128M;
> 	else
> 		return SZ_256M;
>

Yeah, I was also thinking about stripping it. But, for the sake of being
future proof, I finally chose to keep the full version.

Maybe, we can assume that we will never have less than 128M of ram if
you want to simplify it ?

Maxime, any input ?

Regards,

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-03-25 12:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 15:36 Alexandre Belloni
2013-03-25 11:26 ` Maxime Ripard
2013-03-25 12:51 ` Sascha Hauer
2013-03-25 12:58   ` Alexandre Belloni [this message]
2013-03-25 13:02     ` Maxime Ripard
  -- strict thread matches above, loose matches on Subject: below --
2013-02-13 16:50 Maxime Ripard
2013-02-13 17:09 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-14  9:42   ` Maxime Ripard

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=51504A00.3050303@free-electrons.com \
    --to=alexandre.belloni@free-electrons.com \
    --cc=barebox@lists.infradead.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=s.hauer@pengutronix.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