Commit Graph

835 Commits

Author SHA1 Message Date
mdlewisfb
cdeeea475d Adding coverage script for jenkins. 2018-10-26 10:19:53 -07:00
mdlewisfb
9fd59bc6d5 Updating unit tests to gather coverage information. 2018-10-26 10:19:53 -07:00
mdlewisfb
9e7fa2e279 Removing redundant / at the end of paths. 2018-10-24 11:00:49 -07:00
mdlewisfb
18414ea5ed Updated Makefile to put all CONFIGURO outputs to bld/OpenCellular/ 2018-10-24 10:53:44 -07:00
mdlewisfb
da9e3d79d6 Updated Makefile to build bin with gcc 2018-10-24 10:53:44 -07:00
mdlewisfb
40ac4c7f31 Adding -Werror flag to unit test build to maintain fixing all warnings. 2018-10-06 12:47:30 -07:00
mdlewisfb
b5315b1712 Adding post_update_POSTData prototype to post_frame.h to fix unit test warnings. 2018-10-06 12:46:12 -07:00
mdlewisfb
441d2eb15f Updating misc fixes in source and headers for warnings in unit tests. 2018-10-06 12:41:06 -07:00
mdlewisfb
3831578255 Merge pull request #107 from Telecominfraproject/ltc4274_fixes
Fixes for ltc4274
2018-10-04 12:56:34 -07:00
mdlewisfb
28f82700dc Misc inconsistency fixes for header and source code files, including fixing ltc4274_reset error with missing param. 2018-10-03 10:14:28 -07:00
mdlewisfb
55962ac120 Fixing incorrect enum typedef, issue #101 2018-10-03 10:01:10 -07:00
mdlewisfb
f70dd75754 Fix for implicit fall through, issue #102 2018-10-03 09:51:02 -07:00
mdlewisfb
2172a405d3 Fixes for Test_ocmp_eeprom.c warnings. 2018-10-03 07:55:07 -07:00
mdlewisfb
adb69fdd20 Fixes for Test_ocmp_ltc4274.c warnings. 2018-10-03 07:24:47 -07:00
mdlewisfb
4257c30a7d Fixes for Test_powerSource.c warnings. 2018-10-02 18:46:42 -07:00
mdlewisfb
497d013e9c Fixes for Test_PinGroup_driver.c and Test_pca9557.c warnings. 2018-10-02 18:45:29 -07:00
mdlewisfb
5ee3f2cd8a Fixes for Test_OcGpio.c warnings. 2018-10-02 18:36:19 -07:00
mdlewisfb
6b65c57fe4 Fixes for Test_ltc4275.c warnings. 2018-10-02 18:31:24 -07:00
mdlewisfb
40348f0ad4 Fixed missing function prototype in fake_GPIO.h 2018-10-02 16:16:37 -07:00
mdlewisfb
28bef2fa9a Fixes for Test_GpioSX1509.c warnings. 2018-10-02 16:10:20 -07:00
mdlewisfb
2bdb96355b Fixes for Test_ocmp_adt7481.c warnings. 2018-10-02 16:07:46 -07:00
mdlewisfb
842d289290 Adding -fshort-enums flag to fix Linux stack smashing error. 2018-10-02 15:50:30 -07:00
mdlewisfb
dab621bb15 Merge pull request #60 from Telecominfraproject/directory_cleanup
Directory cleanup
2018-10-02 10:29:49 -07:00
mdlewisfb
774a23c00f Reverting common/inc move 2018-10-02 10:28:26 -07:00
mdlewisfb
3537665179 Updating CCS project to point to inc/ instead of common/ 2018-10-02 10:28:25 -07:00
mdlewisfb
39c6592de4 Consolidating inc/ and common/inc directories all under inc/. 2018-10-02 10:28:24 -07:00
mdlewisfb
d3982f98dc Renaming Devices to devices for consistent directory naming. 2018-10-02 10:28:23 -07:00
Kashif Ali
31d75a0ffd Re-addig coding style guide for OCWare 2018-10-01 09:56:42 -07:00
Vishal Thakur
0b08f7a126 Updated unit test makefile with respect to the repository structure. 2018-09-28 23:40:21 -07:00
Vishal Thakur
b9761dc1cc Added Copyright header to Unit test files. 2018-09-28 23:40:16 -07:00
Vishal Thakur
973eb3b3d1 OpenCellular OCware repo merged to OpenCellular TIP repo.
> Changes done :
> 1. Shared schema between host and embedded controller.
2. Commands messages are handled at driver level.
3. Debug message type added to enable debugging on i2c, spi and gpio's.
4. Auto test capabilities added to ethernet module.
5. Unit test cases written for multiple devices like LTC4275, LTC4274, LTC4015,ADT7481, PCA9557, SX1509.
2018-09-28 23:40:11 -07:00
David Hendricks
6a28b88fbb firmware/coreboot: Subtree merge libgfxinit
Signed-off-by: David Hendricks <dhendricks@fb.com>
2018-06-14 15:36:02 -07:00
David Hendricks
6f4bd2f6eb firmware/coreboot: Subtree merged libhwbase
Signed-off-by: David Hendricks <dhendricks@fb.com>
2018-06-14 15:32:35 -07:00
David Hendricks
d4467c3e5b firmware/coreboot: Subtree merged chrome-ec
Signed-off-by: David Hendricks <dhendricks@fb.com>
2018-06-14 15:25:36 -07:00
David Hendricks
262ea45093 firmware/coreboot: Subtree merged arm-trusted-firmware
Signed-off-by: David Hendricks <dhendricks@fb.com>
2018-06-14 15:22:44 -07:00
David Hendricks
95e19f53aa firmware/coreboot: Subtree merged vboot
Signed-off-by: David Hendricks <dhendricks@fb.com>
2018-06-14 15:19:56 -07:00
David Hendricks
4833902df2 firmware/coreboot: Subtree merged blobs 2018-06-14 15:16:35 -07:00
David Hendricks
994e41f949 firmware/coreboot: Subtree merged nvidia-cbootimage 2018-06-14 15:13:32 -07:00
David Hendricks
6d6d5fecc0 firmware/coreboot: Initial import via subtree merge
Signed-off-by: David Hendricks <dhendricks@fb.com>
2018-06-14 13:12:30 -07:00
Andrey Pronin
41c585ed74 tpm_lite: stub: retry in case of TPM comm error
This CL retries reads and writes from/to TPM device if an error
is returned by read()/write(), up to 3 total attempts.

This is useful case of transient TPM communication errors that go
away after a single retry. Without this CL, after such errors the
encstateful key might be regenerated and encstateful data wiped.

BRANCH=none
BUG=chromium:702724
TEST=1) normal boot still works;
     2) simulate a single error, verify that it retries.

Change-Id: I259882209df0aad66cd083729f746ea45909922b
Reviewed-on: https://chromium-review.googlesource.com/1067939
Commit-Ready: Andrey Pronin <apronin@chromium.org>
Tested-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2018-05-24 15:44:34 -07:00
Mattias Nissler
1c98ae4fdd tpm_lite: Set O_CLOEXEC when opening TPM device.
This sets O_CLOEXEC when opening the TPM device to make sure the file
descriptor isn't shared across processes. The TPM character device
exposes the raw communication channel to send/receive commands to/from
the TPM. The TPM is not designed for concurrent access by multiple
users and the kernel driver already returns EBUSY on open when a
different process has already opened it. Consequently, it only makes
sense to have the /dev/tpm0 file descriptor be closed automatically on
exec().

None of the callers I'm aware of need to share the TPM file descriptor
across processes, and mount-encrypted has some ad-hoc code to close the
descriptor when it does fork+exec to spawn a helper. The existing code
isn't consistent and comprehensive (mount-encrypted spawns other
helpers where it forgets to close the file descriptor), so the plan is
to set O_CLOEXEC and remove the ad-hoc code.

BRANCH=None
BUG=None
TEST=Compiles, passes tests, image boots.

Change-Id: Ia6e73fb12e8f2ed8fe99b4c53ea6eb8cda4a21f5
Reviewed-on: https://chromium-review.googlesource.com/1055569
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2018-05-14 09:14:48 -07:00
Sam Hurst
ae602dee78 cgpt: Remove unnecessary 512-byte sector check and minimum lba count checks.
This was an oversight from a previous CL:1007498 that removed the 512 block
size restrictions.

BUG=b:77540192
BRANCH=none
TEST=manual
make runtests passed.

Change-Id: I75b3ffebcc25afdde3774bcbb4a9600215a04436
Reviewed-on: https://chromium-review.googlesource.com/1031193
Commit-Ready: Sam Hurst <shurst@google.com>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2018-05-01 08:31:57 -07:00
Duncan Laurie
534194ead7 Add new NV and GBB flag to control UDC
This change adds a new NV and GBB flag for controlling USB device
mode behavior, adding an additional step to enable UDC on systems
that support it.

Users of this feature will need to first enable developer mode and
then enable UDC separately by running "crossystem dev_enable_udc=1".

Alternatively those without write protect enabled can set a GBB
flag to have UDC enabled by default while in developer mode.

This is based on the security reviewed proposal at
https://docs.google.com/document/d/1b6avd9xvhvljN_NKtctWrClj4mSYZ_uPmp7MmAnPwqs

BUG=b:74339386
BRANCH=poppy
TEST=manual testing on Eve device

Change-Id: I6f440320f28b033639b53246d3034bc8acc37a33
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1010769
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-04-17 15:47:13 -07:00
David Hendricks
c14b527ae5 firmware: Move EC files to a new ec/ subdirectory
This makes room for other non-EC related firmware files.

Signed-off-by: David Hendricks <dhendricks@fb.com>
2018-04-16 20:39:55 -07:00
Mattias Nissler
e4e246f15c tpm_lite: tpmc command to check owner auth
Add a command that checks whether the well-known secret (SHA1 hash of
20 zero bytes) works for owner authentication. This is accomplished by
sending a DefineSpace command for TPM_NV_INDEX_TRIAL, which will
trigger auth checks but not actually allocate an NVRAM space.
Successful command execution thus indicates that authorization was
successful. tpmc exposes the status via its exit status. This will be
used in the tpm-firmware-updater driver script to verify that the TPM
is in upgradable state.

BRANCH=None
BUG=chromium:788719
TEST=compiles

Change-Id: I630831127e0e01186650412a92643c2153fbe2ee
Reviewed-on: https://chromium-review.googlesource.com/978171
Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2018-04-13 10:03:39 +00:00
Mattias Nissler
dc060ace1b tpm_lite: Add TlclGetSpaceInfo
The new TlclGetSpaceInfo function returns more detailed information
about a defined NVRAM space. The existing TlclGetPermissions function
is now using TlclGetSpaceInfo behind the scenes.

BRANCH=None
BUG=chromium:788719
TEST=New unit tests.

Change-Id: I6c4f490d575788b696fd742a69e81e2767ec50f1
Reviewed-on: https://chromium-review.googlesource.com/937705
Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2018-04-13 10:03:37 +00:00
Mattias Nissler
ec9040c4ef tpm_lite: Add missing NVRAM attribute constants.
Add the remaining constants for NVRAM space attributes. The code
previously only declared the ones required in vboot_reference, but
that led to other code growing its own ad-hoc declarations for missing
constants. Just declare them all to simplify things.

BRANCH=None
BUG=chromium:788719
TEST=compiles

Change-Id: I749ae5e4dc1b2ba56121fe42fd136b505d8cae80
Reviewed-on: https://chromium-review.googlesource.com/937704
Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
2018-04-13 10:03:35 +00:00
Mattias Nissler
2e62620ce7 tpm_lite: Support delegation family functionality.
Adds two new functions and their corresponding TPM commands to create
delegation families and list the delegation family table, respectively.
This isn't sufficient to meaningfully manage delegation families, but good
enough for the (ab)use case of storing flags in delegation family labels, which
we are going to do in order to strengthen encrypted stateful to guarantee
recreation of the encrypted file system after TPM clear..

BRANCH=None
BUG=chromium:788719
TEST=new unit tests

Change-Id: I31beb662784a8fff450b485c7cabc553944d7772
Reviewed-on: https://chromium-review.googlesource.com/817199
Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2018-04-13 10:03:34 +00:00
Mattias Nissler
bc5b2db15b tpm_lite: Add more general DefineSpaceEx function
Add a TlclDefineSpaceEx function that allows to pass additional
parameters when creating NVRAM spaces, i.e. owner authorization as
well as PCR bindings.

BRANCH=None
BUG=chromium:788719
TEST=New unit tests.

Change-Id: I73404c05528a89604fea3bcb1f00741fb865ba77
Reviewed-on: https://chromium-review.googlesource.com/814114
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Trybot-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
2018-04-13 10:03:32 +00:00
Mattias Nissler
ac2286e8f8 tpm_lite: Implement TakeOwnership support
Add the ability to take TPM ownership. This requires two new commands:
TPM_OIAP to start an auth session and TPM_TakeOwnership to establish
ownership. TPM_TakeOwnership requires an auth session and proper
command authentication to work, which is also added.

BRANCH=None
BUG=chromium:788719
TEST=new unit tests

Change-Id: Ib70144eedb0b1c7c43b26c06529d33ccbaa51a0e
Reviewed-on: https://chromium-review.googlesource.com/790414
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Trybot-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Trybot-Ready: Mattias Nissler <mnissler@chromium.org>
2018-04-13 10:03:31 +00:00