diff options
author | Gaurav Shah <gauravsh@google.com> | 2014-04-03 10:03:17 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-04-04 04:58:21 +0000 |
commit | 841126fec6a0c17540f7b5dddb232a36fe4a06f1 (patch) | |
tree | bceffea1a4c35da38b8be8a30709b2ba8b4a73c2 | |
parent | 4ff446b493e8a74804fd00082119681f768d366a (diff) | |
download | vboot-841126fec6a0c17540f7b5dddb232a36fe4a06f1.tar.gz |
vboot_reference: Provide crossystem interface stubs for mipsstabilize-5791.0.Bstabilize-5784.0.Bfirmware-nyan-5771.Bfactory-nyan-5772.B
BUG=chromium:358418
TEST=emerge-mipsel-o32-generic vboot_reference now builds.
BRANCH=none
Change-Id: Ia1414dfdef00c5b22ed0971fad814ef761b32b86
Reviewed-on: https://chromium-review.googlesource.com/193050
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Gaurav Shah <gauravsh@chromium.org>
-rw-r--r-- | host/arch/mips/lib/crossystem_arch.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/host/arch/mips/lib/crossystem_arch.c b/host/arch/mips/lib/crossystem_arch.c new file mode 100644 index 00000000..28a6b806 --- /dev/null +++ b/host/arch/mips/lib/crossystem_arch.c @@ -0,0 +1,74 @@ +/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include <string.h> + +#include "vboot_common.h" +#include "vboot_nvstorage.h" +#include "host_common.h" +#include "crossystem.h" +#include "crossystem_arch.h" + +// TODO: Currently these are stub implementations providing reasonable defaults +// wherever possible. They will need real implementation as part of of MIPS +// firmware bringup. + +int VbReadNvStorage(VbNvContext* vnc) { + return -1; +} + +int VbWriteNvStorage(VbNvContext* vnc) { + return -1; +} + +VbSharedDataHeader *VbSharedDataRead(void) { + return NULL; +} + +int VbGetArchPropertyInt(const char* name) { + if (!strcasecmp(name,"devsw_cur")) { + return 1; + } else if (!strcasecmp(name,"recoverysw_cur")) { + return 0; + } else if (!strcasecmp(name,"wpsw_cur")) { + return 1; + } else if (!strcasecmp(name,"devsw_boot")) { + return 1; + } else if (!strcasecmp(name,"recoverysw_boot")) { + return 0; + } else if (!strcasecmp(name,"recoverysw_ec_boot")) { + return 0; + } else if (!strcasecmp(name,"wpsw_boot")) { + return 1; + } + return -1; +} + +const char* VbGetArchPropertyString(const char* name, char* dest, size_t size) { + if (!strcasecmp(name,"hwid")) { + return StrCopy(dest, "UnknownMipsHwid", size); + } else if (!strcasecmp(name,"fwid")) { + return StrCopy(dest, "UnknownMipsFwid", size); + } else if (!strcasecmp(name,"ro_fwid")) { + return StrCopy(dest, "UnknownMipsRoFwid", size); + } else if (!strcasecmp(name,"mainfw_act")) { + return StrCopy(dest, "A", size); + } else if (!strcasecmp(name,"mainfw_type")) { + return StrCopy(dest, "developer", size); + } else if (!strcasecmp(name,"ecfw_act")) { + return StrCopy(dest, "RO", size); + } + return NULL; +} + +int VbSetArchPropertyInt(const char* name, int value) { + /* All is handled in arch independent fashion */ + return -1; +} + +int VbSetArchPropertyString(const char* name, const char* value) { + /* All is handled in arch independent fashion */ + return -1; +} |