From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Wed, 07 Apr 2010 10:23:35 -0700 Subject: [U-Boot] [PATCH 01/28] nios2: add nios2-generic board In-Reply-To: <4BBBF9CE.8000408@wytron.com.tw> References: <1268984633-12224-1-git-send-email-thomas@wytron.com.tw> <1268984633-12224-2-git-send-email-thomas@wytron.com.tw> <4BB976E9.9050804@gmail.com> <4BBBF9CE.8000408@wytron.com.tw> Message-ID: <4BBCBF97.9010602@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 4/6/2010 8:19 PM, Thomas Chou wrote: > On 04/05/2010 01:36 PM, Ben Warren wrote: >> Hi Thomas, >> >> On 3/19/2010 12:43 AM, Thomas Chou wrote: >>> This is a generic approach to port u-boot for nios2 boards. >>> It uses a new set of device drivers, such as the cfi flash, spi >>> lash, nand flash and new ethernet drivers. >>> >> >>> +#ifdef CONFIG_CMD_NET >>> +int board_eth_init(bd_t *bis) >>> +{ >>> + int rc = 0; >>> +#ifdef CONFIG_SMC91111 >>> + rc = smc91111_initialize(bis, CONFIG_SMC91111_BASE); >>> +#endif >>> + >>> +#ifdef CONFIG_DRIVER_DM9000 >>> + rc = dm9000_initialize(bis); >>> +#endif >>> + >>> +#ifdef CONFIG_ALTERA_TSE >>> + altera_tse_init(bis, CONFIG_SYS_NUM_TSE_MACS); >>> +#endif >>> + >>> +#ifdef CONFIG_ETHOC >>> + rc = ethoc_initialize(bis, CONFIG_SYS_ETHOC_BASE); >>> +#endif >>> + return rc; >>> +} >> Please clean up the return code handling. The drivers are not >> mutually exclusive. > Hi Ben, > > Does it make sense to return 0 always, as we don't have cpu_eth_init()? > No, it should return the number of interfaces initialized. I realize that the caller doesn't currently do anything with this number, and intend to make a return code of -1 be interpreted as an error, but that's currently not the case. If there's an error in board_eth_init(), return 0 and print an error message. > >> >> >>> + >>> +#define CONFIG_ETHADDR 08:00:3e:26:0a:5b >>> +#define CONFIG_NETMASK 255.255.255.0 >>> +#define CONFIG_IPADDR 192.168.2.21 >>> +#define CONFIG_SERVERIP 192.168.2.16 >>> + >> Please remove these definitions > OK. > > Best regards, > Thomas regards, Ben