summaryrefslogtreecommitdiff
path: root/board/bf533-ezkit/flash.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-12-17 16:53:07 +0100
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-12-17 16:53:07 +0100
commitcb5473205206c7f14cbb1e747f28ec75b48826e2 (patch)
tree8f4808d60917100b18a10b05230f7638a0a9bbcc /board/bf533-ezkit/flash.c
parentbaf449fc5ff96f071bb0e3789fd3265f6d4fd9a0 (diff)
parent92c78a3bbcb2ce508b4bf1c4a1e0940406a024bb (diff)
downloadu-boot-imx-cb5473205206c7f14cbb1e747f28ec75b48826e2.zip
u-boot-imx-cb5473205206c7f14cbb1e747f28ec75b48826e2.tar.gz
u-boot-imx-cb5473205206c7f14cbb1e747f28ec75b48826e2.tar.bz2
Merge branch 'fixes' into cleanups
Conflicts: board/atmel/atngw100/atngw100.c board/atmel/atstk1000/atstk1000.c cpu/at32ap/at32ap700x/gpio.c include/asm-avr32/arch-at32ap700x/clk.h include/configs/atngw100.h include/configs/atstk1002.h include/configs/atstk1003.h include/configs/atstk1004.h include/configs/atstk1006.h include/configs/favr-32-ezkit.h include/configs/hammerhead.h include/configs/mimc200.h
Diffstat (limited to 'board/bf533-ezkit/flash.c')
-rw-r--r--board/bf533-ezkit/flash.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/board/bf533-ezkit/flash.c b/board/bf533-ezkit/flash.c
index cdf4dc6..a861e16 100644
--- a/board/bf533-ezkit/flash.c
+++ b/board/bf533-ezkit/flash.c
@@ -82,7 +82,7 @@ unsigned long flash_init(void)
size_b0 = size_b1 = size_b2 = 0;
#ifdef DEBUG
- printf("Flash Memory Start 0x%x\n", CFG_FLASH_BASE);
+ printf("Flash Memory Start 0x%x\n", CONFIG_SYS_FLASH_BASE);
printf("Memory Map for the Flash\n");
printf("0x20000000 - 0x200FFFFF Flash A Primary (1MB)\n");
printf("0x20100000 - 0x201FFFFF Flash B Primary (1MB)\n");
@@ -90,20 +90,20 @@ unsigned long flash_init(void)
printf("0x20280000 - 0x2028FFFF Flash B Secondary (64KB)\n");
printf("Please type command flinfo for information on Sectors \n");
#endif
- 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;
}
- size_b0 = flash_get_size(CFG_FLASH0_BASE, &flash_info[0], 0);
- size_b1 = flash_get_size(CFG_FLASH0_BASE, &flash_info[1], 1);
- size_b2 = flash_get_size(CFG_FLASH0_BASE, &flash_info[2], 2);
+ size_b0 = flash_get_size(CONFIG_SYS_FLASH0_BASE, &flash_info[0], 0);
+ size_b1 = flash_get_size(CONFIG_SYS_FLASH0_BASE, &flash_info[1], 1);
+ size_b2 = flash_get_size(CONFIG_SYS_FLASH0_BASE, &flash_info[2], 2);
if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b0 == 0) {
printf("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
size_b0, size_b0 >> 20);
}
- (void)flash_protect(FLAG_PROTECT_SET, CFG_FLASH0_BASE,
+ (void)flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_FLASH0_BASE,
(flash_info[0].start[2] - 1), &flash_info[0]);
return (size_b0 + size_b1 + size_b2);
@@ -180,7 +180,7 @@ int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
int ret;
int d;
if (addr % 2) {
- read_flash(addr - 1 - CFG_FLASH_BASE, &d);
+ read_flash(addr - 1 - CONFIG_SYS_FLASH_BASE, &d);
d = (int)((d & 0x00FF) | (*src++ << 8));
ret = write_data(addr - 1, 2, (uchar *) & d);
if (ret == FLASH_FAIL)
@@ -196,7 +196,7 @@ int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
int write_data(long lStart, long lCount, uchar * pnData)
{
long i = 0;
- unsigned long ulOffset = lStart - CFG_FLASH_BASE;
+ unsigned long ulOffset = lStart - CONFIG_SYS_FLASH_BASE;
int d;
int nSector = 0;
int flag = 0;
@@ -285,7 +285,7 @@ int write_flash(long nOffset, int nValue)
{
long addr;
- addr = (CFG_FLASH_BASE + nOffset);
+ addr = (CONFIG_SYS_FLASH_BASE + nOffset);
SSYNC();
*(unsigned volatile short *)addr = nValue;
SSYNC();
@@ -297,7 +297,7 @@ int write_flash(long nOffset, int nValue)
int read_flash(long nOffset, int *pnValue)
{
int nValue = 0x0;
- long addr = (CFG_FLASH_BASE + nOffset);
+ long addr = (CONFIG_SYS_FLASH_BASE + nOffset);
if (nOffset != 0x2)
reset_flash();
@@ -396,7 +396,7 @@ int erase_block_flash(int nBlock, unsigned long address)
if ((nBlock < 0) || (nBlock > AFP_NumSectors))
return FALSE;
- ulSectorOff = (address - CFG_FLASH_BASE);
+ ulSectorOff = (address - CONFIG_SYS_FLASH_BASE);
write_flash((WRITESEQ1 | ulSectorOff), WRITEDATA1);
write_flash((WRITESEQ2 | ulSectorOff), WRITEDATA2);