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

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Nov 21 01:26:04 CET 2008


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.c    1970-01-01 
> 01:00:00.000000000 +0100
> +++ u-boot-1.3.4-col/board/colibri/colibri.c    2008-09-23 
> 15:13:35.000000000 +0200
> @@ -0,0 +1,61 @@
> +/*
> + * (C) Copyright 2007
> + * Daniel Mack, caiaq <daniel at caiaq.de>
> + *
> + * 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>
> +
> +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 = 0xa0000100;
   ^^^^
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.mk    1970-01-01 
> 01:00:00.000000000 +0100
> +++ u-boot-1.3.4-col/board/colibri/config.mk    2008-09-23 
> 15:13:35.000000000 +0200
> @@ -0,0 +1 @@
> +TEXT_BASE = 0xa1700000
> 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.S    1970-01-01 
> 01:00:00.000000000 +0100
> +++ u-boot-1.3.4-col/board/colibri/lowlevel_init.S    2008-09-23 
> 15:13:35.000000000 +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 <config.h>
> +#include <version.h>
> +#include <asm/arch/pxa-regs.h>
> +
> +/* wait for coprocessor write complete */
> +.macro CPWAIT reg
> +mrc    p15,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
> +sub    pc,pc,#4
> +.endm
> +
> +
..... 
> +    ldr        r0,    =GAFR2_U
> +    ldr        r1,    =CFG_GAFR2_U_VAL
> +    str        r1,   [r0]
> +
> +    ldr        r0,    =GAFR3_L
> +    ldr        r1,    =CFG_GAFR3_L_VAL
> +    str        r1,   [r0]
> +
> +    ldr        r0,    =GAFR3_U
> +    ldr        r1,    =CFG_GAFR3_U_VAL
> +    str        r1,   [r0]
> +
> +    ldr        r0,    =PSSR        /* enable GPIO pins */
> +    ldr        r1,    =CFG_PSSR_VAL
> +    str        r1,   [r0]
> +
> +    /* ---------------------------------------------------------------- */
> +    /* Enable memory interface                        */
> +    /*                                    */
> +    /* The sequence below is based on the recommended init steps        */
> +    /* detailed in the Intel PXA250 Operating Systems Developers Guide, */
> +    /* Chapter 10.                                */
> +    /* ---------------------------------------------------------------- */
please use this style of coment
/*
 * sdf
 * sdf
 */
> +    /* ---------------------------------------------------------------- */
> +    /* Step 1: Wait for at least 200 microsedonds to allow internal 
>      */
> +    /*       clocks to settle. Only necessary after hard reset...        */
> +    /*       FIXME: can be optimized later                */
> +    /* ---------------------------------------------------------------- */
......
> u-boot-1.3.4-col/board/colibri/Makefile
> --- u-boot-1.3.4/board/colibri/Makefile    1970-01-01 01:00:00.000000000 
> +0100
> +++ u-boot-1.3.4-col/board/colibri/Makefile    2008-09-23 
> 15:13:35.000000000 +0200
> @@ -0,0 +1,51 @@
> +#
> +# (C) Copyright 2000-2006
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# 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).a
      ^^^^
please use tab
> +
> +COBJS    := colibri.o
        ^^^^
please use tab
> +SOBJS    := lowlevel_init.o
        ^^^^
please use tab
> +
> +SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
       ^^^^
please use tab
> +OBJS    := $(addprefix $(obj),$(COBJS))
       ^^^^
please use tab
> +SOBJS    := $(addprefix $(obj),$(SOBJS))
        ^^^^
please use tab
> +
> +$(LIB):    $(obj).depend $(OBJS) $(SOBJS)
          ^^^^
please use tab
> +    $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
   ^^^^
please use tab
> +
> +clean:
> +    rm -f $(SOBJS) $(OBJS)
   ^^^^
please use tab
> +
> +distclean:    clean
             ^^^^
please use tab
> +    rm -f $(LIB) core *.bak .depend
   ^^^^
please use tab
> +
> +#########################################################################
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff -purN u-boot-1.3.4/board/colibri/u-boot.lds 
> u-boot-1.3.4-col/board/colibri/u-boot.lds
> --- u-boot-1.3.4/board/colibri/u-boot.lds    1970-01-01 
> 01:00:00.000000000 +0100
> +++ u-boot-1.3.4-col/board/colibri/u-boot.lds    2008-09-23 
> 15:13:35.000000000 +0200
> @@ -0,0 +1,56 @@
> +/*
> +* (C) Copyright 2000
> +* Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +*
> +* 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
> +*/
> +
> +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
> +OUTPUT_ARCH(arm)
> +ENTRY(_start)
> +SECTIONS
> +{
> +    . = 0x00000000;
   ^^^^
please use tab
> +
> +    . = ALIGN(4);
   ^^^^
please use tab
and so on
> +    .text      :
> +    {
.....
> diff -purN u-boot-1.3.4/include/asm-arm/mach-types.h 
> u-boot-1.3.4-col/include/asm-arm/mach-types.h
no more need the mach-types.h has been updated
> --- u-boot-1.3.4/include/asm-arm/mach-types.h    2008-08-12 
> 16:08:38.000000000 +0200
> +++ u-boot-1.3.4-col/include/asm-arm/mach-types.h    2008-09-23 
> 15:13:35.000000000 +0200
> @@ -11689,6 +11689,18 @@ extern unsigned int __machine_arch_type;
>   # define machine_is_ax8004()    (0)
>   #endif
> +
....
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +/*
> + * High Level Configuration Options
> + * (easy to change)
> + */
> +
> +/* #define DEBUG            15 */
please no dead code
> +#define CONFIG_PXA27X        1    /* This is an PXA27x CPU    */
> +#define CONFIG_COLIBRI        1    /* on a Colibri Board     */
> +/* #define CONFIG_MMC        1    */
please no dead code
> +#define BOARD_LATE_INIT        1
> +
> +#undef CONFIG_USE_IRQ            /* we don't need IRQ/FIQ stuff */
> +
> +#define RTC
> +
> +/*
> + * Size of malloc() pool
> + */
> +#define CFG_MALLOC_LEN        (CFG_ENV_SECT_SIZE + 128*1024)
> +#define CFG_GBL_DATA_SIZE    128    /* size in bytes reserved for 
> initial data */
> +
> +/*
> + * Hardware drivers
> + */
> +
> +/*
> + * select serial console configuration
> + */
> +#define CONFIG_FFUART           1       /* we use FFUART */
> +
> +/* allow to overwrite serial and ethaddr */
> +#define CONFIG_ENV_OVERWRITE
> +
> +#define CONFIG_BAUDRATE           9600
> +
> +/* #define CONFIG_DOS_PARTITION   1 */
please no dead code
> +
> +#undef CONFIG_SHOW_BOOT_PROGRESS
> +
> +#define CONFIG_BOOTDELAY    -1
> +#define CONFIG_ETHADDR        00:00:00:00:00:00
> +#define CONFIG_NETMASK          255.255.255.0
> +#define CONFIG_IPADDR           192.168.1.99
> +#define CONFIG_SERVERIP        192.168.1.1
please remove network ip configuration
> +#define CONFIG_BOOTCOMMAND    "bootm 80000 || dhcp && bootm"
> +#define CONFIG_BOOTARGS        "console=ttyS0,9600n8 "\
> +                " rw root=/dev/nfs ip=:::::eth0:"
> +
> +#define CONFIG_EXTRA_ENV_SETTINGS ""
> +
> +/*
> + * Command line configuration.
> + */
> +#include <config_cmd_default.h>
> +
> +#define CONFIG_CMD_DFL
> +#define CONFIG_CMD_DIAG
> +#define CONFIG_CMD_DHCP
> +#define CONFIG_CMD_SDRAM
> +/* #define CONFIG_COMMANDS              (CONFIG_CMD_DFL | CFG_CMD_DIAG 
> | CFG_CMD_DHCP | CFG_CMD_SDRAM | CFG_CMD_KGDB) */
please no dead code
> +/*#define CONFIG_COMMANDS               (CONFIG_CMD_DFL | CFG_CMD_DIAG 
> | CFG_CMD_SDRAM)*/
please no dead code

please also note that your patch is ligne wrapped

Best Regards,
J.


More information about the U-Boot mailing list