diff options
Diffstat (limited to 'board/freescale/common')
| -rw-r--r-- | board/freescale/common/pixis.c | 4 | ||||
| -rw-r--r-- | board/freescale/common/sgmii_riser.c | 65 | ||||
| -rw-r--r-- | board/freescale/common/sgmii_riser.h | 1 | ||||
| -rw-r--r-- | board/freescale/common/sys_eeprom.c | 4 |
4 files changed, 70 insertions, 4 deletions
diff --git a/board/freescale/common/pixis.c b/board/freescale/common/pixis.c index 96820ac60..eb76d937f 100644 --- a/board/freescale/common/pixis.c +++ b/board/freescale/common/pixis.c @@ -280,7 +280,7 @@ int pixis_disable_watchdog_cmd(cmd_tbl_t *cmdtp, U_BOOT_CMD( diswd, 1, 0, pixis_disable_watchdog_cmd, - "diswd - Disable watchdog timer \n", + "Disable watchdog timer", NULL); #ifdef CONFIG_PIXIS_SGMII_CMD @@ -539,7 +539,7 @@ pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) U_BOOT_CMD( pixis_reset, CONFIG_SYS_MAXARGS, 1, pixis_reset_cmd, - "pixis_reset - Reset the board using the FPGA sequencer\n", + "Reset the board using the FPGA sequencer", " pixis_reset\n" " pixis_reset [altbank]\n" " pixis_reset altbank wd\n" diff --git a/board/freescale/common/sgmii_riser.c b/board/freescale/common/sgmii_riser.c index 5ccd6bcad..aeacb91bc 100644 --- a/board/freescale/common/sgmii_riser.c +++ b/board/freescale/common/sgmii_riser.c @@ -14,6 +14,8 @@ #include <config.h> #include <common.h> +#include <net.h> +#include <libfdt.h> #include <tsec.h> void fsl_sgmii_riser_init(struct tsec_info_struct *tsec_info, int num) @@ -24,3 +26,66 @@ void fsl_sgmii_riser_init(struct tsec_info_struct *tsec_info, int num) if (tsec_info[i].flags & TSEC_SGMII) tsec_info[i].phyaddr += SGMII_RISER_PHY_OFFSET; } + +void fsl_sgmii_riser_fdt_fixup(void *fdt) +{ + struct eth_device *dev; + int node; + int i = -1; + int etsec_num = 0; + + node = fdt_path_offset(fdt, "/aliases"); + if (node < 0) + return; + + while ((dev = eth_get_dev_by_index(++i)) != NULL) { + struct tsec_private *priv; + int enet_node; + char enet[16]; + const u32 *phyh; + int phynode; + const char *model; + const char *path; + + printf("Updating PHY address for %s\n", dev->name); + if (!strstr(dev->name, "eTSEC")) + continue; + + sprintf(enet, "ethernet%d", etsec_num++); + path = fdt_getprop(fdt, node, enet, NULL); + if (!path) { + debug("No alias for %s\n", enet); + continue; + } + + enet_node = fdt_path_offset(fdt, path); + if (enet_node < 0) + continue; + + model = fdt_getprop(fdt, enet_node, "model", NULL); + + printf("%s's model is %s\n", enet, model); + /* + * We only want to do this to eTSECs. On some platforms + * there are more than one type of gianfar-style ethernet + * controller, and as we are creating an implicit connection + * between ethernet nodes and eTSEC devices, it is best to + * make the connection use as much explicit information + * as exists. + */ + if (!strstr(model, "TSEC")) + continue; + + phyh = fdt_getprop(fdt, enet_node, "phy-handle", NULL); + if (!phyh) + continue; + + phynode = fdt_node_offset_by_phandle(fdt, fdt32_to_cpu(*phyh)); + + priv = dev->priv; + + printf("Device flags are %x\n", priv->flags); + if (priv->flags & TSEC_SGMII) + fdt_setprop_cell(fdt, phynode, "reg", priv->phyaddr); + } +} diff --git a/board/freescale/common/sgmii_riser.h b/board/freescale/common/sgmii_riser.h index 8d56a1f59..e1fcc858f 100644 --- a/board/freescale/common/sgmii_riser.h +++ b/board/freescale/common/sgmii_riser.h @@ -13,3 +13,4 @@ */ void fsl_sgmii_riser_init(struct tsec_info_struct *tsec_info, int num); +void fsl_sgmii_riser_fdt_fixup(void *fdt); diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index eb58c7fd5..988cb94aa 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -328,7 +328,7 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) prog_eeprom(); break; default: - printf("Usage:\n%s\n", cmdtp->usage); + cmd_usage(cmdtp); break; } @@ -362,7 +362,7 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) break; case 'h': /* help */ default: - printf("Usage:\n%s\n", cmdtp->usage); + cmd_usage(cmdtp); break; } |