From: Reinhard Meyer (-VC) <reinhard.meyer@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] add support for EMK TOP7000 CPU module
Date: Sun, 06 Jun 2010 13:26:16 +0200 [thread overview]
Message-ID: <4C0B85D8.4070508@emk-elektronik.de> (raw)
In-Reply-To: <4C0A9493.8090008@emk-elektronik.de>
Hello,
is this patch going to be accepted, or is someone insisting that only
my port shall return the number of controllers initialized?
Reinhard Meyer schrieb:
> Ben Warren schrieb:
>> 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@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@dave-tech.it>
>>>
>>> PPChameleonEVB PPC405EP
>>>
>>> -Reinhard Meyer <r.meyer@emk-elektronik.de>
>>> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
>>>
>>> TOP860 MPC860T
>>> TOP5200 MPC5200
>>> @@ -919,6 +919,10 @@ Julien May <julien.may@miromico.ch>
>>>
>>> HAMMERHEAD AT32AP7000
>>>
>>> +Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
>>> +
>>> + TOP7000 AT32AP7000
>>> +
>>> Haavard Skinnemoen <haavard.skinnemoen@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>
>>
> That is our address range.
>
>>> +
>>> +#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>
> 1) in net/eth.c:
> /* Try board-specific initialization first. If it fails or isn't
> * present, try the cpu-specific initialization */
> if (board_eth_init(bis) < 0)
> cpu_eth_init(bis);
> that means >=0 OK, <0 error code....
> 2) most other ports do something like
> int board_eth_init(bd_t *bi)
> {
> return macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]);
> }
> where macb_eth_initialize() returns 0 on success...
> 3) no port seems to return a positive number >0
> IF in the future it is required that the function returns the number of interfaces
> EVERY port has to be modified :)
>> regards,
>> Ben
>
> Best Regards, Reinhard
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
next prev parent reply other threads:[~2010-06-06 11:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-05 10:41 [U-Boot] [PATCH] add support for EMK TOP7000 CPU module Reinhard Meyer
2010-06-05 14:41 ` Ben Warren
2010-06-05 18:16 ` Reinhard Meyer
2010-06-06 11:26 ` Reinhard Meyer [this message]
2010-06-06 11:42 ` Wolfgang Denk
2010-06-06 11:45 ` Reinhard Meyer
2010-06-06 11:52 ` Reinhard Meyer
2010-06-06 12:09 ` Reinhard Meyer
2010-06-06 12:16 ` Wolfgang Denk
2010-06-06 13:23 ` Ben Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C0B85D8.4070508@emk-elektronik.de \
--to=reinhard.meyer@emk-elektronik.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.