diff options
author | Wolfgang Denk <wd@denx.de> | 2008-10-18 21:59:44 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-10-18 21:59:44 +0200 |
commit | f82642e33899766892499b163e60560fbbf87773 (patch) | |
tree | ab90f076f18e56b2b3e8c9375b95917daa78c1d9 /board/tb0229/flash.c | |
parent | b59b16ca24bc7e77ec113021a6d77b9b32fcf192 (diff) | |
parent | 360fe71e82b83e264c964c9447c537e9a1f643c8 (diff) | |
download | u-boot-imx-f82642e33899766892499b163e60560fbbf87773.zip u-boot-imx-f82642e33899766892499b163e60560fbbf87773.tar.gz u-boot-imx-f82642e33899766892499b163e60560fbbf87773.tar.bz2 |
Merge 'next' branch
Conflicts:
board/freescale/mpc8536ds/mpc8536ds.c
include/configs/mgcoge.h
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'board/tb0229/flash.c')
-rw-r--r-- | board/tb0229/flash.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/board/tb0229/flash.c b/board/tb0229/flash.c index e9f6418..933d5ec 100644 --- a/board/tb0229/flash.c +++ b/board/tb0229/flash.c @@ -27,10 +27,10 @@ #include <ppc4xx.h> #include <asm/processor.h> -flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */ +flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ -#ifdef CFG_FLASH_16BIT +#ifdef CONFIG_SYS_FLASH_16BIT #define FLASH_WORD_SIZE unsigned short #define FLASH_ID_MASK 0xFFFF #else @@ -44,7 +44,7 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */ /* stolen from esteem192e/flash.c */ ulong flash_get_size (volatile FLASH_WORD_SIZE * addr, flash_info_t * info); -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT static int write_word (flash_info_t * info, ulong dest, ulong data); #else static int write_short (flash_info_t * info, ulong dest, ushort data); @@ -63,14 +63,14 @@ unsigned long flash_init (void) unsigned long base_b0, base_b1; /* Init: no FLASHes known */ - for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) { + for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; ++i) { flash_info[i].flash_id = FLASH_UNKNOWN; } /* Static FLASH Bank configuration here - FIXME XXX */ size_b0 = - flash_get_size ((volatile FLASH_WORD_SIZE *) CFG_FLASH_BASE, + flash_get_size ((volatile FLASH_WORD_SIZE *) CONFIG_SYS_FLASH_BASE, &flash_info[0]); if (flash_info[0].flash_id == FLASH_UNKNOWN) { @@ -78,9 +78,9 @@ unsigned long flash_init (void) } /* Only one bank */ - if (CFG_MAX_FLASH_BANKS == 1) { + if (CONFIG_SYS_MAX_FLASH_BANKS == 1) { /* Setup offsets */ - flash_get_offsets (CFG_FLASH_BASE, &flash_info[0]); + flash_get_offsets (CONFIG_SYS_FLASH_BASE, &flash_info[0]); /* Monitor protection ON by default */ #if 0 /* sand: */ @@ -91,19 +91,19 @@ unsigned long flash_init (void) &flash_info[0]); #else (void) flash_protect (FLAG_PROTECT_SET, - CFG_MONITOR_BASE, - CFG_MONITOR_BASE + monitor_flash_len - + CONFIG_SYS_MONITOR_BASE, + CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]); #endif size_b1 = 0; flash_info[0].size = size_b0; } -#ifdef CFG_FLASH_BASE_2 +#ifdef CONFIG_SYS_FLASH_BASE_2 /* 2 banks */ else { size_b1 = flash_get_size ((volatile FLASH_WORD_SIZE *) - CFG_FLASH_BASE_2, &flash_info[1]); + CONFIG_SYS_FLASH_BASE_2, &flash_info[1]); /* Re-do sizing to get full correct info */ @@ -144,8 +144,8 @@ unsigned long flash_init (void) &flash_info[0]); #else (void) flash_protect (FLAG_PROTECT_SET, - CFG_MONITOR_BASE, - CFG_MONITOR_BASE + monitor_flash_len - + CONFIG_SYS_MONITOR_BASE, + CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1, &flash_info[0]); #endif @@ -200,7 +200,7 @@ static void flash_get_offsets (ulong base, flash_info_t * info) } else if (info->flash_id & FLASH_BTYPE) { if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT /* set sector offsets for bottom boot block type */ info->start[0] = base + 0x00000000; info->start[1] = base + 0x00004000; @@ -256,7 +256,7 @@ static void flash_get_offsets (ulong base, flash_info_t * info) i = info->sector_count - 1; if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT info->start[i--] = base + info->size - 0x00004000; info->start[i--] = base + info->size - 0x00008000; info->start[i--] = base + info->size - 0x0000C000; @@ -448,7 +448,7 @@ ulong flash_get_size (volatile FLASH_WORD_SIZE * addr, flash_info_t * info) /* Write auto select command: read Manufacturer ID */ -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT /* * Note: if it is an AMD flash and the word at addr[0000] @@ -699,7 +699,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) /* Disable interrupts which might cause a timeout here */ flag = disable_interrupts (); if (info->flash_id < FLASH_AMD_COMP) { -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT addr[0x0555] = 0x00AA00AA; addr[0x02AA] = 0x00550055; addr[0x0555] = 0x00800080; @@ -741,7 +741,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) addr = (volatile FLASH_WORD_SIZE *) (info->start[l_sect]); while ((addr[0] & (0x00800080 & FLASH_ID_MASK)) != (0x00800080 & FLASH_ID_MASK)) { - if ((now = get_timer (start)) > CFG_FLASH_ERASE_TOUT) { + if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) { printf ("Timeout\n"); return 1; } @@ -762,7 +762,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) for (sect = s_first; sect <= s_last; sect++) { if (info->protect[sect] == 0) { /* not protected */ barf = 0; -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT addr = (vu_long *) (info->start[sect]); addr[0] = 0x00500050; addr[0] = 0x00200020; @@ -801,7 +801,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) l_sect = sect; } addr = (volatile FLASH_WORD_SIZE *) info->start[0]; -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT addr[0] = (0x00FF00FF & FLASH_ID_MASK); /* reset bank */ #else addr[0] = (0x00FF & FLASH_ID_MASK); /* reset bank */ @@ -821,7 +821,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) flash_info_t *info; int i; - for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) { + for (i=0, info=&flash_info[0]; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i, ++info) { if ((addr >= info->start[0]) && (addr < (info->start[0] + info->size)) ) { return (info); @@ -898,7 +898,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) { -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT ulong cp, wp, data; int l; #else @@ -907,7 +907,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) #endif int i, rc; -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT wp = (addr & ~3); /* get lower word aligned address */ @@ -1034,7 +1034,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) * 1 - write timeout * 2 - Flash not erased */ -#ifndef CFG_FLASH_16BIT +#ifndef CONFIG_SYS_FLASH_16BIT static int write_word (flash_info_t * info, ulong dest, ulong data) { vu_long *addr = (vu_long *) (info->start[0]); @@ -1076,7 +1076,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data) while ((*((vu_long *) dest) & 0x00800080) != (data & 0x00800080)) { - if (get_timer (start) > CFG_FLASH_WRITE_TOUT) { + if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) { printf ("timeout\n"); return (1); } @@ -1085,7 +1085,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data) } else { while (!(addr[0] & 0x00800080)) { /* wait for error or finish */ - if (get_timer (start) > CFG_FLASH_WRITE_TOUT) { + if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) { printf ("timeout\n"); return (1); } @@ -1157,7 +1157,7 @@ static int write_short (flash_info_t * info, ulong dest, ushort data) if (info->flash_id < FLASH_AMD_COMP) { /* AMD stuff */ while ((*((vu_short *) dest) & 0x0080) != (data & 0x0080)) { - if (get_timer (start) > CFG_FLASH_WRITE_TOUT) { + if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) { return (1); } } @@ -1165,7 +1165,7 @@ static int write_short (flash_info_t * info, ulong dest, ushort data) } else { /* intel stuff */ while (!(addr[0] & 0x0080)) { /* wait for error or finish */ - if (get_timer (start) > CFG_FLASH_WRITE_TOUT) + if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1); } @@ -1184,7 +1184,7 @@ static int write_short (flash_info_t * info, ulong dest, ushort data) *addr = 0x00B0; *addr = 0x0070; while (!(addr[0] & 0x0080)) { /* wait for error or finish */ - if (get_timer (start) > CFG_FLASH_WRITE_TOUT) + if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1); } |