Re: [U-Boot] PATCH: Add support for Toradex Colibri PX270 Modules

2008-11-20 Thread Jean-Christophe PLAGNIOL-VILLARD
On 12:39 Fri 26 Sep , Peter Katzmann wrote:
> Hello,
> i took the already submitted patches from Daniel Mack, fixed some minor 
> problems and patched it against the 1.3.4 tree.
> The patch compiles clean and all my boards boots well.
> If there  are any objections leave me a note
> 
> peter
Sorry to answer so late
but could you rebase it against current HEAD

see some comments below
> 
> 
> diff -purN u-boot-1.3.4/board/colibri/colibri.c 
> u-boot-1.3.4-col/board/colibri/colibri.c
> --- u-boot-1.3.4/board/colibri/colibri.c1970-01-01 
> 01:00:00.0 +0100
> +++ u-boot-1.3.4-col/board/colibri/colibri.c2008-09-23 
> 15:13:35.0 +0200
> @@ -0,0 +1,61 @@
> +/*
> + * (C) Copyright 2007
> + * Daniel Mack, caiaq <[EMAIL PROTECTED]>
> + *
> + * 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 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/* 
> - */
> +
> +/*
> + * Miscelaneous platform dependent initialisations
> + */
> +
> +int board_init (void)
> +{
> +/* memory and cpu-speed are setup before relocation */
   
please use tab
> +/* so we do _nothing_ here */
   
please use tab
> +
> +/* arch number of COLIRBI-Board */
   
please use tab
> +gd->bd->bi_arch_number = MACH_TYPE_COLIBRI;
   
please use tab
> +
> +/* adress of boot parameters */
   
please use tab
> +gd->bd->bi_boot_params = 0xa100;
   
please use tab
> +
> +return 0;
   
please use tab
> +}
> +
> +int board_late_init(void)
> +{
> +setenv("stdout", "serial");
   
please use tab
> +setenv("stderr", "serial");
   
please use tab
> +return 0;
   
please use tab
> +}
> +
> +
> +int dram_init (void)
> +{
> +gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
   
please use tab
> +gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
   
please use tab
> +return 0;
> +}
   
please use tab
> diff -purN u-boot-1.3.4/board/colibri/config.mk 
> u-boot-1.3.4-col/board/colibri/config.mk
> --- u-boot-1.3.4/board/colibri/config.mk1970-01-01 
> 01:00:00.0 +0100
> +++ u-boot-1.3.4-col/board/colibri/config.mk2008-09-23 
> 15:13:35.0 +0200
> @@ -0,0 +1 @@
> +TEXT_BASE = 0xa170
> diff -purN u-boot-1.3.4/board/colibri/lowlevel_init.S 
> u-boot-1.3.4-col/board/colibri/lowlevel_init.S
> --- u-boot-1.3.4/board/colibri/lowlevel_init.S1970-01-01 
> 01:00:00.0 +0100
> +++ u-boot-1.3.4-col/board/colibri/lowlevel_init.S2008-09-23 
> 15:13:35.0 +0200
> @@ -0,0 +1,465 @@
> +/*
> +* This was originally from the Lubbock u-boot port.
> +*
> +* Most of this taken from Redboot hal_platform_setup.h with cleanup
> +*
> +* NOTE: I haven't clean this up considerably, just enough to get it
> +* running. See hal_platform_setup.h for the source. See
> +* board/cradle/lowlevel_init.S for another PXA250 setup that is
> +* much cleaner.
> +*
> +* 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 
> +#include 
> +#include 
> +
> +/* wait for coprocessor write complete */
> +.macro CPWAIT reg
> +mrcp15,0,\reg,c2,c0,0
  
please use tab for indentation in all the patch

please also note that the CFG_ has been renamed in CONFIG_SYS_
> +mov\reg,\reg
> +subpc,pc,#4
> +.endm
> +
> +
. 
> +ldrr0,=GAFR2_U
> +ldrr1,=CFG_GAFR2_U_VAL
> +str

[U-Boot] PATCH: Add support for Toradex Colibri PX270 Modules

2008-09-26 Thread Peter Katzmann
Hello,
i took the already submitted patches from Daniel Mack, fixed some minor 
problems and patched it against the 1.3.4 tree.
The patch compiles clean and all my boards boots well.
If there  are any objections leave me a note

peter


diff -purN u-boot-1.3.4/board/colibri/colibri.c 
u-boot-1.3.4-col/board/colibri/colibri.c
--- u-boot-1.3.4/board/colibri/colibri.c1970-01-01 
01:00:00.0 +0100
+++ u-boot-1.3.4-col/board/colibri/colibri.c2008-09-23 
15:13:35.0 +0200
@@ -0,0 +1,61 @@
+/*
+ * (C) Copyright 2007
+ * Daniel Mack, caiaq <[EMAIL PROTECTED]>
+ *
+ * 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 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* 
- */
+
+/*
+ * Miscelaneous platform dependent initialisations
+ */
+
+int board_init (void)
+{
+/* memory and cpu-speed are setup before relocation */
+/* so we do _nothing_ here */
+
+/* arch number of COLIRBI-Board */
+gd->bd->bi_arch_number = MACH_TYPE_COLIBRI;
+
+/* adress of boot parameters */
+gd->bd->bi_boot_params = 0xa100;
+
+return 0;
+}
+
+int board_late_init(void)
+{
+setenv("stdout", "serial");
+setenv("stderr", "serial");
+return 0;
+}
+
+
+int dram_init (void)
+{
+gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+return 0;
+}
diff -purN u-boot-1.3.4/board/colibri/config.mk 
u-boot-1.3.4-col/board/colibri/config.mk
--- u-boot-1.3.4/board/colibri/config.mk1970-01-01 
01:00:00.0 +0100
+++ u-boot-1.3.4-col/board/colibri/config.mk2008-09-23 
15:13:35.0 +0200
@@ -0,0 +1 @@
+TEXT_BASE = 0xa170
diff -purN u-boot-1.3.4/board/colibri/lowlevel_init.S 
u-boot-1.3.4-col/board/colibri/lowlevel_init.S
--- u-boot-1.3.4/board/colibri/lowlevel_init.S1970-01-01 
01:00:00.0 +0100
+++ u-boot-1.3.4-col/board/colibri/lowlevel_init.S2008-09-23 
15:13:35.0 +0200
@@ -0,0 +1,465 @@
+/*
+* This was originally from the Lubbock u-boot port.
+*
+* Most of this taken from Redboot hal_platform_setup.h with cleanup
+*
+* NOTE: I haven't clean this up considerably, just enough to get it
+* running. See hal_platform_setup.h for the source. See
+* board/cradle/lowlevel_init.S for another PXA250 setup that is
+* much cleaner.
+*
+* 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 
+#include 
+#include 
+
+/* wait for coprocessor write complete */
+.macro CPWAIT reg
+mrcp15,0,\reg,c2,c0,0
+mov\reg,\reg
+subpc,pc,#4
+.endm
+
+
+/*
+*Memory setup
+*/
+
+.globl lowlevel_init
+lowlevel_init:
+
+/* Set up GPIO pins first - */
+
+ldrr0,=GPSR0
+ldrr1,=CFG_GPSR0_VAL
+strr1,   [r0]
+
+ldrr0,=GPSR1
+ldrr1,=CFG_GPSR1_VAL
+strr1,   [r0]
+
+ldrr0,=GPSR2
+ldrr1,=CFG_GPSR2_VAL
+strr1,   [r0]
+
+ldrr0,=GPSR3
+ldrr1,=CFG_GPSR3_VAL
+strr1,   [r0]
+
+ldrr0,=GPCR0
+ldrr1,=CFG_GPCR0_VAL
+strr1,   [r0]
+
+ldrr0,=GPCR1
+ldrr1,=CFG_GPCR1_VAL
+strr1,   [r0]
+
+ldrr0,=GPCR2
+ldrr1,=CFG_GPCR2_VAL
+strr1,   [r0]
+
+ldrr0,=GPCR3
+ldrr1,=CFG_GPCR3_VAL
+strr1,   [r0]
+
+ldr