Re: [U-Boot] [PATCH v2 1/2] ARMV7: Add support for Samsung ORIGEN board

2011-07-18 Thread Chander Kashyap
Dear Minkyu,

On 15 July 2011 14:23, Minkyu Kang proms...@gmail.com wrote:
 Dear Chander Kashyap,

 On 12 July 2011 17:48, Chander Kashyap chander.kash...@linaro.org wrote:
 Origen board is based upon S5PV310 SoC which is similiar to
 S5PC210 SoC.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 ---
  MAINTAINERS                          |    1 +
  board/samsung/origen/Makefile        |   46 
  board/samsung/origen/lowlevel_init.S |  468 
 ++
  board/samsung/origen/mem_setup.S     |  392 
  board/samsung/origen/origen.c        |  103 
  boards.cfg                           |    1 +
  include/configs/origen.h             |  167 
  7 files changed, 1178 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/origen/Makefile
  create mode 100644 board/samsung/origen/lowlevel_init.S
  create mode 100644 board/samsung/origen/mem_setup.S
  create mode 100644 board/samsung/origen/origen.c
  create mode 100644 include/configs/origen.h

 diff --git a/MAINTAINERS b/MAINTAINERS
 index 2bba7b4..bb98115 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -704,6 +704,7 @@ Minkyu Kang mk7.k...@samsung.com
  Chander Kashyap k.chan...@samsung.com

        SMDKV310                ARM ARMV7 (S5PC210 SoC)
 +       origen                  ARM ARMV7 (S5PC210 SoC)

 Please keep this list alphabetically.
yes I will.


  Frederik Kriewitz frede...@kriewitz.eu

 diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
 new file mode 100644
 index 000..84e1415
 --- /dev/null
 +++ b/board/samsung/origen/origen.c
 @@ -0,0 +1,103 @@
 +#include common.h
 +#include asm/io.h
 +#include asm/arch/cpu.h
 +#include asm/arch/gpio.h
 +#include asm/arch/mmc.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +struct s5pc210_gpio_part1 *gpio1;
 +struct s5pc210_gpio_part2 *gpio2;
 +
 +int board_init(void)
 +{
 +       gpio1 = (struct s5pc210_gpio_part1 *) S5PC210_GPIO_PART1_BASE;
 +       gpio2 = (struct s5pc210_gpio_part2 *) S5PC210_GPIO_PART2_BASE;
 +
 +       gd-bd-bi_arch_number = MACH_TYPE_ORIGEN;
 +       gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
 +       return 0;
 +}
 +
 +int dram_init(void)
 +{
 +       gd-ram_size    = PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE \
 +                       + PHYS_SDRAM_3_SIZE + PHYS_SDRAM_4_SIZE;

 get_ram_size().

Done.

 +       return 0;
 +}
 +
 +void dram_init_banksize(void)
 +{
 +       gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
 +       gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 +       gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
 +       gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
 +       gd-bd-bi_dram[2].start = PHYS_SDRAM_3;
 +       gd-bd-bi_dram[2].size = PHYS_SDRAM_3_SIZE;
 +       gd-bd-bi_dram[3].start = PHYS_SDRAM_4;
 +       gd-bd-bi_dram[3].size = PHYS_SDRAM_4_SIZE;
 +}
 +
 +#ifdef CONFIG_DISPLAY_BOARDINFO
 +int checkboard(void)
 +{
 +       printf(\nBoard: ORIGEN\n);
 +       return 0;
 +}
 +#endif
 +
 +#endif
 diff --git a/boards.cfg b/boards.cfg
 index dfefc3f..a3ee25d 100644
 --- a/boards.cfg
 +++ b/boards.cfg
 @@ -161,6 +161,7 @@ s5p_goni                     arm         armv7       
 goni                samsung
  smdkc100                     arm         armv7       smdkc100            
 samsung        s5pc1xx
  s5pc210_universal            arm         armv7       universal_c210      
 samsung        s5pc2xx
  smdkv310                    arm         armv7       smdkv310            
 samsung        s5pc2xx
 +origen                      arm         armv7       origen              
 samsung        s5pc2xx

 Please keep this list alphabetically.



  harmony                      arm         armv7       harmony             
 nvidia         tegra2
  seaboard                     arm         armv7       seaboard            
 nvidia         tegra2
  u8500_href                   arm         armv7       u8500               
 st-ericsson    u8500
 diff --git a/include/configs/origen.h b/include/configs/origen.h
 new file mode 100644
 index 000..6fa488a
 --- /dev/null
 +++ b/include/configs/origen.h
 @@ -0,0 +1,167 @@
 +/*
 + * Copyright (C) 2011 Samsung Electronics
 + *
 + * Configuration settings for the SAMSUNG ORIGEN (S5PV310) board.
 + *
 + * 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., 

Re: [U-Boot] [PATCH v2 1/2] ARMV7: Add support for Samsung ORIGEN board

2011-07-15 Thread Minkyu Kang
Dear Chander Kashyap,

On 12 July 2011 17:48, Chander Kashyap chander.kash...@linaro.org wrote:
 Origen board is based upon S5PV310 SoC which is similiar to
 S5PC210 SoC.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 ---
  MAINTAINERS                          |    1 +
  board/samsung/origen/Makefile        |   46 
  board/samsung/origen/lowlevel_init.S |  468 
 ++
  board/samsung/origen/mem_setup.S     |  392 
  board/samsung/origen/origen.c        |  103 
  boards.cfg                           |    1 +
  include/configs/origen.h             |  167 
  7 files changed, 1178 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/origen/Makefile
  create mode 100644 board/samsung/origen/lowlevel_init.S
  create mode 100644 board/samsung/origen/mem_setup.S
  create mode 100644 board/samsung/origen/origen.c
  create mode 100644 include/configs/origen.h

 diff --git a/MAINTAINERS b/MAINTAINERS
 index 2bba7b4..bb98115 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -704,6 +704,7 @@ Minkyu Kang mk7.k...@samsung.com
  Chander Kashyap k.chan...@samsung.com

        SMDKV310                ARM ARMV7 (S5PC210 SoC)
 +       origen                  ARM ARMV7 (S5PC210 SoC)

Please keep this list alphabetically.


  Frederik Kriewitz frede...@kriewitz.eu

 diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
 new file mode 100644
 index 000..84e1415
 --- /dev/null
 +++ b/board/samsung/origen/origen.c
 @@ -0,0 +1,103 @@
 +#include common.h
 +#include asm/io.h
 +#include asm/arch/cpu.h
 +#include asm/arch/gpio.h
 +#include asm/arch/mmc.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +struct s5pc210_gpio_part1 *gpio1;
 +struct s5pc210_gpio_part2 *gpio2;
 +
 +int board_init(void)
 +{
 +       gpio1 = (struct s5pc210_gpio_part1 *) S5PC210_GPIO_PART1_BASE;
 +       gpio2 = (struct s5pc210_gpio_part2 *) S5PC210_GPIO_PART2_BASE;
 +
 +       gd-bd-bi_arch_number = MACH_TYPE_ORIGEN;
 +       gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
 +       return 0;
 +}
 +
 +int dram_init(void)
 +{
 +       gd-ram_size    = PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE \
 +                       + PHYS_SDRAM_3_SIZE + PHYS_SDRAM_4_SIZE;

get_ram_size().

 +       return 0;
 +}
 +
 +void dram_init_banksize(void)
 +{
 +       gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
 +       gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 +       gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
 +       gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE;
 +       gd-bd-bi_dram[2].start = PHYS_SDRAM_3;
 +       gd-bd-bi_dram[2].size = PHYS_SDRAM_3_SIZE;
 +       gd-bd-bi_dram[3].start = PHYS_SDRAM_4;
 +       gd-bd-bi_dram[3].size = PHYS_SDRAM_4_SIZE;
 +}
 +
 +#ifdef CONFIG_DISPLAY_BOARDINFO
 +int checkboard(void)
 +{
 +       printf(\nBoard: ORIGEN\n);
 +       return 0;
 +}
 +#endif
 +
 +#endif
 diff --git a/boards.cfg b/boards.cfg
 index dfefc3f..a3ee25d 100644
 --- a/boards.cfg
 +++ b/boards.cfg
 @@ -161,6 +161,7 @@ s5p_goni                     arm         armv7       goni 
                samsung
  smdkc100                     arm         armv7       smdkc100            
 samsung        s5pc1xx
  s5pc210_universal            arm         armv7       universal_c210      
 samsung        s5pc2xx
  smdkv310                    arm         armv7       smdkv310            
 samsung        s5pc2xx
 +origen                      arm         armv7       origen              
 samsung        s5pc2xx

Please keep this list alphabetically.

  harmony                      arm         armv7       harmony             
 nvidia         tegra2
  seaboard                     arm         armv7       seaboard            
 nvidia         tegra2
  u8500_href                   arm         armv7       u8500               
 st-ericsson    u8500
 diff --git a/include/configs/origen.h b/include/configs/origen.h
 new file mode 100644
 index 000..6fa488a
 --- /dev/null
 +++ b/include/configs/origen.h
 @@ -0,0 +1,167 @@
 +/*
 + * Copyright (C) 2011 Samsung Electronics
 + *
 + * Configuration settings for the SAMSUNG ORIGEN (S5PV310) board.
 + *
 + * 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
 + */
 +
 +#ifndef __CONFIG_H
 +#define 

[U-Boot] [PATCH v2 1/2] ARMV7: Add support for Samsung ORIGEN board

2011-07-12 Thread Chander Kashyap
Origen board is based upon S5PV310 SoC which is similiar to
S5PC210 SoC.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
---
 MAINTAINERS  |1 +
 board/samsung/origen/Makefile|   46 
 board/samsung/origen/lowlevel_init.S |  468 ++
 board/samsung/origen/mem_setup.S |  392 
 board/samsung/origen/origen.c|  103 
 boards.cfg   |1 +
 include/configs/origen.h |  167 
 7 files changed, 1178 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/origen/Makefile
 create mode 100644 board/samsung/origen/lowlevel_init.S
 create mode 100644 board/samsung/origen/mem_setup.S
 create mode 100644 board/samsung/origen/origen.c
 create mode 100644 include/configs/origen.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 2bba7b4..bb98115 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -704,6 +704,7 @@ Minkyu Kang mk7.k...@samsung.com
 Chander Kashyap k.chan...@samsung.com
 
SMDKV310ARM ARMV7 (S5PC210 SoC)
+   origen  ARM ARMV7 (S5PC210 SoC)
 
 Frederik Kriewitz frede...@kriewitz.eu
 
diff --git a/board/samsung/origen/Makefile b/board/samsung/origen/Makefile
new file mode 100644
index 000..65eff91
--- /dev/null
+++ b/board/samsung/origen/Makefile
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2011 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+SOBJS  := mem_setup.o
+SOBJS  += lowlevel_init.o
+COBJS  += origen.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:$(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/samsung/origen/lowlevel_init.S 
b/board/samsung/origen/lowlevel_init.S
new file mode 100644
index 000..cbb3c45
--- /dev/null
+++ b/board/samsung/origen/lowlevel_init.S
@@ -0,0 +1,468 @@
+/*
+ * Lowlevel setup for ORIGEN board based on S5PV310
+ *
+ * Copyright (C) 2011 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 config.h
+#include version.h
+#include asm/arch/cpu.h
+
+/*
+ * Register usages:
+ *
+ * r5 has zero always
+ * r7 has GPIO part1 base 0x1140
+ * r6 has GPIO part2 base 0x1100
+ */
+
+#define MEM_DLLl_ON
+
+_TEXT_BASE:
+   .word   CONFIG_SYS_TEXT_BASE
+
+   .globl lowlevel_init
+lowlevel_init:
+   push{lr}
+
+   /* r5 has always zero */
+   mov r5, #0
+   ldr r7, =S5PC210_GPIO_PART1_BASE
+   ldr r6, =S5PC210_GPIO_PART2_BASE
+
+   /* check reset status  */
+   ldr r0, =(S5PC210_POWER_BASE + 0x804)   @ INFORM1
+   ldr r1, [r0]
+
+   /* AFTR wakeup reset */
+   ldr r2, =S5P_CHECK_DIDLE
+   cmp r1, r2
+   beq exit_wakeup
+
+   /* Sleep wakeup reset */
+   ldr r2, =S5P_CHECK_SLEEP
+   cmp r1, r2
+   beq wakeup_reset
+
+   /*
+* If U-boot is already running in ram, no need to relocate U-Boot.
+* Memory controller must be configured before relocating U-Boot
+* in ram.
+*/
+