]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/fpga/altera.c
Merge branch 'u-boot-tegra/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / drivers / fpga / altera.c
index 09dc0b22e1b4a92124536c1c24ebe88948a34035..6e34a8e56e9c1191514901727e92c05b3c0d94e1 100644 (file)
@@ -5,24 +5,7 @@
  * (C) Copyright 2002
  * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -45,7 +28,7 @@
 static int altera_validate (Altera_desc * desc, const char *fn);
 
 /* ------------------------------------------------------------------------- */
-int altera_load( Altera_desc *desc, void *buf, size_t bsize )
+int altera_load(Altera_desc *desc, const void *buf, size_t bsize)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
@@ -60,7 +43,7 @@ int altera_load( Altera_desc *desc, void *buf, size_t bsize )
                                        __FUNCTION__);
                        ret_val = ACEX1K_load (desc, buf, bsize);
 #elif defined(CONFIG_FPGA_CYCLON2)
-                       PRINTF ("%s: Launching the CYCLON II Loader...\n",
+                       PRINTF ("%s: Launching the CYCLONE II Loader...\n",
                                        __FUNCTION__);
                        ret_val = CYC2_load (desc, buf, bsize);
 #else
@@ -85,7 +68,7 @@ int altera_load( Altera_desc *desc, void *buf, size_t bsize )
        return ret_val;
 }
 
-int altera_dump( Altera_desc *desc, void *buf, size_t bsize )
+int altera_dump(Altera_desc *desc, const void *buf, size_t bsize)
 {
        int ret_val = FPGA_FAIL;        /* assume a failure */
 
@@ -170,9 +153,9 @@ int altera_info( Altera_desc *desc )
                        printf ("Unsupported interface type, %d\n", desc->iface);
                }
 
-               printf ("Device Size:   \t%d bytes\n"
-                               "Cookie:        \t0x%x (%d)\n",
-                               desc->size, desc->cookie, desc->cookie);
+               printf("Device Size:   \t%zd bytes\n"
+                     "Cookie:        \t0x%x (%d)\n",
+                     desc->size, desc->cookie, desc->cookie);
 
                if (desc->iface_fns) {
                        printf ("Device Function Table @ 0x%p\n", desc->iface_fns);
@@ -211,50 +194,11 @@ int altera_info( Altera_desc *desc )
        return ret_val;
 }
 
-int altera_reloc( Altera_desc *desc, ulong reloc_offset)
-{
-       int ret_val = FPGA_FAIL;        /* assume a failure */
-
-       if (!altera_validate (desc, (char *)__FUNCTION__)) {
-               printf ("%s: Invalid device descriptor\n", __FUNCTION__);
-       } else {
-               switch (desc->family) {
-               case Altera_ACEX1K:
-#if defined(CONFIG_FPGA_ACEX1K)
-                       ret_val = ACEX1K_reloc (desc, reloc_offset);
-#else
-                       printf ("%s: No support for ACEX devices.\n",
-                                       __FUNCTION__);
-#endif
-                       break;
-#if defined(CONFIG_FPGA_STRATIX_II)
-               case Altera_StratixII:
-                       ret_val = StratixII_reloc (desc, reloc_offset);
-                       break;
-#endif
-               case Altera_CYC2:
-#if defined(CONFIG_FPGA_CYCLON2)
-                       ret_val = CYC2_reloc (desc, reloc_offset);
-#else
-                       printf ("%s: No support for CYCLON II devices.\n",
-                                       __FUNCTION__);
-#endif
-                       break;
-                       /* Add new family types here */
-               default:
-                       printf ("%s: Unsupported family type, %d\n",
-                                       __FUNCTION__, desc->family);
-               }
-       }
-
-       return ret_val;
-}
-
 /* ------------------------------------------------------------------------- */
 
 static int altera_validate (Altera_desc * desc, const char *fn)
 {
-       int ret_val = FALSE;
+       int ret_val = false;
 
        if (desc) {
                if ((desc->family > min_altera_type) &&
@@ -262,7 +206,7 @@ static int altera_validate (Altera_desc * desc, const char *fn)
                        if ((desc->iface > min_altera_iface_type) &&
                                (desc->iface < max_altera_iface_type)) {
                                if (desc->size) {
-                                       ret_val = TRUE;
+                                       ret_val = true;
                                } else {
                                        printf ("%s: NULL part size\n", fn);
                                }