]> git.sur5r.net Git - u-boot/blobdiff - board/hymod/bsp.c
arm: ep9315: Add .vectors section to lds and remove obsolete lds
[u-boot] / board / hymod / bsp.c
index f131e51d4e2281e4c08436e53b65b9ee9c1b8198..e54640f2d2d63992edbc33b10947cab7e666cad1 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * 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+
  *
  * hacked for Hymod FPGA support by Murray.Jensen@csiro.au, 29-Jan-01
  */
 #include <command.h>
 #include <net.h>
 #include <asm/iopin_8260.h>
-#include <cmd_bsp.h>
+
+DECLARE_GLOBAL_DATA_PTR;
 
 /*-----------------------------------------------------------------------
  * Board Special Commands: FPGA load/store, EEPROM erase
  */
 
-#if (CONFIG_COMMANDS & CFG_CMD_BSP)
+#if defined(CONFIG_CMD_BSP)
 
 #define LOAD_SUCCESS           0
 #define LOAD_FAIL_NOCONF       1
  */
 
 int
-fpga_load (int mezz, uchar *addr, ulong size)
+fpga_load(int mezz, const uchar *addr, ulong size)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        hymod_conf_t *cp = &gd->bd->bi_hymod_conf;
        xlx_info_t *fp;
        xlx_iopins_t *fpgaio;
        volatile uchar *fpgabase;
        volatile uint cnt;
-       uchar *eaddr = addr + size;
+       const uchar *eaddr = addr + size;
        int result;
 
        if (mezz)
@@ -142,7 +125,7 @@ fpga_load (int mezz, uchar *addr, ulong size)
 
 /* ------------------------------------------------------------------------- */
 int
-do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        uchar *addr, *save_addr;
        ulong size;
@@ -201,7 +184,7 @@ do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                        load_addr = simple_strtoul (argv[3], NULL, 16);
                        NetBootFileXferSize = 0;
 
-                       if (NetLoop (TFTP) <= 0) {
+                       if (NetLoop(TFTPGET) <= 0) {
                                printf ("tftp transfer failed - aborting "
                                        "fgpa load\n");
                                return 1;
@@ -273,12 +256,11 @@ do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                break;
        }
 
-       printf ("Usage:\n%s\n", cmdtp->usage);
-       return 1;
+       return cmd_usage(cmdtp);
 }
-cmd_tbl_t U_BOOT_CMD(fpga) = MK_CMD_ENTRY(
-       "fpga", 6,      1,      do_fpga,
-       "fpga    - FPGA sub-system\n",
+U_BOOT_CMD(
+       fpga,   6,      1,      do_fpga,
+       "FPGA sub-system",
        "load [type] addr size\n"
        "  - write the configuration data at memory address `addr',\n"
        "    size `size' bytes, into the FPGA of type `type' (either\n"
@@ -298,14 +280,14 @@ cmd_tbl_t U_BOOT_CMD(fpga) = MK_CMD_ENTRY(
        "fpga info\n"
        "  - print information about the Hymod FPGA, namely the\n"
        "    memory addresses at which the four FPGA local bus\n"
-       "    address spaces appear in the physical address space\n"
+       "    address spaces appear in the physical address space"
 );
 /* ------------------------------------------------------------------------- */
 int
-do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
        uchar data[HYMOD_EEPROM_SIZE];
-       uint addr = CFG_I2C_EEPROM_ADDR;
+       uint addr = CONFIG_SYS_I2C_EEPROM_ADDR;
 
        switch (argc) {
 
@@ -325,8 +307,7 @@ do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                /* fall through ... */
 
        default:
-               printf ("Usage:\n%s\n", cmdtp->usage);
-               return 1;
+               return cmd_usage(cmdtp);
        }
 
        memset (data, 0, HYMOD_EEPROM_SIZE);
@@ -335,19 +316,19 @@ do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 
        return 0;
 }
-cmd_tbl_t U_BOOT_CMD(eec) = MK_CMD_ENTRY(
-       "eeclear",      1,      0,      do_eecl,
-       "eeclear - Clear the eeprom on a Hymod board \n",
+U_BOOT_CMD(
+       eeclear,        1,      0,      do_eecl,
+       "Clear the eeprom on a Hymod board",
        "[type]\n"
        "  - write zeroes into the EEPROM on the board of type `type'\n"
        "    (`type' is either `main' or `mezz' - default `main')\n"
-       "    Note: the EEPROM write enable jumper must be installed\n"
+       "    Note: the EEPROM write enable jumper must be installed"
 );
 
 /* ------------------------------------------------------------------------- */
 
 int
-do_htest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_htest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #if 0
        int rc;
@@ -403,6 +384,4 @@ do_htest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return 0;
 }
 
-#endif /* CFG_CMD_BSP */
-
-/* ------------------------------------------------------------------------- */
+#endif