projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
edb93xx: change calculation un early_udelay.h
[oweals/u-boot.git]
/
board
/
mpc8540eval
/
flash.c
diff --git
a/board/mpc8540eval/flash.c
b/board/mpc8540eval/flash.c
index 7300a041a21dc150c66c821d7cb4f28e18b0cfe3..9df5bd9a4c0cde564c995c3ea4fdf8ae871beff4 100644
(file)
--- a/
board/mpc8540eval/flash.c
+++ b/
board/mpc8540eval/flash.c
@@
-31,19
+31,19
@@
#include <common.h>
#include <common.h>
-#if !defined(C
FG
_NO_FLASH)
+#if !defined(C
ONFIG_SYS
_NO_FLASH)
-flash_info_t flash_info[C
FG_MAX_FLASH_BANKS]; /* info for FLASH chips
*/
+flash_info_t flash_info[C
ONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips
*/
-#if defined(C
F
G_ENV_IS_IN_FLASH)
-# ifndef C
F
G_ENV_ADDR
-# define C
FG_ENV_ADDR (CFG_FLASH_BASE + CF
G_ENV_OFFSET)
+#if defined(C
ONFI
G_ENV_IS_IN_FLASH)
+# ifndef C
ONFI
G_ENV_ADDR
+# define C
ONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFI
G_ENV_OFFSET)
# endif
# endif
-# ifndef C
F
G_ENV_SIZE
-# define C
FG_ENV_SIZE CF
G_ENV_SECT_SIZE
+# ifndef C
ONFI
G_ENV_SIZE
+# define C
ONFIG_ENV_SIZE CONFI
G_ENV_SECT_SIZE
# endif
# endif
-# ifndef C
F
G_ENV_SECT_SIZE
-# define C
FG_ENV_SECT_SIZE CF
G_ENV_SIZE
+# ifndef C
ONFI
G_ENV_SECT_SIZE
+# define C
ONFIG_ENV_SECT_SIZE CONFI
G_ENV_SIZE
# endif
#endif
# endif
#endif
@@
-74,7
+74,7
@@
unsigned long flash_init (void)
/* Init: enable write,
* or we cannot even write flash commands
*/
/* Init: enable write,
* or we cannot even write flash commands
*/
- for (i=0; i<C
FG
_MAX_FLASH_BANKS; ++i) {
+ for (i=0; i<C
ONFIG_SYS
_MAX_FLASH_BANKS; ++i) {
flash_info[i].flash_id = FLASH_UNKNOWN;
/* set the default sector offset */
flash_info[i].flash_id = FLASH_UNKNOWN;
/* set the default sector offset */
@@
-82,7
+82,7
@@
unsigned long flash_init (void)
/* Static FLASH Bank configuration here - FIXME XXX */
/* Static FLASH Bank configuration here - FIXME XXX */
- size = flash_get_size((vu_long *)C
FG
_FLASH_BASE, &flash_info[0]);
+ size = flash_get_size((vu_long *)C
ONFIG_SYS
_FLASH_BASE, &flash_info[0]);
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
@@
-90,24
+90,24
@@
unsigned long flash_init (void)
}
/* Re-do sizing to get full correct info */
}
/* Re-do sizing to get full correct info */
- size = flash_get_size((vu_long *)C
FG
_FLASH_BASE, &flash_info[0]);
+ size = flash_get_size((vu_long *)C
ONFIG_SYS
_FLASH_BASE, &flash_info[0]);
flash_info[0].size = size;
#if !defined(CONFIG_RAM_AS_FLASH)
flash_info[0].size = size;
#if !defined(CONFIG_RAM_AS_FLASH)
-#if C
FG_MONITOR_BASE >= CFG
_FLASH_BASE
+#if C
ONFIG_SYS_MONITOR_BASE >= CONFIG_SYS
_FLASH_BASE
/* monitor protection ON by default */
flash_protect(FLAG_PROTECT_SET,
/* monitor protection ON by default */
flash_protect(FLAG_PROTECT_SET,
- C
FG
_MONITOR_BASE,
- C
FG
_MONITOR_BASE+monitor_flash_len-1,
+ C
ONFIG_SYS
_MONITOR_BASE,
+ C
ONFIG_SYS
_MONITOR_BASE+monitor_flash_len-1,
&flash_info[0]);
#endif
&flash_info[0]);
#endif
-#ifdef C
F
G_ENV_IS_IN_FLASH
+#ifdef C
ONFI
G_ENV_IS_IN_FLASH
/* ENV protection ON by default */
flash_protect(FLAG_PROTECT_SET,
/* ENV protection ON by default */
flash_protect(FLAG_PROTECT_SET,
- C
F
G_ENV_ADDR,
- C
FG_ENV_ADDR+CF
G_ENV_SECT_SIZE-1,
+ C
ONFI
G_ENV_ADDR,
+ C
ONFIG_ENV_ADDR+CONFI
G_ENV_SECT_SIZE-1,
&flash_info[0]);
#endif
#endif
&flash_info[0]);
#endif
#endif
@@
-177,8
+177,8
@@
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
udelay(20);
asm("sync");
udelay(20);
asm("sync");
-#ifndef C
FG
_FLASH_CFI
- printf("Not define C
FG
_FLASH_CFI\n");
+#ifndef C
ONFIG_SYS
_FLASH_CFI
+ printf("Not define C
ONFIG_SYS
_FLASH_CFI\n");
return (0);
#else
value = addr[0];
return (0);
#else
value = addr[0];
@@
-237,7
+237,7
@@
static ulong flash_get_size (vu_long *addr, flash_info_t *info)
break;
}
#endif
break;
}
#endif
-#endif /*#ifdef C
FG
_FLASH_CFI*/
+#endif /*#ifdef C
ONFIG_SYS
_FLASH_CFI*/
if (big_endian==0) value = (addr[0] & 0xFF000000) >>8;
else value = (addr[0] & 0x00FF0000);
if (big_endian==0) value = (addr[0] & 0xFF000000) >>8;
else value = (addr[0] & 0x00FF0000);
@@
-453,7
+453,7
@@
int flash_erase (flash_info_t *info, int s_first, int s_last)
asm("sync");
return 1;
}
asm("sync");
return 1;
}
- if ((now=get_timer(start)) > C
FG
_FLASH_ERASE_TOUT) {
+ if ((now=get_timer(start)) > C
ONFIG_SYS
_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr16 = 0xFFFF; /* reset bank */
asm("sync");
printf ("Timeout\n");
*addr16 = 0xFFFF; /* reset bank */
asm("sync");
@@
-505,7
+505,7
@@
int flash_erase (flash_info_t *info, int s_first, int s_last)
asm("sync");
return 1;
}
asm("sync");
return 1;
}
- if ((now=get_timer(start)) > C
FG
_FLASH_ERASE_TOUT) {
+ if ((now=get_timer(start)) > C
ONFIG_SYS
_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0xFFFFFFFF; /* reset bank */
asm("sync");
printf ("Timeout\n");
*addr = 0xFFFFFFFF; /* reset bank */
asm("sync");
@@
-591,7
+591,7
@@
int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
cnt -= FLASH_BLOCK_SIZE;
if (((count-cnt)>>10)>temp) {
temp=(count-cnt)>>10;
cnt -= FLASH_BLOCK_SIZE;
if (((count-cnt)>>10)>temp) {
temp=(count-cnt)>>10;
- printf("\r%
d
KB",temp);
+ printf("\r%
lu
KB",temp);
}
}
printf("\n");
}
}
printf("\n");
@@
-693,13
+693,14
@@
static int write_block(flash_info_t *info, uchar * src, ulong dest, ulong cnt)
/* data polling for D7 */
flag = 0;
while (((csr = *addr) & ready) != ready) {
/* data polling for D7 */
flag = 0;
while (((csr = *addr) & ready) != ready) {
- if ((now=get_timer(start)) > C
FG
_FLASH_WRITE_TOUT) {
+ if ((now=get_timer(start)) > C
ONFIG_SYS
_FLASH_WRITE_TOUT) {
flag = 1;
break;
}
}
if (csr & 0x4040) {
flag = 1;
break;
}
}
if (csr & 0x4040) {
- printf ("CSR indicates write error (%04x) at %08lx\n", csr, (ulong)addr);
+ printf ("CSR indicates write error (%04lx) at %08lx\n",
+ csr, (ulong)addr);
flag = 1;
}
/* Clear Status Registers Command */
flag = 1;
}
/* Clear Status Registers Command */
@@
-750,13
+751,14
@@
static int write_short (flash_info_t *info, ulong dest, ushort data)
/* data polling for D7 */
flag = 0;
while (((csr = *addr) & ready) != ready) {
/* data polling for D7 */
flag = 0;
while (((csr = *addr) & ready) != ready) {
- if ((now=get_timer(start)) > C
FG
_FLASH_WRITE_TOUT) {
+ if ((now=get_timer(start)) > C
ONFIG_SYS
_FLASH_WRITE_TOUT) {
flag = 1;
break;
}
}
if (csr & 0x4040) {
flag = 1;
break;
}
}
if (csr & 0x4040) {
- printf ("CSR indicates write error (%04x) at %08lx\n", csr, (ulong)addr);
+ printf ("CSR indicates write error (%04lx) at %08lx\n",
+ csr, (ulong)addr);
flag = 1;
}
/* Clear Status Registers Command */
flag = 1;
}
/* Clear Status Registers Command */
@@
-813,7
+815,7
@@
static int write_word (flash_info_t *info, ulong dest, ulong data)
start = get_timer (0);
flag = 0;
while (((csr = *addr) & ready) != ready) {
start = get_timer (0);
flag = 0;
while (((csr = *addr) & ready) != ready) {
- if (get_timer(start) > C
FG
_FLASH_WRITE_TOUT) {
+ if (get_timer(start) > C
ONFIG_SYS
_FLASH_WRITE_TOUT) {
flag = 1;
break;
}
flag = 1;
break;
}
@@
-879,7
+881,7
@@
static int clear_block_lock_bit(flash_info_t * info, vu_long * addr)
*addr = 0x70707070; /* read status */
start = get_timer (0);
while((*addr & ready) != ready){
*addr = 0x70707070; /* read status */
start = get_timer (0);
while((*addr & ready) != ready){
- if ((now=get_timer(start)) > C
FG
_FLASH_ERASE_TOUT) {
+ if ((now=get_timer(start)) > C
ONFIG_SYS
_FLASH_ERASE_TOUT) {
printf ("Timeout on clearing Block Lock Bit\n");
*addr = 0xFFFFFFFF; /* reset bank */
asm("sync");
printf ("Timeout on clearing Block Lock Bit\n");
*addr = 0xFFFFFFFF; /* reset bank */
asm("sync");
@@
-889,4
+891,4
@@
static int clear_block_lock_bit(flash_info_t * info, vu_long * addr)
return 0;
}
return 0;
}
-#endif /* !C
FG
_NO_FLASH */
+#endif /* !C
ONFIG_SYS
_NO_FLASH */