]> git.sur5r.net Git - u-boot/blobdiff - examples/standalone/mem_to_mem_idma2intr.c
board: ti: am571x-idk: Support 6 port Ethernet or 4 port Ethernet with LCD
[u-boot] / examples / standalone / mem_to_mem_idma2intr.c
index eeff5f5f2de1f35280e03bcc4061afdf0064a3fb..ce6e6c4a1071aa6b68c4dee7a9b323aefb30c42b 100644 (file)
@@ -1,5 +1,5 @@
 /* The dpalloc function used and implemented in this file was derieved
- * from PPCBoot/U-Boot file "arch/ppc/cpu/mpc8260/commproc.c".
+ * from PPCBoot/U-Boot file "arch/powerpc/cpu/mpc8260/commproc.c".
  */
 
 /* Author: Arun Dharankar <ADharankar@ATTBI.Com>
@@ -7,7 +7,7 @@
  */
 
 /*
- * This file is based on "arch/ppc/8260_io/commproc.c" - here is it's
+ * This file is based on "arch/powerpc/8260_io/commproc.c" - here is it's
  * copyright notice:
  *
  * General Purpose functions for the global management of the
@@ -28,6 +28,7 @@
 
 
 #include <common.h>
+#include <console.h>
 #include <exports.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -185,13 +186,6 @@ int ctrlc (void)
        }
        return 0;
 }
-void * memset(void * s,int c,size_t count)
-{
-       char *xs = (char *) s;
-       while (count--)
-               *xs++ = c;
-       return s;
-}
 int memcmp(const void * cs,const void * ct,size_t count)
 {
        const unsigned char *su1, *su2;
@@ -204,9 +198,9 @@ int memcmp(const void * cs,const void * ct,size_t count)
 #endif /* STANDALONE */
 
 #ifdef STANDALONE
-int mem_to_mem_idma2intr (int argc, char *argv[])
+int mem_to_mem_idma2intr (int argc, char * const argv[])
 #else
-int do_idma (bd_t * bd, int argc, char *argv[])
+int do_idma (bd_t * bd, int argc, char * const argv[])
 #endif /* STANDALONE */
 {
        int i;
@@ -309,7 +303,8 @@ int idma_init (void)
 
        memaddr = dpalloc (sizeof (pram_idma_t), 64);
 
-       *(volatile ushort *) &immap->im_dprambase[PROFF_IDMA2_BASE] = memaddr;
+       *(volatile u16 *)&immap->im_dprambase16
+               [PROFF_IDMA2_BASE / sizeof(u16)] = memaddr;
        piptr = (volatile pram_idma_t *) ((uint) (immap) + memaddr);
 
        piptr->pi_resv1 = 0;            /* manual says: clear it */
@@ -356,7 +351,7 @@ uint dpalloc (uint size, uint align)
        /* Pointer to initial global data area */
 
        if (dpinit_done == 0) {
-               dpbase = gd->dp_alloc_base;
+               dpbase = gd->arch.dp_alloc_base;
                dpinit_done = 1;
        }
 
@@ -369,7 +364,7 @@ uint dpalloc (uint size, uint align)
        if ((off = size & align_mask) != 0)
                size += align - off;
 
-       if ((dpbase + size) >= gd->dp_alloc_top) {
+       if ((dpbase + size) >= gd->arch.dp_alloc_top) {
                dpbase = savebase;
                printf ("dpalloc: ran out of dual port ram!");
                return 0;