Commit Graph

18 Commits

Author SHA1 Message Date
Louis Yung-Chieh Lo
03d4ed278d Add GEC lock mechanism.
Basically re-use the gec lock code from flashrom package.

BUG=chrome-os-partner:12319
TEST=Build and run on link. Only build on snow.
while true; do ectool hello; done &   ; run 10 instances.
                                      ; expect all instances runs okay.

Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Change-Id: I11d5824f46810c6f5a04a564a81387cdea081697
Reviewed-on: https://gerrit.chromium.org/gerrit/29763
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2012-08-10 09:28:34 -07:00
Vic Yang
dde4e99faa Prevent parallel make from failing
When we do parallel 'make', it fails intermittently. We might be hitting
a make bug: http://savannah.gnu.org/bugs/?30653
Let's remove the intermediate file for now and see if this happens
again.

BUG=chrome-os-partner:11614
TEST=Repeatedly remove some file and parallel make. This originally
gave an error once every two time. It doesn't now.

Change-Id: Iaaf48e7d19b11dad30bc70cd50e73c195caf17b4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28105
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2012-07-20 18:57:06 -07:00
Randall Spangler
fc7b64e186 Remove firmware B
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>
2012-07-17 13:11:44 -07:00
Randall Spangler
c44c17890c Rename A and B images to RW and RW_B, part 1
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>
2012-07-17 10:50:30 -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
Vincent Palatin
fbfd828b9a simple and self-contained EC flashing tool
This produces a host binary running on the application processor and
which is able to re-flash th EC firmware over the AP-to-EC link (either
LPC or I2C).
The payload (ie the EC firmware) to use is embedded inside the flasher
binary.

This is just aimed at testing and developer upgrade. The auto-update
flow is using flashrom.

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

BUG=None
TEST=build for link/daisy/snow/bds and tests
On Snow, run burn_my_ec from the serial console and see that the EC was
correctly re-flashed.

Change-Id: I7f90e773678a7ef3d8dc6dbacf54e80f3294607b
Reviewed-on: https://gerrit.chromium.org/gerrit/24236
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
2012-05-31 16:28:06 -07:00
Hung-Te Lin
6654374f31 ec: Remove *.dis from default target.
*.dis files can always be generated by *.elf files, so we can remove it from
default build targets, and only generate that on demand (make dis).

This also speeds up building time from 6.637s to 4.9s.

BUG=chromium-os:31379
TEST=emerge-link chromeos-ec
      make # no *.dis
      make dis # get *.dis

Change-Id: Ibc5305501ae72a0733f401863ea1d4c1f17aa34f
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
2012-05-30 14:00:16 +08:00
Vincent Palatin
304d207117 Split communication functions from host tools
Preparatory work to re-use the tools on ARM boards using I2C
communications.

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

BUG=None
TEST=make BOARD=link && make BOARD=bds && make BOard=DAISY

Change-Id: I31d41f30c3231a4a9349b939bf6bba871ed4c383
2012-05-24 23:34:01 +00:00
Randall Spangler
df38373a5f Extract A and B images from signed EC binary for openocd macros
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=build, then flash_link_a from openocd telnet session

Change-Id: If922f54adb4684e27a38ed87348111bd9047535d
2012-05-14 10:46:16 -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
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
Vincent Palatin
a94e3277b3 update versioning information stored in the EC
Add build information (date/time/builder) which can be displayed at the
EC console.

Generate a version from the board name and the branch tag.

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

BUG=chromium-os:27013
TEST=on BDS, run version command on the console.
inspect the built binary.

Change-Id: Idb1f68898ba6b811d02919f17ab4536ed9f8934a
2012-03-02 16:46:26 +00:00
Vincent Palatin
71219213f5 Honor V=1 build flag when building tests recursively
Allow to display the verbose command lines even when building the test
programs.

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

BUG=None
TEST="make tests" with and without V=1

Change-Id: Ib1195c7e069d7823c2eb7b2311bd5f3c6cd6c835
2012-02-02 22:02:18 +00:00
Vincent Palatin
cf9fcef328 Move OS files to a CPU specific directory
Preparatory work to introduce a second SoC : 3/5

We split the drivers files which contain SoC specific drivers from the
OS files which only depend the actual CPU core.

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

BUG=None
TEST=run EC firmware on BDS and test a few commands on the console.

Change-Id: I598f8b23e074da9bd6b0e2ce6689c1075fe854f0
2012-01-25 22:50:07 +00:00
Vincent Palatin
d356dea61e Add modularity to the build
You can now enable/disable tasks more easily.
To conditionally compile a C file depending on the task FOO activation,
just write something like that in the build.mk file :
common-$(CONFIG_TASK_FOO)+=foo_source.o

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

BUG=None
TEST=make all BOARD=link && make qemu-tests

Change-Id: I760fb248e1599d13190ccd937a68ef47da17b510
2012-01-24 23:17:07 +00:00
Randall Spangler
3d2efff518 Add ec_uartd build-side utility
This provides a pty for the EC UART channel on the BD-ICDI-B FTDI
daughtercard for EC debugging.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=make && build/bds/util/ec_uartd (with EC attached to FTDI board)

Change-Id: I51fe50d0da6345962affb860b923425197a04fa1
2011-12-13 14:34:29 -08:00
Randall Spangler
bc4c1b4eb9 Separate utility build for build and host utils
Build is the system doing the build (e.g. 64-bit linux) and host is the
target platform on top of the ec (e.g. 32-bit Chromium OS).

Necessary to get ectool properly compiling for Chromium OS.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=make && file build/bds/util/ectool; ectool should be a 32-bit binary

Change-Id: I50eba4c164ece236646a7c6087b1b86769beeb28
2011-12-08 10:55:27 -08:00
Vincent Palatin
e24fa592d2 Initial sources import 3/3
source files mainly done by Vincent.

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

Change-Id: Ic2d1becd400c9b4b4a14d4a243af1bdf77d9c1e2
2011-12-07 19:10:02 +00:00