summaryrefslogtreecommitdiff
path: root/common/fmap.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: Remove checkpatch warningsRandall Spangler2013-12-191-6/+6
| | | | | | | | | | | | | | | | This make minor syntactic changes and renames some camel-cased symbols to keep checkpatch from complaining. The goal is to reduce the temptation to use 'repo upload --no-verify'. This is a big furball of find/replace, but no functional changes. BUG=chromium:322144 BRANCH=none TEST=build all boards; pass unit tests Change-Id: I0269b7dd95836ef9a6e33f88c003ab0f24f842a0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/180495
* Clean up flash section defines and increase lm4 image sizeRandall Spangler2013-06-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | The firmware defines had two almost-identical sets. Coalesce into one consistent set. Link had 256 KB flash, but only allowed 2 80KB images. Future LM4-based platforms (slippy/peppy/falco/etc) will now use the entire flash, with RO=124KB, pstate=4KB, RW=128KB. This matches what the STM32 platforms do, where pstate is contiguous with the RO firmware. No functional change to STM32-based platforms. BUG=chrome-os-partner:19176 BRANCH=none TEST=build all platforms and dump_fmap ec.bin. - stm32-based platforms should report RO=61440@0, RW=65536@0x10000 - link should report RO=81920@0, RW=81920@0x14000 - slippy should report RO=129024@0, RW=131072@0x20000 Change-Id: I20b1d95c16250d9a5d228ead06eef03d96548823 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/56655
* Clean up fmap.cRandall Spangler2012-10-241-10/+16
| | | | | | | | | | | | | No functional changes; just reformatting. BUG=chrome-os-partner:15579 BRANCH=none TEST=compile code Change-Id: I6b775c835a935be845bc8aea3dd742af91ab2af7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36455 Reviewed-by: Simon Glass <sjg@chromium.org>
* Snow: WP_RO should be 0x10000 (including pstate).Louis Yung-Chieh Lo2012-08-171-3/+3
| | | | | | | | | | | | | | | To reflect the CL 00799d5 that moves the pstate to 0xf000. BUG=chrome-os-partner:12799 TEST=Build in chroot. snow: WP_RO is changed from 0:0xf000 --> 0:0x10000. daisy: WP_RO is unchanged. link: WP_RO is unchanged. Change-Id: I572bae3f624744e60d13a762875211beffc6c516 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/30670 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Remove signature-based vboot supportRandall Spangler2012-08-071-28/+1
| | | | | | | | | | | | | | | | | | | | Superseded by EC software sync (hash-based). Sig-based vboot was correctly implemented, but ended up being too slow to be useful given the limited processing power of the EC chips, and we also couldn't come up with a manageable way to handle A/B autoupdate of signed EC firmware. This change and an associated vboot_reference change shrinks the EC binary by ~2KB. BUG=chrome-os-partner:11232 TEST=build link,snow; boot link and check that 'hash' command still works. Change-Id: I3f03ae2d0a4030977826980d6ec5613181e154c2 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/29496 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Change some FMAP area_offset to be related to the start of flash.Louis Yung-Chieh Lo2012-07-251-3/+10
| | | | | | | | | | | | | | | | | | | | | | The area_offset of following area are wrong which is related to the CPU view in the STM32 chip: FMAP RO_FRID RW_FWID Add a macro RELATIVE() to calculate the real offset in flash. BUG=chrome-os-partner:11269 TEST=build in chroot for link and snow. Those fmap afddress are related to the start of flash. Change-Id: I691814e2f53b1de0ecf9fd385bed8d5c598373a7 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28388 Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
* ec: Remove "_A" suffix in FMAP RW firmware areas.Hung-Te Lin2012-07-231-12/+5
| | | | | | | | | | | | | | | Since we only have one RW firmware, let's remove _A to prevent confusion. Also change "BOOT_STUB" to FR_MAIN to reflect the fact that it's not just bootstub - it's a full firmware area just like FW_MAIN. BUG=chrome-os-partner:11360 TEST=emerge-link chromeos-ec; dump_fmap -x /build/link/firmware/ec.bin Change-Id: Ia84062ada5959164b2b4e0f9cc5fcc032ca6f71e Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27971 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* chromeos-ec: Refine FMAP.Hung-Te Lin2012-07-181-37/+33
| | | | | | | | | | | | | Make EC FMAP more compliant to existing devices (EC_RO, EC_RW, RW_FWID), eliminating unnecessary areas (RO_SETION, EC_IMAGE), and add more detailed comments to each area. BUG=chrome-os-partner:11360 TEST=emerge-link chromeos-ec; dump_fmap -x ec.bin Change-Id: I3d30d6fe0d3cee2e944009dccef488f7215b6395 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27739
* Don't waste space on vblock and root key if not doing sig-based EC vbootRandall Spangler2012-07-171-1/+9
| | | | | | | | | BUG=chrome-os-partner:11455 TEST=dump_fmap build/link/ec.bin; shouldn't see VBLOCK or ROOT_KEY sections Change-Id: I8c1309936d86772fdf9aecdc8d95f0578ef0f65b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27661
* Remove firmware BRandall Spangler2012-07-171-34/+3
| | | | | | | | | | BUG=chrome-os-partner:11449 TEST=build link, snow, bds; ectool reboot_ec cold to make sure enums line up Change-Id: Ie09db2080a00f1a7e2c05579b9b41ea5137c1af0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27658 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Rename A and B images to RW and RW_B, part 1Randall Spangler2012-07-171-15/+15
| | | | | | | | | | | | | | | | | | | All of our current EC configs have RO and a single RW image. Calling that image 'A' is confusing, particularly when combined with EC software sync (where the RW image is updated from either the A or B AP RW firmware). So, rename it. This changes all the build artifacts and constants. Internal EC commands and host commands still refer to A/B; that will be fixed in part 2. BUG=none TEST=build link, snow, bds Change-Id: Icfed4914745f0799bb71befb6a6563cfd8bc90ab Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27649 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Use __packed instead of __attribute__((packed))Randall Spangler2012-06-281-3/+4
| | | | | | | | | | | 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
* Only one RW image is now the defaultRandall Spangler2012-06-261-2/+3
| | | | | | | | | | | | 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
* Put correct RO_FRID, RW_FWID_A, RW_FWID_B entries in FMAPBill Richardson2012-06-071-6/+14
| | | | | | | | | | | | 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>
* do not advertise RW-B in FMAP if it doesn't existVincent Palatin2012-05-221-0/+2
| | | | | | | | | | | | | 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
* Clean up linker scripts; detect out-of-flash problem.Bill Richardson2012-05-211-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Enable verified boot for EC firmwareBill Richardson2012-05-101-1/+0
| | | | | | | | | | | | | | | | | | | | 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>
* Add EC_RO/EC_RW and WP_RO FMAP area for fw_updater and factory.Louis Yung-Chieh Lo2012-05-081-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update EC config and FMAP to reserve room for vboot signaturesBill Richardson2012-05-041-15/+14
| | | | | | | | | | | | | 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>
* Refine the EC flash size in FMAP structure.Louis Yung-Chieh Lo2012-05-021-1/+2
| | | | | | | | | | | BUG=none TEST=make and dump: % dump_fmap build/link/ec.bin ... fmap_size: 0x0003f800 (260096) ... Change-Id: I9e5a5d1a1d2c9d3e6660a13d5b2fff438517af7e
* Add basic FMAP to EC firmware image.Bill Richardson2012-05-011-0/+152
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>