Re: [U-Boot] [PATCH V4 6/9] SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT

2013-01-15 Thread Amarendra Reddy
Hi Simon,

Thanks for the review comments.
Please find my responses below.

Thanks  Regards
Amarendra Reddy

On 12 January 2013 22:11, Simon Glass s...@chromium.org wrote:

 Hi Amar,

 On Fri, Jan 11, 2013 at 9:58 AM, Amarendra Reddy
 amar.lavan...@gmail.com wrote:
  Hi Simon,
 
  Thanks for review comments.
  Please find my responses below.
 
  Thanks  Regards
  Amarendra Reddy
 
  On 10 January 2013 22:27, Simon Glass s...@chromium.org wrote:
 
  Hi Amar,
 
  On Fri, Jan 4, 2013 at 1:34 AM, Amar amarendra...@samsung.com wrote:
   This patch enables and initialises DWMMC for SMDK5250.
   Supports both FDT and non-FDT. This patch creates a new file
   'exynos5-dt.c' meant for FDT support.
   exynos5-dt.c:   This file shall contain all code which
 supports
   FDT.
   Any addition of FDT support for any module
 needs
   to be
   added in this file.
   smdk5250.c: This file shall contain the code which
 supports
   non-FDT.
   version. Any addition of non-FDT support for
 any
   module
   needs to be added in this file.
   May be, the file smdk5250.c can be removed in
   near future
   when non-FDT is not required.
  
   The Makefile is updated to compile only one of the files
   exynos5-dt.c / smdk5250.c based on FDT configuration.
  
   NOTE:
   Please note that all additions corresponding to FDT need to be added
   into the
   file exynos5-dt.c.
   At same time if non-FDT support is required then add the corresponding
   updations into smdk5250.c.
  
   Changes from V1:
   1)A new file 'exynos5-dt.c' is created meant for FDT support
   2)Makefile is updated to compile only one of the files
   exynos5-dt.c / smdk5250.c based on FDT configuration
  
   Changes from V2:
   1)Updation of commit message and resubmition of proper patch
   set.
  
   Changes from V3:
   No change.
  
   Signed-off-by: Amar amarendra...@samsung.com
   ---
board/samsung/smdk5250/Makefile |   4 +
board/samsung/smdk5250/exynos5-dt.c | 242
   
board/samsung/smdk5250/smdk5250.c   |  97 +++
include/configs/exynos5250-dt.h |   2 +
include/i2c.h   |   2 +
5 files changed, 292 insertions(+), 55 deletions(-)
create mode 100644 board/samsung/smdk5250/exynos5-dt.c
  
   diff --git a/board/samsung/smdk5250/Makefile
   b/board/samsung/smdk5250/Makefile
   index 47c6a5a..ecca9f3 100644
   --- a/board/samsung/smdk5250/Makefile
   +++ b/board/samsung/smdk5250/Makefile
   @@ -32,8 +32,12 @@ COBJS+= tzpc_init.o
COBJS  += smdk5250_spl.o
  
ifndef CONFIG_SPL_BUILD
   +ifdef CONFIG_OF_CONTROL
   +COBJS  += exynos5-dt.o
   +else
COBJS  += smdk5250.o
endif
   +endif
  
ifdef CONFIG_SPL_BUILD
COBJS  += spl_boot.o
   diff --git a/board/samsung/smdk5250/exynos5-dt.c
   b/board/samsung/smdk5250/exynos5-dt.c
   new file mode 100644
   index 000..da539ca
   --- /dev/null
   +++ b/board/samsung/smdk5250/exynos5-dt.c
   @@ -0,0 +1,242 @@
   +/*
   + * Copyright (C) 2012 Samsung Electronics
   + *
   + * See file CREDITS for list of people who contributed to this
   + * project.
   + *
   + * This program is free software; you can redistribute it and/or
   + * modify it under the terms of the GNU General Public License as
   + * published by the Free Software Foundation; either version 2 of
   + * the License, or (at your option) any later version.
   + *
   + * This program is distributed in the hope that it will be useful,
   + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   + * GNU General Public License for more details.
   + *
   + * You should have received a copy of the GNU General Public License
   + * along with this program; if not, write to the Free Software
   + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
   + * MA 02111-1307 USA
   + */
   +
   +#include common.h
   +#include fdtdec.h
   +#include asm/io.h
   +#include i2c.h
   +#include netdev.h
   +#include spi.h
   +#include asm/arch/cpu.h
   +#include asm/arch/dwmmc.h
   +#include asm/arch/gpio.h
   +#include asm/arch/mmc.h
   +#include asm/arch/pinmux.h
   +#include asm/arch/sromc.h
   +#include power/pmic.h
   +
   +DECLARE_GLOBAL_DATA_PTR;
   +
   +int board_init(void)
   +{
   +   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
   +#ifdef CONFIG_EXYNOS_SPI
   +   spi_init();
   +#endif
   +   return 0;
   +}
   +
   +int dram_init(void)
   +{
   +   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1,
   PHYS_SDRAM_1_SIZE)
   +   + get_ram_size((long *)PHYS_SDRAM_2,
   PHYS_SDRAM_2_SIZE)
   +   + get_ram_size((long *)PHYS_SDRAM_3,
   PHYS_SDRAM_3_SIZE)
   +   + get_ram_size((long 

Re: [U-Boot] [PATCH V4 6/9] SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT

2013-01-12 Thread Simon Glass
Hi Amar,

On Fri, Jan 11, 2013 at 9:58 AM, Amarendra Reddy
amar.lavan...@gmail.com wrote:
 Hi Simon,

 Thanks for review comments.
 Please find my responses below.

 Thanks  Regards
 Amarendra Reddy

 On 10 January 2013 22:27, Simon Glass s...@chromium.org wrote:

 Hi Amar,

 On Fri, Jan 4, 2013 at 1:34 AM, Amar amarendra...@samsung.com wrote:
  This patch enables and initialises DWMMC for SMDK5250.
  Supports both FDT and non-FDT. This patch creates a new file
  'exynos5-dt.c' meant for FDT support.
  exynos5-dt.c:   This file shall contain all code which supports
  FDT.
  Any addition of FDT support for any module needs
  to be
  added in this file.
  smdk5250.c: This file shall contain the code which supports
  non-FDT.
  version. Any addition of non-FDT support for any
  module
  needs to be added in this file.
  May be, the file smdk5250.c can be removed in
  near future
  when non-FDT is not required.
 
  The Makefile is updated to compile only one of the files
  exynos5-dt.c / smdk5250.c based on FDT configuration.
 
  NOTE:
  Please note that all additions corresponding to FDT need to be added
  into the
  file exynos5-dt.c.
  At same time if non-FDT support is required then add the corresponding
  updations into smdk5250.c.
 
  Changes from V1:
  1)A new file 'exynos5-dt.c' is created meant for FDT support
  2)Makefile is updated to compile only one of the files
  exynos5-dt.c / smdk5250.c based on FDT configuration
 
  Changes from V2:
  1)Updation of commit message and resubmition of proper patch
  set.
 
  Changes from V3:
  No change.
 
  Signed-off-by: Amar amarendra...@samsung.com
  ---
   board/samsung/smdk5250/Makefile |   4 +
   board/samsung/smdk5250/exynos5-dt.c | 242
  
   board/samsung/smdk5250/smdk5250.c   |  97 +++
   include/configs/exynos5250-dt.h |   2 +
   include/i2c.h   |   2 +
   5 files changed, 292 insertions(+), 55 deletions(-)
   create mode 100644 board/samsung/smdk5250/exynos5-dt.c
 
  diff --git a/board/samsung/smdk5250/Makefile
  b/board/samsung/smdk5250/Makefile
  index 47c6a5a..ecca9f3 100644
  --- a/board/samsung/smdk5250/Makefile
  +++ b/board/samsung/smdk5250/Makefile
  @@ -32,8 +32,12 @@ COBJS+= tzpc_init.o
   COBJS  += smdk5250_spl.o
 
   ifndef CONFIG_SPL_BUILD
  +ifdef CONFIG_OF_CONTROL
  +COBJS  += exynos5-dt.o
  +else
   COBJS  += smdk5250.o
   endif
  +endif
 
   ifdef CONFIG_SPL_BUILD
   COBJS  += spl_boot.o
  diff --git a/board/samsung/smdk5250/exynos5-dt.c
  b/board/samsung/smdk5250/exynos5-dt.c
  new file mode 100644
  index 000..da539ca
  --- /dev/null
  +++ b/board/samsung/smdk5250/exynos5-dt.c
  @@ -0,0 +1,242 @@
  +/*
  + * Copyright (C) 2012 Samsung Electronics
  + *
  + * See file CREDITS for list of people who contributed to this
  + * project.
  + *
  + * This program is free software; you can redistribute it and/or
  + * modify it under the terms of the GNU General Public License as
  + * published by the Free Software Foundation; either version 2 of
  + * the License, or (at your option) any later version.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  + * GNU General Public License for more details.
  + *
  + * You should have received a copy of the GNU General Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  + * MA 02111-1307 USA
  + */
  +
  +#include common.h
  +#include fdtdec.h
  +#include asm/io.h
  +#include i2c.h
  +#include netdev.h
  +#include spi.h
  +#include asm/arch/cpu.h
  +#include asm/arch/dwmmc.h
  +#include asm/arch/gpio.h
  +#include asm/arch/mmc.h
  +#include asm/arch/pinmux.h
  +#include asm/arch/sromc.h
  +#include power/pmic.h
  +
  +DECLARE_GLOBAL_DATA_PTR;
  +
  +int board_init(void)
  +{
  +   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
  +#ifdef CONFIG_EXYNOS_SPI
  +   spi_init();
  +#endif
  +   return 0;
  +}
  +
  +int dram_init(void)
  +{
  +   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1,
  PHYS_SDRAM_1_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_2,
  PHYS_SDRAM_2_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_3,
  PHYS_SDRAM_3_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_4,
  PHYS_SDRAM_4_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_5,
  PHYS_SDRAM_7_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_6,
  PHYS_SDRAM_7_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_7,
  PHYS_SDRAM_7_SIZE)
  +   + 

Re: [U-Boot] [PATCH V4 6/9] SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT

2013-01-11 Thread Amarendra Reddy
Hi Simon,

Thanks for review comments.
Please find my responses below.

Thanks  Regards
Amarendra Reddy

On 10 January 2013 22:27, Simon Glass s...@chromium.org wrote:

 Hi Amar,

 On Fri, Jan 4, 2013 at 1:34 AM, Amar amarendra...@samsung.com wrote:
  This patch enables and initialises DWMMC for SMDK5250.
  Supports both FDT and non-FDT. This patch creates a new file
  'exynos5-dt.c' meant for FDT support.
  exynos5-dt.c:   This file shall contain all code which supports
 FDT.
  Any addition of FDT support for any module needs
 to be
  added in this file.
  smdk5250.c: This file shall contain the code which supports
 non-FDT.
  version. Any addition of non-FDT support for any
 module
  needs to be added in this file.
  May be, the file smdk5250.c can be removed in
 near future
  when non-FDT is not required.
 
  The Makefile is updated to compile only one of the files
  exynos5-dt.c / smdk5250.c based on FDT configuration.
 
  NOTE:
  Please note that all additions corresponding to FDT need to be added
 into the
  file exynos5-dt.c.
  At same time if non-FDT support is required then add the corresponding
  updations into smdk5250.c.
 
  Changes from V1:
  1)A new file 'exynos5-dt.c' is created meant for FDT support
  2)Makefile is updated to compile only one of the files
  exynos5-dt.c / smdk5250.c based on FDT configuration
 
  Changes from V2:
  1)Updation of commit message and resubmition of proper patch set.
 
  Changes from V3:
  No change.
 
  Signed-off-by: Amar amarendra...@samsung.com
  ---
   board/samsung/smdk5250/Makefile |   4 +
   board/samsung/smdk5250/exynos5-dt.c | 242
 
   board/samsung/smdk5250/smdk5250.c   |  97 +++
   include/configs/exynos5250-dt.h |   2 +
   include/i2c.h   |   2 +
   5 files changed, 292 insertions(+), 55 deletions(-)
   create mode 100644 board/samsung/smdk5250/exynos5-dt.c
 
  diff --git a/board/samsung/smdk5250/Makefile
 b/board/samsung/smdk5250/Makefile
  index 47c6a5a..ecca9f3 100644
  --- a/board/samsung/smdk5250/Makefile
  +++ b/board/samsung/smdk5250/Makefile
  @@ -32,8 +32,12 @@ COBJS+= tzpc_init.o
   COBJS  += smdk5250_spl.o
 
   ifndef CONFIG_SPL_BUILD
  +ifdef CONFIG_OF_CONTROL
  +COBJS  += exynos5-dt.o
  +else
   COBJS  += smdk5250.o
   endif
  +endif
 
   ifdef CONFIG_SPL_BUILD
   COBJS  += spl_boot.o
  diff --git a/board/samsung/smdk5250/exynos5-dt.c
 b/board/samsung/smdk5250/exynos5-dt.c
  new file mode 100644
  index 000..da539ca
  --- /dev/null
  +++ b/board/samsung/smdk5250/exynos5-dt.c
  @@ -0,0 +1,242 @@
  +/*
  + * Copyright (C) 2012 Samsung Electronics
  + *
  + * See file CREDITS for list of people who contributed to this
  + * project.
  + *
  + * This program is free software; you can redistribute it and/or
  + * modify it under the terms of the GNU General Public License as
  + * published by the Free Software Foundation; either version 2 of
  + * the License, or (at your option) any later version.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  + * GNU General Public License for more details.
  + *
  + * You should have received a copy of the GNU General Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  + * MA 02111-1307 USA
  + */
  +
  +#include common.h
  +#include fdtdec.h
  +#include asm/io.h
  +#include i2c.h
  +#include netdev.h
  +#include spi.h
  +#include asm/arch/cpu.h
  +#include asm/arch/dwmmc.h
  +#include asm/arch/gpio.h
  +#include asm/arch/mmc.h
  +#include asm/arch/pinmux.h
  +#include asm/arch/sromc.h
  +#include power/pmic.h
  +
  +DECLARE_GLOBAL_DATA_PTR;
  +
  +int board_init(void)
  +{
  +   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
  +#ifdef CONFIG_EXYNOS_SPI
  +   spi_init();
  +#endif
  +   return 0;
  +}
  +
  +int dram_init(void)
  +{
  +   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1,
 PHYS_SDRAM_1_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_2,
 PHYS_SDRAM_2_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_3,
 PHYS_SDRAM_3_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_4,
 PHYS_SDRAM_4_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_5,
 PHYS_SDRAM_7_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_6,
 PHYS_SDRAM_7_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_7,
 PHYS_SDRAM_7_SIZE)
  +   + get_ram_size((long *)PHYS_SDRAM_8,
 PHYS_SDRAM_8_SIZE);

 This looks ugly - is there any other way of doing this? Also 7 

Re: [U-Boot] [PATCH V4 6/9] SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT

2013-01-10 Thread Simon Glass
Hi Amar,

On Fri, Jan 4, 2013 at 1:34 AM, Amar amarendra...@samsung.com wrote:
 This patch enables and initialises DWMMC for SMDK5250.
 Supports both FDT and non-FDT. This patch creates a new file
 'exynos5-dt.c' meant for FDT support.
 exynos5-dt.c:   This file shall contain all code which supports FDT.
 Any addition of FDT support for any module needs to be
 added in this file.
 smdk5250.c: This file shall contain the code which supports 
 non-FDT.
 version. Any addition of non-FDT support for any 
 module
 needs to be added in this file.
 May be, the file smdk5250.c can be removed in near 
 future
 when non-FDT is not required.

 The Makefile is updated to compile only one of the files
 exynos5-dt.c / smdk5250.c based on FDT configuration.

 NOTE:
 Please note that all additions corresponding to FDT need to be added into the
 file exynos5-dt.c.
 At same time if non-FDT support is required then add the corresponding
 updations into smdk5250.c.

 Changes from V1:
 1)A new file 'exynos5-dt.c' is created meant for FDT support
 2)Makefile is updated to compile only one of the files
 exynos5-dt.c / smdk5250.c based on FDT configuration

 Changes from V2:
 1)Updation of commit message and resubmition of proper patch set.

 Changes from V3:
 No change.

 Signed-off-by: Amar amarendra...@samsung.com
 ---
  board/samsung/smdk5250/Makefile |   4 +
  board/samsung/smdk5250/exynos5-dt.c | 242 
 
  board/samsung/smdk5250/smdk5250.c   |  97 +++
  include/configs/exynos5250-dt.h |   2 +
  include/i2c.h   |   2 +
  5 files changed, 292 insertions(+), 55 deletions(-)
  create mode 100644 board/samsung/smdk5250/exynos5-dt.c

 diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
 index 47c6a5a..ecca9f3 100644
 --- a/board/samsung/smdk5250/Makefile
 +++ b/board/samsung/smdk5250/Makefile
 @@ -32,8 +32,12 @@ COBJS+= tzpc_init.o
  COBJS  += smdk5250_spl.o

  ifndef CONFIG_SPL_BUILD
 +ifdef CONFIG_OF_CONTROL
 +COBJS  += exynos5-dt.o
 +else
  COBJS  += smdk5250.o
  endif
 +endif

  ifdef CONFIG_SPL_BUILD
  COBJS  += spl_boot.o
 diff --git a/board/samsung/smdk5250/exynos5-dt.c 
 b/board/samsung/smdk5250/exynos5-dt.c
 new file mode 100644
 index 000..da539ca
 --- /dev/null
 +++ b/board/samsung/smdk5250/exynos5-dt.c
 @@ -0,0 +1,242 @@
 +/*
 + * Copyright (C) 2012 Samsung Electronics
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#include common.h
 +#include fdtdec.h
 +#include asm/io.h
 +#include i2c.h
 +#include netdev.h
 +#include spi.h
 +#include asm/arch/cpu.h
 +#include asm/arch/dwmmc.h
 +#include asm/arch/gpio.h
 +#include asm/arch/mmc.h
 +#include asm/arch/pinmux.h
 +#include asm/arch/sromc.h
 +#include power/pmic.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +int board_init(void)
 +{
 +   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
 +#ifdef CONFIG_EXYNOS_SPI
 +   spi_init();
 +#endif
 +   return 0;
 +}
 +
 +int dram_init(void)
 +{
 +   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, 
 PHYS_SDRAM_1_SIZE)
 +   + get_ram_size((long *)PHYS_SDRAM_2, 
 PHYS_SDRAM_2_SIZE)
 +   + get_ram_size((long *)PHYS_SDRAM_3, 
 PHYS_SDRAM_3_SIZE)
 +   + get_ram_size((long *)PHYS_SDRAM_4, 
 PHYS_SDRAM_4_SIZE)
 +   + get_ram_size((long *)PHYS_SDRAM_5, 
 PHYS_SDRAM_7_SIZE)
 +   + get_ram_size((long *)PHYS_SDRAM_6, 
 PHYS_SDRAM_7_SIZE)
 +   + get_ram_size((long *)PHYS_SDRAM_7, 
 PHYS_SDRAM_7_SIZE)
 +   + get_ram_size((long *)PHYS_SDRAM_8, 
 PHYS_SDRAM_8_SIZE);

This looks ugly - is there any other way of doing this? Also 7 appears
in more than one line.

Since the banks are all SDRAM_BANK_SIZE apart, perhaps you could just
use a for loop with a single base address?

If this function is common with the other file then perhaps it should
go in a common file?

 +   return 0;
 +}
 +
 +#if 

[U-Boot] [PATCH V4 6/9] SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT

2013-01-04 Thread Amar
This patch enables and initialises DWMMC for SMDK5250.
Supports both FDT and non-FDT. This patch creates a new file
'exynos5-dt.c' meant for FDT support.
exynos5-dt.c:   This file shall contain all code which supports FDT.
Any addition of FDT support for any module needs to be
added in this file.
smdk5250.c: This file shall contain the code which supports non-FDT.
version. Any addition of non-FDT support for any module
needs to be added in this file.
May be, the file smdk5250.c can be removed in near 
future
when non-FDT is not required.

The Makefile is updated to compile only one of the files
exynos5-dt.c / smdk5250.c based on FDT configuration.

NOTE:
Please note that all additions corresponding to FDT need to be added into the
file exynos5-dt.c.
At same time if non-FDT support is required then add the corresponding
updations into smdk5250.c.

Changes from V1:
1)A new file 'exynos5-dt.c' is created meant for FDT support
2)Makefile is updated to compile only one of the files
exynos5-dt.c / smdk5250.c based on FDT configuration

Changes from V2:
1)Updation of commit message and resubmition of proper patch set.

Changes from V3:
No change.

Signed-off-by: Amar amarendra...@samsung.com
---
 board/samsung/smdk5250/Makefile |   4 +
 board/samsung/smdk5250/exynos5-dt.c | 242 
 board/samsung/smdk5250/smdk5250.c   |  97 +++
 include/configs/exynos5250-dt.h |   2 +
 include/i2c.h   |   2 +
 5 files changed, 292 insertions(+), 55 deletions(-)
 create mode 100644 board/samsung/smdk5250/exynos5-dt.c

diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
index 47c6a5a..ecca9f3 100644
--- a/board/samsung/smdk5250/Makefile
+++ b/board/samsung/smdk5250/Makefile
@@ -32,8 +32,12 @@ COBJS+= tzpc_init.o
 COBJS  += smdk5250_spl.o
 
 ifndef CONFIG_SPL_BUILD
+ifdef CONFIG_OF_CONTROL
+COBJS  += exynos5-dt.o
+else
 COBJS  += smdk5250.o
 endif
+endif
 
 ifdef CONFIG_SPL_BUILD
 COBJS  += spl_boot.o
diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
new file mode 100644
index 000..da539ca
--- /dev/null
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include fdtdec.h
+#include asm/io.h
+#include i2c.h
+#include netdev.h
+#include spi.h
+#include asm/arch/cpu.h
+#include asm/arch/dwmmc.h
+#include asm/arch/gpio.h
+#include asm/arch/mmc.h
+#include asm/arch/pinmux.h
+#include asm/arch/sromc.h
+#include power/pmic.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+   gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
+#ifdef CONFIG_EXYNOS_SPI
+   spi_init();
+#endif
+   return 0;
+}
+
+int dram_init(void)
+{
+   gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
+   + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
+   + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
+   + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE)
+   + get_ram_size((long *)PHYS_SDRAM_5, PHYS_SDRAM_7_SIZE)
+   + get_ram_size((long *)PHYS_SDRAM_6, PHYS_SDRAM_7_SIZE)
+   + get_ram_size((long *)PHYS_SDRAM_7, PHYS_SDRAM_7_SIZE)
+   + get_ram_size((long *)PHYS_SDRAM_8, PHYS_SDRAM_8_SIZE);
+   return 0;
+}
+
+#if defined(CONFIG_POWER)
+int power_init_board(void)
+{
+   if (pmic_init(I2C_PMIC))
+   return -1;
+   else
+   return 0;
+}
+#endif
+
+void dram_init_banksize(void)
+{
+   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
+   gd-bd-bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1,
+   PHYS_SDRAM_1_SIZE);
+   gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
+   gd-bd-bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2,
+