From f358aab84571b56fb15e04504801ac87ec4fab59 Mon Sep 17 00:00:00 2001 From: Vikram Adiga Date: Mon, 15 Jun 2015 14:58:53 -0700 Subject: [PATCH] update TI-RTOS build scripts to add hardware accelerator lib build --- tirtos/README | 42 +++++-------------- tirtos/packages/ti/net/wolfssl/package.bld | 13 ++++-- .../{package.bld => package.bld.hide} | 0 .../test/{package.bld => package.bld.hide} | 0 tirtos/wolfssl.bld | 3 +- tirtos/wolfssl.mak | 6 +-- 6 files changed, 25 insertions(+), 39 deletions(-) rename tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/{package.bld => package.bld.hide} (100%) rename tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/{package.bld => package.bld.hide} (100%) diff --git a/tirtos/README b/tirtos/README index c933e662c..6001f5664 100644 --- a/tirtos/README +++ b/tirtos/README @@ -1,36 +1,14 @@ -wolfSSL library for TI-RTOS +# wolfSSL library for TI-RTOS -This directory contains the files that build wolfSSL library for TI-RTOS. -Please follow the instructions in TI-RTOS user guide (www.ti.com/tool/ti-rtos) -to build the wolfSSL library and the example applications. +This directory contains the files that build wolfSSL library for TI-RTOS. +Please follow the instructions in "Using wolfSSL with TI-RTOS" (http://processors.wiki.ti.com/index.php/Using_wolfSSL_with_TI-RTOS) to build the wolfSSL +library and the example applications. -Included Files ---------------- +Also read TI-RTOS Getting Started Guide and TI-RTOS User Guide to learn more +about TI-RTOS (http://www.ti.com/tool/ti-rtos). -1. wolfSSL library build files (packages/ti/net/wolfssl) +## Example Application - Build instructions provided in TI-RTOS user guide (www.ti.com/tool/ti-rtos) - -2. wc_ test application (packages/ti/net/wolfssl/tests/wolfcrypt/test) - - This application is the standard wc_ test application provided with - wolfSSL. - - It will be built along with the wolfSSL library. Load the built executable - on the target and make sure the wolfSSL library works as expected. - -3. wc_ benchmark application - (packages/ti/net/wolfssl/tests/wolfcrypt/benchmark) - - This application is the standard wc_ benchmark application provided - with wolfSSL. - - It will be built along with the wolfSSL library. Load the built executable - on the target and run to get the benchmark results for the configured - wolfSSL library. - -Examples Application --------------------- - -A simple 'TCP echo server with TLS' example application is provided with TI-RTOS -product. Look in the TI-RTOS user guide for instructions to build examples. +A simple "TCP echo server with TLS" example application is provided with TI-RTOS +product. Look in the TI-RTOS Getting Started Guide for instructions to build +examples. diff --git a/tirtos/packages/ti/net/wolfssl/package.bld b/tirtos/packages/ti/net/wolfssl/package.bld index 002cb08dc..1d506f13f 100644 --- a/tirtos/packages/ti/net/wolfssl/package.bld +++ b/tirtos/packages/ti/net/wolfssl/package.bld @@ -5,7 +5,7 @@ var Build = xdc.useModule('xdc.bld.BuildEnvironment'); var Pkg = xdc.useModule('xdc.bld.PackageContents'); -/* make command to search for the srcs */ +/* make command to search for the srcs */ Pkg.makePrologue = "vpath %.c $(subst ;, ,$(XPKGPATH))"; /* WOLFSSL sources */ @@ -17,7 +17,7 @@ var wolfSSLObjList = [ "wolfcrypt/src/blake2b.c", "wolfcrypt/src/camellia.c", "wolfcrypt/src/chacha.c", - "wolfcrypt/src/coding.c", + "wolfcrypt/src/coding.c", "wolfcrypt/src/des3.c", "wolfcrypt/src/dh.c", "wolfcrypt/src/dsa.c", @@ -25,6 +25,7 @@ var wolfSSLObjList = [ "wolfcrypt/src/error.c", "wolfcrypt/src/hc128.c", "wolfcrypt/src/hmac.c", + "wolfcrypt/src/hash.c", "wolfcrypt/src/integer.c", "wolfcrypt/src/logging.c", "wolfcrypt/src/md4.c", @@ -46,11 +47,17 @@ var wolfSSLObjList = [ "src/keys.c", "src/ssl.c", "src/tls.c", - ]; +]; for each (var targ in Build.targets) { var libOptions = {incs: wolfsslPathInclude}; var lib = Pkg.addLibrary("lib/wolfssl", targ, libOptions); lib.addObjects(wolfSSLObjList); + + var hwLibptions = {incs: wolfsslPathInclude, defs: " -DWOLFSSL_TI_HASH " + + "-DWOLFSSL_TI_CRYPT -DTARGET_IS_SNOWFLAKE_RA2"}; + + var hwLib = Pkg.addLibrary("lib/wolfssl_tm4c_hw", targ, hwLibptions); + hwLib.addObjects(wolfSSLObjList); } diff --git a/tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/package.bld b/tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/package.bld.hide similarity index 100% rename from tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/package.bld rename to tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/benchmark/package.bld.hide diff --git a/tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/package.bld b/tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/package.bld.hide similarity index 100% rename from tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/package.bld rename to tirtos/packages/ti/net/wolfssl/tests/EK_TM4C1294XL/wolfcrypt/test/package.bld.hide diff --git a/tirtos/wolfssl.bld b/tirtos/wolfssl.bld index 696208ba0..e7330e06f 100644 --- a/tirtos/wolfssl.bld +++ b/tirtos/wolfssl.bld @@ -34,6 +34,7 @@ var armOpts = " -ms "; var gnuOpts = " -D_POSIX_SOURCE "; var iarOpts = ""; +var TivaWareDir = ""; /* Uncomment the following lines to build libraries for debug mode: */ // Pkg.attrs.profile = "debug"; @@ -67,7 +68,7 @@ for (arg = 0; arg < arguments.length; arg++) { continue; } - if (targetName.match(/^TivaWareDir/) ) { + if (targetName.match(/^TIVAWARE/) ) { TivaWareDir = rootDir; continue; } diff --git a/tirtos/wolfssl.mak b/tirtos/wolfssl.mak index 450e10aa7..5ab82c065 100644 --- a/tirtos/wolfssl.mak +++ b/tirtos/wolfssl.mak @@ -9,7 +9,7 @@ XDC_INSTALL_DIR ?= C:/ti/xdctools_3_24_02_30 SYSBIOS_INSTALL_DIR ?= C:/ti/bios_6_34_01_14 NDK_INSTALL_DIR ?= C:/ti/ndk_2_24_00_02 TIRTOS_INSTALLATION_DIR ?= C:/ti/tirtos_tivac_2_00_00_22 -TivaWareDir ?= C:/ti/tivaware +TIVAWARE ?= C:/ti/tivaware WOLFSSL_INSTALL_DIR ?= C:/wolfssl/wolfssl-2.9.4 # @@ -40,12 +40,12 @@ XDCARGS= \ ti.targets.arm.elf.M4F=\"$(ti.targets.arm.elf.M4F)\" \ gnu.targets.arm.M4F=\"$(gnu.targets.arm.M4F)\" \ iar.targets.arm.M4F=\"$(iar.targets.arm.M4F)\" \ - TivaWareDir=\"$(TivaWareDir)\" + TIVAWARE=\"$(TIVAWARE)\" # # Set XDCPATH to contain necessary repositories. # -XDCPATH = $(SYSBIOS_INSTALL_DIR)/packages;$(NDK_INSTALL_DIR)/packages;$(WOLFSSL_INSTALL_DIR);$(TIRTOS_INSTALLATION_DIR)/packages;$(TivaWareDir); +XDCPATH = $(SYSBIOS_INSTALL_DIR)/packages;$(NDK_INSTALL_DIR)/packages;$(WOLFSSL_INSTALL_DIR);$(TIRTOS_INSTALLATION_DIR)/packages;$(TIVAWARE); export XDCPATH #