cr50: sqa: don't modify flags if board id is erased
cr50: sqa: don't modify flags if board id is erased

Cr50 can only set a board id if the board id is blank.
0xffffffff:0xffffffff:0xffffffff is a blank board id. As SQA images are
now if you run eraseflashinfo while the board id isn't set,
eraseflashinfo will set the flags to 0 without changing the RLZ
information. The BID will be 0xffffffff:0xffffffff:0. This board id
isn't considered blank, so you won't be able to set the RLZ in the
future. Also the second field is not the inverse of the first, so it
will be considered invalid. This is a very bad state to get the board id
into because you can't change it, but it's also invalid.

This change checks that the board id is set before modifying the flags.
Cr50 wont modify the flags of an erased board id. It will only change
the flags if the board id is set.

BUG=none
BRANCH=none
TEST=erase the board id. make sure flags aren't set to 0 after running
eraseflashinfo. Set the board id. Make sure flags are set to 0 after
running eraseflashinfo.

Change-Id: Idc184e58c0dc398bc93c1119d822a13889c59963
Signed-off-by: Mary Ruthven <81380f3403fed74252e92df3ed012a1819ec6296@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1565452
Reviewed-by: Namyoon Woo <e8732cefb861f07768f47df788a8e8eb75efc09a@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec