summaryrefslogtreecommitdiff
path: root/drivers/net/xilinx_emaclite.c
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2014-02-24 11:16:28 +0100
committerTom Rini <trini@ti.com>2014-03-04 09:27:32 -0500
commit0c9c99a20b8b900fc8e284f89a08ff6f46de6a3b (patch)
tree1dfed837f0aa454ef0f89c1743fe95d572ec645a /drivers/net/xilinx_emaclite.c
parenteeb72e67619b98d2502fe634a3a5d9953de92ad0 (diff)
downloadu-boot-imx-0c9c99a20b8b900fc8e284f89a08ff6f46de6a3b.zip
u-boot-imx-0c9c99a20b8b900fc8e284f89a08ff6f46de6a3b.tar.gz
u-boot-imx-0c9c99a20b8b900fc8e284f89a08ff6f46de6a3b.tar.bz2
net: emaclite: Fix OF initialization
- Add xilinx_emaclite_of_init to netdev.h - Remove global data pointer from the driver - Add better handling for error state. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/net/xilinx_emaclite.c')
-rw-r--r--drivers/net/xilinx_emaclite.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 0a5209d..2a5cc44 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -14,8 +14,6 @@
#include <asm/io.h>
#include <fdtdec.h>
-DECLARE_GLOBAL_DATA_PTR;
-
#undef DEBUG
#define ENET_ADDR_LENGTH 6
@@ -364,24 +362,27 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
}
#ifdef CONFIG_OF_CONTROL
-int xilinx_emaclite_init(bd_t *bis)
+int xilinx_emaclite_of_init(const void *blob)
{
int offset = 0;
u32 ret = 0;
u32 reg;
do {
- offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset,
+ offset = fdt_node_offset_by_compatible(blob, offset,
"xlnx,xps-ethernetlite-1.00.a");
if (offset != -1) {
- reg = fdtdec_get_addr(gd->fdt_blob, offset, "reg");
+ reg = fdtdec_get_addr(blob, offset, "reg");
if (reg != FDT_ADDR_T_NONE) {
- u32 rxpp = fdtdec_get_int(gd->fdt_blob, offset,
+ u32 rxpp = fdtdec_get_int(blob, offset,
"xlnx,rx-ping-pong", 0);
- u32 txpp = fdtdec_get_int(gd->fdt_blob, offset,
+ u32 txpp = fdtdec_get_int(blob, offset,
"xlnx,tx-ping-pong", 0);
- ret |= xilinx_emaclite_initialize(bis, reg,
+ ret |= xilinx_emaclite_initialize(NULL, reg,
txpp, rxpp);
+ } else {
+ debug("EMACLITE: Can't get base address\n");
+ return -1;
}
}
} while (offset != -1);