Add command for handling DDR ECC registers on MPC8349EE MDS board.
[oweals/u-boot.git] / common / xilinx.c
index cb153e14eff8fa149258e915d4a9a786b5274655..e03e78cb28527403f1085c5dfdc955b0daf0e509 100644 (file)
@@ -30,6 +30,7 @@
 #include <common.h>
 #include <virtex2.h>
 #include <spartan2.h>
+#include <spartan3.h>
 
 #if (CONFIG_FPGA & CFG_FPGA_XILINX)
 
@@ -53,7 +54,7 @@ int xilinx_load (Xilinx_desc * desc, void *buf, size_t bsize)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
-       if (!xilinx_validate (desc, __FUNCTION__)) {
+       if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("%s: Invalid device descriptor\n", __FUNCTION__);
        } else
                switch (desc->family) {
@@ -65,6 +66,16 @@ int xilinx_load (Xilinx_desc * desc, void *buf, size_t bsize)
 #else
                        printf ("%s: No support for Spartan-II devices.\n",
                                        __FUNCTION__);
+#endif
+                       break;
+               case Xilinx_Spartan3:
+#if (CONFIG_FPGA & CFG_SPARTAN3)
+                       PRINTF ("%s: Launching the Spartan-III Loader...\n",
+                                       __FUNCTION__);
+                       ret_val = Spartan3_load (desc, buf, bsize);
+#else
+                       printf ("%s: No support for Spartan-III devices.\n",
+                                       __FUNCTION__);
 #endif
                        break;
                case Xilinx_Virtex2:
@@ -90,7 +101,7 @@ int xilinx_dump (Xilinx_desc * desc, void *buf, size_t bsize)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
-       if (!xilinx_validate (desc, __FUNCTION__)) {
+       if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("%s: Invalid device descriptor\n", __FUNCTION__);
        } else
                switch (desc->family) {
@@ -102,6 +113,16 @@ int xilinx_dump (Xilinx_desc * desc, void *buf, size_t bsize)
 #else
                        printf ("%s: No support for Spartan-II devices.\n",
                                        __FUNCTION__);
+#endif
+                       break;
+               case Xilinx_Spartan3:
+#if (CONFIG_FPGA & CFG_SPARTAN3)
+                       PRINTF ("%s: Launching the Spartan-III Reader...\n",
+                                       __FUNCTION__);
+                       ret_val = Spartan3_dump (desc, buf, bsize);
+#else
+                       printf ("%s: No support for Spartan-III devices.\n",
+                                       __FUNCTION__);
 #endif
                        break;
                case Xilinx_Virtex2:
@@ -127,12 +148,15 @@ int xilinx_info (Xilinx_desc * desc)
 {
        int ret_val = FPGA_FAIL;
 
-       if (xilinx_validate (desc, __FUNCTION__)) {
+       if (xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("Family:        \t");
                switch (desc->family) {
                case Xilinx_Spartan2:
                        printf ("Spartan-II\n");
                        break;
+               case Xilinx_Spartan3:
+                       printf ("Spartan-III\n");
+                       break;
                case Xilinx_Virtex2:
                        printf ("Virtex-II\n");
                        break;
@@ -180,6 +204,15 @@ int xilinx_info (Xilinx_desc * desc)
                                /* just in case */
                                printf ("%s: No support for Spartan-II devices.\n",
                                                __FUNCTION__);
+#endif
+                               break;
+                       case Xilinx_Spartan3:
+#if (CONFIG_FPGA & CFG_SPARTAN3)
+                               Spartan3_info (desc);
+#else
+                               /* just in case */
+                               printf ("%s: No support for Spartan-III devices.\n",
+                                               __FUNCTION__);
 #endif
                                break;
                        case Xilinx_Virtex2:
@@ -194,6 +227,7 @@ int xilinx_info (Xilinx_desc * desc)
                                /* Add new family types here */
                        default:
                                /* we don't need a message here - we give one up above */
+                               ;
                        }
                } else
                        printf ("No Device Function Table.\n");
@@ -210,7 +244,7 @@ int xilinx_reloc (Xilinx_desc * desc, ulong reloc_offset)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
-       if (!xilinx_validate (desc, __FUNCTION__)) {
+       if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
                printf ("%s: Invalid device descriptor\n", __FUNCTION__);
        } else
                switch (desc->family) {
@@ -220,6 +254,14 @@ int xilinx_reloc (Xilinx_desc * desc, ulong reloc_offset)
 #else
                        printf ("%s: No support for Spartan-II devices.\n",
                                        __FUNCTION__);
+#endif
+                       break;
+               case Xilinx_Spartan3:
+#if (CONFIG_FPGA & CFG_SPARTAN3)
+                       ret_val = Spartan3_reloc (desc, reloc_offset);
+#else
+                       printf ("%s: No support for Spartan-III devices.\n",
+                                       __FUNCTION__);
 #endif
                        break;
                case Xilinx_Virtex2: