firmware: ti_sci: Update ti_sci_msg_req_reboot to include domain
[pandora-u-boot.git] / api / api.c
index 71fa038..89003c1 100644 (file)
--- a/api/api.c
+++ b/api/api.c
 #include <env.h>
 #include <malloc.h>
 #include <env_internal.h>
+#include <linux/delay.h>
 #include <linux/types.h>
 #include <api_public.h>
+#include <u-boot/crc.h>
 
 #include "api_private.h"
 
@@ -55,7 +57,7 @@ static int API_getc(va_list ap)
        if ((c = (int *)va_arg(ap, uintptr_t)) == NULL)
                return API_EINVAL;
 
-       *c = getc();
+       *c = getchar();
        return 0;
 }
 
@@ -640,7 +642,7 @@ int syscall(int call, int *retval, ...)
        return 1;
 }
 
-void api_init(void)
+int api_init(void)
 {
        struct api_signature *sig;
 
@@ -677,7 +679,7 @@ void api_init(void)
        sig = malloc(sizeof(struct api_signature));
        if (sig == NULL) {
                printf("API: could not allocate memory for the signature!\n");
-               return;
+               return -ENOMEM;
        }
 
        env_set_hex("api_address", (unsigned long)sig);
@@ -689,6 +691,8 @@ void api_init(void)
        sig->checksum = crc32(0, (unsigned char *)sig,
                              sizeof(struct api_signature));
        debugf("syscall entry: 0x%lX\n", (unsigned long)sig->syscall);
+
+       return 0;
 }
 
 void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long size,