diff options
author | Bogdan Purcareata <bogdan.purcareata@nxp.com> | 2017-05-24 16:40:21 +0000 |
---|---|---|
committer | York Sun <york.sun@nxp.com> | 2017-06-01 19:55:50 -0700 |
commit | 33a8991a877847e39bc6b525f65664be026ba45b (patch) | |
tree | ceb4ebbbb827772bc9b5c7b332c000dc32a46a52 /drivers/net/fsl-mc/mc.c | |
parent | 380e86f361e4e2aef83295972863654fde157560 (diff) |
drivers: net: fsl-mc: Link MC boot to PHY_RESET_R
DPAA2 platforms boot the Management Complex based on the u-boot env
variable "mcinitcmd". Instead of doing this step on each platform
individually, define a single mc_env_boot function in the MC driver,
since it's semantically tied to it.
Call the function in a per-board reset_phy hook, as it gets called at a
later moment, when all board PHY devices have been initialized.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Heinz Wrobel <heinz.wrobel@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'drivers/net/fsl-mc/mc.c')
-rw-r--r-- | drivers/net/fsl-mc/mc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 0a74e3e42e..8da04281e9 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -27,6 +27,7 @@ #define MC_MEM_SIZE_ENV_VAR "mcmemsize" #define MC_BOOT_TIMEOUT_ENV_VAR "mcboottimeout" +#define MC_BOOT_ENV_VAR "mcinitcmd" DECLARE_GLOBAL_DATA_PTR; static int mc_boot_status = -1; @@ -1368,3 +1369,18 @@ U_BOOT_CMD( "fsl_mc lazyapply DPL [DPL_addr] - Apply DPL file on exit\n" "fsl_mc start aiop [FW_addr] - Start AIOP\n" ); + +void mc_env_boot(void) +{ +#if defined(CONFIG_FSL_MC_ENET) + char *mc_boot_env_var; + /* The MC may only be initialized in the reset PHY function + * because otherwise U-Boot has not yet set up all the MAC + * address info properly. Without MAC addresses, the MC code + * can not properly initialize the DPC. + */ + mc_boot_env_var = getenv(MC_BOOT_ENV_VAR); + if (mc_boot_env_var) + run_command_list(mc_boot_env_var, -1, 0); +#endif /* CONFIG_FSL_MC_ENET */ +} |