Dino Li 72a7796dcb it8380dev: fix flash module and reset cause.
1. Use flash common code commands for flash erase and write test.
2. Reset cause is "soft" if software reset is triggered by core.
3. Fix EC keeps rebooting after reboot command when write protection is set
   while WP pin is de-asserted.

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=1. console commands "flashwrite" and "flasherase" OK.
     2. console "reboot", reset cause is soft.
     3. console command crash "assert", "divzero", and "stack" show
        reboot reason as soft.
     4. manually test with console commands.

flashinfo
Physical: 256 KB
Usable:   256 KB
Write:      4 B (ideal 1024 B)
Erase:   1024 B (to 1-bits)
Protect: 2048 B
Flags:
Protected now:
    ........ ........ ........ ........
    ........ ........ ........ ........
    ........ ........ ........ ........
    ........ ........ ........ ........
> flashwp enable
> flashinfo
Physical: 256 KB
Usable:   256 KB
Write:      4 B (ideal 1024 B)
Erase:   1024 B (to 1-bits)
Protect: 2048 B
Flags:   wp_gpio_asserted ro_at_boot
Protected now:
    ........ ........ ........ ........
    ........ ........ ........ ........
    ........ ........ ........ ........
    ........ ........ ........ ........
> reboot
Rebooting!

--- UART initialized after reboot ---
[Reset cause: soft]

flashinfo
Physical: 256 KB
Usable:   256 KB
Write:      4 B (ideal 1024 B)
Erase:   1024 B (to 1-bits)
Protect: 2048 B
Flags:   wp_gpio_asserted ro_at_boot ro_now
Protected now:
    YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY
    YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY
    ........ ........ ........ ........
    ........ ........ ........ ........
> flashinfo
Physical: 256 KB
Usable:   256 KB
Write:      4 B (ideal 1024 B)
Erase:   1024 B (to 1-bits)
Protect: 2048 B
Flags:   ro_at_boot ro_now
Protected now:
    YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY
    YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY
    ........ ........ ........ ........
    ........ ........ ........ ........
> reboot
Rebooting!

--- UART initialized after reboot ---
[Reset cause: soft]

flashinfo
Physical: 256 KB
Usable:   256 KB
Write:      4 B (ideal 1024 B)
Erase:   1024 B (to 1-bits)
Protect: 2048 B
Flags:   ro_at_boot ro_now INCONSISTENT
Protected now:
    YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY
    YYYYYYYY YYYYYYYY YYYYYYYY YYYYYYYY
    ........ ........ ........ ........
    ........ ........ ........ ........

--- UART initialized after reboot ---
[Reset cause: power-on]

flashinfo
Physical: 256 KB
Usable:   256 KB
Write:      4 B (ideal 1024 B)
Erase:   1024 B (to 1-bits)
Protect: 2048 B
Flags:   ro_at_boot
Protected now:
    ........ ........ ........ ........
    ........ ........ ........ ........
    ........ ........ ........ ........
    ........ ........ ........ ........

Change-Id: Ifad48d190a84326ed3cb4cde497d906b8ab8cd5f
Reviewed-on: https://chromium-review.googlesource.com/297933
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-09-16 20:49:57 -07:00
2015-09-16 14:49:46 -07:00
2015-05-07 00:00:47 +00:00
2015-09-16 14:49:47 -07:00
2015-08-15 01:32:39 +00:00
2015-09-16 14:49:46 -07:00
2015-09-16 14:49:46 -07:00
2012-05-11 09:11:52 -07:00
2015-09-16 14:49:31 -07:00
2014-04-02 19:58:53 +00:00
2014-05-15 05:20:14 +00:00

For an overview of the Embedded Controller firmware, refer to

http://www.chromium.org/chromium-os/2014-firmware-summit
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%