Commit Graph

10 Commits

Author SHA1 Message Date
Randall Spangler
2e0ae57990 Use __packed instead of __attribute__((packed))
The presubmit script for linux kernel style prefers the former.

BUG=none
TEST=none

Change-Id: I0a0a1eb039f45975ada075c1302d868071a7cfb1
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26361
2012-06-28 17:40:39 -07:00
Randall Spangler
fb123b4838 Only one RW image is now the default
And if RW B isn't enabled, it's not even linked.

BUG=chrome-os-partner:10881
TEST=on link, should be no B image, and 'sysjump B' should fail
On BDS, still should be A and B images

Signed-off-by: Randall Spangler <rspangler@chromium.org>
Change-Id: Icb2af07881cc7e28b9b877f45824486a22fde8d7
Reviewed-on: https://gerrit.chromium.org/gerrit/26116
2012-06-26 13:58:54 -07:00
Bill Richardson
12eecc012b Put correct RO_FRID, RW_FWID_A, RW_FWID_B entries in FMAP
BUG=chrome-os-partner:9495
TEST=manual

Build image, run dump_fmap. Look for those entries.

Change-Id: I6dfc38e00ce1e11ea24c8392d1691fab32a59d1f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24696
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2012-06-07 01:20:16 -07:00
Vincent Palatin
5e1f87ce56 do not advertise RW-B in FMAP if it doesn't exist
The Snow board has currently the second RW partition de-activated due to
flash space constraints, we don't want to send false information to the
tools.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chrome-os-partner:8865
TEST=on Snow, flashrom -p internal:bus=lpc -i EC_RW -w ec.bin

Change-Id: I6da60028aa69aeb476d5c2d98df5a03ece961891
2012-05-22 19:48:30 +00:00
Bill Richardson
add419009f Clean up linker scripts; detect out-of-flash problem.
The VMA of the .data segment is in RAM, but we actually put it into FLASH.
The linker doesn't notice if it runs out of flash, so it creates an invalid
image.

This adds an explicit check to be sure it all fits. It also refactors the
region declarations to be more explicit. For vboot-enabled configurations,

  CONFIG_SECTION_*      - describes the extent of flash for one entire image
  CONFIG_FW_*           - the region within the SECTION for the firmware only
  CONFIG_VBLOCK_*       - the region within the RW SECTIONs for the vblocks
  CONFIG_VBOOT_ROOTKEY  - the region within the RO SECTION for the root key

Look at chip/lm4/config.h for the best example.

BUG=chrome-os-partner:9839
TEST=manual

Build it, run it.

Change-Id: I3c652e82d58a5328115cc750c80ecba6a3fd99a3
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-21 14:20:02 -07:00
Bill Richardson
8101b71316 Enable verified boot for EC firmware
BUG=chrome-os-partner:7459
TEST=manual

In the chroot:

  cd src/platform/ec
  make BOARD=link

The firmware image (build/link/ec.bin) is signed with dev-keys. Reflash the
EC and try it, and it should verify and reboot into RW A.

Additional tests (setting USE_RO_NORMAL, poking random values into VBLOCK_A
or FW_MAIN_A to force RW B to run, etc.) are left as an exercise for the
reader. I've done them and they work, though.

Change-Id: I29a23ea69aef02a11aebd4af3b043f6864723523
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-10 17:27:36 -07:00
Louis Yung-Chieh Lo
468e34d51d Add EC_RO/EC_RW and WP_RO FMAP area for fw_updater and factory.
EC_RO and WP_RO area are identical and should cover whole range needed to
be write-protected. While EC_RO is for legacy firmware updater, the WP_RO
is for future factory finalize test.

EC_RW is for fw_updater to update both A/B at once.

Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>

BUG=chrome-os-partner:9536
TEST=build in chroot and dump_fmap build/link/ec.bin
opened build/link/ec.bin
hit at 0x00013800
fmap_signature   __FMAP__
fmap_version:    1.0
fmap_base:       0x0
fmap_size:       0x0003f800 (260096)
fmap_name:       EC_FMAP
fmap_nareas:     16
area:            1
area_offset:     0x00000000
area_size:       0x00014000 (81920)
area_name:       RO_SECTION
area:            2
area_offset:     0x00000000
area_size:       0x00013000 (77824)
area_name:       BOOT_STUB
area:            5
area_offset:     0x00013800
area_size:       0x00000302 (770)
area_name:       FMAP
area:            7                    <----
area_offset:     0x00000000           <----
area_size:       0x00014000 (81920)   <----
area_name:       EC_RO                <----
area:            8                    <----
area_offset:     0x00014000           <----
area_size:       0x00028000 (163840)  <----
area_name:       EC_RW                <----
area:            9                    <----
area_offset:     0x00000000           <----
area_size:       0x00014000 (81920)   <----
area_name:       WP_RO                <----
area:            10
area_offset:     0x00014000
area_size:       0x00014000 (81920)
area_name:       RW_SECTION_A
area:            14
area_offset:     0x00028000
area_size:       0x00014000 (81920)
area_name:       RW_SECTION_B

Change-Id: I11b9450f87e26ef1cd0ac65ecd059e13d8489e26
2012-05-08 14:51:34 +08:00
Bill Richardson
3b361af2a7 Update EC config and FMAP to reserve room for vboot signatures
This just reserves room. It doesn't actually perform any verification yet.

BUG=chrome-os-partner:7459
TEST=manual

  make BOARD=link
  dump_fmap build/link/ec.bin

Change-Id: I424db1d601a614be3dfe5abb200e24e8bc62e47e
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-04 14:42:58 -07:00
Louis Yung-Chieh Lo
f1467b61b7 Refine the EC flash size in FMAP structure.
BUG=none
TEST=make and dump:
% dump_fmap build/link/ec.bin
...
fmap_size:       0x0003f800 (260096)
...

Change-Id: I9e5a5d1a1d2c9d3e6660a13d5b2fff438517af7e
2012-05-02 15:29:07 +08:00
Bill Richardson
8d921af0bb Add basic FMAP to EC firmware image.
This is very basic, so you can only rely on RO_SECTION, RW_SECTION_A, and
RW_SECTION_B for now. We'll fill in more regions as we add vboot stuff.

Still, you should be able to do things like this:

  flashrom -p internal:bus=lpc -r ec.bin

  flashrom -p internal:bus=lpc -w ec.bin -i RW_SECTION:ec.B.flat

BUG=chrome-os-partner:8198
TEST=manual

Build the image, look for the FMAP in it.

  cd src/platform/ec
  make BOARD=link
  dump_fmap ./build/link/ec.bin

Change-Id: I0adbbfb8e975faae805bda271873fcef46590cf4
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-01 15:54:39 -07:00