@@ -8,10 +8,11 @@ LIBSTB_SRCS = container.c rom.c tpm_chip.c stb.c cvc.c
LIBSTB_OBJS = $(LIBSTB_SRCS:%.c=%.o)
LIBSTB = $(LIBSTB_DIR)/built-in.o
+include $(SRC)/$(LIBSTB_DIR)/mbedtls/Makefile.inc
include $(SRC)/$(LIBSTB_DIR)/drivers/Makefile.inc
include $(SRC)/$(LIBSTB_DIR)/tss/Makefile.inc
-$(LIBSTB): $(LIBSTB_OBJS:%=$(LIBSTB_DIR)/%) $(DRIVERS) $(TSS)
+$(LIBSTB): $(LIBSTB_OBJS:%=$(LIBSTB_DIR)/%) $(DRIVERS) $(TSS) $(MBEDTLS)
libstb/create-container: libstb/create-container.c
$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) \
@@ -4,7 +4,7 @@ DRIVERS_DIR = libstb/drivers
SUBDIRS += $(DRIVERS_DIR)
-DRIVERS_SRCS = romcode.c tpm_i2c_interface.c tpm_i2c_nuvoton.c sw_driver.c sha512.c
+DRIVERS_SRCS = romcode.c tpm_i2c_interface.c tpm_i2c_nuvoton.c sw_driver.c
DRIVERS_OBJS = $(DRIVERS_SRCS:%.c=%.o)
DRIVERS = $(DRIVERS_DIR)/built-in.o
@@ -17,8 +17,8 @@
#include <chip.h>
#include <string.h>
#include <skiboot.h>
+#include <libstb/mbedtls/sha512.h>
#include "../rom.h"
-#include "sha512.h"
#include "sw_driver.h"
static sha2_hash_t *hw_key_hash = NULL;
new file mode 100644
@@ -0,0 +1,11 @@
+# -*-Makefile-*-
+
+MBEDTLS_DIR = libstb/mbedtls
+
+SUBDIRS += $(MBEDTLS_DIR)
+
+MBEDTLS_SRCS = sha512.c
+MBEDTLS_OBJS = $(MBEDTLS_SRCS:%.c=%.o)
+MBEDTLS = $(MBEDTLS_DIR)/built-in.o
+
+$(MBEDTLS): $(MBEDTLS_OBJS:%=$(MBEDTLS_DIR)/%)
similarity index 100%
rename from libstb/drivers/sha512.c
rename to libstb/mbedtls/sha512.c
similarity index 100%
rename from libstb/drivers/sha512.h
rename to libstb/mbedtls/sha512.h
The drivers/sha512.c file is a SHA512 hash implementation imported from the mbed TLS project. As a matter of semantics, this moves drivers/sha512.* to the mbedtls directory. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> --- libstb/Makefile.inc | 3 ++- libstb/drivers/Makefile.inc | 2 +- libstb/drivers/sw_driver.c | 2 +- libstb/mbedtls/Makefile.inc | 11 +++++++++++ libstb/{drivers => mbedtls}/sha512.c | 0 libstb/{drivers => mbedtls}/sha512.h | 0 6 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 libstb/mbedtls/Makefile.inc rename libstb/{drivers => mbedtls}/sha512.c (100%) rename libstb/{drivers => mbedtls}/sha512.h (100%)