History log of /external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
05987b159acb9737707b9ef92b818ac434ef8c3d 06-Feb-2015 David Riley <davidriley@chromium.org> Changes to compile signing tools on darwin

The following works from a Mac with these changes:
make Q= ARCH=arm HAVE_MACOS=1 `pwd`/build/futility/futility

Only vbutil_keyblock and vbutil_kernel have been exercised.

BUG=none
TEST='make Q= ARCH=arm HAVE_MACOS=1 `pwd`/build/futility/futility'
BRANCH=none

Signed-off-by: David Riley <davidriley@chromium.org>

Change-Id: Ie69cfee0c650d4ff96be6322083a2fea1543ee39
Reviewed-on: https://chromium-review.googlesource.com/246773
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Commit-Queue: David Riley <davidriley@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
c93ddb60aae37fc06f614a1b79e6f3fee25b97c4 06-Feb-2015 Ken Chang <kenc@nvidia.com> crossystem: read recovery switch status from chromeos_arm device

The kernel chromeos_arm platform device provides the recovery status
with the consideration of active polarity.
Thus make crossystem to read from chromeos_arm device first. If this
is not available, read directly from gpio pin status.

BUG=chrome-os-partner:36425
BRANCH=none
TEST=ran on kitty,
'crossystem recoverysw_cur' return 0 with recovery switch off
'crossystem recoverysw_cur' return 1 with recovery switch on

Change-Id: Ie20630d7d07aeadf24044cd3ffc495df7cdd8a4a
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/246883
Tested-by: Titan Lee <titanlee@nvidia.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Titan Lee <titanlee@nvidia.com>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
054c1147989d39a432923cc359d123f0d8e9390a 09-Nov-2014 Vadim Bendebury <vbendeb@chromium.org> crossystem: add platform for ipa8064

Storm and Whirlwind use Ipq8064 chipset, need a new platform category
in crossystem.

BRANCH=storm
BUG=chrome-os-partner:33592
TEST=manual
localhost ~ # echo $(crossystem platform_family)
IPQ8064
localhost ~ #

Change-Id: I921771e12604d3051e5d4213db494a79007147ff
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/228677
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
d241fff54c982f2764e6d126a024ab71fa6dd84a 13-Oct-2014 Duncan Laurie <dlaurie@chromium.org> crossystem: Change ReadFileInt to take an unsigned int pointer

Currently ReadFileInt assumes that an integer value read from a file
is never going to be "-1" and uses that value to indicate failure.
In particular for GPIO values that may be returned by the kernel it
is possible for them to be not simply 0 or 1 but instead a bit within
the GPIO status register that indicates the value.

The function semantics are changed to have the caller pass in the
variable to store the integer in, and use the return code explicitly
as a pass or fail condition.

This requires all the callers of ReadFileInt to be changed to use the
new scheme, and the x86 ReadGpio function is changed to normalize the
GPIO value that is read from the kernel instead of assuming it is
always 1 for active high values.

BUG=chrome-os-partner:32645
BRANCH=samus,auron
TEST=build for samus, check crossystem output and ensure that all
values are properly reported and that wpsw_cur is correct now.
Also tested to ensure no changes in output on: x86-alex, daisy,
peach_pit, lumpy, stumpy, nyan_big, nyan_blaze, rush_ryu, panther,
wolf, zako, auron, rambi, squawks, parrot_ivb, veyron_pinky

Change-Id: I824152eed5f96cf1faaa18ba31a01f4d346ad172
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223009
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
aaa325727a19366f40c84d45bfdbfd2e4fa92de0 08-Oct-2014 David Hendricks <dhendrix@chromium.org> crossystem: rename Vb*NvStorage_mkbp to Vb*NvStorage_mosys

This is just a cosmetic tweak to make it a bit clearer that
mosys is the underlying interface for these particular vbnv
read/write functions.

BUG=none
BRANCH=none
TEST=it still compiles

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: Ide172bfecf608a30489d25026268aedfc421ce4d
Reviewed-on: https://chromium-review.googlesource.com/222062
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
1137139a2e0ea24a5fb7df3b621d4c0ec59daf81 08-Oct-2014 David Hendricks <dhendrix@chromium.org> crossystem: handle "flash" media in Vb*NvStorage()

This handles VBNV data stored in SPI flash which happens to be
the exact same way we handle VBNV data stored in the EC.

BUG=chrome-os-partner:31529
BRANCH=none
TEST=with CL:221349 applied, crossystem on storm no longer
spews tons of errors

Change-Id: I021d9f430acfac34dff44a927361a5a0e5ae2ff8
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/222061
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
435be9873179338d0c4e7b2d823989181a089771 28-Jan-2014 Gabe Black <gabeblack@chromium.org> tegra124: Add the tegra124 compatibility string to crossystem.

Teach crossystem the tegra124 compatibility string so that it can identify the
platform for tegra124 based systems.

I called the platform Tegra5 to fit in with what seems to be the naming scheme
for the other Tegra SOCs.

BUG=chrome-os-partner:25355
TEST=Built and ran on nyan and saw the "platform_family" setting return Tegra5
instead of (error).
BRANCH=None

Change-Id: I1044f958ecdac37ad285fdc3d53e7bc36ca69315
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/184051
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
a3d70a3d2b5c052db039d097aaffa42008da24b5 30-Oct-2013 J. Richard Barnette <jrbarnette@chromium.org> Make crossystem.h more polite and more useful.

This adds a VB_MAX_STRING_PROPERTY for callers that don't
want to guess at how big to make their buffers.

Additionally, it changes the size parameter to VbGetPropertyString()
from int to size_t.

BUG=None
TEST=compile the code
BRANCH=none

Change-Id: I22809d48e13b535593cb22a56444e2dcb27791a5
Reviewed-on: https://chromium-review.googlesource.com/175039
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
3401fdcd4125beea1a8cb1cc59ee27df89d4d88a 16-Aug-2013 Simon Glass <sjg@chromium.org> Correct some minor compiler warnings

A few places in the code through up warnings when building with strict
compiler flags. Correct these.

BUG=chrome-os-partner:21115
BRANCH=pit
TEST=manual
Build with:

FEATURES=test emerge-peach_pit vboot_reference

and see that iot now succeeds. Warnings include:

host/arch/arm/lib/crossystem_arch.c: In function 'ReadFdtValue':
host/arch/arm/lib/crossystem_arch.c:93:8: error: ignoring return value of 'fread', declared with attribute warn_unused_result [-Werror=unused-result]

Change-Id: I765723636e5f8979b794925c7b610081b2849026
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66174
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
47779880b28f2c549dd3349d8f28d68a0f784eb4 16-Aug-2013 Simon Glass <sjg@chromium.org> Improve kernel tests to pass valgrind

At present the kernel tests produce valgrind errors since the GPT data is
sometimes accessed before it is read. This is unnecessary, so update the
code to avoid this.

BUG=chrome-os-partner:21115
BRANCH=pit
TEST=manual
valgrind --leak-check=full ./build/tests/vboot_kernel_tests

See that we no longer get valgrind errors.

Change-Id: I9e9660e38a62a735cf01a37c2d81ddb5ab8b1528
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66173
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
114d54a9e26aad6bfa4564152a3f1daed2e75a9b 20-Jun-2013 Vadim Bendebury <vbendeb@chromium.org> Add 5420 to the set of recognizable platforms

It is used on peach_pit.

BRANCH=none
BUG=none
TEST=manual
. on peach-pit:

localhost ~ # echo $(crossystem arch)
arm
localhost ~ #

Change-Id: Ia9a4ea2291d6b672fca1c9e1305961eedc4f60cf
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59339
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
09a8447862c7d111d6abdd7891508df1a8f1cc5b 03-Oct-2012 Randall Spangler <rspangler@chromium.org> crossystem devsw_cur returns devsw_boot if virtual dev switch

devsw_cur is really a meaningless concept on systems with virtual dev
switches; it exists primarily to support factory test of physical
developer switches. However, some plugins use this instead of the
preferred devsw_boot, and it's easier to modify crossystem than the
plugins at this point in time.

BUG=chrome-os-partner:12928
BRANCH=none (affects all current products, but is an OS-level change, not FW)
TEST=manual

- On link, 'crossystem devsw_cur devsw_boot' with dev switch on -> '1 1'
- On link, 'crossystem devsw_cur devsw_boot' with dev switch off -> '0 0'
- On lumpy or earlier, 'crossystem devsw_cur' should return current dev
switch position; check this by toggling the physical switch without
rebooting and see that the reported value follows the switch value.

Change-Id: Ie7416e5cb03c133572c32af677b55ed18884dfb8
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34531
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
210c5ef2d9d060bebf5020da886e2cabd6e05d6d 24-Sep-2012 Che-Liang Chiou <clchiou@chromium.org> crossystem should not grumble about older firmware

Older firmware does not provide nonvolatile-context-storage FDT
property, and crossystem complains about it.

This is harmless; so just make it quiet.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BRANCH=none
BUG=chrome-os-partner:14475
TEST=manual, see blow

Run crossystem and make sure its output does not contain
"Unable to open FDT property nonvolatile-context-storage"
messages.

Check crossystem still works by comparing its output w/ and w/o this
change.

Change-Id: I0b8f40775833457a75d801f185344e931ac08847
Reviewed-on: https://gerrit.chromium.org/gerrit/33896
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
770c1b772c0aa9241bc2923354092a14e1c68661 12-Sep-2012 Che-Liang Chiou <clchiou@chromium.org> crossystem should switch on VbNvContext storage type

We may have multiple storage types (disk or mkbp) of VbNvContext.
crossystem should switch the type and choose the corresponding device
driver.

After patching U-Boot, you may check storage type:
[ "mkbp" = "$(cat /proc/device-tree/firmware/chromeos/nonvolatile-context-storage)" ]

And cross-verify crossystem with mosys:

$ mosys nvram vboot read
70000000000000000000000000000020
$ crossystem recovery_request
0

$ crossystem recovery_request=123
$ mosys nvram vboot read
70007b0000000000000000000000005d

$ mosys nvram vboot write 70000000000000000000000000000020
$ crossystem recovery_request
0

More importantly, crossystem should also work with older version of
firmware, which does not pass down this information.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BRANCH=none
BUG=chrome-os-partner:13766
TEST=Check storage type on a Snow device:
[ "mkbp" = "$(cat /proc/device-tree/firmware/chromeos/nonvolatile-context-storage)" ]
Make sure that FAFT is still happy:
./run_remote_tests.sh --remote $ADDR --board daisy 'firmware_TryFwB/control$'
./run_remote_tests.sh --remote $ADDR --board daisy 'firmware_TryFwB/control.dev$'
More importantly, check crossystem worked well even when ChromeOS
is booted from an older version of firmware.

Change-Id: I3989a8c181efe03cd9f06127743763e0ad97e281
Reviewed-on: https://gerrit.chromium.org/gerrit/32470
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
3afe5566ccee0df6c636ab6e9cf882106fe9245b 16-Aug-2012 Gabe Black <gabeblack@chromium.org> Make crossystem look for the write protect switch in the chromeos_arm device

The value of the ChromeOS write protect switch is now provided through the new
chromeos_arm platform device which avoids the mismatch between U-Boot and
kernel GPIO numbering.

BUG=chrome-os-partner:11297
TEST=gmerge-ed onto a snow and verified that crossystem got the right value of
the write protect switch.
BRANCH=snow

Change-Id: I466370e4f6bf2d14c067518a9d620e9e60142a0b
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/30534
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
da8d32dc8d0fb5ebcfffa305f4a3ecb2dd7c79ac 03-Aug-2012 Randall Spangler <rspangler@chromium.org> Crossystem should return at-boot switch positions from VbSharedData

This is more reliable than reading them through FDT/ACPI, since it reflects
the positions as shown to verified boot code.

Notes:
1. This affects ALL platforms with virtual dev switches (x86 AND arm)
2. The fix should have no effect on older platforms, but I haven't tested those.

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

1. boot in normal mode.

devsw_boot = 0 # Developer switch position at boot
recovery_reason = 0 # Recovery mode reason for current boot
recoverysw_boot = 0 # Recovery switch position at boot
wpsw_boot = 1 # Firmware write protect hardware switch position at boot

2. boot in developer mode.

localhost ~ # crossystem
devsw_boot = 1 # Developer switch position at boot
recovery_reason = 0 # Recovery mode reason for current boot
recoverysw_boot = 0 # Recovery switch position at boot
wpsw_boot = 1 # Firmware write protect hardware switch position at boot

3. boot in developer-recovery mode using keyboard combo.

devsw_boot = 1 # Developer switch position at boot
recovery_reason = 2 # Recovery mode reason for current boot
recoverysw_boot = 1 # Recovery switch position at boot
wpsw_boot = 1 # Firmware write protect hardware switch position at boot

4. disable WP and reboot. wpsw_boot should be 0.

Change-Id: If4156b5e14c6923c5b331c7e5feaabbffe1dad37
Reviewed-on: https://gerrit.chromium.org/gerrit/29199
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
ffb9233a90fe8f29bb80292a75aed04778b0cda5 11-Jul-2012 Che-Liang Chiou <clchiou@chromium.org> crossystem: Let kernel worry about active_low stuff

As kernel has adjusted the value of /sys/class/gpio/gpio${PORT}/ with
active_low stuff before returning it to user, crossystem should not do
another adjustment.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BUG=chrome-os-partner:11297
TEST=On Snow, run crossystem and see wpsw_boot equals to wpsw_cur.
Then invert /sys/class/gpio/gpio${PORT}/active_low value, and
see wpsw_boot does not equal to wpsw_cur.

Change-Id: I09fec89788bc4393775d5cf9763b8cebeb645ad4
Reviewed-on: https://gerrit.chromium.org/gerrit/27252
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
7ec9f717173ae08571c457bd39a067dd0ce2c471 11-Jul-2012 Che-Liang Chiou <clchiou@chromium.org> crossystem: Return error when trying to read GPIO port zero

For the record, zero is a valid GPIO port number. Unfortunately
firmware uses port zero to denote that a GPIO port is not exist.
So crossystem should not attempt to read GPIO port zero, but
return error instead.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BUG=chrome-os-partner:11296
TEST=On Snow, run crossystem and see devsw_cur and recoverysw_cur
are "(error)"

Change-Id: I70b15824f613df1e46bf152515ad4e9362c9f066
Reviewed-on: https://gerrit.chromium.org/gerrit/27251
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
edea097d55771083fd17075f2cc2c8c7a5449914 09-Jul-2012 Che-Liang Chiou <clchiou@chromium.org> Revert "Read virtual switch current values correctly"

This reverts commit 7ec59576f6f61effdc35482c8cfd4aa32b643b1a.

We would like to keep dev_cur and recovery_cur output "(error)" so that
factory process knows that firmware uses virtual switches.

I think this is strange, but this is how factory process works for now.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BUG=chromium-os:10007
TEST=none

Change-Id: I370a3e9f5a8847916445348abb81f7c4bbf3d27f
Reviewed-on: https://gerrit.chromium.org/gerrit/26909
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
a5ef4f98fc30cfae232295464fbc9d846c980fdf 02-Jul-2012 Rong Chang <rongchang@chromium.org> Exporting GPIO if the sysfs node does not exist

This change exports gpio number if it can not be accessed. Ignore
the active_low checking for compatibility.

Signed-off-by: Rong Chang <rongchang@chromium.org>
BUG=chrome-os-partner:11029
TEST=manual
Run crossystem and check WP pin status

Change-Id: I0885ab21c6c6d614945e4fda49a373e8619772a9
Reviewed-on: https://gerrit.chromium.org/gerrit/26563
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
7ec59576f6f61effdc35482c8cfd4aa32b643b1a 02-Jul-2012 Che-Liang Chiou <clchiou@chromium.org> Read virtual switch current values correctly

As dev switch and recovery switch may be virtual, crossystem has to
distinguish virtual switches from physical ones.

Since to a virtual switch, its current value should always equal to its
boot value, return a boot value when asked for a current value.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>

BUG=chrome-os-partner:10007
TEST=crossystem devsw_cur|recoverysw_cur show correct value on Snow

Change-Id: Ia73147ecd5528a3cc5276aff02a632ce4f52ea8b
Reviewed-on: https://gerrit.chromium.org/gerrit/26568
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
d808a43d357371451c8ca4b4ad1a38f2251155c4 29-Jun-2012 Tom Wai-Hong Tam <waihong@chromium.org> crossystem: Add the ddr_type field on crossystem for querying DDR RAM type

Samsung want to know what memory type on the device. So this CL adds a
new field ddr_type to crossystem utility in order to query this info.

It is only available on ARM platform so far.

BUG=chrome-os-partner:10857
TEST=Built and boot on Snow successfuly. On userspace, query the field via:
localhost ~ # crossystem ddr_type
ddr3

Change-Id: I01d1dec412fe4052e1ea6cfe2e53830da97a710b
Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26411
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
58def7454d2c4d085e383a0b73d00670390ddd83 26-Jun-2012 Olof Johansson <olofj@chromium.org> add EXYNOS{4,5} to platform_name tables on arm

BUG=chrome-os-partner:10872
TEST=run crossystem on snow, check output

Change-Id: I413cbd86833fc8abff9afbf12a85abe53b586af4
Reviewed-on: https://gerrit.chromium.org/gerrit/26090
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
f47291926afce3235421f73811a04324195f3e13 03-May-2012 Bill Richardson <wfrichar@chromium.org> Require -Wall -Werror for everything.

BUG=none
TEST=none

Change-Id: Ib9781238274285f73d00d8fca4ecda28fc2c6678
Reviewed-on: https://gerrit.chromium.org/gerrit/21748
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
885a9774ef469666854a0e4bed7c33733d0396c7 17-Jan-2012 Bernie Thompson <bhthompson@chromium.org> Add a failure check to ReadFdtBlock in ReadFdtPlatformFamily

This adds in logic to check that ReadFdtBlock within ReadFdtPlatformFamily
succeeded, returning NULL on failure.

BUG=None
TEST=Manual, run crossystem on an ARM system without a valid compatible FDT
entry and ensure (error) is returned for platform_family.

Change-Id: I6351292ff73e4bc08b028f85e72ccfe62159194a
Reviewed-on: https://gerrit.chromium.org/gerrit/14321
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Ready: Bernie Thompson <bhthompson@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
bd00c622e4249b67087a81adb1978a661c7ef8c9 17-Jan-2012 Bernie Thompson <bhthompson@chromium.org> Allow crossystem ReadFdtBlock() to use a direct path starting with '/'

This extends the ReadFdtBlock function for ARM to allow for a direct path
to a FDT entry by starting the property with a '/'. This allows the
ReadFdtPlatformFamily function to use a direct path instead of stepping back
through folders, and will enable future crossystem entries to do the same.

BUG=chromium-os:24669
TEST=Manual

Change-Id: Ibddb881815947259c2532d7f5474eda5fdc9f803
Reviewed-on: https://gerrit.chromium.org/gerrit/14305
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Ready: Bernie Thompson <bhthompson@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
0b5789fee96b7213a9762c5b2cf7f705a99d95ef 28-Dec-2011 Bernie Thompson <bhthompson@chromium.org> Add in a platform_family value to crossystem

This implements a platform_family value within the crossystem utility,
as the platform (particularly for ARM) is not easily accessable elsewhere at
runtime.

For the ARM side this contains a table which is used to determine the platform
family based on the /proc/device-tree/compatible entry. Similarly on x86 the
table is used to check against PCI entries. Additional entries can be made
as new platform families emerge.

BUG=chromium-os:24669
TEST=Manual, verified that crossystem runs properly and returns a valid
platform_family value on various platforms (mario, alex, z600, x220, etc).

Change-Id: Id0e973902d27ead471c1243bcc6c3292acc8479d
Reviewed-on: https://gerrit.chromium.org/gerrit/13520
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
36dccdbad1c88657ee893b794b5aba2feacefaa5 29-Jun-2011 Nick Sanders <nsanders@chromium.org> Add check to validate VbSharedData magic

TEST=run crossystem
BUG=chrome-os-partner:4691

Change-Id: If590d185446dfa7cb628b5014f3a9a9c7b7a901d
Reviewed-on: http://gerrit.chromium.org/gerrit/3355
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
04b7978c4682c8b65aa9a212ff2a7d0071336b22 20-Jul-2011 Che-Liang Chiou <clchiou@chromium.org> CHROMIUM: fix incorrect crossystem recovery_reason

U-Boot should not parse the raw contents of VbNvStorage, and so cannot
read the recovery reason from the VbNvStorage. On the other hand, it is
easy for crossystem to read the recovery reason from the VbNvStorage
itself.

After this change is merged, U-Boot will stop providing the (incorrect)
recovery reason in the device tree.

BUG=chromium-os:17876,chromium-os:17852
TEST=press recovery button and see crossystem reports recovery_reason=2

Change-Id: I236667f0b4f2e25da193cf6b6f7db3871d1e093f
Reviewed-on: http://gerrit.chromium.org/gerrit/4396
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
a185b8d8f61ac165bc15c6b51d23b6e1be5b15cf 16-Jul-2011 Randall Spangler <rspangler@chromium.org> Report mainfw_act based on VbSharedData

Don't use FDT to report it on ARM.

This fixes ARM reporting the wrong thing for RO-normal.

BUG=none
TEST=none

Change-Id: Id3a1bd2a1d2502e1d9493ab362be5a58fa88d70e
Reviewed-on: http://gerrit.chromium.org/gerrit/4213
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
7994d07d565d11557a1701ff16e892d7ab8e0d41 15-Jul-2011 Olof Johansson <olofj@chromium.org> crossystem: arm: use proper gpio references

BUG=none
TEST=make sure developer switch and recovery switch runtime reading works as expected (manually)

Change-Id: I3b17ac66f88b2b789bebe4e7d271666f8c63a8b0
Reviewed-on: http://gerrit.chromium.org/gerrit/4127
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
3a6e2f10b279b9b285ae4b832d2df92a05dacd52 14-Jul-2011 Olof Johansson <olofj@chromium.org> arm: convert to new device tree usage

This also includes reading the nonvolatile storage from disk instead of
through the device-tree, since it's not updated there.

BUG=none
TEST=read and write a few crossystem variables

Change-Id: I6836a6eb0c92a0560dd393e694690a694bdb77a6
Reviewed-on: http://gerrit.chromium.org/gerrit/4078
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
d70241f37d87bd7758fc6c5bbb7d5870098ecdfc 06-Jul-2011 Rong Chang <rongchang@chromium.org> Introduce arm fdt support in crossystem utility

This CL builds upon recent changes in u-boot and kernel. (see issue
ids: 15744, 16665)

- Remove /sys/kernel/debug/chromeos_arm share memory mechanism
- Load properties from /proc/device-tree/crossystem/*
- Write NVCXT to /dev/mmcblk0:lba[0]

BUG=chromium-os:17300
TEST=manual

Run crossystem on device console. Check current values of gpio
switches. All other values are exported from FDT directly.

Change-Id: Ib8db4a4aeb6dc36308ad8882403cb2f5978a5c70
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3676
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
fbb52dfa9cf1b38eedc119c84f1f64d5fa7f1fbb 30-Jun-2011 Hung-Te Lin <hungte@chromium.org> crossystem: fix VbSharedDataHeader size

The content in VbSharedMem should be VbSharedData instead of FMAP.

BUG=chromium-os:17168
TEST=crossystem # seeing correct value
(the test need a u-boot with fix included)

Change-Id: I3d7d1eb2b35c9475c2047e9479cee69464da20b1
Reviewed-on: http://gerrit.chromium.org/gerrit/3436
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
1c1a883bc746a6216bb634825d33d80562853020 28-Jun-2011 Randall Spangler <rspangler@chromium.org> Fix ARM build for vboot_reference crossystem lib

BUG=none
TEST=none

Change-Id: I655cd69a0e1d2a3ad6ce9f326cbd989fc8ecb43d
Reviewed-on: http://gerrit.chromium.org/gerrit/3270
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
cbc86f786c34a608b347f492551f172b281d784b 25-May-2011 Doug Anderson <dianders@chromium.org> Fixed compiler warning in v-boot reference.

The error was:
arch/arm/lib/crossystem_arch.c: In function ‘VbReadSharedMemory’:
arch/arm/lib/crossystem_arch.c:134: error: format ‘%d’ expects type ‘int’, but argument 5 has type ‘long unsigned int’

BUG=none
TEST=(outside choot): cd src/platform/vboot_reference; make

Change-Id: I5e1f69abd125fe06cf6ae04a7946568bdbcef83e
Reviewed-on: http://gerrit.chromium.org/gerrit/1547
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
78b05174b712a81c5d4571edc37d3f92175f39f1 23-May-2011 Che-Liang Chiou <clchiou@chromium.org> crossystem: arm: fix incorrect mainfw_act output

BUG=chromium-os:15626
TEST=manual

when not recovery boot
$ [ $(crossystem mainfw_act) = "A" ] || [ $(crossystem mainfw_act) = "B" ]

when recovery boot
$ [ $(crossystem mainfw_act) = "recovery" ]

Change-Id: I3917106b61e2979d8cb07f01fd0cec044ae725cb
Reviewed-on: http://gerrit.chromium.org/gerrit/1345
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
a3ec5c40f86f4c71305600ea25b58c1862d1c504 19-May-2011 Vadim Bendebury <vbendeb@chromium.org> Ensure ARM crossystem gpio readings match u-boot.

U-boot and crossystem interpret the same switch state differently
for 'recovery mode' and 'write protect', This change adds the
ability to invert certan GPIO readings such that crossystem and
u-boot return the same values.

BUG=chromium-os:15393
TEST=manual

Running crossystem on the target with developer u-boot image:

- observe that recoverysw_cur reading matches recoverysw_boot and
wpsw_cur reading matches_wpsw_boot.

- try rebooting with recovery or developer mode buttons pressed,
observe the change in reported values of devsw_boot and
recoverysw_boot.

- observe reported values of devsw_cur and recoverysw_cur
following pressing of the buttons.

Change-Id: I628f59b60008719bbff1722d23154ce934af6c36
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1193
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
c3574086a82d04b3584712f7e15a8eb4ea6d40a0 03-May-2011 Vadim Bendebury <vbendeb@chromium.org> Introduce arm support in crossystem.

This CL builds upon earlier firmware and kernel changes (see CLs
related to the same bug, chromium-os:12522).

ARM firmware now simulates both Nvram storage and VDAT buffer, the
structures the x86 version uses extensively to communicate back and
forth between firmware/kernel/userland.

So, to make crossystem work on arm, all what's needed is to provide
architecture specific interface to Nvram and VDAT simulation, and
architecture specific processing for variables which are accessed on
ARM platforms in a different way.

The few discrepancies and platform specifics which had to be addressed
for ARM specifically are as follows:

- the Nvram contents are cached in the shared memory and available for
reading as part of /sys/kernel/debug/chromeos_arm. When writing
Nvram, the same file needs to be written, but only the 16 bytes
(representing the Nvram contents) are aacepted.

- the VDAT buffer also comes from the shared memory (as part of the
same sysfs file)

- when crossystem starts, it needs to read in this shared memory
contents, a` weak' function VbArchInit() is being added such that it
is provided on ARM platforms only, on x86 an empty stub is called.

- current developer/recovery request/ro firmware switch states are
retrieved through GPIO drivers. The GPIO numbers are defined in the
file, the GPIO driver is supposed to be configured before
crsossystem can operate.

- the BINF values are supplied through an array within shared memory,
it would be easy to refactor both x86 and ARM use the same code to
process BINF values, but with this submission the code is duplicated
to minimize x86 impact.

- the following crossystem variables do not have ARM equivalents,
thier values are reported as '(error)':

recoverysw_ec_boot
savedmem_base
savedmem_size

BUG=chromium-os:12522
TEST=manual:

. bring up a kaen system
. execute the following script to enable the appropriate GPIOSs:

for gpio in 56 59 168; do echo $gpio > /sys/class/gpio/export; done

. run `crossystem' and observe reasonable output values

. to verify that it reads GPIOs properly, try

echo $(./crossystem recoverysw_cur)

with the miniservo 'GOOG_REC' button pressed and released, observe
different readings (note that the state of the button is reversed,
the released button is reported as '1')

. to verify the write capabilities, note that the nvram contents can
be accessed using the following shell commands

echo 3 > /proc/sys/vm/drop_caches
2>/dev/null dd if=/dev/mmcblk0 of=/tmp/blk bs=16 count=1 && \
od -t x1 /tmp/blk | head -1

(the first command cause the device cache dropped, and the second
command accesses the device contents.

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
localhost var # echo $(./crossystem fwb_tries)
10
localhost var # echo 3 > /proc/sys/vm/drop_caches
localhost var # 2>/dev/null dd if=/dev/mmcblk0 of=/tmp/blk bs=16 count=1 && od -t x1 /tmp/blk | head -1
0000000 60 0a 00 be 00 00 00 00 00 00 00 02 00 00 00 a2
localhost var # ./crossystem fwb_tries=9
localhost var # echo $(./crossystem fwb_tries)
9
localhost var # echo 3 > /proc/sys/vm/drop_caches
localhost var # 2>/dev/null dd if=/dev/mmcblk0 of=/tmp/blk bs=16 count=1 && od -t x1 /tmp/blk | head -1
0000000 60 09 00 be 00 00 00 00 00 00 00 02 00 00 00 8a
localhost var #
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Change-Id: Ie4c6ff44441d98a42b1057953208fdb90c08f46d
Reviewed-on: http://gerrit.chromium.org/gerrit/113
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
824906b9dbd7d5c883949acf404a008fe17b1da7 08-Apr-2011 Randall Spangler <rspangler@chromium.org> Add crossystem arch (reports x86 or arm, depending on platform)

Change-Id: I857ead5b108d42195145cdbc5cdafa817f3416b4

R=reinauer@chromium.org
BUG=chrome-os-partner:3023
TEST=crossystem arch

(reports 'x86' on x86 platform, 'arm' on ARM platform)

Review URL: http://codereview.chromium.org/6813054
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c
eb59195473246f8ff3076950f3c3b8d3564d433d 07-Apr-2011 Randall Spangler <rspangler@chromium.org> Refactor crossystem to move x86-specific implementation to its own file.

This should be ready for the ARM team to pick up and work on. I added
a placeholder ARM implementation file, though it's not hooked up in
the Makefile yet.

As soon as you implement the VbNvStorage APIs, all the related
crossystem commands will start working. Ditto for VbSharedData.

The params which x86 gets from ACPI you'll need to get from u-boot
somehow, probably via your own kernel driver.

R=robotboy@chromium.org
BUG=chromium-os:12522
TEST=emerge-x86-alex vboot_reference, make sure it still works on x86

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

Change-Id: I628ee56508421b937ed50db7cb9b8385408d2f5e
/external/vboot_reference/host/arch/arm/lib/crossystem_arch.c