diff mbox

[U-Boot,v2] Add support for Wandboard quad.

Message ID 20130528160435.51fb4668@triceratops
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Tapani Utriainen May 28, 2013, 8:04 a.m. UTC
Add support for Wandboard quad.

Signed-off-by: Tapani Utriainen <tapani@technexion.com>
---
 Changes from v1:
 - reorganized the board names into alphabetical order
 - added quad entry to the Wandboard README
 
 board/wandboard/README      | 5 +++++
 boards.cfg                  | 1 +
 include/configs/wandboard.h | 2 ++
 3 files changed, 8 insertions(+)

--
1.8.0.3

Comments

Otavio Salvador May 28, 2013, 12:22 p.m. UTC | #1
On Tue, May 28, 2013 at 5:04 AM, Tapani Utriainen <tapani@technexion.com>wrote:

>
> Add support for Wandboard quad.
>
> Signed-off-by: Tapani Utriainen <tapani@technexion.com>
>

Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Stefano Babic June 3, 2013, 9:28 a.m. UTC | #2
Hi Tapani,

On 28/05/2013 10:04, Tapani Utriainen wrote:
> 
> Add support for Wandboard quad.
> 
> Signed-off-by: Tapani Utriainen <tapani@technexion.com>
> ---

Due to increased memory, a warning is generated for wandboard_quad:

wandboard.c: In function 'dram_init':
wandboard.c:47:31: warning: integer overflow in expression [-Woverflow]

It is better to fix it directly into this patch. Can you fix it by
casting to phys_size_t and resubmit ?

	gd->ram_size = (phys_size_t)CONFIG_DDR_MB * SZ_1M;

By the way, I forget why it is not possible to use get_ram_size() here.
I know this is not part of this patch (could be done later), but any
hints why we cannot use as usual get_ram_size() in dram_init ?

Thanks,
Stefano Babic
Wolfgang Denk June 3, 2013, 11:21 a.m. UTC | #3
Dear Stefano Babic,

In message <51AC61A6.9050609@denx.de> you wrote:
> 
> It is better to fix it directly into this patch. Can you fix it by
> casting to phys_size_t and resubmit ?
> 
> 	gd->ram_size = (phys_size_t)CONFIG_DDR_MB * SZ_1M;

Please do NOT use these terrible  SZ_*  defines.  Never, ever.

They are dangerous and should be avoided.

Best regards,

Wolfgang Denk
Otavio Salvador June 3, 2013, 11:25 a.m. UTC | #4
On Mon, Jun 3, 2013 at 8:21 AM, Wolfgang Denk <wd@denx.de> wrote:

> Dear Stefano Babic,
>
> In message <51AC61A6.9050609@denx.de> you wrote:
> >
> > It is better to fix it directly into this patch. Can you fix it by
> > casting to phys_size_t and resubmit ?
> >
> >       gd->ram_size = (phys_size_t)CONFIG_DDR_MB * SZ_1M;
>
> Please do NOT use these terrible  SZ_*  defines.  Never, ever.
>
> They are dangerous and should be avoided.
>

Do you mind to explain why?
Wolfgang Denk June 3, 2013, 1:01 p.m. UTC | #5
Dear Otavio,

In message <CAP9ODKonqM3QLeryOBrgvgfqwdrT+2ePfk+MBECzewDhjQ6FQg@mail.gmail.com> you wrote:
>
> > Please do NOT use these terrible  SZ_*  defines.  Never, ever.
> >
> > They are dangerous and should be avoided.
> >
> 
> Do you mind to explain why?

Well, what does "SZ_1M" mean?  Is it 1000 * 1000 (as on hard disk
drives) or 1000 * 1024 (as on floppy disks) or 1024 * 1024 (as for
memory sizes)?

Instead of just seeing at first look what the code does, you have to
look up the actual define, i. e. it obfuscates the code instead of
being helpful.

This has been discussed several times before on the list; see for
example [1] or [2].

[1] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/67552/focus=67575
[2] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/93425

Best regards,

Wolfgang Denk
Otavio Salvador June 20, 2013, 1:26 p.m. UTC | #6
Hello Tapani,

On Tue, May 28, 2013 at 5:04 AM, Tapani Utriainen <tapani@technexion.com> wrote:
>
> Add support for Wandboard quad.
>
> Signed-off-by: Tapani Utriainen <tapani@technexion.com>

Can you handle the comments done by Wolfgang and Stefano?

It'd be very good to have it merged for 2013.07 but we're getting short on time.

--
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
diff mbox

Patch

diff --git a/board/wandboard/README b/board/wandboard/README
index e0b0b33..ff43e03 100644
--- a/board/wandboard/README
+++ b/board/wandboard/README
@@ -17,6 +17,11 @@  To build U-Boot for the Wandboard Dual Lite version:
 $ make wanboard_dl_config
 $ make
 
+To build U-Boot for the Wandboard Quad version:
+
+$ make wandboard_quad_config
+$ make
+
 To build U-Boot for the Wandboard Solo version:
 
 $ make wanboard_solo_config
diff --git a/boards.cfg b/boards.cfg
index 98a512e..b510555 100644
--- a/boards.cfg
+++ b/boards.cfg 
@@ -267,6 +267,7 @@  nitrogen6q2g                 arm         armv7       nitrogen6x          boundar    
 nitrogen6s                   arm         armv7       nitrogen6x          boundary       mx6            nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
 nitrogen6s1g                 arm         armv7       nitrogen6x          boundary       mx6            nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,MX6S,DDR_MB=1024
 wandboard_dl                arm         armv7       wandboard           -              mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL,DDR_MB=1024
+wandboard_quad              arm         armv7       wandboard           -              mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q2g.cfg,MX6Q,DDR_MB=2048
 wandboard_solo              arm         armv7       wandboard           -              mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
 cm_t35                       arm         armv7       cm_t35              -              omap3
 omap3_overo                  arm         armv7       overo               -              omap3
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 120e3f6..ac86626 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -83,6 +83,8 @@ 
 
 #if defined(CONFIG_MX6DL)
 #define CONFIG_DEFAULT_FDT_FILE                "imx6dl-wandboard.dtb"
+#elif defined(CONFIG_MX6Q)
+#define CONFIG_DEFAULT_FDT_FILE                "imx6q-wandboard.dtb"
 #elif defined(CONFIG_MX6S)
 #define CONFIG_DEFAULT_FDT_FILE                "imx6s-wandboard.dtb"
 #endif