Commit Graph

66 Commits

Author SHA1 Message Date
Randall Spangler
5ac39bfff0 Add TPM version checking
Change-Id: Ic32b7bcf0bc5501e21dc84e79419a256d9b0d095

R=semenzato@chromium.org,reinauer@chromium.org
BUG=chrome-os-partner:2832
TEST=manual

crossystem tpm_fwver tpm_kernver
On a debug system, this will return 0x00010001 0x00010001

Review URL: http://codereview.chromium.org/6685075
2011-03-17 17:58:56 -07:00
Randall Spangler
f4ba19d81d Add VbSharedData field parsing
R=reinauer@chromium.org
BUG=chrome-os-partner:2578
TEST=manual

crossystem vdat_timers
should show 'LFS=0,0 LF=number1,number2 LK=number3,number4'
where number1 < number2 < number3 < number4

crossystem vdat_lfdebug
run from a dev mode console, should show
'check=12,0 index=0x00 tpmver=(hex number) lowestver=(hex number)'

crossystem vdat_flags
run from a dev mode console, flags should be 0x04.

Review URL: http://codereview.chromium.org/6685068

Change-Id: Id7b958ae300d10cdcdc1b17a1bb17b7e5069166f
2011-03-17 16:10:21 -07:00
Randall Spangler
b17e8d353c Add VB test error func/num
Change-Id: Ibe253963f0424935554fe91f166ef5040a723c6f

BUG=13107
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6698032
2011-03-15 09:50:38 -07:00
Vadim Bendebury
2008423d5f Add function for VDAT processing.
This CL is a user space counterpart of
http://codereview.chromium.org/6690023, which provided the
ability to retrieve buffers through chromeos_acpi driver.

The buffer contents is communicated as a multi line string
with each buffer byte represented as a two symbol hex
number. `crosstool', on the other has to map the buffer
contents into a certain binary structure. This CL add
conversion of the multiline string into a binary buffer and
also adds a temp. routine to dump the buffer contents on the
screen when `crosstool' is invoked.

Change-Id: I8dd3eb935332f9bc8769c71de0db302365f12d70

BUG=chromium-os:13069, chromium-os:13091
TEST=manual

- Install the new image on a target with firmware providing
 the VDAT ACPI method.

- Run crosstool and watch for the last line:
vdat                   =  11 22 33 44 ff 1f 1c 40 ff 57 74 41 ff ff ff ff # Raw VDAT contents.
localhost tmp #

Review URL: http://codereview.chromium.org/6695012
2011-03-15 09:29:48 -07:00
Randall Spangler
227f792c1b Add check-value support and check /proc/cmdline for cros_nodebug
Change-Id: I35158810184be03f18d98893e4dd640088384579

BUG=12904
TEST=manual

crossystem fwb_tries=1
crossystem fwb_tries?1 && echo YES || echo NO --> YES
crossystem fwb_tries?0x01 && echo YES || echo NO --> YES
crossystem fwb_tries?0 && echo YES || echo NO --> NO

crossystem fwb_tries=0
crossystem fwb_tries?0 && echo YES || echo NO --> YES
crossystem fwb_tries?1 && echo YES || echo NO --> NO
crossystem fwb_tries?0x01 && echo YES || echo NO --> NO

crossystem ecfw_act --> RW (if it's not, change RW to RO in the tests below)
crossystem ecfw_act?RW && echo YES || echo NO --> YES
crossystem ecfw_act?BOB && echo YES || echo NO --> NO

For the following tests, boot Alex with dev switch on and fwb_tries=1
Expected output of `crossystem mainfw_type mainfw_act cros_debug` under each of the following scenarios:
* Neither "cros_debug" nor" cros_nodebug" in kernel command line: normal B 1
* Kernel command line changed to include "cros_nodebug": normal B 0
* Kernel command line changed to include "cros_nodebugg": normal B 1
* Kernel command line changed to include "ccros_nodebug": normal B 1

Review URL: http://codereview.chromium.org/6665005
2011-03-11 13:34:56 -08:00
Randall Spangler
196e1772ed Add cros_debug option to crossystem
Change-Id: Ie62364a87f7f144ee647054d2a9ef83522cdbe7d

BUG=12904
TEST=manual

Expected output of `crossystem mainfw_type cros_debug` under each of the following scenarios:

* Boot Alex with dev switch off: normal 0
* Boot Alex with dev switch on (and dev firmware): developer 1
* Boot Alex with dev switch on (and normal firmware): normal 1
* Boot Alex with recovery firmware: recovery 0
* Boot Alex with dev switch off, then turn the dev switch on after booting: normal 0
* Boot Cr-48 with dev switch off: normal 0
* Boot Cr-48 with dev switch on: developer 1
* Boot Cr-48 with recovery firmware: recovery 0

* Boot Alex with dev switch off and kernel command line changed to include "cros_debug": normal 1
* Boot Alex with dev switch off and kernel command line changed to include "cros_debugg": normal 0
* Boot Alex with dev switch off and kernel command line changed to include "ccros_debug": normal 0

* Boot H2O BIOS with kernel command line changed to include "cros_debug": nonchrome 1
* Boot H2O BIOS with kernel command line changed to include "cros_debugg": nonchrome 0
* Boot H2O BIOS with kernel command line changed to include "ccros_debug": nonchrome 0

Review URL: http://codereview.chromium.org/6659021
2011-03-10 11:31:06 -08:00
Randall Spangler
b416714a10 Add crossystem support for nvram_cleared and kern_nv
Fix try_b processing

And move key block flags check up in LoadFirmware(), which speeds up
boot when the dev switch is off because it doesn't do a signature
check and then throw it out.

BUG=12282
TEST=build firmware, try by hand

Review URL: http://codereview.chromium.org/6596081

Change-Id: I10474e9e0ae324906dfe02a351347d04ce847f67
2011-03-01 13:04:22 -08:00
Randall Spangler
618d17d48c Add kern_nv field to crossystem
Change-Id: Ifa5cc3bd8367a258fb720162572f450a1be99c03

BUG=none
TEST=manual

crossystem kern_nv=0x12345678
crossystem kern_nv

Review URL: http://codereview.chromium.org/6602040
2011-03-01 10:33:11 -08:00
Randall Spangler
92e378e453 rename tried_fwb constants
Change-Id: Ib8018bfe29eed50766c699d832efe4f1afcabb1a

BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6597015
2011-02-25 13:56:53 -08:00
Randall Spangler
172602829d Add NV storage fields for firmware flags
1) Did firmware attempt RW slot B before slot A?

2) Did firmware check the kernel keyblock signature, or just its hash?

Added crossystem support as well.

BUG=chrome-os-partner:1657
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6597011

Change-Id: I0d743ae87cedd938ba988170793717d3fdbd8ce9
2011-02-25 12:06:26 -08:00
Randall Spangler
0f8ffb11f5 crossystem uses VbNvStorage
Change-Id: I3f158115c8514bda0b271674870d68717c4816e6

BUG=12282
TEST=manual

crossystem fwb_tries=0 && crossystem fwb_tries

This should print 0 on both BIOSes.

crossystem fwb_tries=6 && crossystem fwb_tries

This should print 1 on an older BIOS and 6 on a new BIOS (0050+)

Then reboot and run

crossystem mainfw_act

This should print 'B', since fwb_tries was non-zero.

Review URL: http://codereview.chromium.org/6576059
2011-02-25 09:50:54 -08:00
Randall Spangler
2b59a07c54 Add flashmap base address
Change-Id: If2106cbde445edc0970862a06d3837d2e466d9ef

BUG=chrome-os-partner:2487
TEST=manual

From a root shell, type: crossystem fmap_base
Should match the contents of /sys/devices/platform/chromeos_acpi/FMAP
(note that you need a new BIOS >0049 to get one that supports FMAP)

Review URL: http://codereview.chromium.org/6580037
2011-02-24 11:17:24 -08:00
Randall Spangler
b47ed5a8fb Add more properties to crossystem
crossystem now covers all data currently provided by chromeos_acpi.

Change-Id: I3364c4d65ddf63fe788d3d9c1e9d05e64be22856

BUG=chromium-os:12282
TEST=manual - test on Cr-48 and compare with ACPI values

Review URL: http://codereview.chromium.org/6557001
2011-02-23 13:05:40 -08:00
Randall Spangler
e73302caae Add support for CHNV settings to crossystem.
crossystem can now be used in place of reboot_mode.

BUG=12327
TEST=manual by comparing with the old reboot_mode utility

crossystem recovery_request=1
reboot_mode
crossystem dbg_reset=1
reboot_mode
crossystem fwb_tries=1
reboot_mode

crossystem recovery_request=0
reboot_mode
crossystem dbg_reset=0
reboot_mode
crossystem fwb_tries=0
reboot_mode

Review URL: http://codereview.chromium.org/6538066

Change-Id: Ifde661d4621129d52e757654d85e386e65f90df5
2011-02-18 14:53:01 -08:00
Randall Spangler
c80fe65f9e Fix WP polarity on Mario
Note that both the current and boot settings are incorrect as reported
by the BIOS.  This fixes both.

Change-Id: Iebd2b4ac91232444e538f6e2763a22cb227f2e4f

BUG=chrome-os-partner:2078
TEST=manual

Run crossystem on Mario and Alex with WP enabled, disabled and check
Verify true hardware WP status by doing:
   flashrom --wp-enable
   flashrom --wp-status
   flashrom --wp-disable
   flashrom --wp-status
On a system with hardware WP enabled, the disable step should fail and write
protect will still report enabled.

Review URL: http://codereview.chromium.org/6531035
2011-02-17 11:06:47 -08:00
Randall Spangler
542186618a Initial version of crossystem.
Works for getting switch positions, hwid, fwid.

BUG=chrome-os-partner:1940
TEST=ran manually on Mario and Alex

Review URL: http://codereview.chromium.org/6413002

Change-Id: I874df3b5adf872fec2d36e574cb4b8b4a72d331c
2011-02-07 11:20:20 -08:00