diff options
author | Shengzhou Liu <Shengzhou.Liu@freescale.com> | 2011-10-14 16:26:05 +0800 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-10-18 00:36:55 -0500 |
commit | 2a523f524090d7fc5600ece9f12d7c955db567d7 (patch) | |
tree | 5c7e51b81be51bae4f7ef571861dab675652bb4d /board/freescale/corenet_ds/eth_hydra.c | |
parent | 4d28db8a1e8b90e1e3ffd95d7f949b849e33fa2f (diff) | |
download | u-boot-imx-2a523f524090d7fc5600ece9f12d7c955db567d7.zip u-boot-imx-2a523f524090d7fc5600ece9f12d7c955db567d7.tar.gz u-boot-imx-2a523f524090d7fc5600ece9f12d7c955db567d7.tar.bz2 |
fdt: Add new fdt_set_node_status & fdt_set_status_by_alias helpers
Add common function fdt_set_node_status() to assist in various locations
that we set a nodes status. This function utilizes the status values
that are part of the EPAPR spec (on power.org).
fdt_set_status_by_alias() is based on fdt_set_node_status() but uses an
alias string to identify the node to update.
We also add some shortcut functions to help the common cases of setting
"okay" and "disabled":
fdt_status_okay()
fdt_status_disabled()
fdt_status_okay_by_alias()
fdt_status_disabled_by_alias()
Finally, we fixup the corenet_ds ethernet code which previously had
a function by the same name that can be replaced with the new helpers.
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
Diffstat (limited to 'board/freescale/corenet_ds/eth_hydra.c')
-rw-r--r-- | board/freescale/corenet_ds/eth_hydra.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/board/freescale/corenet_ds/eth_hydra.c b/board/freescale/corenet_ds/eth_hydra.c index 91b3408..a7a5e13 100644 --- a/board/freescale/corenet_ds/eth_hydra.c +++ b/board/freescale/corenet_ds/eth_hydra.c @@ -70,6 +70,7 @@ #include <fm_eth.h> #include <fsl_mdio.h> #include <malloc.h> +#include <fdt_support.h> #include <asm/fsl_dtsec.h> #include "../common/ngpixis.h" @@ -200,25 +201,6 @@ static int hydra_mdio_init(char *realbusname, char *fakebusname) } /* - * Given an alias or a path for a node, set the status of that node. - * - * If 'alias' is not a valid alias, then it is treated as a full path to the - * node. No error checking is performed. - * - * This function is normally called to set the status for a virtual MDIO node. - */ -static void fdt_set_node_status(void *fdt, const char *alias, - const char *status) -{ - const char *path = fdt_get_alias(fdt, alias); - - if (!path) - path = alias; - - do_fixup_by_path(fdt, path, "status", status, strlen(status) + 1, 1); -} - -/* * Given an alias or a path for a node, set the mux value of that node. * * If 'alias' is not a valid alias, then it is treated as a full path to the @@ -372,14 +354,14 @@ void fdt_fixup_board_enet(void *fdt) case PHY_INTERFACE_MODE_SGMII: lane = serdes_get_first_lane(SGMII_FM1_DTSEC1 + idx); if (lane >= 0) { - fdt_set_node_status(fdt, "emi1_sgmii", "okay"); + fdt_status_okay_by_alias(fdt, "emi1_sgmii"); /* Also set the MUX value */ fdt_set_mdio_mux(fdt, "emi1_sgmii", mdio_mux[i].val); } break; case PHY_INTERFACE_MODE_RGMII: - fdt_set_node_status(fdt, "emi1_rgmii", "okay"); + fdt_status_okay_by_alias(fdt, "emi1_rgmii"); break; default: break; @@ -388,7 +370,7 @@ void fdt_fixup_board_enet(void *fdt) lane = serdes_get_first_lane(XAUI_FM1); if (lane >= 0) - fdt_set_node_status(fdt, "emi2_xgmii", "okay"); + fdt_status_okay_by_alias(fdt, "emi2_xgmii"); #endif } |