]> git.sur5r.net Git - u-boot/blobdiff - board/esd/common/xilinx_jtag/micro.c
Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / board / esd / common / xilinx_jtag / micro.c
index 9b2cf90d4311dca139386452a508e2f5cb249e40..556636c55483487e0d2e3f4dff7fc2b74b51edf6 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2003
  * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.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+
  */
 
 /*****************************************************************************
 #include "lenval.h"
 #include "ports.h"
 
-
-extern const unsigned char fpgadata[];
-extern int filesize;
-
+const unsigned char *xsvfdata;
 
 /*============================================================================
  * XSVF #define
@@ -1831,19 +1812,28 @@ int xsvfExecute(void)
  *               ppzArgv  - array of ptrs to strings (command-line arguments).
  * Returns:      int      - Legacy return value:  1 = success; 0 = error.
  *****************************************************************************/
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int     iErrorCode;
-       char*   pzXsvfFileName;
        unsigned long duration;
        unsigned long long startClock, endClock;
 
+       if (argc == 2)
+               xsvfdata = (unsigned char *)simple_strtoul(argv[1], NULL, 16);
+       else {
+#ifdef CONFIG_SYS_XSVF_DEFAULT_ADDR
+               xsvfdata = (unsigned char *)CONFIG_SYS_XSVF_DEFAULT_ADDR;
+#else
+               printf("Usage:\ncpld %s\n", cmdtp->help);
+               return -1;
+#endif
+       }
+
        iErrorCode          = XSVF_ERRORCODE( XSVF_ERROR_NONE );
-       pzXsvfFileName      = 0;
        xsvf_iDebugLevel    = 0;
 
        printf("XSVF Player v%s, Xilinx, Inc.\n", XSVF_VERSION);
-       printf("XSVF Filesize = %d bytes\n", filesize);
+       printf("Reading XSVF data @ %p\n", xsvfdata);
 
        /* Initialize the I/O.  SetPort initializes I/O on first call */
        setPort( TMS, 1 );
@@ -1858,7 +1848,7 @@ int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return( iErrorCode );
 }
 U_BOOT_CMD(
-       cpld,   1,      1,      do_cpld,
-       "Program onboard CPLD",
-       NULL
-       );
+       cpld,   2,      1,      do_cpld,
+       "program onboard CPLD",
+       "<xsvf-addr>"
+);