Mercurial > flash_v2
comparison packages/devs/flash/intel/bootblock/current/src/bootblock_flash.c @ 138:289bf90c6a9b
Merge from eCos master repository on 2000-11-24-06:43:05-GMT
| author | jlarmour |
|---|---|
| date | Fri, 24 Nov 2000 07:49:02 +0000 |
| parents | a9ac27ec7abc |
| children | 6b5f480c6929 |
comparison
equal
deleted
inserted
replaced
| 137:eb9861b635da | 138:289bf90c6a9b |
|---|---|
| 66 // Copy 'program' code to RAM for execution | 66 // Copy 'program' code to RAM for execution |
| 67 code_len = (unsigned long)&flash_query_end - (unsigned long)&flash_query; | 67 code_len = (unsigned long)&flash_query_end - (unsigned long)&flash_query; |
| 68 _flash_query = (code_fun *)flash_info.work_space; | 68 _flash_query = (code_fun *)flash_info.work_space; |
| 69 memcpy(_flash_query, &flash_query, code_len); | 69 memcpy(_flash_query, &flash_query, code_len); |
| 70 HAL_DCACHE_SYNC(); // Should guarantee this code will run | 70 HAL_DCACHE_SYNC(); // Should guarantee this code will run |
| 71 | 71 HAL_ICACHE_INVALIDATE_ALL(); // is also required to avoid old contents |
| 72 stat = (*_flash_query)(data); | 72 stat = (*_flash_query)(data); |
| 73 #if DEBUG | 73 #if DEBUG |
| 74 printf("stat = %x\n", stat); | 74 printf("stat = %x\n", stat); |
| 75 dump_buf(data, sizeof(data)); | 75 dump_buf(data, sizeof(data)); |
| 76 #endif | 76 #endif |
| 83 // FIXME: More devices, comments, etc | 83 // FIXME: More devices, comments, etc |
| 84 if (data[1] == (unsigned short)0x8897) { | 84 if (data[1] == (unsigned short)0x8897) { |
| 85 num_regions = 64*2; | 85 num_regions = 64*2; |
| 86 region_size = 0x20000; | 86 region_size = 0x20000; |
| 87 } else if (data[1] == (unsigned short)0x88f4) { | 87 } else if (data[1] == (unsigned short)0x88f4) { |
| 88 num_regions = 32*4; // 4 devices in serial, each having 32 regions | 88 num_regions = 32; // (only use one for now)*4; // 4 devices in serial, each having 32 regions |
| 89 region_size = 0x10000; | 89 region_size = 0x10000; |
| 90 } else { | 90 } else { |
| 91 printf("Unknown device type: %x\n", data[1]); | 91 printf("Unknown device type: %x\n", data[1]); |
| 92 return FLASH_ERR_HWR; | 92 return FLASH_ERR_HWR; |
| 93 } | 93 } |
| 94 | 94 |
| 95 // Hard wired for now FIXME | 95 // Hard wired for now FIXME |
| 96 flash_info.block_size = region_size; | 96 flash_info.block_size = region_size; |
| 97 flash_info.blocks = num_regions; | 97 flash_info.blocks = num_regions; |
| 98 flash_info.start = (void *)0;//0x10000000 FIXME; | 98 #if 0 // This should be used only for the gross XX firmware build |
| 99 flash_info.start = (void *)0; | |
| 99 flash_info.end = (void *)(0x10000000+(num_regions*region_size)); | 100 flash_info.end = (void *)(0x10000000+(num_regions*region_size)); |
| 101 #else | |
| 102 flash_info.start = (void *)0x50000000; | |
| 103 flash_info.end = (void *)(0x50000000+(num_regions*region_size)); | |
| 104 #endif | |
| 105 | |
| 100 return FLASH_ERR_OK; | 106 return FLASH_ERR_OK; |
| 101 } | 107 } |
| 102 | 108 |
| 103 // Map a hardware status to a package error | 109 // Map a hardware status to a package error |
| 104 int | 110 int |
