X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=board%2Fep8260%2Fflash.c;h=44f63ee382d4a387070b32f46d3e7fd04e1c3060;hb=28c860b23fb2dd1affec909e98f25c58324e2140;hp=8d996407cd8f479777516082ce30c54891c129c3;hpb=5a1aceb0689e2f731491838970884a673ef7e7d3;p=oweals%2Fu-boot.git diff --git a/board/ep8260/flash.c b/board/ep8260/flash.c index 8d996407cd..44f63ee382 100644 --- a/board/ep8260/flash.c +++ b/board/ep8260/flash.c @@ -9,23 +9,7 @@ * * This file is based on board/tqm8260/flash.c. *-------------------------------------------------------------------- - * 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 @@ -35,7 +19,7 @@ #define V_BYTE(a) (*(volatile unsigned char *)( a )) -flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; +flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /*----------------------------------------------------------------------- @@ -134,13 +118,13 @@ unsigned long flash_init (void) int i; /* Init: no FLASHes known */ - for (i=0; i>20); @@ -150,20 +134,20 @@ unsigned long flash_init (void) * protect monitor and environment sectors */ -#if CFG_MONITOR_BASE >= CFG_FLASH0_BASE +#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH0_BASE flash_protect(FLAG_PROTECT_SET, - CFG_MONITOR_BASE, - CFG_MONITOR_BASE+monitor_flash_len-1, + CONFIG_SYS_MONITOR_BASE, + CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1, &flash_info[0]); #endif -#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CFG_ENV_ADDR) -# ifndef CFG_ENV_SIZE -# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE +#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) +# ifndef CONFIG_ENV_SIZE +# define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE # endif flash_protect(FLAG_PROTECT_SET, - CFG_ENV_ADDR, - CFG_ENV_ADDR + CFG_ENV_SIZE - 1, + CONFIG_ENV_ADDR, + CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]); #endif @@ -284,7 +268,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) while ((V_ULONG( info->start[l_sect] ) & 0x00800080) != 0x00800080 || (V_ULONG( info->start[l_sect] + 4 ) & 0x00800080) != 0x00800080) { - if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { + if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) { printf ("Timeout\n"); return 1; } @@ -403,7 +387,7 @@ static int write_dword (flash_info_t *info, ulong dest, unsigned char * pdata) start = get_timer (0); while (((V_ULONG( dest ) & 0x00800080) != (ch & 0x00800080)) || ((V_ULONG( dest + 4 ) & 0x00800080) != (cl & 0x00800080))) { - if (get_timer(start) > CFG_FLASH_WRITE_TOUT) { + if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { return (1); } }