| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch assigns the bit offset 0 in TPM_BOARD_CFG register to
indicate the status of INT_AP_L extension. The bit 1 means INT_AP_L
pulse extension is activated, and 0 means it is not.
BUG=b:148691139
TEST=tested on atlas and on careena.
1. Checked the default TPM_BOARD_CFG (PWRDN_SCRATCH21) value was zero
and the INT_AP_L assertion duration was 4~10 microseconds.
> md 0x400000f4 1 // memory dump on GC_PMU_PWRDN_SCRATCH21
400000F4: 0x00000000
2. Attempted to change the board configuration (with a hacked UART
command.). The register value was unchanged.
> brdcfg 0x01
TPM_BOARD_CFG = 0x00000000
> md 0x400000f4 1
400000F4: 0x00000000
3. Forced to write the board configuration with a hacked UART command.
The register value was changed.
> brdcfg 0x01 force
TPM_BOARD_CFG = 0x80000001
> md 0x400000f4 1
400000F4: 0x80000001
4. Checked the INT_AP_L assertion duration extended to 110
microseconds or longer.
5. After cr50 deep sleep, checked the pulse duration was still
extended.
- turned AP off.
- disconnected Suzy-Qable.
- waited three seconds
- connected Suzy-Qable, and checked the reset cause was 'hibernate
rbox'.
> md 0x400000f4 1
400000F4: 0x8000001
6. With 100 usec long INT_AP pulse, checked trunks_cliend
regression_test, stress_test and ext_command_test runs good.
Checked dmesg and found no TPM errors through all tests.
(ap) $ trunks_client --regression_test
(ap) $ trunks_client --stress_test
(ap) $ trunks_client --ext_command_test
7.checked no character loss during uart_stress_tester.
(chroot) $ uart_stress_tester.py -c -t 600 /dev/ttyUSB2 /dev/ttyUSB1
8. the shortest duration of INT_AP_L assertion and deassertion
observed in logic analyzer were 110 usec and 152 usec.
9. measured the depthcharge exit timestamp and cr50 flash time with
or without INT_AP pulse extended to 100 usec, on atlas and helios:
-----------------+-------------------+------------------
| atlas | helios
-----------------+-------------------+------------------
boot (sec) | 1.398 -> 1.402 | 1.004 -> 1.011
cr50 flash (sec) | 10.800 -> 14.609 | 16.024 -> 16.466
-----------------+-------------------+------------------
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: I2b9f9defb63cf05f9d91b741ccb4b49c4c6bc8e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2202839
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the TPM vendor-defined register, TPM_BOARD_CFG,
which indicates the board configuration status. This register is
attributed as one-time-programmable and the value is maintained
across deep sleeps. Cr50 allows a write on this register right after
a cr50 reset until it receives a TPM2_PCR_Extend command.
BUG=b:148691139
TEST=none
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: I89ae5a53c15990ef78812aec5da81a59f04d7d98
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2202838
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch applies INT_AP_L extension on I2CS. It uses
GPIO_MONITOR_I2CS_SDA to detect a transaction start during INT_AP_L
assertion and to deassert INT_AP_L.
BUG=b:148691139
TEST=None
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: Iedd59b488dfdfaaf71dd71eda6437f1a9402d3c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2150517
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a feature to extend each level of GPIO_INT_AP_L at
least for 100 microseconds. The assertion (low GPIO_INT_AP_L)
duration might be shorter only if AP asserts a SPS CS before
INT_AP_L deassertion, because it means means AP recognized
GPIO_INT_AP_L assertion already.
This patch increases the flash usage by 280 bytes.
BUG=b:148691139
TEST=None
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: Ie74b236bc5352e9fc21fe600c12946e50955160a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2114430
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new option triggers sending the VENDOR_CC_SEED_AP_RO_CHECK vendor
command with the empty payload.
The Cr50 response indicates if the erase succeeded or there were
problems (either board ID space not erased, or flash erase operation
failed).
BUG=b:153764696
TEST=verified successful erase of the AP RO flash space on devices
with empty board ID space, and failure to erase in case board ID
space is programmed with the appropriate error message.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I4b7c981323771b73a837e766bd5e94e3824e8e00
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2204976
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a no-op change which will make it easier to have gsctool
report sensible errors in case attempts to erase AP RO hash space
fail.
BUG=b:153764696
TEST='make buildall -j' succeeds
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Iad396a52439ac7e4377f1dc983f00e976fabd8ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2207791
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch extends the VENDOR_CC_SEED_AP_RO_CHECK handler to erase the
AP RO hash space if two requirements are met:
- the vendor command payload is empty
- the board ID space in INFO1 is not programmed
Also, after this patch it would be impossible to program the AP RO
hash if the Board ID INFO1 field is set. This will prevent attempts to
write the hash by the users of existing devices.
BUG=b:153764696
TEST=after expanding gsctool was able to verify AP RO hash space erase
when allowed. Was able to write the hash when board ID space is
uninitialized, and was not able to write the hash when the Board
ID space is set.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I0d2409cb0a97bf98f52e7f10fd41660305638122
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2204975
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code opening the RO windows to make it possible to update or
enable the RO images, leaves the window open, allowing subsequent
writes into the RO space. It has been acceptable until now, because RO
updates are usually followed up by reboots.
With introduction of the AP RO hash, there is a need to close the
window (specifically, disable write access) when not in use. This
patch adds a function for that and uses the new function everywhere
where flash_open_ro_window() is called.
BUG=b:153764696
TEST=verified successful Cr50 RO and AP RO hash updates.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ia595e5c7ce0beb1a67ef3513117984d18655a60c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2204973
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's make sure that should there be an error during flash write
operation saving the AP hash information, the error gets reported to
the AP in the VC response.
BUG=b:153764696
TEST='make buildall -j'
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Idf9f8d267cae923909c2afc777b95bb2c7b638b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2202955
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When AP RO verification is attempted, a lot of thing could go wrong,
and the operator would usually have very little insight into what's
happening unless there is a terminal connected to the Cr50 console.
This patch adds a new log event for registering the AP RO verification
progress. The event payload is a single byte value, logging the
following events:
0 - refresh key press is detected
1 - power button has been released before AP RO check was triggered
2 - trigger sequence timeout (refresh button not pressed in time)
3 - AP RO check triggered
4 - could not run the check, hash space not programmed
5 - could not run the check, hash space corrupted
6 - AP RO verification failed
7 - AP RO verification succeeded
BUG=b:153764696
TEST=verified logging during various AP RO verification attempts:
$ gsctool -a -L
Log time zone is PST
Dec 31 69 16:00:01 : 00
May 06 20 21:20:49 : 09 01
May 06 20 21:21:53 : 09 00
May 06 20 21:21:54 : 09 00
May 06 20 21:21:55 : 09 03
May 06 20 21:21:56 : 09 07
May 06 20 21:23:03 : 09 00
May 06 20 21:23:04 : 09 00
May 06 20 21:23:05 : 09 02
May 07 20 11:21:52 : 09 00
May 07 20 11:21:53 : 09 00
May 07 20 11:21:54 : 09 01
May 08 20 11:57:21 : 09 00
May 08 20 11:57:22 : 09 00
May 08 20 11:57:23 : 09 03
May 08 20 11:57:24 : 09 04
May 08 20 12:07:15 : 09 00
May 08 20 12:07:16 : 09 00
May 08 20 12:07:17 : 09 03
May 08 20 12:07:19 : 09 07
May 08 20 12:09:20 : 09 00
May 08 20 12:09:21 : 09 00
May 08 20 12:09:22 : 09 03
May 08 20 12:09:23 : 09 06
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I739f9dbb2e7b8fc87601d61e1f87eb49d85bdf14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191283
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch flips on the switch for the AP RO verification
implementation.
BUG=b:153764696
TEST=generated AP integrity verification data using the ap_ro_hash.py
script and then ran the verification procedure, observing the
'hash match' message on the Cr50 console.
Also verified that the Open Box RMA procedure still succeeds.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I15f19aefcb11a055e66994e33976b98ce6fdf099
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2220829
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds plumbing necessary to invoke the AP RO verification function
in response to the operator entering the 'magic sequence' of holding
the power button pressed and pressing/releasing the refresh button
three times within five seconds.
The code used during the 'Open box RMA' verification process is used,
with the physical presence confirmation phase bypassed.
This patch also makes sure that attempts to use CCD to program AP or
EC flash while AP RO verification is in progress would fail.
BUG=b:153764696, b:154966209
TEST=with the next patch applied, generated AP integrity verification
data using the ap_ro_hash.py script and then ran the verification
procedure, observing the 'hash match' message on the Cr50
console.
Also verified that the Open Box RMA procedure still succeeds.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ic101fb892554ebb05f9ebe6d1546bfb439f74043
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171399
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=script works with a cr50 running 0.6.2
Change-Id: I14cfd8d90bff40843493d22576307421524d3350
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2207571
Reviewed-by: Wai-Hong Tam <waihong@google.com>
(cherry picked from commit be7c49d46cd1e8b94be5ce7b3752ec6f4a04223d)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2218678
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At this point images with testlab support are available. Fail if cr50 is
running a prod image that is too old.
BUG=none
BRANCH=none
TEST=none
Change-Id: I096502417c4a44b4a2f458a2a5601de2d154d5cf
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2207572
Reviewed-by: Wai-Hong Tam <waihong@google.com>
(cherry picked from commit 26dfe4442eb06ef1c3e60b47fbf2065c095de824)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2218679
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds code which accepts the vendor command communicating
the list of the AP firmware sections to verify and the expected
cumulative sha256 sum value of the sections.
The vendor command payload is checked for sanity: each range offset is
not expected to exceed 32M bytes (the largest possible SPI flash size)
and each size is not expected to exceed 4M bytes.
If any inconsistencies are found in the payload, or the flash
integrity space is already programmed, an error is returned to the AP.
It the command validity check succeeds, the payload of the vendor
command is prepended by a header including the number of the flash
regions to check and a 4 byte checksum of the stored information.
This combined information is stored in the dedicated H1 flash space,
specifically the RO_B region, at offset of 0x3000, 2K bytes page below
the region used for the flash log.
The valid RO range in upgrade_fw.c:set_valid_sections() is modified to
prevent erasing of the AP RO hash value during Cr50 RO updates.
The new file also introduces a function used to verify the AP flash
when requested. The returned value indicates one of three conditions:
- valid verification information not found
- AP flash integrity verification failed
- AP flash integrity verification succeeded
A new console command allows to examine the contents of the space
where the list of ranges and the sum are stored. CR50_DEV builds also
allow to erase the page.
BUG=b:153764696
TEST=with the rest of the patches applied verified successful
execution of the AP RO verification sequence.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I1894ef897a86e9d60b9f5bcff3a680f632239e1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171398
Reviewed-by: Andrey Pronin <apronin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes it possible to check if the INFO1 Board ID space is
programmed or not.
BUG=b:153764696
TEST='make buildall -j'
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ic771956a08e276c2e1a426729a8ecdae3f86a04f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2204974
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new error values reported by the VENDOR_CC_SEED_AP_RO_CHECK vendor
command, and clean up the command line error processing to report all
collected errors instead of just complaining that the ranges were not
specified in the command line.
BUG=b:153764696
TEST=used the script and observed expected error values reported.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I0f5e6a28776af2afc550bd2c44e6cc3a0cb80153
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2204977
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code which allows to read a section of AP or EC flash and
calculate the section's SHA256 sum does not allow calculating the sum
over multiple non-adjacent flash areas.
This patch changes the implementation to allow calculations over more
than one region. Initialization, calculation and reporting of the
result become three separate API entries.
The loop counting the number of the read flash chunks, is being
simplified, a watchdog kick added to the brief loop interruptions, as
it turns out that sleeping alone is not enough to prevent watchdog
expiration when calculating hash over large SPI flash ranges.
Also simplified prototypes for usb_spi_board_enable() and
usb_spi_board_disable().
BUG=b:153764696
TEST=created an RO descriptor for the Atlas DUT and verified that
'gsctool -O' succeeds.
Cq-Depend: chrome-internal:2939596
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Iec7b8634c7c80ebc7600c5b708879eb322bc7fec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2163569
Reviewed-by: Andrey Pronin <apronin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a minor API clean up, it is not entirely clear why const void
pointers were not used originally, but using this type for input data
(and void pointer for output) makes interfacing with the library much
easier.
Also modified cases where the first parameter of DCRYPTO_SHA1_hash()
was typecasted unnecessarily.
BUG=none
TEST=make buildall succeeds, Cr50 image supports booting a Chrome OS
device just fine.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ic8a670aa7b26598ea323182845c184b7f1d715a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2163568
Reviewed-by: Andrey Pronin <apronin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds processing of the case when the Cr50 does not support
the vendor command setting the AP RO areas hash.
Also improve help message and include text descriptions of the
encountered errors, if any.
BUG=b:153764696
TEST=with the rest of the patches applied verified that programming of
the AP RO verification space succeeds when expected, and proper
errors are reported in case of failure.
./util/test_ap_ro_hash.py also still succeeds.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ie3898ef5ab925404decd730f457267615c9ab39c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171397
Reviewed-by: Andrey Pronin <apronin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes cr50 respond EC-EFS2 related TPM commands no matter
it has the board property, BOARD_EC_CR50_COMM_SUPPORT or not.
board_has_ec_cr50_comm_support() calls remain for configuring
GPIO_EC_PACKET_MODE_EN only.
BUG=b:155214584
TEST=checked gsctool running on Coral.
[before]
$ gsctool --getbootmode
finding_device 18d1:5014
Found device.
found interface 3 endpoint 4, chunk_len 64
READY
-------
Error 8 in Getting boot mode
[after]
$ gsctool --getbootmode
finding_device 18d1:5014
Found device.
found interface 3 endpoint 4, chunk_len 64
READY
-------
Boot mode = 0x00: NORMAL
Also checked 'ec_comm' uart command.
[before]
> ec_comm
No EC-CR50 comm support
Invalid argument
Usage: ec_comm [corrupt]
[after]
> ec_comm
uart : 0xff
packet mode : DISABLED
phase : 0
preamble_count : 0
bytes_received : 0
bytes_expected : 0
response : 0x0000
ec_hash : UNLOADED <-- It is marked as unloaded,
secdata_error_code : 0x00001203 <-- because of NVMEM error.
boot_mode : NORMAL <-- Still, boot_mode is normal.
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: I08dc9abd8f194c83484b5be9b0a5e8844b2fd221
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2185872
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Displaying epoch values in the flash log entries does not help the end
user to synchronize the flash log events with other logs generated on
the device.
This patch changes the log output format to display the device time
zone in the first line and then all present log entries with timestamp
in 'dd:mm:yy hh:mm:ss' format.
BUG=b:153764696
TEST=ran the new gsctool image on a Chrome OS device:
$ gsctool -a -L
Log time zone is PST
Dec 31 69 16:00:01 : 00
May 06 20 21:20:41 : 09 01
...
May 08 20 12:09:21 : 09 00
May 08 20 12:09:22 : 09 03
May 08 20 12:09:23 : 09 06
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I3fca12e1679fbdd9e0e168606014e84c89c42402
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191282
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Change-Id: Idc983499980c0211d29767bb9dfad6caac99dc00
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2189617
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove 'deep sleep' and 'invalid' idle actions from the idle console
command.
BUG=b:156032428
TEST='idle s' and 'idle w' work when the console is open.
Change-Id: I9da2fa0d679ef89ecb2eaaad82541bd3e9e16140
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2189616
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Change-Id: I33ad7debedb98f8ff90b4e8eaff96e25c73da4cd
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2180880
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This python script will be run in a Chrome OS factory image, with
limited availability of chromite libraries.
The command line parameters of the script are a set of AP firmware
address ranges and FMAP section names.
The script does the following:
- use flashrom to read the FMAP area from the AP flash and dump_fmap
to generate the flash map description.
- verify that section names passed in as parameters (if any) are
indeed are present in the flash map.
- verify that all passed in ranges and sections fit into the WP_RO
area of the flash (as defined if the flash map).
- prepare a layout file to instruct flashrom to read only the
sections of interest (as defined by ranges and section names
passed in the command line).
- use flashrom again to read the required sections of the AP flash
into a file.
- read the file and and pass the required sections through the
sha256 hash calculation.
- prepare the Cr50 vendor command to pass information about the
flash ranges and the sha256 sum to Cr50 and send the command.
A unit test is also being added.
BUG=b:153764696
TEST=./util/test_ap_ro_hash.py succeeds.
with the rest of the patches added end to end AP RO verification
procedure also succeeds.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ic0fa3759b3a32db8cf521be28c3c7dfe0cd35278
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2161576
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recent interrupt pulse extension brought to fore an old bug where
the AP_INT_L pulse is generated by the SPS driver before the
controller is actually ready to accept the next SPI frame.
This patch rearranges the code to make sure that the pulse is
generated after all controller clean up.
BUG=b:154458891
TEST=verified that Atlas device is still booting fine. Will test it on
other devices which seemed to be triggering the bug.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I480760b4afea24295f96abde2fc75c414017c27f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171452
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Change-Id: Ic84368d12832dc5bb08d7085090ad727130c3114
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171517
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes cr50 to set the TPM VC response size as zero before it
returns an error code upon VENDOR_CC_GET_BOOT_MODE or
VENDOR_CC_RESET_EC.
BUG=b:155214584
TEST=ran 'gsctool --getbootmode' on atlas where the board property does
not contain BOARD_EC_CR50_COMM_SUPPORT.
[cr50]
> brdprop
properties = 0x1041
[Before the fix]
$ gsctool --getbootmode
finding_device 18d1:5014
Found device.
found interface 3 endpoint 4, chunk_len 64
READY
-------
../../util/usb_if.c:209, libusb_bulk_transfer returned -8 (Overflow)
[After the fix]
$ gsctool -g
finding_device 18d1:5014
Found device.
found interface 3 endpoint 4, chunk_len 64
READY
-------
Error 8 in Getting boot mode
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: Ic1d9b261415487f0a3a0690e6090cbb5387ddd64
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171167
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch sorts the list of the suppressed messages alphanumerically
and adds 'missing-print-function' to the list, as this error does not
apply to Python3.
BUG=none
TEST=linter error message
R: 1, 0: Missing "from __future__ import print_function...
is not reported any more, the rest of the linter output did not
change.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ie97d88fcecfa70a89323d9122c3781e3da23f533
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2161575
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:123686979
TEST=make buildall -j
Change-Id: I1fc49f44c6f1be3bcacb26662862cb68899be299
Signed-off-by: Louis Collard <louiscollard@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102092
Tested-by: Leo Lai <cylai@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Leo Lai <cylai@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:123686979
TEST=make buildall -j
Cq-Depend: chromium:2051792
Signed-off-by: Louis Collard <louiscollard@chromium.org>
Change-Id: I9558ebcf5a83ae8a422a43b776147bececea70ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102091
Tested-by: Leo Lai <cylai@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Commit-Queue: Leo Lai <cylai@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also replaces uses of 'unsigned' with 'unsigned int'
BUG=b:123686979
TEST=make buildall -j
Change-Id: I2c7a861540f4ca3491b78f0c87e77ed01f57f0a0
Signed-off-by: Louis Collard <louiscollard@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102090
Tested-by: Leo Lai <cylai@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Leo Lai <cylai@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:123686979
TEST=make buildall -j
Signed-off-by: Louis Collard <louiscollard@chromium.org>
Change-Id: I646483719d5b97bf9622bbdd2f78ec3dce995d4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102089
Tested-by: Leo Lai <cylai@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Leo Lai <cylai@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes use of the modification of the vendor command
VENDOR_CC_WP, which allows to enable WP.
BUG=b:153881773
TEST=verified that attempts to enable WP when running the unmodified
Cr50 image fail with error message "Early Cr50 versions do not
support setting WP", and that the updated Cr50 image allows to
enable WP using 'gsctool -a -w enable'
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ie28c1c9b171dd6ea2e3edc0ae624f953cb4fa4fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2149526
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The gsctool utility allows to examine the device WP status, but does
not allow to set it. It would be useful to provide the user with a
means of enabling WP at any time.
This patch extends the existing vendor command VENDOR_CC_WP
implementation to allow an optional one byte parameter. If the
parameter is present, the Cr50 will unconditionally invoke
set_wp_state(1) when processing the command.
BUG=b:153881773
TEST=with the corresponding gsctool.c changes coming up in the next
patch verified that attempts to enable WP when running the
unmodified Cr50 image fail with error message "Early Cr50
versions do not support setting WP", and that the updated Cr50
image allows to enable WP using 'gsctool -a -w enable'
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I75c200bbb9085e9f74c227ef80f782defdaaa29e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2149519
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When supported, the AP RO verification would be triggered by the
operator pressing and keeping pressed the power button and then
pressing and releasing a few times the refresh key.
As proposed in this patch, to trigger the verification the operator
must complete the sequence within 3 seconds by pressing the refresh
key three times.
The sequences is controlled by periodic polling. Enabling refresh key
press interrupts was investigated, the issue is that the key generates
plenty of interrupts due to dribbling, to the tune of a hundred each
time it is pressed. It is much cheaper to just poll every 20 ms.
The CONFIG_AP_RO_VERIFICATION config flag controls enabling of this
feature.
BUG=b:141191727
TEST=enabled the new feature and verified proper operation by both
detecting the trigger and abandoning the sequence due to released
power button or not enough times pressed refresh key.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I55376a87009d6f8020358ad11db1e47d0b8393ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2144944
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cr50 used to read GPIO_EN_PP3300_INA_L value to detect if USB_I2C is
enabled. However it requires an external pullup. Instead, this patch
adds a sw flag to indicate USB_I2C status, so that it can keep
USB_I2C status regardless external HW factors.
BUG=b:152946978
TEST=ran flash_ec on waddledee, ampton, and dragonegg.
Signed-off-by: Namyoon Woo <namyoon@chromium.org>
Change-Id: Ie1a3a8c790e9643a3b49b6c519167ee3bdecc650
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2140535
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that the Cr50 not shutting off the AP UART quickly enough
causes violation of the JSL power sequence requirements due to the
leakage caused by the active UART lines.
Let's speed up AP state polling when CCD is active. When CCD is not
active the UART is shut of to start with.
BUG=b:152446186
TEST=running the new image verified that that timing constraints are
not violated any more. Also verified reliable UART=>USB bridging
operation.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Iffb7f8bc33c4516bb7cf5cbf58c5ced277cd1aec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2139732
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Change-Id: Ib0a272579ea750ab439a1bbede4e3ac9cc1380e6
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2142450
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch make sure that cr50 attempts to read ECRW hash from
TPM nvmem only if the board supports EC-EFS2. Though this attempt
is not critical, it prints an read error message in console, which
could mislead the reader.
BUG=none
TEST=none
Signed-off-by: Namyoon Woo <namyoon@chromium.org>
Change-Id: I95e8407b19259fd62e0d1858efdd2696042dcd95
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2138601
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Change-Id: Ia5c4b11ef217bad279b865a91c1618d9b6571c17
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2137911
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If UART-EC TX is disabled, the USB input data used to be ignored in
UART-EC TX interrupt handler, but it neglected to call uartn_tx_stop(),
which was a defect. In this patch, those data shall be ignored when they
arrive from USB (in USB RX stream handler), which is earlier than
UART-EC TX interrupt, and uartn_tx_start() won't be called.
BUG=b:153198965
TEST=Repeated to lock and open CCD, and checked EC-UART is RO or RW.
Checked EC-EFS2 working, and uart_stress_tester as well.
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: I1c3c2c5a7626850f6389616bbe1f69188d5eca6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135140
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a string parameter __func__ ie encountered in the source code,
the function name is saved in the format strings dictionary, and then
packet is prepared, instead of sending the string, a byte of 0xff is
sent and then the four byte value which is the string index.
But two bytes is enough to send the string index, as it is a 16 bit
value by design.
This patch modifies both transmit and receive sides to start using 2
byte indices for __func__.
BUG=b:149964350
TEST=built the new image, tried running it, observed correct function
names in the console output.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I682dd18cb4dd434e6982d33f1918ef398d5caa20
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2131046
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most strings in the Cr50 image are not going to change any time soon,
the most likely change is the addition of new strings.
With this in mind, it makes sense to keep the string dictionary around
and just keep updating it when building a new image, maybe adding new
strings, or most often just reusing the ones already in the blob.
This patch tries reading the blob before processing the inputs, and if
the blob is read and unzipped/unpickled successfully, its contents are
used to seed the string dictionary before the inputs are processed.
With this approach 100% compatibility between the Cr50 image and the
blob is not required, most of the strings would be interpreted
properly even with older blobs.
A test case is being added to verify this behavior.
BUG=b:149964350
TEST=./util/test_util_precompile.py
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I761d6b043dfc85b54352aadaa66d24d4027e95f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2119144
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One of the difference between Acropora and Cr50 is such that in case
of Acropora the format strings are transferred within packets, and in
case of Cr50 only the index of the string is passed in the packet, the
string itself is obtained from the list prepared by running
util_precompile.py.
Another difference is that in Acropora each console packet message
represents a full line, in Cr50 the message could be representing just
a part of the line, down to a single character.
These differences require modifications of the packet header on the
DUT side and modifications of the Packet class in Acroterm.
Cr50Packet class inherits from Packet, to abstract header structure
differences a class specific method of unpack_ph() is being added. The
new method extracts packet fields, returning fields common for both
packet formats, and saving the class unique values in the object
attributes.
This allows to consolidate the packet validation function and only
divert processing when decode_packet() is invoked. Cr50Packet
constructor is passed the list of format strings, the str_index field
from packet header is the index of the format string in the list.
The Cr50Term class inherits from Acroterm, the only difference is that
Cr50Term uses Cr50Packet for packet processing, and prepares the list
of strings, retrieving it from the blob created by util_precompile.py.
Two new command line options are being added:
--cr50_mode enables Cr50 packet mode console support
--cr50_str_blob points at the strings blob, by default
build/cr50/RW/str_blob is used.
Note that on the DUT the Cr50 packet mode is disabled by default. To
start using console packet one needs to add the line
to board/cr50/board.h and rebuild the image.
BUG=b:149964350
TEST=./util/test_acroterm.py succeeds.
When Cr50 is built with the suggested modification of
board/cr50/board.h, acroterm invoked as
$ util/acroterm.py --tty /dev/ttyUSBx --cr50_mode
allows to open terminal sessions with USB and UART consoles.
Change-Id: I301a5515a0994dba91f2cb40a77c4b59c3becd45
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2116277
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A very few changes are needed to support the packet mode:
- provide functions to report how much room is left in USB/UART
transmit buffers;
- compile out cprintf/cprints/cputs just in case to be able to catch
cases where util_precompile.py fails to convert them for whatever
reason;
- do not add CR to every LF, this messes up packet transmissions, and
the terminal is doing the right thing anyways
- there is a problem with the USB channel in packet mode: the device
reboots as soon as an attempt to send something to the host is
undertaken. The problem can be rectified by disabling the deferred
function path in the Cr50 console USB channel. A bug was open to
track it down, but in packet mode using deferred function in this
path is less critical, as the amount of sent data always is at
least as much as the packet header size
BUG=b:149964350, b:152116489
TEST=with the rest of the patches applied packet mode console works
fine. When packet mode is disabled the conventional mode console
works fine.
Change-Id: Ib010cede36adc87cf80f49e5d76ec9e274d9e608
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2114238
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Namyoon Woo <namyoon@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a console driver for packet mode.
The driver processes information prepared by util_precomplie.py when
processing printf invocations in the source code. Each invocation is
replaced by a cmsgX function, where X is the number of format
arguments.
cmsgX functions prepare an array of parameters of size X and invoke a
common function, passing it the array and an integer value, consisting
of up to 8 4 bit fields, describing the parameters.
Since both console drivers need to be able to filter logical console
channels, the channel_mask variable is made global.
BUG=b:149964350
TEST=with the rest of patches applied and packet mode enabled,
verified proper operation of both Cr50 consoles (USB and UART).
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I1f6ef5ea50bffbe14d3e3850fff0191c54f37033
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2113931
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the upcoming introduction of transitioning Cr50 console
communications to packet mode, there is a need to be able to replace
all print function invocations in the code with calls to packet
sending function.
This replacement is easiest to make in C preprocessor outputs, as
there all macros are replaced with actual function invocations.
This patch adds a configuration option CONFIG_EXTRACT_PRINTF_STRINGS,
when enabled, building of the image object files starts happening in
three steps instead of one, instead of .c => .o transition, the steps
are .c => .E => .Ep => .o, where .E is the C preprocessor output, and
.Ep is result of post processing by ./util/util_precompile.py.
BUG=b:149964350
TEST=image layout does not change if CONFIG_EXTRACT_PRINTF_STRINGS is
not defined. With the rest of the patches applied defining the
above config option allows to build a Cr50 image supporting
packet console communications mode.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: I20b8ba7c5d13cb54ac6adbdbce856d92023ce997
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2113122
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This script is customized to be used in Chrome OS EC codebase, where
functions cprintf(), cprints() and cputs()are used to generate console
output.
The operation of the script is extensively described in the docstring
of the file, a unit test is provided to verify basic functionality.
BUG=b:149964350
TEST=./util/test_util_precompile.py succeeds with the rest of the
patches applied built a Cr50 image, verified that using a
verified version of Acroterm one can communicate with Cr50
console the same way it works today over regular UART.
Change-Id: I2c92088a8b08dcf7fdb606a01fbc94ab0d2df6e6
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106863
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|