X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Fgen860t%2Ffpga.c;h=b7984dd0fec19e186860dca277b3650434545fde;hb=e4b87e5b1d026bd010e2ba3abbf89561e8320287;hp=37788d5396a86af3b4ed1fd717ebca74bf35b906;hpb=bf9e3b38f77c2eac620263dd60437c6ec47a27bf;p=u-boot diff --git a/board/gen860t/fpga.c b/board/gen860t/fpga.c index 37788d5396..b7984dd0fe 100644 --- a/board/gen860t/fpga.c +++ b/board/gen860t/fpga.c @@ -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+ */ /* @@ -32,7 +15,9 @@ #include #include "fpga.h" -#if (CONFIG_FPGA) +DECLARE_GLOBAL_DATA_PTR; + +#if defined(CONFIG_FPGA) #if 0 #define GEN860T_FPGA_DEBUG @@ -159,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) { @@ -180,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 */ } @@ -189,12 +174,11 @@ void fpga_selectmap_init (void) */ int gen860t_init_fpga (void) { - DECLARE_GLOBAL_DATA_PTR; - 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: */