]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/gen860t/fpga.c
mtd: nand: omap: make am33xx/elm.c as common driver for all OMAPx and AMxxxx platforms
[karo-tx-uboot.git] / board / gen860t / fpga.c
index 2ba7e0e4207b92a8997b5b463fead7ff4f7fa62b..b7984dd0fec19e186860dca277b3650434545fde 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+
  */
 
 /*
@@ -34,7 +17,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if (CONFIG_FPGA)
+#if defined(CONFIG_FPGA)
 
 #if 0
 #define GEN860T_FPGA_DEBUG
@@ -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);
 
        /*
@@ -376,5 +360,3 @@ int fpga_busy_fn (int cookie)
        return 0;
 }
 #endif
-
-/* vim: set ts=4 tw=78 sw=4: */