Skip to content

Commit

Permalink
firmware: turris-mox-rwtm: report failures better
Browse files Browse the repository at this point in the history
Report a notice level message if a command is not supported by the rWTM
firmware.

This should not be an error, merely a notice, because the firmware can
be used on boards that do not have manufacturing information burned.

Fixes: 389711b ("firmware: Add Turris Mox rWTM firmware driver")
Signed-off-by: Marek Behún <[email protected]>
Reviewed-by: Pali Rohár <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: Gregory CLEMENT <[email protected]>
  • Loading branch information
elkablo authored and gclement committed Jun 17, 2021
1 parent e34e602 commit 72f9988
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions drivers/firmware/turris-mox-rwtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,14 @@ static int mox_get_board_info(struct mox_rwtm *rwtm)
return ret;

ret = mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval);
if (ret < 0 && ret != -ENODATA) {
return ret;
} else if (ret == -ENODATA) {
if (ret == -ENODATA) {
dev_warn(rwtm->dev,
"Board does not have manufacturing information burned!\n");
} else if (ret == -ENOSYS) {
dev_notice(rwtm->dev,
"Firmware does not support the BOARD_INFO command\n");
} else if (ret < 0) {
return ret;
} else {
rwtm->serial_number = reply->status[1];
rwtm->serial_number <<= 32;
Expand Down Expand Up @@ -237,10 +240,13 @@ static int mox_get_board_info(struct mox_rwtm *rwtm)
return ret;

ret = mox_get_status(MBOX_CMD_ECDSA_PUB_KEY, reply->retval);
if (ret < 0 && ret != -ENODATA) {
return ret;
} else if (ret == -ENODATA) {
if (ret == -ENODATA) {
dev_warn(rwtm->dev, "Board has no public key burned!\n");
} else if (ret == -ENOSYS) {
dev_notice(rwtm->dev,
"Firmware does not support the ECDSA_PUB_KEY command\n");
} else if (ret < 0) {
return ret;
} else {
u32 *s = reply->status;

Expand Down

0 comments on commit 72f9988

Please sign in to comment.