Commit 2b7c4a19835dab608bbd8662a60b03aa0f37a423

Authored by Prabhakar Kushwaha
Committed by York Sun
1 parent cd8aefc076

drivers: fsl-mc: Return error for major version mismatch

Management complex major version should match to the firmware present in flash.

Return error during mismatch of major version.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: York Sun <yorksun@freescale.com>

Showing 1 changed file with 7 additions and 2 deletions Side-by-side Diff

drivers/net/fsl-mc/mc.c
... ... @@ -518,10 +518,15 @@
518 518 goto out;
519 519 }
520 520  
521   - if (MC_VER_MAJOR != mc_ver_info.major)
  521 + if (MC_VER_MAJOR != mc_ver_info.major) {
522 522 printf("fsl-mc: ERROR: Firmware major version mismatch (found: %d, expected: %d)\n",
523 523 mc_ver_info.major, MC_VER_MAJOR);
  524 + printf("fsl-mc: Update the Management Complex firmware\n");
524 525  
  526 + error = -ENODEV;
  527 + goto out;
  528 + }
  529 +
525 530 if (MC_VER_MINOR != mc_ver_info.minor)
526 531 printf("fsl-mc: WARNING: Firmware minor version mismatch (found: %d, expected: %d)\n",
527 532 mc_ver_info.minor, MC_VER_MINOR);
... ... @@ -541,7 +546,7 @@
541 546  
542 547 out:
543 548 if (error != 0)
544   - mc_boot_status = -error;
  549 + mc_boot_status = error;
545 550 else
546 551 mc_boot_status = 0;
547 552