[U-Boot] [PATCH] add support for EMK TOP7000 CPU module

Ben Warren biggerbadderben at gmail.com
Sat Jun 5 16:41:42 CEST 2010


Hello Reinhard,

On Sat, Jun 5, 2010 at 3:41 AM, Reinhard Meyer (-VC) <
reinhard.meyer at emk-elektronik.de> wrote:

> Add support for EMK TOP7000 CPU module
>
> Specifics:
>
> 1) create subdir board/emk/top7000 and files in it
> 2) create include/configs/top7000.h
> 3) update board/emk/common/vpd.c
> 4) add call to misc_init_r() to arch/avr32/lib/board.c
> 5) create arch/avr32/include/asm/unaligned.h to
>   fix zlib.c compilation problem
> 6) update Makefile, MAINTAINERS, MAKEALL
>
> Signed-off-by: Reinhard Meyer <info at emk-elektronik.de>
>
> ---
>  MAINTAINERS                        |    6 +-
>  MAKEALL                            |    3 +-
>  Makefile                           |    3 +
>  arch/avr32/include/asm/unaligned.h |    1 +
>  arch/avr32/lib/board.c             |    5 +
>  board/emk/common/vpd.c             |   56 +++++++++-
>  board/emk/top7000/Makefile         |   41 +++++++
>  board/emk/top7000/config.mk        |    3 +
>  board/emk/top7000/top7000.c        |  169 ++++++++++++++++++++++++++++
>  board/emk/top7000/u-boot.lds       |   72 ++++++++++++
>  include/configs/top7000.h          |  216
> ++++++++++++++++++++++++++++++++++++
>  11 files changed, 570 insertions(+), 5 deletions(-)
>  create mode 100644 arch/avr32/include/asm/unaligned.h
>  create mode 100644 board/emk/top7000/Makefile
>  create mode 100644 board/emk/top7000/config.mk
>  create mode 100644 board/emk/top7000/top7000.c
>  create mode 100644 board/emk/top7000/u-boot.lds
>  create mode 100644 include/configs/top7000.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7a13d28..a361be1 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -311,7 +311,7 @@ Andrea "llandre" Marson <andrea.marson at dave-tech.it>
>
>        PPChameleonEVB  PPC405EP
>
> -Reinhard Meyer <r.meyer at emk-elektronik.de>
> +Reinhard Meyer <reinhard.meyer at emk-elektronik.de>
>
>        TOP860          MPC860T
>        TOP5200         MPC5200
> @@ -919,6 +919,10 @@ Julien May <julien.may at miromico.ch>
>
>        HAMMERHEAD              AT32AP7000
>
> +Reinhard Meyer <reinhard.meyer at emk-elektronik.de>
> +
> +       TOP7000         AT32AP7000
> +
>  Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
>
>        ATSTK1000       AT32AP7xxx
> diff --git a/MAKEALL b/MAKEALL
> index 2527352..3a80041 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -873,7 +873,8 @@ LIST_avr32="                \
>        atngw100        \
>        favr-32-ezkit   \
>        hammerhead      \
> -       mimc200         \
> +       mimc200         \
> +       top7000         \
>  "
>
>  #########################################################################
> diff --git a/Makefile b/Makefile
> index c26e491..e57a4ca 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3549,6 +3549,9 @@ hammerhead_config :       unconfig
>  mimc200_config         :       unconfig
>        @$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 mimc at32ap700x
>
> +top7000_config :       unconfig
> +       @$(MKCONFIG) $(@:_config=) avr32 at32ap top7000 emk at32ap700x
> +
>  #========================================================================
>  # SH3 (SuperH)
>  #========================================================================
> diff --git a/arch/avr32/include/asm/unaligned.h
> b/arch/avr32/include/asm/unaligned.h
> new file mode 100644
> index 0000000..6cecbbb
> --- /dev/null
> +++ b/arch/avr32/include/asm/unaligned.h
> @@ -0,0 +1 @@
> +#include <asm-generic/unaligned.h>
> diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
> index 917ed6c..6be5ab0
> --- a/arch/avr32/lib/board.c
> +++ b/arch/avr32/lib/board.c
> @@ -337,6 +337,11 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
>        jumptable_init();
>        console_init_r();
>
> +#if defined(CONFIG_MISC_INIT_R)
> +       /* miscellaneous platform dependent initialisations */
> +       misc_init_r();
> +#endif
> +
>        s = getenv("loadaddr");
>        if (s)
>                load_addr = simple_strtoul(s, NULL, 16);
> diff --git a/board/emk/common/vpd.c b/board/emk/common/vpd.c
> index c2af219..a6c456b
> --- a/board/emk/common/vpd.c
> +++ b/board/emk/common/vpd.c
> @@ -1,6 +1,6 @@
>  /*
> - * (C) Copyright 2003
> - * Reinhard Meyer, EMK Elektronik GmbH, r.meyer at emk-elektronik.de
> + * (C) Copyright 2003-2010
> + * EMK Elektronik GmbH & Co. KG, reinhard.meyer at emk-elektronik.de
>  *
>  * See file CREDITS for list of people who contributed to this
>  * project.
> @@ -22,7 +22,8 @@
>  */
>
>  #include <common.h>
> -
> +#include <command.h>
> +
>
>  /*****************************************************************************
>  * read "factory" part of EEPROM and set some environment variables
>
>  *****************************************************************************/
> @@ -70,6 +71,10 @@ void read_factory_r (void)
>                /* search for our specific entry */
>                if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
>                        setenv ("ethaddr", (char *)(buf + 19));
> +#if defined(CONFIG_TOP7000)
> +               } else if (!strncmp ((char *) buf, "[RLA/lan2/Ethernet] ",
> 20)) {
> +                       setenv ("eth1addr", (char *)(buf + 20));
> +#endif
>                } else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
>                        setenv ("serial#", (char *)(buf + 15));
>                } else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) {
> @@ -77,3 +82,48 @@ void read_factory_r (void)
>                }
>        }
>  }
> +
> +#if defined(CONFIG_TOP7000)
> +int do_vpd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> +       uchar buf[512];
> +       uchar *p;
> +       int i;
> +       u_int addr;
> +
> +       if (argc != 3)
> +               return 1;
> +
> +       p = buf+2;
> +       i = simple_strtoul(argv[1], NULL, 10);
> +       if (i<1 || i>32766)
> +               return 1;
> +
> +       addr=(i-1)*2;
> +
> +       p+=sprintf((char*)p,
> +               "[RLA/lan/Ethernet] 00:80:d9:0d:%02x:%02x\n",
> +               addr/256, addr%256);
> +       addr++;
> +       p+=sprintf((char*)p,
> +               "[RLA/lan2/Ethernet] 00:80:d9:0d:%02x:%02x\n",
> +               addr/256, addr%256);
>
These appear to be public MAC addresses.  Are these ones that your company
owns and you're guaranteeing to be unique?
<snip>

> +
> +#ifdef CONFIG_CMD_NET
> +int board_eth_init(bd_t *bi)
> +{
> +       macb_eth_initialize(0,
> +               (void *)MACB0_BASE, bi->bi_phy_id[0]);
> +       macb_eth_initialize(1,
> +               (void *)MACB1_BASE, bi->bi_phy_id[1]);
> +       return 0;
>
Please return the number of controllers that were successfully initialized.
<snip>

regards,
Ben


More information about the U-Boot mailing list