Skip to content
Snippets Groups Projects
Commit 7fd70820 authored by Michal Simek's avatar Michal Simek Committed by Joe Hershberger
Browse files

net: emaclite: Support OF initialization


Support new CONFIG_OF_CONTROL option where device
probing is done based on device tree description.

Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
CC: Joe Hershberger <joe.hershberger@gmail.com>
parent 61e12988
Branches
Tags
No related merge requests found
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#include <config.h> #include <config.h>
#include <malloc.h> #include <malloc.h>
#include <asm/io.h> #include <asm/io.h>
#include <fdtdec.h>
DECLARE_GLOBAL_DATA_PTR;
#undef DEBUG #undef DEBUG
...@@ -375,3 +378,30 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, ...@@ -375,3 +378,30 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
return 1; return 1;
} }
#ifdef CONFIG_OF_CONTROL
int xilinx_emaclite_init(bd_t *bis)
{
int offset = 0;
u32 ret = 0;
u32 reg;
do {
offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset,
"xlnx,xps-ethernetlite-1.00.a");
if (offset != -1) {
reg = fdtdec_get_addr(gd->fdt_blob, offset, "reg");
if (reg != FDT_ADDR_T_NONE) {
u32 rxpp = fdtdec_get_int(gd->fdt_blob, offset,
"xlnx,rx-ping-pong", 0);
u32 txpp = fdtdec_get_int(gd->fdt_blob, offset,
"xlnx,tx-ping-pong", 0);
ret |= xilinx_emaclite_initialize(bis, reg,
txpp, rxpp);
}
}
} while (offset != -1);
return ret;
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment