diff options
author | wdenk <wdenk> | 2003-06-21 00:17:24 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-06-21 00:17:24 +0000 |
commit | 592c5cabe78fe1cef4eb733904c81a9555d59a7e (patch) | |
tree | 7655563542f63358451ed964d0f49d2f803846d4 /board/hymod/flash.c | |
parent | 72755c7137396fdd8230dfc498294760fa2aaeb4 (diff) | |
download | u-boot-imx-592c5cabe78fe1cef4eb733904c81a9555d59a7e.zip u-boot-imx-592c5cabe78fe1cef4eb733904c81a9555d59a7e.tar.gz u-boot-imx-592c5cabe78fe1cef4eb733904c81a9555d59a7e.tar.bz2 |
Patch by Murray Jensen, 20 Jun 2003:
- hymod update
- cleanup (especially for gcc-3.x compilers)
Diffstat (limited to 'board/hymod/flash.c')
-rw-r--r-- | board/hymod/flash.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/board/hymod/flash.c b/board/hymod/flash.c index 7d1ae30..ad0a229 100644 --- a/board/hymod/flash.c +++ b/board/hymod/flash.c @@ -43,29 +43,26 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */ * in the flash_info entry "fip". Fatal error if nothing there. */ static void -bank_probe (flash_info_t *fip, bank_addr_t base) +bank_probe (flash_info_t *fip, volatile bank_addr_t base) { - bank_addr_t addr; + volatile bank_addr_t addr; bank_word_t word; int i; /* reset the flash */ *base = BANK_CMD_RST; - /* check the manufacturer id - must be intel */ + /* put flash into read id mode */ *base = BANK_CMD_RD_ID; - word = *BANK_REG_MAN_CODE (base); - *base = BANK_CMD_RST; + /* check the manufacturer id - must be intel */ + word = *BANK_REG_MAN_CODE (base); if (word != BANK_FILL_WORD (INTEL_MANUFACT&0xff)) panic ("\nbad manufacturer's code (0x%08lx) at addr 0x%08lx", (unsigned long)word, (unsigned long)base); /* check the device id */ - *base = BANK_CMD_RD_ID; word = *BANK_REG_DEV_CODE (base); - *base = BANK_CMD_RST; - switch (word) { case BANK_FILL_WORD (INTEL_ID_28F320J5&0xff): @@ -110,12 +107,15 @@ bank_probe (flash_info_t *fip, bank_addr_t base) } fip->size = (bank_size_t)addr - (bank_size_t)base; + + /* reset the flash */ + *base = BANK_CMD_RST; } static void bank_reset (flash_info_t *info, int sect) { - bank_addr_t addr = (bank_addr_t)info->start[sect]; + volatile bank_addr_t addr = (bank_addr_t)info->start[sect]; #ifdef FLASH_DEBUG printf ("writing reset cmd to addr 0x%08lx\n", (unsigned long)addr); @@ -127,7 +127,7 @@ bank_reset (flash_info_t *info, int sect) static void bank_erase_init (flash_info_t *info, int sect) { - bank_addr_t addr = (bank_addr_t)info->start[sect]; + volatile bank_addr_t addr = (bank_addr_t)info->start[sect]; int flag; #ifdef FLASH_DEBUG @@ -152,7 +152,7 @@ bank_erase_init (flash_info_t *info, int sect) static int bank_erase_poll (flash_info_t *info, int sect) { - bank_addr_t addr = (bank_addr_t)info->start[sect]; + volatile bank_addr_t addr = (bank_addr_t)info->start[sect]; bank_word_t stat = *addr; #ifdef FLASH_DEBUG @@ -176,7 +176,7 @@ bank_erase_poll (flash_info_t *info, int sect) } static int -bank_write_word (bank_addr_t addr, bank_word_t value) +bank_write_word (volatile bank_addr_t addr, bank_word_t value) { bank_word_t stat; ulong start; |