]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - api/api.c
Remove unused definition IOMUX_SION
[karo-tx-uboot.git] / api / api.c
index 10f83eb691c85afe8ee817f72035ef140d78142a..a3bf60ad6280d0b90cdc030f595166d583370752 100644 (file)
--- a/api/api.c
+++ b/api/api.c
  */
 
 #include <config.h>
-
-#if defined(CONFIG_API)
-
 #include <command.h>
 #include <common.h>
 #include <malloc.h>
+#include <environment.h>
 #include <linux/types.h>
 #include <api_public.h>
 
 #define DEBUG
 #undef DEBUG
 
-/* U-Boot routines needed */
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-extern uchar (*env_get_char)(int);
-extern uchar *env_get_addr(int);
-
 /*****************************************************************************
  *
  * This is the API core.
@@ -231,7 +224,7 @@ static int API_dev_enum(va_list ap)
                /* start over - clean up enumeration */
                dev_enum_reset();       /* XXX shouldn't the name contain 'stor'? */
                debugf("RESTART ENUM\n");
-               
+
                /* net device enumeration first */
                if (dev_enum_net(di))
                        return 0;
@@ -365,7 +358,7 @@ static int API_dev_write(va_list ap)
                return API_EINVAL;
 
        if (di->type & DEV_TYP_STOR)
-               /* 
+               /*
                 * write to storage is currently not supported by U-Boot:
                 * no storage device implements block_write() method
                 */
@@ -523,7 +516,7 @@ static int API_env_enum(va_list ap)
        char *last, **next;
 
        last = (char *)va_arg(ap, u_int32_t);
-       
+
        if ((next = (char **)va_arg(ap, u_int32_t)) == NULL)
                return API_EINVAL;
 
@@ -535,12 +528,12 @@ static int API_env_enum(va_list ap)
 
                for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
                        for (n = i; env_get_char(n) != '\0'; ++n) {
-                               if (n >= CFG_ENV_SIZE) {
+                               if (n >= CONFIG_ENV_SIZE) {
                                        /* XXX shouldn't we set *next = NULL?? */
                                        return 0;
                                }
                        }
-               
+
                        if (envmatch((uchar *)last, i) < 0)
                                continue;
 
@@ -560,6 +553,50 @@ static int API_env_enum(va_list ap)
        return 0;
 }
 
+/*
+ * pseudo signature:
+ *
+ * int API_display_get_info(int type, struct display_info *di)
+ */
+static int API_display_get_info(va_list ap)
+{
+       int type;
+       struct display_info *di;
+
+       type = va_arg(ap, int);
+       di = va_arg(ap, struct display_info *);
+
+       return display_get_info(type, di);
+}
+
+/*
+ * pseudo signature:
+ *
+ * int API_display_draw_bitmap(ulong bitmap, int x, int y)
+ */
+static int API_display_draw_bitmap(va_list ap)
+{
+       ulong bitmap;
+       int x, y;
+
+       bitmap = va_arg(ap, ulong);
+       x = va_arg(ap, int);
+       y = va_arg(ap, int);
+
+       return display_draw_bitmap(bitmap, x, y);
+}
+
+/*
+ * pseudo signature:
+ *
+ * void API_display_clear(void)
+ */
+static int API_display_clear(va_list ap)
+{
+       display_clear();
+       return 0;
+}
+
 static cfp_t calls_table[API_MAXCALL] = { NULL, };
 
 /*
@@ -567,7 +604,7 @@ static cfp_t calls_table[API_MAXCALL] = { NULL, };
  * serviced until finished.
  *
  * e.g. syscall(1, int *, u_int32_t, u_int32_t, u_int32_t, u_int32_t);
- * 
+ *
  * call:       syscall number
  *
  * retval:     points to the return value placeholder, this is the place the
@@ -583,7 +620,7 @@ int syscall(int call, int *retval, ...)
        va_list ap;
        int rv;
 
-       if (call < 0 || call >= calls_no || calls_table[call] == NULL) {
+       if (call < 0 || call >= calls_no) {
                debugf("invalid call #%d\n", call);
                return 0;
        }
@@ -623,6 +660,9 @@ void api_init(void)
        calls_table[API_ENV_GET] = &API_env_get;
        calls_table[API_ENV_SET] = &API_env_set;
        calls_table[API_ENV_ENUM] = &API_env_enum;
+       calls_table[API_DISPLAY_GET_INFO] = &API_display_get_info;
+       calls_table[API_DISPLAY_DRAW_BITMAP] = &API_display_draw_bitmap;
+       calls_table[API_DISPLAY_CLEAR] = &API_display_clear;
        calls_no = API_MAXCALL;
 
        debugf("API initialized with %d calls\n", calls_no);
@@ -655,7 +695,7 @@ void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long siz
 
        if (!si->mr || !size || (flags == 0))
                return;
-       
+
        /* find free slot */
        for (i = 0; i < si->mr_no; i++)
                if (si->mr[i].flags == 0) {
@@ -666,5 +706,3 @@ void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long siz
                        return;
                }
 }
-
-#endif /* CONFIG_API */