#include <asm/arch/clk.h>
#include <asm/arch/gpio.h>
#include <asm/arch/hmatrix.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
gd->bd->bi_phy_id[1] = 0x03;
}
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
-
#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bi)
{
#include <asm/arch/clk.h>
#include <asm/arch/gpio.h>
#include <asm/arch/hmatrix.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
gd->bd->bi_phy_id[1] = 0x11;
}
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
-
#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bi)
{
#include <asm/io.h>
#include <net.h>
#include <asm/mach-common/bits/bootrom.h>
+#include <netdev.h>
/**
* is_valid_ether_addr - Determine if the given Ethernet address is valid
#if defined(CONFIG_BFIN_MAC)
-extern int bfin_EMAC_initialize(bd_t *bis);
-
int board_eth_init(bd_t *bis)
{
return bfin_EMAC_initialize(bis);
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/sdram.h>
}
#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET)
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
-
int board_eth_init(bd_t *bi)
{
return macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]);
#include <libfdt.h>
#include <fdt_support.h>
#include <spd_sdram.h>
+#include <netdev.h>
#include "../common/pixis.h"
return val;
}
-extern int uli526x_initialize(bd_t *);
-
int board_eth_init(bd_t *bis)
{
-#if defined(CONFIG_ULI526)
- uli526x_initialize(bis);
-#endif
- return 0;
+ return pci_eth_init(bis);
}
* MA 02111-1307 USA
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/sdram.h>
#endif /* CONFIG_ATMEL_SPI */
#ifdef CONFIG_CMD_NET
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
-
int board_eth_init(bd_t *bi)
{
macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]);
#include "../cpu/at32ap/at32ap700x/sm.h"
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/sdram.h>
.refresh_period = (781 * (SDRAMC_BUS_HZ / 1000)) / 100000,
};
-extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
-
#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bis)
{
#include <common.h>
#include <mpc824x.h>
#include <pci.h>
+#include <netdev.h>
int checkboard (void)
{
pci_mpc824x_init(&hose);
}
-extern int skge_initialize(bd_t *bis);
-
int board_eth_init(bd_t *bis)
{
int rc = 0;
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
/* ------------------------------------------------------------------------- */
-extern int greth_initialize(bd_t *bis);
-
#ifdef CONFIG_GRETH
int cpu_eth_init(bd_t *bis)
{
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/processor.h>
}
/* ------------------------------------------------------------------------- */
-extern int greth_initialize(bd_t *bis);
#ifdef CONFIG_GRETH
int cpu_eth_init(bd_t *bis)
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
#include <watchdog.h>
#include <command.h>
#include <asm/immap.h>
+#include <netdev.h>
#ifdef CONFIG_M5271
/*
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
* int board_eth_init(bd_t *bis)
*/
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
return mcffec_initialize(bis);
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <netdev.h>
#include <asm/immap.h>
* int board_eth_init(bd_t *bis)
*/
-extern int mcdmafec_initialize(bd_t *bis);
-extern int mcffec_initialize(bd_t*);
-
int cpu_eth_init(bd_t *bis)
{
#if defined(CONFIG_FSLDMAFEC)
#include <common.h>
#include <config.h>
#include <net.h>
+#include <netdev.h>
#include <command.h>
#include <malloc.h>
#include <common.h>
#include <command.h>
#include <net.h>
+#include <netdev.h>
#include <malloc.h>
#include <asm/processor.h>
#include <ambapp.h>
*/
#include <net.h>
+#include <netdev.h>
#include <malloc.h>
#include <linux/mii.h>
#include <command.h>
#include <net.h>
+#include <netdev.h>
#include <miiphy.h>
#undef ET_DEBUG
*/
#include <common.h>
+#include <netdev.h>
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
#include <common.h>
#include <malloc.h>
#include <net.h>
+#include <netdev.h>
#include <asm/io.h>
#include <pci.h>
#include <miiphy.h>
--- /dev/null
+/*
+ * (C) Copyright 2008
+ * Benjamin Warren, biggerbadderben@gmail.com
+ *
+ * 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
+ */
+
+/*
+ * netdev.h - definitions an prototypes for network devices
+ */
+
+#ifndef _NETDEV_H_
+#define _NETDEV_H_
+
+/*
+ * Board and CPU-specific initialization functions
+ * board_eth_init() has highest priority. cpu_eth_init() only
+ * gets called if board_eth_init() isn't instantiated or fails.
+ * Return values:
+ * 0: success
+ * -1: failure
+ */
+
+int board_eth_init(bd_t *bis);
+int cpu_eth_init(bd_t *bis);
+
+/* Driver initialization prototypes */
+int bfin_EMAC_initialize(bd_t *bis);
+int greth_initialize(bd_t *bis);
+int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
+int mcdmafec_initialize(bd_t *bis);
+int mcffec_initialize(bd_t *bis);
+int skge_initialize(bd_t *bis);
+int uli526x_initialize(bd_t *bis);
+
+/* Boards with PCI network controllers can call this from their board_eth_init()
+ * function to initialize whatever's on board.
+ * Return value is total # of devices found */
+
+static inline int pci_eth_init(bd_t *bis)
+{
+ int num = 0;
+#if defined(CONFIG_ULI526)
+ num += uli526x_initialize(bis);
+#endif
+ return num;
+}
+
+#endif /* _NETDEV_H_ */
+