Move up to mbed TLS 2.x

The mbed TLS library has introduced some changes in the API from
the 1.3.x to the 2.x releases. Using the 2.x releases requires
some changes to the crypto and transport modules.

This patch updates both modules to the mbed TLS 2.x API.

All references to the mbed TLS library in the code or documentation
have been updated to 'mbed TLS'. Old references to PolarSSL have
been updated to 'mbed TLS'.

User guide updated to use mbed TLS 2.2.0.

NOTE: moving up to mbed TLS 2.x from 1.3.x is not backward compatible.
Applying this patch will require an mbed TLS 2.x release to be used.
Also note that the mbed TLS license changed to Apache version 2.0.

Change-Id: Iba4584408653cf153091f2ca2ee23bc9add7fda4
diff --git a/drivers/auth/mbedtls/mbedtls_common.c b/drivers/auth/mbedtls/mbedtls_common.c
index 2978260..053bf1a 100644
--- a/drivers/auth/mbedtls/mbedtls_common.c
+++ b/drivers/auth/mbedtls/mbedtls_common.c
@@ -30,11 +30,11 @@
 
 #include <assert.h>
 
-/* mbedTLS headers */
-#include <polarssl/memory_buffer_alloc.h>
+/* mbed TLS headers */
+#include <mbedtls/memory_buffer_alloc.h>
 
 /*
- * mbedTLS heap
+ * mbed TLS heap
  */
 #if (MBEDTLS_KEY_ALG_ID == MBEDTLS_ECDSA)
 #define MBEDTLS_HEAP_SIZE		(14*1024)
@@ -44,22 +44,15 @@
 static unsigned char heap[MBEDTLS_HEAP_SIZE];
 
 /*
- * mbedTLS initialization function
- *
- * Return: 0 = success, Otherwise = error
+ * mbed TLS initialization function
  */
 void mbedtls_init(void)
 {
 	static int ready;
-	int rc;
 
 	if (!ready) {
-		/* Initialize the mbedTLS heap */
-		rc = memory_buffer_alloc_init(heap, MBEDTLS_HEAP_SIZE);
-		if (rc == 0) {
-			ready = 1;
-		} else {
-			assert(0);
-		}
+		/* Initialize the mbed TLS heap */
+		mbedtls_memory_buffer_alloc_init(heap, MBEDTLS_HEAP_SIZE);
+		ready = 1;
 	}
 }