2 * Freescale SGMII Riser Card
4 * This driver supports the SGMII Riser card found on the
5 * "DS" style of development board from Freescale.
7 * This software may be used and distributed according to the
8 * terms of the GNU Public License, Version 2, incorporated
11 * Copyright 2008 Freescale Semiconductor, Inc.
21 void fsl_sgmii_riser_init(struct tsec_info_struct *tsec_info, int num)
25 for (i = 0; i < num; i++)
26 if (tsec_info[i].flags & TSEC_SGMII)
27 tsec_info[i].phyaddr += SGMII_RISER_PHY_OFFSET;
30 void fsl_sgmii_riser_fdt_fixup(void *fdt)
32 struct eth_device *dev;
37 node = fdt_path_offset(fdt, "/aliases");
41 while ((dev = eth_get_dev_by_index(++i)) != NULL) {
42 struct tsec_private *priv;
50 if (!strstr(dev->name, "eTSEC"))
53 sprintf(enet, "ethernet%d", etsec_num++);
54 path = fdt_getprop(fdt, node, enet, NULL);
56 debug("No alias for %s\n", enet);
60 enet_node = fdt_path_offset(fdt, path);
64 model = fdt_getprop(fdt, enet_node, "model", NULL);
67 * We only want to do this to eTSECs. On some platforms
68 * there are more than one type of gianfar-style ethernet
69 * controller, and as we are creating an implicit connection
70 * between ethernet nodes and eTSEC devices, it is best to
71 * make the connection use as much explicit information
74 if (!strstr(model, "TSEC"))
77 phyh = fdt_getprop(fdt, enet_node, "phy-handle", NULL);
81 phynode = fdt_node_offset_by_phandle(fdt, fdt32_to_cpu(*phyh));
85 if (priv->flags & TSEC_SGMII)
86 fdt_setprop_cell(fdt, phynode, "reg", priv->phyaddr);