summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--lib/chromeos/Makefile1
-rw-r--r--lib/chromeos/tlcl_stub.c58
-rw-r--r--lib/chromeos/utility.c9
4 files changed, 69 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index e4ac086537..cf340bfb38 100644
--- a/Makefile
+++ b/Makefile
@@ -310,10 +310,6 @@ else
PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
endif
PLATFORM_LIBS += $(PLATFORM_LIBGCC)
-# Add vboot_reference lib
-ifdef VBOOT
-PLATFORM_LIBS += $(VBOOT)/lib/vboot_fw.a
-endif
export PLATFORM_LIBS
# Special flags for CPP when processing the linker script.
@@ -326,6 +322,10 @@ LDPPFLAGS += \
__OBJS := $(subst $(obj),,$(OBJS))
__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
+# Add vboot_reference lib
+ifdef VBOOT
+__LIBS += $(VBOOT)/lib/vboot_fw.a
+endif
#########################################################################
#########################################################################
diff --git a/lib/chromeos/Makefile b/lib/chromeos/Makefile
index 7f81f919d5..56acf9b68b 100644
--- a/lib/chromeos/Makefile
+++ b/lib/chromeos/Makefile
@@ -39,6 +39,7 @@ LIB = $(obj)libchromeos.a
COBJS-$(CONFIG_CHROMEOS) += boot_device.o
COBJS-$(CONFIG_CHROMEOS) += fmap.o
+COBJS-$(CONFIG_CHROMEOS) += tlcl_stub.o
COBJS-$(CONFIG_CHROMEOS) += utility.o
COBJS := $(COBJS-y)
diff --git a/lib/chromeos/tlcl_stub.c b/lib/chromeos/tlcl_stub.c
new file mode 100644
index 0000000000..41a9e2e705
--- /dev/null
+++ b/lib/chromeos/tlcl_stub.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2010, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+#include <config.h>
+#include <common.h>
+#include <tlcl_stub.h>
+
+/* A dummy TPM library implementation for now */
+
+void TlclStubInit(void)
+{
+}
+
+void TlclCloseDevice(void)
+{
+}
+
+void TlclOpenDevice(void)
+{
+}
+
+uint32_t TlclStubSendReceive(const uint8_t* request, int request_length,
+ uint8_t* response, int max_length)
+{
+ return TPM_E_NON_FATAL;
+}
diff --git a/lib/chromeos/utility.c b/lib/chromeos/utility.c
index 0e289fd087..0c17a9ef92 100644
--- a/lib/chromeos/utility.c
+++ b/lib/chromeos/utility.c
@@ -55,12 +55,15 @@
/* Is it defined in lib/string.c? */
int memcmp(const void *cs, const void *ct, size_t count);
-void abort(void)
+/* Append underscore to prevent name conflict with abort() in
+ * cpu/arm_cortexa9/tegra2/board.c (which is empty)
+ */
+void _abort(void)
{
reset_cpu(0);
}
-#define exit(retcode) abort()
+#define exit(retcode) _abort()
void error(const char *format, ...)
{
@@ -86,7 +89,7 @@ void *Malloc(size_t size)
void *p = malloc(size);
if (!p) {
/* Fatal Error. We must abort. */
- abort();
+ _abort();
}
return p;
}