From 841126fec6a0c17540f7b5dddb232a36fe4a06f1 Mon Sep 17 00:00:00 2001 From: Gaurav Shah Date: Thu, 3 Apr 2014 10:03:17 -0700 Subject: vboot_reference: Provide crossystem interface stubs for mips 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 Tested-by: Gaurav Shah Commit-Queue: Gaurav Shah --- host/arch/mips/lib/crossystem_arch.c | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 host/arch/mips/lib/crossystem_arch.c 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 + +#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; +} -- cgit v1.2.1