ddr: imx8m: Return error values from LPDDR4 training

In cases when the same SPL should run on boards with i.MX8MM, that
differ in DDR configuration, it is necessary to try different
parameters and check if the training done by the firmware suceeds or
not.

Therefore we return the DDR training/initialization success to the
upper layer in order to be able to retry with different settings if
necessary.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
This commit is contained in:
Frieder Schrempf 2019-12-11 10:01:19 +00:00 committed by Stefano Babic
parent 162c72c804
commit 83083febf5
4 changed files with 23 additions and 11 deletions

View file

@ -84,7 +84,7 @@ static inline void decode_streaming_message(void)
debug("\n");
}
void wait_ddrphy_training_complete(void)
int wait_ddrphy_training_complete(void)
{
unsigned int mail;
@ -95,10 +95,10 @@ void wait_ddrphy_training_complete(void)
decode_streaming_message();
} else if (mail == 0x07) {
debug("Training PASS\n");
break;
return 0;
} else if (mail == 0xff) {
printf("Training FAILED\n");
break;
debug("Training FAILED\n");
return -1;
}
}
}