]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/gen860t/fpga.c
ARM: tegra: remove custom define for Jetson TK1
[karo-tx-uboot.git] / board / gen860t / fpga.c
index 1e6bdf1ccf6a1c9d6c51d13dbfc2f3146bb9d155..dd0ef707d6d5b56ef522b1d2f89cb4bd6a09d844 100644 (file)
@@ -3,24 +3,7 @@
  * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
  * Keith Outwater, keith_outwater@mvis.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+
  */
 
 /*
@@ -57,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /* Note that these are pointers to code that is in Flash.  They will be
  * relocated at runtime.
  */
-Xilinx_Virtex2_Slave_SelectMap_fns fpga_fns = {
+xilinx_virtex2_slave_selectmap_fns fpga_fns = {
        fpga_pre_config_fn,
        fpga_pgm_fn,
        fpga_init_fn,
@@ -73,8 +56,8 @@ Xilinx_Virtex2_Slave_SelectMap_fns fpga_fns = {
        fpga_post_config_fn
 };
 
-Xilinx_desc fpga[CONFIG_FPGA_COUNT] = {
-       {Xilinx_Virtex2,
+xilinx_desc fpga[CONFIG_FPGA_COUNT] = {
+       {xilinx_virtex2,
         slave_selectmap,
         XILINX_XC2V3000_SIZE,
         (void *) &fpga_fns,
@@ -161,7 +144,7 @@ int test_fpga_ibtr (void)
  */
 void fpga_reset (int assert)
 {
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
+       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
        PRINTF ("%s:%d: RESET ", __FUNCTION__, __LINE__);
        if (assert) {
@@ -182,7 +165,7 @@ void fpga_selectmap_init (void)
 {
        PRINTF ("%s:%d: Initialize SelectMap interface\n", __FUNCTION__,
                __LINE__);
-       fpga_pgm_fn (FALSE, FALSE, 0);  /* make sure program pin is inactive */
+       fpga_pgm_fn(false, false, 0);   /* make sure program pin is inactive */
 }
 
 
@@ -193,8 +176,9 @@ int gen860t_init_fpga (void)
 {
        int i;
 
-       PRINTF ("%s:%d: Initialize FPGA interface (relocation offset = 0x%.8lx)\n", __FUNCTION__, __LINE__, gd->reloc_off);
-       fpga_init (gd->reloc_off);
+       PRINTF ("%s:%d: Initialize FPGA interface\n",
+               __FUNCTION__, __LINE__);
+       fpga_init ();
        fpga_selectmap_init ();
 
        for (i = 0; i < CONFIG_FPGA_COUNT; i++) {
@@ -210,7 +194,7 @@ int gen860t_init_fpga (void)
  */
 int fpga_pgm_fn (int assert, int flush, int cookie)
 {
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
+       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
        PRINTF ("%s:%d: FPGA PROGRAM ", __FUNCTION__, __LINE__);
 
@@ -233,7 +217,7 @@ int fpga_pgm_fn (int assert, int flush, int cookie)
  */
 int fpga_init_fn (int cookie)
 {
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
+       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
        PRINTF ("%s:%d: INIT check... ", __FUNCTION__, __LINE__);
        if (immap->im_cpm.cp_pbdat & (0x80000000 >> FPGA_INIT_BIT_NUM)) {
@@ -251,7 +235,7 @@ int fpga_init_fn (int cookie)
  */
 int fpga_done_fn (int cookie)
 {
-       volatile immap_t *immap = (immap_t *) CFG_IMMR;
+       volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
        PRINTF ("%s:%d: DONE check... ", __FUNCTION__, __LINE__);
        if (immap->im_cpm.cp_pbdat & (0x80000000 >> FPGA_DONE_BIT_NUM)) {
@@ -313,7 +297,7 @@ int fpga_abort_fn (int cookie)
 int fpga_pre_config_fn (int cookie)
 {
        PRINTF ("%s:%d: FPGA pre-configuration\n", __FUNCTION__, __LINE__);
-       fpga_reset (TRUE);
+       fpga_reset(true);
        return 0;
 }
 
@@ -327,9 +311,9 @@ int fpga_post_config_fn (int cookie)
        int rc;
 
        PRINTF ("%s:%d: FPGA post configuration\n", __FUNCTION__, __LINE__);
-       fpga_reset (TRUE);
+       fpga_reset(true);
        udelay (1000);
-       fpga_reset (FALSE);
+       fpga_reset(false);
        udelay (1000);
 
        /*