Vadim Bendebury 730c7c469f cr50: report rw version properly
The code reporting the RW version is in fact using a fixed location in
flash memory. This is fine for a single RW image (i.e. the vast
majority of the EC boards), but is wrong for CR50 which can run one of
two RW images.

The fix is to account for this by providing the currently running
image type to the function retrieving the image version.

Note that RW and RW_B versions end up at different offsets into the
image, it is impossible to retrieve the version of the not currently
running RW by just changing the offset into the flash memory.

BRANCH=none
BUG=chrome-os-partner:55145
TEST=as follows:
   - build, update and start a cr50
   - check the vers. command output, observe that it is running from
     RW and reports the correct RW version string:

    > vers
    Chip:    g cr50 B1 0_0
    Board:   0
    RO:
    RW:    cr50_v1.1.4856-df14f6a
    Build: cr50_v1.1.4856-df14f6a 2016-07-11 11:52:44 vbendeb@eskimo.mtv.corp.google.com
    >

   - build the image again, update and restart the cr50
   - check the vers. command output, observe that it is running from
     RW_B and reports the correct RW version string:

    > vers
    Chip:    g cr50 B1 0_0
    Board:   0
    RO:
    RW_B:  cr50_v1.1.4856-df14f6a
    Build: cr50_v1.1.4856-df14f6a 2016-07-11 11:52:44 vbendeb@eskimo.mtv.corp.google.com
    >

   - erase the RW space base
     flasherase 0x4000 0x20000
   - run the vers command again. It was failing before this fix, now
     it still shows the proper RW_B version.

Change-Id: Iab8bc0e61b50dd65a9e18a0369b18bdd9cc05421
Reviewed-on: https://chromium-review.googlesource.com/359580
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-07-12 01:51:01 -07:00
2016-07-11 10:23:10 -07:00
2016-07-12 01:51:01 -07:00
2016-07-11 21:27:46 -07:00
2016-07-11 21:27:47 -07:00
2016-07-11 21:27:46 -07:00
2012-05-11 09:11:52 -07:00
2016-07-11 21:27:46 -07:00
2016-07-11 21:27:46 -07:00
2014-04-02 19:58:53 +00:00
2015-12-08 20:05:05 -08:00

For an overview of the Embedded Controller firmware, refer to

http://www.chromium.org/chromium-os/2014-firmware-summit

For instructions on building from source, refer to

http://www.chromium.org/chromium-os/ec-development/getting-started-building-ec-images-quickly
Description
No description provided
Readme 1.4 GiB
Languages
C 64.7%
Lasso 20.7%
ASL 3.6%
JavaScript 3.2%
C# 2.9%
Other 4.6%